Commit d4a40661 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'master' into B8460DropdownMenuMultipleS

parents 2be97933 501ca6e1
Pipeline #1946 failed with stages
in 2 minutes and 38 seconds
......@@ -502,7 +502,7 @@ Extension Manager: QFQ Configuration
+-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| saveButtonClass | btn btn-default navbar-btn | Bootstrap CSS class for save button on top of the form. |
+-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| saveButtonClassOnChange | alert-info btn-info | Bootstrap CSS class for save button showing 'data changed'. |
| buttonOnChangeClass | alert-info btn-info | Bootstrap CSS class for save button showing 'data changed'. |
+-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| saveButtonGlyphIcon | glyphicon-ok | Icon for the form save button. |
+-----------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
......@@ -6596,10 +6596,10 @@ Parameter and (element) sources
* *url*: `u:<url>` - any URL, pointing to an internal or external destination.
* *uid*: `uid:<int>` - the tt_contents.uid of a QFQ PageContent record (shown on hover in the backend). This will render
only the raw QFQ processed bodytext of the specified PageContent, without additional tags, styles, or CSS includes.
QFQ will retrieve the PageContent's bodytext from the Typo3 database, parse it, and render it as a PDF. Parameters can be
passed: `uid:<int>[?arg1=value1][&arg2=value2][...]` and will be available in the SIP store for the QFQ PageContent,
* *uid*: `uid:<tt-content record id>` - the tt_content.uid of a QFQ PageContent record (shown on hover in the backend). This will render
only the specified QFQ content record, without any Typo3 layout elements (Menu, Body,...)
QFQ will retrieve the tt-content's bodytext from the Typo3 database, parse it, and render it as a PDF. Parameters can be
passed: `uid:<tt-content record id>[?arg1=value1][&arg2=value2][...]` and will be available in the SIP store for the QFQ PageContent,
or passed as wkhtmltopdf arguments, if applicable.
* *WKHTML Options* for `page`, `urlParam` or `url`:
......@@ -6805,14 +6805,14 @@ Setup
* Create a special column name `_excel` (or `_link`) in QFQ/Report. As a source, define a T3 PageContent, which has to
deliver the dynamic content (also `excel-export-sample`_). ::
SELECT CONCAT('d:final.xlsx|M:excel|s:1|t:Excel (new)|uid:43') AS _link
SELECT CONCAT('d:final.xlsx|M:excel|s:1|t:Excel (new)|uid:<tt-content record id>') AS _link
* Create a T3 PageContent which delivers the content.
* It is recommended to use the `uid:<int>` syntax for excel imports, because there should be no html code on the
* It is recommended to use the `uid:<tt-content record id>` syntax for excel imports, because there should be no html code on the
resulting content. QFQ will retrieve the PageContent's bodytext from the Typo3 database, parse it, and pass the
result as the instructions for filling the excel file.
* Parameters can be passed: `uid:43?param=value&param2=value2` and will be accessible in the SIP Store (S) in the
* Parameters can be passed: `uid:<tt-content record id>?param=<value1>&param2=<value2>` and will be accessible in the SIP Store (S) in the
QFQ PageContent.
* Use the regular QFQ Report syntax to create some output.
* The newline at the end of every line needs to be CHAR(10). To make it simpler, the special column name `... AS _XLS`
......@@ -6881,17 +6881,17 @@ In Report Syntax::
.. _`excel-export-sample`:
Excel export samples::
Excel export samples (54 is a example <tt-content record id>)::
# From scratch (both are the same, one with '_excel' the other with '_link')
SELECT CONCAT('d:new.xlsx|t:Excel (new)|uid:54') AS _excel
SELECT CONCAT('d:new.xlsx|t:Excel (new)|uid:54|M:excel|s:1') AS _link
# Template
SELECT CONCAT('d:final.xlsx|t:Excel (template)|F:fileadmin/template.xlsx|uid:24') AS _excel
SELECT CONCAT('d:final.xlsx|t:Excel (template)|F:fileadmin/template.xlsx|uid:54') AS _excel
# With parameter (via SIP) - get the Parameter on page 'exceldata' with '{{arg1:S}}' and '{{arg2:S}}'
SELECT CONCAT('d:final.xlsx|t:Excel (parameter)|uid:32&arg1=hello&arg2=world') AS _excel
SELECT CONCAT('d:final.xlsx|t:Excel (parameter)|uid:54&arg1=hello&arg2=world') AS _excel
.. _dropdownMenu:
......
......@@ -121,7 +121,6 @@ phpunit_snapshot: snapshot phpunit
phpunit_release: release phpunit
doc-local:
# test
source docker/_helper_functions.sh; makePathExecutable "${PWD}/../"
docker pull t3docs/render-documentation
source <(docker run --rm t3docs/render-documentation show-shell-commands); dockrun_t3rd makehtml
......
......@@ -140,6 +140,7 @@ const KVP_VALUE_GIVEN = 'value_given';
// JSON encoded messages thrown through an exception:
const ERROR_MESSAGE_TO_USER = 'toUser'; // always shown to the user.
const ERROR_MESSAGE_TO_DEVELOPER = 'support'; // Message to help the developer to understand the problem.
const ERROR_MESSAGE_TO_DEVELOPER_SANITIZE = 'support_sanitize'; // Typically 'true' or missing. If 'false' then content of 'support' won't be html encoded.
const ERROR_MESSAGE_OS = 'os'; // Error message from the OS - like 'file not found' or specific SQL problem
const ERROR_MESSAGE_HTTP_STATUS = 'httpStatus'; // HTTP Status Code to report
......@@ -1789,4 +1790,10 @@ const HTTP_401_UNAUTHORIZED = '401 Unauthorized';
const HTTP_403_FORBIDDEN = '403 Forbidden';
const HTTP_403_METHOD_NOT_ALLOWED = '405 Method Not Allowed';
const HTTP_404_NOT_FOUND = '404 Not Found';
const HTTP_409_CONFLICT = '409 Conflict';
\ No newline at end of file
const HTTP_409_CONFLICT = '409 Conflict';
// update sql functions
const ACTION_FUNCTION_UPDATE = '_fupdate'; // get parameter to set the update behaviour of functions.sql
const ACTION_FUNCTION_UPDATE_NEXT_UPDATE = 'nextUpdate'; // functions.sql is updated at next qfq update
const ACTION_FUNCTION_UPDATE_NEVER = 'never'; // functions.sql is never updated
const ACTION_FUNCTION_UPDATE_NOT_PERFORMED = 'notUpdated'; // functions.sql update was skipped during last qfq update
\ No newline at end of file
......@@ -165,10 +165,16 @@ class DatabaseUpdate {
* @throws UserFormException
*/
private function updateSqlFunctions($oldFunctionsHash) {
if ('no' === $oldFunctionsHash) {
if (ACTION_FUNCTION_UPDATE_NEVER === $oldFunctionsHash) {
return null;
}
if ($_GET[ACTION_FUNCTION_UPDATE] === ACTION_FUNCTION_UPDATE_NEXT_UPDATE) {
return ACTION_FUNCTION_UPDATE_NOT_PERFORMED;
} elseif ($_GET[ACTION_FUNCTION_UPDATE] === ACTION_FUNCTION_UPDATE_NEVER) {
return ACTION_FUNCTION_UPDATE_NEVER;
}
$functionsSql = file_get_contents(__DIR__ . '/../../sql/functions.sql');
$functionsHash = hash('md5', $functionsSql);
......@@ -193,11 +199,17 @@ class DatabaseUpdate {
return $functionsHash;
} else {
$errorMsg[ERROR_MESSAGE_TO_USER] = 'Error while updating qfq.';
$errorMsg[ERROR_MESSAGE_TO_DEVELOPER] = "Error while updating qfq: " .
"Could not properly execute the file 'functions.sql' on the QFQ MYSQL database. " .
"Please do so manually or set the parameter 'functionsHash' in the table comments of the table" .
" 'Form' to 'no' i.e. 'Version=x.y.z&functionHash=no' to disable updating of the qfq mysql functions." .
" You may also try giving the mysql user the 'SUPER' privilege temporarily.";
$errorMsg[ERROR_MESSAGE_TO_DEVELOPER] =
"Failed to play functions.sql, probably not enough permissions for the qfq mysql user. " .
"Possible solutions: <ul>" .
'<li>Grant Super privilages to qfq mysql user temporarily.</li>' .
'<li>Play the following file manually on the database: ' .
'<a href="http://webwork16.math.uzh.ch/megger/qfq/typo3conf/ext/qfq/Source/sql/functions.sql">typo3conf/ext/qfq/Source/sql/functions.sql</a></li>' .
'<li><a href="?' . http_build_query(array_merge($_GET, array(ACTION_FUNCTION_UPDATE=>ACTION_FUNCTION_UPDATE_NEXT_UPDATE))) . '">Click here</a> to skip the sql functions update until next qfq release update</li>' .
'<li><a href="?' . http_build_query(array_merge($_GET, array(ACTION_FUNCTION_UPDATE=>ACTION_FUNCTION_UPDATE_NEVER))) . '">Click here</a> to skip the sql functions update forever</li>' .
'</ul>' .
"To enable the sql functions update again you can delete the parameter 'functionsHash' in the table comments of the table 'Form'.";
$errorMsg[ERROR_MESSAGE_TO_DEVELOPER_SANITIZE] = false;
throw new DbException(json_encode($errorMsg), ERROR_PLAY_SQL_FILE);
}
}
......
......@@ -144,7 +144,18 @@ class AbstractException extends \Exception {
$arrForm['FE column'] = Store::getVar(SYSTEM_FORM_ELEMENT_COLUMN, STORE_SYSTEM);
}
// Check if the 'developer message shouldn't be sanitized
$developerRaw=null;
if(($arrMsg[ERROR_MESSAGE_TO_DEVELOPER_SANITIZE]??true)==false){
$developerRaw=$arrMsg[ERROR_MESSAGE_TO_DEVELOPER]??'';
}
unset($arrMsg[ERROR_MESSAGE_TO_DEVELOPER_SANITIZE]);
$arrMerged = OnArray::htmlentitiesOnArray(array_merge($arrMsg, $arrDebugShow));
// Restore raw developer message
if($developerRaw!==null){
$arrMerged[ERROR_MESSAGE_TO_DEVELOPER]=$developerRaw;
}
if (!empty($os = $arrMerged[ERROR_MESSAGE_OS] ?? '')) {
// [ mysqli: 1146 ] Table 'qfq_db.UNKNOWN_TABLE' doesn't exist
......
Markdown is supported
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