Commit 201e1510 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Merge remote-tracking branch 'origin/crose_work' into raos_work

parents bd343f14 89879621
......@@ -60,19 +60,31 @@ DELETE
* class=record-delete
* Button: data-sip={{SIP}}
* SIP values:
* SIP_RECORD_ID: Mandatory.
* SIP_TABLE: Either SIP_TABLE or SIP_FORM has to be given.
* SIP_FORM: Either SIP_TABLE or SIP_FORM has to be given. Not implemented now.
* SIP_TARGET_URL: Only with SIP_MODE_ANSWER=MODE_HTML - Url to redirect browser to.
* SIP_MODE_ANSWER: MODE_JSON / MODE_HTML. If not given, this means MODE_JSON.
* Three possible variants with delete links:
* Form: main record
* (1) Form: main record
* HTML Code:
<button id="delete-button" type="button" class="btn btn-default navbar-btn" ><span class="glyphicon glyphicon-trash"></span></button>
* Form: subrecord, one delete button per record
* Report: typially inside a table, but maybe different.
* (2) Form: subrecord, one delete button per record
* HTML Code:
<button type="button" class="record-delete" data-sip={{SIP}} ><span class="glyphicon glyphicon-trash"></span></button>
* (3) Report: typially inside a table, but maybe different.
<button type="button" class="record-delete" data-sip={{SIP}} ><span class="glyphicon glyphicon-trash"></span></button>
Upload
-----------------
......@@ -87,12 +99,12 @@ Upload
Upload to server, before 'save'
...............................
* If a user open's a file for upload via the browse button, that file is immediately transmitted to the server. The user will see a turning wheel during until the upload finished.
* If a user open's a file for upload via the browse button, that file is immediately transmitted to the server. The user will see a turning wheel until the upload finished.
* After successfull upload the 'Browse' button disappears and the filename, plus the delete button, will be displayed (client logic).
* The uploaded file will be checked: maxsize, mime type, check script.
* The uploaded file is still temporary. It has been renamed from $_SESSION['X'][<uploadSip>][FILES_TMP_NAME] to $_SESSION['X'][<uploadSip>][FILES_TMP_NAME].cached
* The upload action will be saved in the user session.
* $_SESSION['X'][<uploadSip>][FILES_TMP_NAME|FILES_NAME|FILES_ERROR|FILE_SIZE]
* $_SESSION['X'][<uploadSip>][FILES_TMP_NAME|FILES_NAME|FILES_ERROR|FILE_SIZE]
* Clicks the user on delete button:
* In the usersession a flagDelete will be set: $_SESSION['X'][<uploadSip>]['flagDelete']='1'
* An optional previous upload file (still not saved on the final place) will be deleted.
......@@ -100,13 +112,15 @@ Upload to server, before 'save'
Form save
.........
* Before building the insert/update, process all 'uploads'.
* Get every uniq sipUpload to every upload formElement. Get the corresponding temporary uploaded filename.
* If $_SESSION['X'][<uploadSip>]['flagDelete']='1' is set, delete prefious uploaded file.
* Calculate <destination>
* mv <file>.cached <destination>
* clientvalue[<feName>] = <destination>
* delete $_SESSION['X'][<uploadSip>]
* Step 1: insert /update the record.
* Step 2: process all 'uploads'.
* Get every uniq sipUpload to every upload formElement. Get the corresponding temporary uploaded filename.
* If $_SESSION['X'][<uploadSip>]['flagDelete']='1' is set, delete prefious uploaded file.
* Calculate <destination>
* mv <file>.cached <destination>
* clientvalue[<feName>] = <destination>
* delete $_SESSION['X'][<uploadSip>]
* Step 3: update record with final `FileDestination'
Formelement type: DATE / DATETIME / TIME
----------------------------------------
......@@ -132,8 +146,8 @@ Formelement type: DATE / DATETIME / TIME
* datetime format: 'DATE TIME'
Debug / Log / Errormessages
===========================
Debug / Log
===========
* Before firing a SQL or doing processing of an FormElement, set some debugging / error variables:
......@@ -157,6 +171,20 @@ Debug / Log / Errormessages
$this->store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM) === 'yes'
Errormessages & Eceptions
=========================
* Exception types:
* Code
* Db
* User Form
* user Report
* plus an Errorhandler which throws exceptions
* Exceptions inside of an API call delivers the error code and msg as JSON to the client.
* Typo3 suppress E_NOTICE (e.g. undefined index). To catch E_NOTICE in QFQ, it will be temporaly enabled in QfqCongroller.php.
Stores
======
......
Neue Versionsnummer
===================
1) In folgenden Files anpassen:
* extension/Documentation/_make/conf.py: release, version
* extension/Documentation/Settings.yml: version
* extension/ext_emconf.php: version
2) Im Projectverzeichnis:
make t3sphinx (nicht sicher ob das noetig ist)
3) Neuen Tag vergeben: git tag v0.4
4) Alle Files, inkl. Tags, in GIT einchecken.
5) Per PhpStorm Sync aller Files auf VM qfq
6) In T3 Instanz Dokumentation rendern lassen.
T3 6.2: Admin Tools > Extension Manager > QFQ > Doku HTML: rechts oben 'Render Documentation'
......@@ -14,11 +14,17 @@ require_once(__DIR__ . '/../../qfq/qfq/exceptions/CodeException.php');
require_once(__DIR__ . '/../../qfq/qfq/exceptions/DbException.php');
class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
public function showAction() {
public function showAction() {
try {
$contentObject = $this->configurationManager->getContentObject();
// By T3 default 'E_NOTICE' is unset. E.g. 'Undefined Index' will throw an exception.
// QFQ like to see those 'E_NOTICE'
$origErrorReporting = error_reporting();
error_reporting($origErrorReporting | E_NOTICE);
$qfq = new \qfq\QuickFormQuery($contentObject->data);
$html = $qfq->process();
......@@ -34,6 +40,9 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
$html = "Generic Exception: " . $e->getMessage();
}
// Restore has to be outside of try/catch - E_NOTICE needs to unset for further T3 handling after an QFQ Exception.
error_reporting($origErrorReporting);
$this->view->assign('qfqOutput', $html);
return $this->view->render();
}
......
......@@ -90,8 +90,6 @@ Setup a *report* to manage all *forms*: Create a Typo3 page and insert a content
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| DB_INIT | DB_INIT=set names utf8 | Global init for using the database. |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| SESSION_NAME | SESSION_NAME=qfq | PHP Session name, by default 'qfq' |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| SQL_LOG | SQL_LOG=sql.log | Filename to log SQL commands: relative to <ext_dir> or absolute. |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| SQL_LOG_MODE | SQL_LOG_MODE=modify | *all*: every statement will be logged - this is a lot |
......@@ -117,7 +115,6 @@ Example: *<ext_dir>/config.ini*
DB_NAME = qfq_db
DB_NAME_TEST = qfq_db_test
DB_INIT = set names utf8
SESSION_NAME = qfq
SQL_LOG = sql.log
SHOW_DEBUG_INFO = auto
CSS_LINK_CLASS_INTERNAL = internal
......
......@@ -6,8 +6,8 @@
conf.py:
copyright: 2016
project: QFQ Extension
version: 0.3
release: 0.3.0
version: 0.4
release: 0.4.0
latex_documents:
- - Index
- qfq.tex
......
......@@ -19,9 +19,6 @@ Features not implemented yet
----------------------------
* Multi Forms
* FormElement:
* type=action (especially not *addNupdate*)
QFQ content element
-------------------
......@@ -35,6 +32,7 @@ The title of the QFQ content element will not be rendered. It's only visible in
QFQ Keywords (Bodytext)
^^^^^^^^^^^^^^^^^^^^^^^
+-------------------+---------------------------------------------------------------------------------+
| Name | Explanation |
+===================+=================================================================================+
......@@ -43,8 +41,9 @@ QFQ Keywords (Bodytext)
| | * by SIP: **form = {{form}}** |
| | * by SQL: **form = {{SELECT c.form FROM conference AS c WHERE c.id={{a:C}} }}** |
+-------------------+---------------------------------------------------------------------------------+
| r | recordId. If specified, the form will load the record with the specified id |
| | * Fix. E.g.: **r = 123**, by SQL: **r = {{SELECT ...}}** |
| r | recordId. The form will load the record with the specified id |
| | * Variants: **r = 123**, by SQL: **r = {{SELECT ...}}** |
| | * If not specified, the default is '0' |
+-------------------+---------------------------------------------------------------------------------+
| <level>.db | Select a DB. Only necessary if a different than the standard DB should be used. |
+-------------------+---------------------------------------------------------------------------------+
......@@ -103,16 +102,17 @@ Debug
Form
----
* Forms will be created by using the *Form editor* (HTML form). The Formeditor itself consist of two regular QFQ forms: *form* and *formElement*
* Forms will be created by using the *Form editor* on the Typo3 frontend (HTML form).
* The Formeditor itself consist of two predefined QFQ forms: *form* and *formElement*
* Every form consist of a) a *Form* record and b) multiple *FormElement* records.
* A form is assigned to a *table*. Such a table is called the *primary table* for this form.
* There are three types of forms:
* There are three types of forms which can roughly categorized into:
* *Simple* form: the form acts on one record, stored in one table.
* The form will create necessary SQL commands for insert, update and delete automatically.
* *Advanced* form: the form acts on one record, stored in more than one table.
* *Advanced* form: the form acts on multiple records, stored in more than one table.
* Fields of the primary table acts like a *simple* form, all other fields have to be specified with *addNupdate* records.
......@@ -135,12 +135,16 @@ Most fields of a form specification might contain:
* A variable (or SQL) statement is surrounded by curly braces:
*{{VarName[:<store / prio>[:<sanitize class>]]}}*
*{{VarName[:<store / prio>[:<sanitize class>[:<escape>]]]}}*
* Example:
*{{r}}*
*{{index:FS}}*
*{{name:FS:alnumx:s}}*
*{{SELECT name FROM person WHERE id=1234}}*
*{{SELECT name FROM person WHERE id={{r}} }}*
......@@ -152,9 +156,9 @@ Most fields of a form specification might contain:
* *{{ SELECT "Hello World" }}* acts as *{{SELECT "Hello World"}}*
* *{{ varname }}* acts as *{{varname}}*
* There are several stores, from where to retrieve the value. If a value is not found in one store, the next store is searched,
until a value is found or there are no more stores available.
* sdkf
* If anywhere along the line an empty string is found, this **is** a value: therefore, the search will stop.
* If no value is found, the value is an <empty string>.
......@@ -162,7 +166,20 @@ URL Parameter
-------------
* URL (=GET) Parameter can be used in *forms* and *reports* as variables.
* If a value violates a parameter sanitize class, an exception is thrown.
* If a value violates a parameter sanitize class, the value becomes an empty string.
Escape
------
* Variables used in SQL Statements might cause trouble, if they contain single or double ticks.
* Escaping of single or double is defined by the parameter <escape> (fourth parameter):
* 's' - single ticks will be escaped.
* 'd' - double ticks will be escaped.
* It's not possible to escape single and double ticks at the same time.
* Which of them to escape (single or double) depends on the surrounding SQL query.
* Escaping is only necessary inside of SQL queries.
Sanitize class
--------------
......@@ -192,12 +209,12 @@ Only variables that are known in a specified store can be substituted.
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
|Name |Description | Content |
+=====+========================================================================================+============================================================================+
| F | Form: data not saved in database yet. | All native form elements. Recent values from the Browser. |
| F | :ref:`STORE_FORM`: data not saved in database yet. | All native form elements. Recent values from the Browser. |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| S | SIP: Client parameter 's' will indicate the current SIP, which will be loaded from the | sip, r (record_id), form |
| | SESSION repo to the SIP-Store. | |
| S | :ref:`STORE_SIP`: Client parameter 's' will indicate the current SIP, which will be | sip, r (record_id), form |
| | loaded from the SESSION repo to the SIP-Store. | |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| R | Record - the record that is going to be edited. For new records: empty. | All columns of the current record from the current table |
| R | :ref:`STORE_RECORD`: Record - the current record loaded in the form | All columns of the current record from the current table |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| P | Parent record. E.g.: on multi forms the current record of the outer query | All columns of the MultiSQL Statement from the table for the current row |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
......@@ -205,11 +222,11 @@ Only variables that are known in a specified store can be substituted.
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| M | Column type: The *table.column* specified *type* | |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| C | Client: POST variable, if not found: GET variable | Parameter sent from the Client (=Browser). |
| C | :ref:`STORE_CLIENT`: POST variable, if not found: GET variable | Parameter sent from the Client (=Browser). |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| T | Typo3: a) Bodytext (ttcontent record), b) Typo3 internal varibles like feUser, ... | See Typo3 tt_content record configuration |
| T | :ref:`STORE_TYPO3`: a) Bodytext (ttcontent record), b) Typo3 internal variables | See Typo3 tt_content record configuration |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| V | Vars - Generic variables | |
| V | :ref:`STORE_VARS`: Generic variables | |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| 0 | Zero - allways value: 0, might be helpful if a variable is empty or undefined and will | All possible keys |
| | be used in an SQL statement. | |
......@@ -217,7 +234,7 @@ Only variables that are known in a specified store can be substituted.
| E | Empty - allways value: 0, might be helpful if a variable is empty or undefined and will| All possible keys |
| | be used in an SQL statement | |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| Y | System: a) Database credentials, b) helper vars for logging/debugging: | |
| Y | :ref:`STORE_SYSTEM`: a) Database, b) helper vars for logging/debugging: | |
| | SYSTEM_SQL_RAW ... SYSTEM_FORM_ELEMENT_COLUMN | |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
......@@ -233,104 +250,189 @@ Only variables that are known in a specified store can be substituted.
Predefined variable names
-------------------------
Store: *CLIENT* - C
^^^^^^^^^^^^^^^^^^^
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+===============+==========================================================================================================================================+
| s | =SIP |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| r | record id. Typically stored in SIP, rarely specified on the URL |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| keySemId | always current Semester Id |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| keySemIdUser | *{{keySemIdUser}}*, may be changed by user |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| HTTP_HOST | current HTTP HOST |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| REMOTE_ADDR | Client IP address |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| '$_SERVER[*]' | All other variables accessable by *$_SERVER[]*. Only the often used have a pre-defined sanitize class. |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| form | Unique name of current form |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| ANREDE | *{{sex}}* == male >> Sehr geehrter Herr, *{{sex}}* == female Sehr geehrte Frau |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| EANREDE | *{{sex}}* == male >> Dear Mr., *{{sex}}* == female >> Dear Mrs. |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
Store: *TYPO3* (Bodytext) - T
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+---------------+-------------------------------------------------------------------+
| Name | Explanation |
+===============+===================================================================+
| form | Formname defined in ttcontent record bodytext |
| | |
| | * Fix. E.g. *form = person* |
| | * via SIP. E.g. *form = {{form}}* |
+---------------+-------------------------------------------------------------------+
| pageId | Record id of current Typo3 page |
+---------------+-------------------------------------------------------------------+
| pageType | Current selected page type (typically URL parameter 'type') |
+---------------+-------------------------------------------------------------------+
| pageLanguage | Current selected page language (typically URL parameter 'L') |
+---------------+-------------------------------------------------------------------+
| ttcontentUid | Record id of current Typo3 content element |
+---------------+-------------------------------------------------------------------+
| feUser | Logged in Typo3 FE User |
+---------------+-------------------------------------------------------------------+
| feUserUid | Logged in Typo3 FE User uid |
+---------------+-------------------------------------------------------------------+
| feUserGroup | FE groups of logged in Typo3 FE User |
+---------------+-------------------------------------------------------------------+
.. _STORE_FORM:
Store: *FORM* - F
^^^^^^^^^^^^^^^^^
* Represents the values in the form, typically before saving them.
* Used for:
* Formelements who will be rerendered, after a parent element has been changed by the user.
* Formelement actions, before saving the form.
* Values will be sanatized by the class configured in corresponding the formelement. By default, the sanitize class is `alnumx`.
* Values will be sanitized by the class configured in corresponding the formelement. By default, the sanitize class is `alnumx`.
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+=========================+============================================================================================================================================+
| FormElement name | Name of native formelement. To get, exactly and only, the specified form element (for 'p_id'): *{{p_id:F}}* |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
.. _STORE_SIP:
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+====================+============================================================================================================================================+
| FormElement name | Name of native formelement. To get, exactly and only, the specified form element (for 'p_id'): *{{p_id:F}}* |
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
Store: *SIP* - S
^^^^^^^^^^^^^^^^
* Filled automatically by creating links. E.g.:
* in `Report` by using `_page?` or `_link` (with active 's')
* in `Form` by using subrecords: 'new', 'edit', 'delete' links (system) or by column type `_page?`, `_link`.
+-------------------------+-----------------------------------------------------------+
| Name | Explanation |
+=========================+===========================================================+
| sip | 13 char uniqid |
+-------------------------+-----------------------------------------------------------+
| r | current record id |
+-------------------------+-----------------------------------------------------------+
| form | current form name |
+-------------------------+-----------------------------------------------------------+
| table | current table name |
+-------------------------+-----------------------------------------------------------+
| urlparam | all non Typo3 paramter in one string |
+-------------------------+-----------------------------------------------------------+
| <user defined> | additional user defined link parameter |
+-------------------------+-----------------------------------------------------------+
.. _STORE_RECORD:
Store: *RECORD* - R
^^^^^^^^^^^^^^^^^^^
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+====================+============================================================================================================================================+
| record column name | Name of a column of the primary table (as defined in the current form). To get, exactly and only, the specified form element: *{{p_id:R}}* |
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
* Current record loaded in Form.
* If r=0, alle values are empty.
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+========================+============================================================================================================================================+
| <column name> | Name of a column of the primary table (as defined in the current form). To get, exactly and only, the specified form element: *{{p_id:R}}* |
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
.. _STORE_CLIENT:
Store: *CLIENT* - C
^^^^^^^^^^^^^^^^^^^
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+=========================+==========================================================================================================================================+
| s | =SIP |
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| r | record id. Typically stored in SIP, rarely specified on the URL |
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| keySemId | always current Semester Id |
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| keySemIdUser | *{{keySemIdUser}}*, may be changed by user |
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| HTTP_HOST | current HTTP HOST |
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| REMOTE_ADDR | Client IP address |
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| '$_SERVER[*]' | All other variables accessable by *$_SERVER[]*. Only the often used have a pre-defined sanitize class. |
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| form | Unique name of current form |
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| ANREDE | *{{sex}}* == male >> Sehr geehrter Herr, *{{sex}}* == female Sehr geehrte Frau |
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| EANREDE | *{{sex}}* == male >> Dear Mr., *{{sex}}* == female >> Dear Mrs. |
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
.. _STORE_TYPO3:
Store: *TYPO3* (Bodytext) - T
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-------------------------+-------------------------------------------------------------------+----------+
| Name | Explanation | Note |
+=========================+===================================================================+==========+
| form | Formname defined in ttcontent record bodytext | see note |
| | | |
| | * Fix. E.g. *form = person* | |
| | * via SIP. E.g. *form = {{form}}* | |
+-------------------------+-------------------------------------------------------------------+----------+
| pageId | Record id of current Typo3 page | see note |
+-------------------------+-------------------------------------------------------------------+----------+
| pageType | Current selected page type (typically URL parameter 'type') | see note |
+-------------------------+-------------------------------------------------------------------+----------+
| pageLanguage | Current selected page language (typically URL parameter 'L') | see note |
+-------------------------+-------------------------------------------------------------------+----------+
| ttcontentUid | Record id of current Typo3 content element | see note |
+-------------------------+-------------------------------------------------------------------+----------+
| feUser | Logged in Typo3 FE User | |
+-------------------------+-------------------------------------------------------------------+----------+
| feUserUid | Logged in Typo3 FE User uid | |
+-------------------------+-------------------------------------------------------------------+----------+
| feUserGroup | FE groups of logged in Typo3 FE User | |
+-------------------------+-------------------------------------------------------------------+----------+
* **note**: not available
* in 'dynamicUpdate' or
* by FormElement class 'action' with type 'beforeSave', 'afterSave', 'beforeDelete', 'afterDelete'.
.. _STORE_VARS:
Store: *VARS* - V
^^^^^^^^^^^^^^^^^
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+====================+============================================================================================================================================+
| random | random string with length of 32 chars, alphanum |
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
+=========================+============================================================================================================================================+
| random | random string with length of 32 chars, alphanum |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| slaveId | see FormElement `action` |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
SQL
---
.. _STORE_SYSTEM:
Store: *SYSTEM* - S
^^^^^^^^^^^^^^^^^^^
+-------------------------+------------------------------------------------------------+
| Name | Explanation |
+=========================+============================================================+
| DB_USER | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| DB_SERVER | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| DB_NAME | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| DB_INIT | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| SQL_LOG | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| SQL_LOG_MODE | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| SHOW_DEBUG_INFO | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| CSS_LINK_CLASS_INTERNAL | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| CSS_LINK_CLASS_EXTERNAL | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| CSS_CLASS_QFQ_CONTAINER | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| EXT_PATH | computed during runtime |
+-------------------------+------------------------------------------------------------+
| SITE_PATH | computed during runtime |
+-------------------------+------------------------------------------------------------+
| DATE_FORMAT | defined in config.ini |
+-------------------------+------------------------------------------------------------+
| sqlFinal | computed during runtime, used for error reporting |
+-------------------------+------------------------------------------------------------+
| sqlParamArray | computed during runtime, used for error reporting |
+-------------------------+------------------------------------------------------------+
| sqlCount | computed during runtime, used for error reporting |
+-------------------------+------------------------------------------------------------+
SQL Statement
-------------
* The detection of an SQL command is case *insensitive*.
* Leading whitespace will be skipped.
* The following commands are interpreted as SQL commands:
* SELECT
* INSERT
* UPDATE
* DELETE
* SHOW
* INSERT, UPDATE, DELETE, REPLACE, TRUNCATE
* SHOW, DESCRIBE, EXPLAIN, SET
* A SQL Statement might contain parameters, including additional SQL statements. Inner SQL queries will be executed first.
* All variables will be substituted one by one from inner to outer.
......@@ -344,9 +446,9 @@ SQL
{{SELECT id, name, IF({{feUser}}=0,'Yes','No') FROM Vorlesung WHERE sem_id={{keySemId:Y}} }}
{{SELECT id, city FROM Address AS adr WHERE adr.p_id={{SELECT id FROM Account AS acc WHERE acc.name={{feUser}} }} }}
* Special case for SELECT input fields. To deliver a result array specify an '!' before the SELECT:
* Special case for SELECT input fields. To deliver a result array specify an '!' before the SELECT: ::
*{{!SELECT ...}}*
*{{!SELECT ...}}*
* This is only possible for the outermost SELECT.
......@@ -507,10 +609,10 @@ Class: Native
|class | enum('native', 'action', | Details below. |
| | 'container') | |
+---------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|type | enum('checkbox', 'date', 'time', 'datetime', 'dateJQW', 'datetimeJQW', 'gridJQW', 'hidden', 'text', 'note', 'password', |
| | 'radio', 'select', 'subrecord', 'textarea', 'timeJQW', 'upload', 'fieldset', 'pill', 'before_load', 'before_save', |
| | 'before_insert', 'before_update', 'before_delete', 'after_load', 'after_save', 'after_insert', 'after_update', 'after_delete', |
| | 'feGroup', 'sendmail') |
|type | enum('checkbox', 'date', 'time', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text', 'note', 'password', |
| | 'radio', 'select', 'subrecord', 'textarea', 'timeJQW', 'upload', 'fieldset', 'pill', 'beforeLoad', 'beforeSave', |
| | 'beforeInsert', 'beforeUpdate', 'beforeDelete', 'afterLoad', 'afterSave', 'afterInsert', 'afterUpdate', 'afterDelete', |
| | 'sendmail') |
+---------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|checkType | enum('min|max', 'pattern', | |
| | 'number', 'email') | |
......@@ -565,7 +667,7 @@ Class: Native
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| Attribute | checkbox | dateJQW | datetimeJQW | gridJQW | hidden | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
| Attribute | checkbox | dateJQW | datetimeJQW | gridJQW | extra | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
+==================+==========+=========+=============+==========+========+=======+======+==========+=======+========+===========+==========+=========+========+
|id |Internal id |