Commit 02b1a66f authored by Carsten  Rose's avatar Carsten Rose
Browse files

Download/Excel: Divided error message 'unknown token' between message toUser and toSupport.

parent be0556ec
Pipeline #754 passed with stage
in 1 minute and 52 seconds
......@@ -2920,7 +2920,7 @@ Checkboxes can be rendered in mode:
There might be situations, where the user should be forced to select a value (e.g. specifying the gender). An unwanted
default value can be suppressed by specifying an explicit definition on the FormElement field `value`::
{{<columnname>:RZ}}
{{<columnName>:RZ}}
For existing records the shown value is as expected the value of the record. For new records, it's the value `0`,
which is typically not one of the ENUM / SET values and therefore nothing is selected.
......@@ -3168,7 +3168,7 @@ Type: radio
* If there is a default configured on a table column, such a value is selected by default. If the user should actively
choose an option, the 'preselection' can be omitted by specifying an explicit definition on the FormElement field `value`::
{{<columnname>:RZ}}
{{<columnName>:RZ}}
For existing records the shown value is as expected the value of the record. For new records, it's the value `0`,
which is typically not one of the ENUM values and therefore nothing is selected.
......@@ -3236,7 +3236,7 @@ will be rendered inside the form as a HTML table.
* Notice the **exclamation mark** after '{{' - this is necessary to return an array of elements, instead of a single string.
* Exactly one column **'id'** has to exist; it specifies the primary record for the target form.
In case the id should not be visible to the user, it has to be named **'_id'**.
* Columnname: *[title=]<title>[|[maxLength=]<number>][|nostrip][|icon][|link][|url][|mailto][|_rowClass][|_rowTooltip]*
* Column name: *[title=]<title>[|[maxLength=]<number>][|nostrip][|icon][|link][|url][|mailto][|_rowClass][|_rowTooltip]*
* If the keyword is used, all parameter are position independent.
* Parameter are separated by '|'.
......@@ -3290,7 +3290,7 @@ will be rendered inside the form as a HTML table.
* Example: *detail=id:personId,rowId:secId,&12:xId,&{{a}}:personId* (rowId is a column of the current selected row defined by sql1)
* By default, the given value will overwrite values on the target record. In most situations, this is the wished behaviour.
* Exceptions of the default behaviour have to be defined on the target form in the corresponding *FormElement* in the
field *value* by changing the default Store priority definition. E.g. `{{<columnname>:RS0}}` - For existing records,
field *value* by changing the default Store priority definition. E.g. `{{<columnName>:RS0}}` - For existing records,
the store `R` will provide a value. For new records, store `R` is empty and store S will be searched for a value:
the value defined in `detail` will be choosen. At last the store '0' is defined as a fallback.
* *source table column name*: E.g. A person form is opened with person.id=5 (r=5). The definition `detail=id:personId`
......@@ -3604,7 +3604,7 @@ Parameter: slaveId
* Auto fill: name the action `action`-*FormElement* equal to an existing column (table from the current form definition).
*slaveId* will be automatically filled with the value of the named column.
* If there is no such named columnname, set *slaveId* = `0`.
* If there is no such named column name, set *slaveId* = `0`.
* Explicit definition: *slaveId* = `123` or *slaveId* = `{{SELECT id ...}}`
......@@ -3679,7 +3679,7 @@ Situation 1: master.xId=slave.id (1:1)
Situation 2: master.id=slave.xId (1:n)
* Name the action element *different* to any columnname of the master record (or no name).
* Name the action element *different* to any column name of the master record (or no name).
* Determine the slaveId: `slaveId={{SELECT id FROM slave WHERE slave.xxx={{...}} LIMIT 1}}`
* {{slaveId}} == 0 ? 'sqlInsert' will be fired.
......@@ -3767,7 +3767,7 @@ See also `copy-form`_.
* *recordSourceTable* = `<tableName>` - Optional: table from where the records will be copied. Default: <recordDestinationTable>
* *recordDestinationTable* = `<tableName>` - table where the new records will be copied to.
* *translateIdColumn* = `<columnname>` - columnname to update references of newly created id's.
* *translateIdColumn* = `<column name>` - column name to update references of newly created id's.
.. _form-magic:
......@@ -4099,7 +4099,7 @@ corresponding `FormElements` all internal references needs to be updated as well
On each FormElement.type=`paste` record, the column to be updated is defined via:
* parameter: translateIdColumn = <columnname>
* parameter: translateIdColumn = <column name>
For the 'copyForm' this would be 'feIdContainer'.
......@@ -4793,7 +4793,7 @@ There is a set of **variables** that will get replaced before the SQL-Query gets
``{{<name>:R}}`` - use case of the above generic definition. See also `access-column-values`_.
``{{<level>.<columnname>}}``
``{{<level>.<columnName>}}``
Similar to ``{{<name>:R}}`` but more specific. There is no sanitize class, escape mode or default value.
``{{<level>.line.count}}`` - Current row index
......@@ -4816,11 +4816,11 @@ Only SELECT and SHOW queries will fire subqueries.
Processing of the resulting rows and columns:
* In general, all columns of all rows will be printed out sequentially.
* On a per column base, printing of columns can be suppressed by starting the columnname with an underscore '_'. E.g.
* On a per column base, printing of columns can be suppressed by starting the column name with an underscore '_'. E.g.
`SELECT id AS _id`.
This might be useful to store values, which will be used later on in another query via the `{{id:R}}` or
`{{<level>.columnname}}` variable. To suppress printing of a column, use a underscore as column name prefix. E.g.
`{{<level>.columnName}}` variable. To suppress printing of a column, use a underscore as column name prefix. E.g.
`SELECT id AS _id`
*Reserved column names* have a special meaning and will be processed in a special way. See
......@@ -5153,9 +5153,11 @@ Special column names
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| _monitor |Constantly display a file. See `column-monitor`_. |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| _XLS |Used for Excel export. Append a `newline` character at the end of the string. See `excel-export`_. |
| _XLS |Used for Excel export. Append a `newline` character at the end of the string. Token must be part of string. See `excel-export`_. |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| _XLSs |Used for Excel export. Prepend 's=' and append a `newline` character around the string. See `excel-export`_. |
| _XLSs |Used for Excel export. Prepend the token 's=' and append a `newline` character at the string. See `excel-export`_. |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| _XLSb |Used for Excel export. Like '_XLSs' but encode the string base64. See `excel-export`_. |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| _XLSn |Used for Excel export. Prepend 'n=' and append a `newline` character around the string. See `excel-export`_. |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
......@@ -5462,7 +5464,7 @@ These column offers a link, with a confirmation question, to delete one record (
..
If the record to delete contains column(s), whose columnname match on `%pathFileName%` and such a
If the record to delete contains column(s), whose column name match on `%pathFileName%` and such a
column points to a real existing file, such a file will be deleted too. If the table contains records where the specific
file is multiple times referenced, than the file is not deleted (it would break the still existing references). Multiple
references are not found, if they use different colummnnames or tablenames.
......@@ -6105,7 +6107,7 @@ By using the `_link` column name:
* setting `s:1` is mandatory for the download function,
* the alttext `a:...` specifies a message in the download popup.
By using `_pdf`, `_Pdf`, `_file`, `_File`, `_zip`, `_Zip`, `excel` as columnname, the options `d`, `m` and `s`
By using `_pdf`, `_Pdf`, `_file`, `_File`, `_zip`, `_Zip`, `_excel` as column name, the options `d`, `m` and `s`
will be set.
All files will be read by PHP - therefore the directory might be protected against direct web access. This is the
......@@ -6344,13 +6346,13 @@ Excel export
Mode:
* NEW: The export file will be completely build from scratch.
* TEMPLATE: The export file is based on an earlier uploaded xlsx file (template). The template itself is unchanged.
* `New`: The export file will be completely build from scratch.
* `Template`: The export file is based on an earlier uploaded xlsx file (template). The template itself is unchanged.
Injecting the data is done in the same way in both modes . The only difference is by specifying a xlsx file which will
be used as an template.
Injecting the data is done in the same way in both modes.
If the export file has to be customized (colors, pictures, headlines, ...), the TEMPLATE mode is the preferred option.
If the export file has to be customized (colors, pictures, headlines, ...), the `Template` mode is the preferred option.
IT's much easier to do all cusomizations via Excel and creating a template than by coding in QFQ / Excel export notation.
Setup
'''''
......@@ -6450,17 +6452,17 @@ In Report Syntax: ::
Drag and drop
-------------
Sort/order elements
^^^^^^^^^^^^^^^^^^^
Order elements
^^^^^^^^^^^^^^
Manually sorting and ordering of elements via `HTML5 drag and drop` is supported via QFQ. Any element to sort
Ordering of elements via `HTML5 drag and drop` is supported via QFQ. Any element to order
should be represented by a database record with an order column. If the elements are unordered, they will be ordered after
the first 'drag and drop' move of an element.
Functionality divides into:
* Display list: the records will be displayed via QFQ/report.
* Sort records: updates of the order column are managed by a specific definition form. The form is not a regular form
* Display: the records will be displayed via QFQ/report.
* Order records: updates of the order column are managed by a specific definition form. The form is not a regular form
(e.g. there are no FormElements), instead it's only a container to held the SQL update query as well as providing
access control via SIP. The form is automatically called via AJAX.
......@@ -6555,8 +6557,8 @@ with an updated `n.ord` column: ::
tail = </tbody><table>
}
Part 2: Sort records
''''''''''''''''''''
Part 2: Order records
'''''''''''''''''''''
A dedicated `Form`, without any `FormElements`, is used to define the reorder logic (database update definition).
......@@ -6575,7 +6577,7 @@ Fields:
| orderColumn = <column name> | Optional. By default 'ord'. |
+-------------------------------------+--------------------------------------------------------------------------------+
| dragAndDropOrderSql = | Query to selects the *same* records as the report in the |
| {{!SELECT n.id AS id, n.ord AS ord FROM Note AS n | same *order!* Inconsistencies results in sort differences. |
| {{!SELECT n.id AS id, n.ord AS ord FROM Note AS n | same *order!* Inconsistencies results in order differences. |
| ORDER BY n.ord}} | The columns `id` and `ord` are *mandatory.* |
+-------------------------------------------------------+--------------------------------------------------------------+
......@@ -6596,7 +6598,7 @@ QFQ iterates over the result set of `dragAndDropOrderSql`. The value of column `
changes are applied where appropriate.
Take care that the query of part 1 (display list) does a) select the same records and b) in the same order as the query
defined in part 2 (sort records) via `dragAndDropOrderSql`.
defined in part 2 (order records) via `dragAndDropOrderSql`.
If you find that the reorder does not work at expected, those two sql queries are not identically.
......
......@@ -35,9 +35,11 @@ class AbstractException extends \Exception {
protected $line = '';
/**
* $this->getMessage() might give a) a simple string or b) an JSON String.
* $this->getMessage() might give
* a) a simple string, or
* b) an JSON String.
*
* JSON String: There are 3+1 different messages:
* If it is a JSON String: There are 3+1 different messages:
* [ERROR_MESSAGE_TO_USER] 'toUser' - shown in the client to the user - no details here!!!
* [ERROR_MESSAGE_SUPPORT] 'support' - help for the developer
* [ERROR_MESSAGE_OS] 'os' - message from the OS, like 'file not found'
......@@ -206,6 +208,7 @@ class AbstractException extends \Exception {
}
} catch (\exception $e) {
// none, should rise up
}
return 'Form: ' . $linkForm . '&nbsp;&nbsp; FormElement: ' . $linkFormElement;
......
......@@ -161,7 +161,10 @@ class Excel {
break;
default:
throw new downloadException("Excel Export: unknown token " . $key, ERROR_UNKNOWN_TOKEN);
$errorMsg[ERROR_MESSAGE_TO_USER] = 'Excel Export: unknown token';
$errorMsg[ERROR_MESSAGE_SUPPORT] = 'Unknown Token: ' . $key;
throw new downloadException(json_encode($errorMsg), ERROR_UNKNOWN_TOKEN);
}
}
......
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