Commit 8bd7c1d0 authored by Marc Egger's avatar Marc Egger
Browse files

Merge branch 'master' into B7455PHPUnitTestsFail

parents 952e2ff6 16c65e95
......@@ -7,11 +7,11 @@ namespace IMATHUZH\Qfq\Controller;
use qfq;
require_once(__DIR__ . '/../../qfq/qfq/QuickFormQuery.php');
require_once(__DIR__ . '/../../qfq/qfq/exceptions/UserFormException.php');
require_once(__DIR__ . '/../../qfq/qfq/exceptions/UserReportException.php');
require_once(__DIR__ . '/../../qfq/qfq/exceptions/CodeException.php');
require_once(__DIR__ . '/../../qfq/qfq/exceptions/DbException.php');
require_once(__DIR__ . '/../../Source/core/QuickFormQuery.php');
require_once(__DIR__ . '/../../Source/core/exceptions/UserFormException.php');
require_once(__DIR__ . '/../../Source/core/exceptions/UserReportException.php');
require_once(__DIR__ . '/../../Source/core/exceptions/CodeException.php');
require_once(__DIR__ . '/../../Source/core/exceptions/DbException.php');
/**
* Class QfqController
......
This diff is collapsed.
......@@ -30,6 +30,14 @@ Date: <date>
Notes
^^^^^
* Existing installations: update QFQ extension config form-layout.formBsColumns/formBsLabelColumns/formBsInputColumns,formBsNoteColumns.
old: 12, new: 'col-md-12 col-lg10' resp. smaller values for individual columnns.
* New config values:
* Config/flagProduction: yes/now - differentiate between development und production system. Will be used for
'throwExceptionGeneralError' too.
* Debug/throwExceptionGeneralError - shows/hide exception of general errors.
Features
^^^^^^^^
......
......@@ -10,10 +10,10 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/QuickFormQuery.php');
require_once(__DIR__ . '/../qfq/store/Store.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/exceptions/CodeException.php');
require_once(__DIR__ . '/../core/QuickFormQuery.php');
require_once(__DIR__ . '/../core/store/Store.php');
require_once(__DIR__ . '/../core/Constants.php');
require_once(__DIR__ . '/../core/exceptions/CodeException.php');
/**
......
......@@ -11,8 +11,8 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/form/Dirty.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../core/form/Dirty.php');
require_once(__DIR__ . '/../core/Constants.php');
/**
......
......@@ -12,12 +12,12 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/report/Download.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/exceptions/DownloadException.php');
require_once(__DIR__ . '/../qfq/exceptions/CodeException.php');
require_once(__DIR__ . '/../qfq/exceptions/DbException.php');
require_once(__DIR__ . '/../qfq/exceptions/ErrorHandler.php');
require_once(__DIR__ . '/../core/report/Download.php');
require_once(__DIR__ . '/../core/Constants.php');
require_once(__DIR__ . '/../core/exceptions/DownloadException.php');
require_once(__DIR__ . '/../core/exceptions/CodeException.php');
require_once(__DIR__ . '/../core/exceptions/DbException.php');
require_once(__DIR__ . '/../core/exceptions/ErrorHandler.php');
set_error_handler("\\qfq\\ErrorHandler::exception_error_handler");
......
......@@ -10,9 +10,9 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/store/Store.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/QuickFormQuery.php');
require_once(__DIR__ . '/../core/store/Store.php');
require_once(__DIR__ . '/../core/Constants.php');
require_once(__DIR__ . '/../core/QuickFormQuery.php');
//require_once(__DIR__ . '/../qfq/exceptions/UserFormException.php');
//require_once(__DIR__ . '/../qfq/exceptions/CodeException.php');
//require_once(__DIR__ . '/../qfq/exceptions/DbException.php');
......
......@@ -10,11 +10,11 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/store/Store.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/File.php');
require_once(__DIR__ . '/../qfq/exceptions/UserFormException.php');
require_once(__DIR__ . '/../qfq/exceptions/CodeException.php');
require_once(__DIR__ . '/../core/store/Store.php');
require_once(__DIR__ . '/../core/Constants.php');
require_once(__DIR__ . '/../core/File.php');
require_once(__DIR__ . '/../core/exceptions/UserFormException.php');
require_once(__DIR__ . '/../core/exceptions/CodeException.php');
/**
* Process File Upload - immediately when the the user selects a file.
......
......@@ -10,9 +10,9 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/store/Store.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/QuickFormQuery.php');
require_once(__DIR__ . '/../core/store/Store.php');
require_once(__DIR__ . '/../core/Constants.php');
require_once(__DIR__ . '/../core/QuickFormQuery.php');
/**
......
......@@ -13,7 +13,7 @@ use qfq;
//require_once(__DIR__ . '/../qfq/store/Config.php');
//require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/report/Html2Pdf.php');
require_once(__DIR__ . '/../core/report/Html2Pdf.php');
//require_once(__DIR__ . '/../qfq/helper/KeyValueStringParser.php');
/**
......
......@@ -10,12 +10,12 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/QuickFormQuery.php');
require_once(__DIR__ . '/../qfq/store/Store.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/exceptions/UserFormException.php');
require_once(__DIR__ . '/../qfq/exceptions/CodeException.php');
require_once(__DIR__ . '/../qfq/exceptions/DbException.php');
require_once(__DIR__ . '/../core/QuickFormQuery.php');
require_once(__DIR__ . '/../core/store/Store.php');
require_once(__DIR__ . '/../core/Constants.php');
require_once(__DIR__ . '/../core/exceptions/UserFormException.php');
require_once(__DIR__ . '/../core/exceptions/CodeException.php');
require_once(__DIR__ . '/../core/exceptions/DbException.php');
/**
......
......@@ -11,8 +11,8 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/form/TypeAhead.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../core/form/TypeAhead.php');
require_once(__DIR__ . '/../core/Constants.php');
/**
......
......@@ -564,7 +564,7 @@ abstract class AbstractBuildForm {
$storeRecord = $this->store->getStore(STORE_RECORD);
$value = $this->report->process($this->bodytextParser->process($value));
$this->store->setStore($storeRecord, STORE_RECORD, true);
$this->store->setVar(SYSTEM_REPORT_FULL_LEVEL, '', STORE_SYSTEM);
$this->store->setVar(SYSTEM_REPORT_FULL_LEVEL, '', STORE_SYSTEM); // debug
}
return $value;
......@@ -973,9 +973,19 @@ abstract class AbstractBuildForm {
$flagRowUpdate = true;
}
$statusHidden = ($formElement[FE_MODE] == 'hidden');
$pattern = null;
if ( isset($formElement[FE_CHECK_PATTERN]) && $formElement[FE_CHECK_PATTERN] != '') {
$pattern = $statusHidden ? false : $formElement[FE_CHECK_PATTERN];
}
// 'value' update via 'form-update' on the full row: only if there is no other FE in that row
if ($flagRowUpdate) {
$json[API_FORM_UPDATE_VALUE] = $value;
//CR if ($pattern !== null) {
// $json['pattern'] = $pattern;
// }
}
if (isset($formElement[FE_LABEL])) {
......@@ -1003,8 +1013,12 @@ abstract class AbstractBuildForm {
// $class = 'col-md-' . $formElement[FE_BS_INPUT_COLUMNS] . ' ';
$class .= ($formElement[FE_MODE] == FE_MODE_HIDDEN) ? ' hidden' : '';
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_ATTRIBUTE]['class'] = $class;
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_ATTRIBUTE]['required'] = $formElement[FE_MODE] == 'required';
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_ATTRIBUTE]['hidden'] = $formElement[FE_MODE] == 'hidden';
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_ATTRIBUTE]['required'] = ($formElement[FE_MODE] == 'required');
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_ATTRIBUTE]['hidden'] = $statusHidden;
if ($pattern !== null) {
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_ATTRIBUTE]['pattern'] = $pattern;
}
}
// #3647
......@@ -1014,8 +1028,12 @@ abstract class AbstractBuildForm {
//TODO #5016 - exception for FE_TYPE_CHECKBOX should be removed ASAP
if ($formElement[FE_TYPE] != FE_TYPE_SELECT && $formElement[FE_TYPE] != FE_TYPE_UPLOAD && $formElement[FE_TYPE] != FE_TYPE_CHECKBOX) {
$json[API_ELEMENT_UPDATE][$formElement[FE_HTML_ID]][API_ELEMENT_ATTRIBUTE]['value'] = $value;
$json[API_ELEMENT_UPDATE][$formElement[FE_HTML_ID]][API_ELEMENT_ATTRIBUTE]['required'] = $formElement[FE_MODE] == 'required';
$json[API_ELEMENT_UPDATE][$formElement[FE_HTML_ID]][API_ELEMENT_ATTRIBUTE]['hidden'] = $formElement[FE_MODE] == 'hidden';
$json[API_ELEMENT_UPDATE][$formElement[FE_HTML_ID]][API_ELEMENT_ATTRIBUTE]['required'] = ($formElement[FE_MODE] == 'required');
$json[API_ELEMENT_UPDATE][$formElement[FE_HTML_ID]][API_ELEMENT_ATTRIBUTE]['hidden'] = $statusHidden;
if ($pattern !== null) {
$json[API_ELEMENT_UPDATE][$formElement[FE_HTML_ID]][API_ELEMENT_ATTRIBUTE]['pattern'] = $pattern;
}
}
}
......@@ -1246,9 +1264,11 @@ abstract class AbstractBuildForm {
$value = '';
}
if ($formElement[FE_DECIMAL_FORMAT] !== '') {
$decimalScale = explode(',', $formElement[FE_DECIMAL_FORMAT])[1]; // scale: Nachkommastellen
$value = number_format($value, $decimalScale, '.', '');
if ($formElement[FE_DECIMAL_FORMAT] !== '' ) {
if($value!=='') { // empty string causes exception in number_format()
$decimalScale = explode(',', $formElement[FE_DECIMAL_FORMAT])[1]; // scale: Nachkommastellen
$value = number_format($value, $decimalScale, '.', '');
}
}
// In case the user specifies MIN & MAX with numbers, the html tag 'type' has to be 'number', to make the range check work in the browser.
......@@ -1277,8 +1297,8 @@ abstract class AbstractBuildForm {
$attribute .= $this->getAttributeList($formElement, [FE_INPUT_AUTOCOMPLETE, 'autofocus', 'placeholder']);
$pattern = Sanitize::getInputCheckPattern($formElement[FE_CHECK_TYPE], $formElement[FE_CHECK_PATTERN], $formElement[FE_DECIMAL_FORMAT], $sanitizeMessage);
$attribute .= ($pattern === '') ? '' : 'pattern="' . $pattern . '" ';
$formElement[FE_CHECK_PATTERN] = Sanitize::getInputCheckPattern($formElement[FE_CHECK_TYPE], $formElement[FE_CHECK_PATTERN], $formElement[FE_DECIMAL_FORMAT], $sanitizeMessage);
$attribute .= ($formElement[FE_CHECK_PATTERN] === '') ? '' : 'pattern="' . $formElement[FE_CHECK_PATTERN] . '" ';
if (empty($formElement[F_FE_DATA_PATTERN_ERROR])) {
$formElement[F_FE_DATA_PATTERN_ERROR] = empty($sanitizeMessage) ? F_FE_DATA_PATTERN_ERROR_DEFAULT : $sanitizeMessage;
}
......@@ -2091,7 +2111,7 @@ abstract class AbstractBuildForm {
public function buildExtra(array $formElement, $htmlFormElementName, $value, array &$json, $mode = FORM_LOAD) {
if ($mode === FORM_LOAD) {
$this->store->setVar($formElement[FE_NAME], $value, STORE_SIP, false);
$this->store->setVar($formElement[FE_NAME], $value, STORE_SIP, true);
}
return;
......
......@@ -10,8 +10,8 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/AbstractBuildForm.php');
require_once(__DIR__ . '/../core/Constants.php');
require_once(__DIR__ . '/../core/AbstractBuildForm.php');
/**
* Class BuildFormPlain
......
......@@ -10,8 +10,8 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/AbstractBuildForm.php');
require_once(__DIR__ . '/../core/Constants.php');
require_once(__DIR__ . '/../core/AbstractBuildForm.php');
/**
* Class BuildFormTable
......
......@@ -454,6 +454,9 @@ const SYSTEM_REDIRECT_ALL_MAIL_TO = 'redirectAllMailTo';
const SYSTEM_MAIL_LOG = 'mailLog';
const SYSTEM_MAIL_LOG_FILE = 'fileadmin/protected/log/mail.log';
const SYSTEM_THROW_GENERAL_ERROR = 'throwExceptionGeneralError';
const SYSTEM_FLAG_PRODUCTION = 'flagProduction';
const SYSTEM_SHOW_DEBUG_INFO = 'showDebugInfo';
const SYSTEM_SHOW_DEBUG_INFO_YES = 'yes';
const SYSTEM_SHOW_DEBUG_INFO_NO = 'no';
......@@ -594,10 +597,10 @@ const SYSTEM_FORM_ELEMENT = 'formElement'; // '<formElementName> /
const SYSTEM_FORM_ELEMENT_ID = 'formElementId'; // '<formElementName> / <formElementeId>'
const SYSTEM_FORM_ELEMENT_COLUMN = 'formElementColumn'; // '<columnname of current processed formElement>'
const SYSTEM_FORM_ELEMENT_MESSAGE = 'formElementMessage'; // '<columnname of current processed formElement>'
const SYSTEM_REPORT_COLUMN_INDEX = 'reportColumnIndex'; // Keyname of SQL-column processed at the moment.
const SYSTEM_REPORT_COLUMN_NAME = 'reportColumnName'; // Keyname of SQL-column processed at the moment.
const SYSTEM_REPORT_COLUMN_VALUE = 'reportColumnValue'; // Keyname of SQL-column processed at the moment.
const SYSTEM_REPORT_FULL_LEVEL = 'reportFullLevel'; // Keyname of SQL-column processed at the moment.
const SYSTEM_REPORT_COLUMN_INDEX = 'reportColumnIndex'; // Index of SQL-column processed at the moment.
const SYSTEM_REPORT_COLUMN_NAME = 'reportColumnName'; // Name of SQL-column processed at the moment.
const SYSTEM_REPORT_COLUMN_VALUE = 'reportColumnValue'; // Value of SQL-column processed at the moment.
const SYSTEM_REPORT_FULL_LEVEL = 'reportFullLevel'; // Full level of current report row. E.g.: 10.20.1. Used for error reports.
const SYSTEM_MESSAGE_DEBUG = 'messageDebug';
const SYSTEM_DOWNLOAD_POPUP = 'hasDownloadPopup'; // Marker which is set to 'true' if there is at least one Download Link rendered
const DOWNLOAD_POPUP_REQUEST = 'true';
......
......@@ -10,8 +10,8 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/store/Store.php');
require_once(__DIR__ . '/../qfq/database/Database.php');
require_once(__DIR__ . '/../core/store/Store.php');
require_once(__DIR__ . '/../core/database/Database.php');
require_once(__DIR__ . '/helper/Support.php');
require_once(__DIR__ . '/helper/OnString.php');
require_once(__DIR__ . '/report/Link.php');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment