sudo apt install pdftk libxrender1 file # for file upload, PDF and 'HTML to PDF' (wkhtmltopdf)
...
...
@@ -1340,7 +1340,7 @@ Form
during the installation of new QFQ versions.
* 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 which can roughly categorized into:
* Forms can roughly categorized into:
* *Simple* form: the form acts on one record, stored in one table.
...
...
@@ -1355,6 +1355,8 @@ Form
* The *FormElements* are defined as a regular *simple* / or *advanced* form, plus a SQL Query, which selects and
iterates over all records. Those records will be loaded at the same time.
* *Delete* form: any form can be used as a form to `delete-record`_.
* Form mode: The parameter 'r' (given via URL or via SIP) decide if the form is in mode:
* `New`:
...
...
@@ -1491,7 +1493,7 @@ showButton
Display or hide the button `new`, `delete`, `close`, `save`.
* *new*: Creates a new record. If the form needs any special parameter via SIP or Client (=browser), hide this 'new' button - the necessary parameter are not provided.
* *delete*: This either deletes the current record only, or (if defined via action *FormElement* 'beforeDelete' ) any specified subrecords.
* *delete*: This either deletes the current record only, or (if defined via action *FormElement* 'beforeDelete' ) any specified subrecords.
* *close*: Close the current form. If there are changes, a popup opens and ask to save / close / cancel. The last page from the history will be shown.
* *save*: Save the form.
...
...
@@ -3021,6 +3023,37 @@ form with the following parameter
* sql1: `{{!SELECT i.id AS id, {{basketId:P}} AS basketId FROM Item AS i WHERE i.basketId={{id:P}} }}`
* Parameter: `recordDestinationTable=Item`
.. _delete-record:
Delete Record
-------------
Deleting record(s) via QFQ might be solved by either:
* using the `delete` button on a form on the top right corner.
* by letting `report`_ creating a special link (see below). The link contains the record id and:
* a form name, or
* a table name.
Deleting a record just by specifying a table name, will only delete the defined record (no slave records).
* By using a delete button via `report` or in a `subrecord` row, a ajax request is send.
* By using a delete button on the top right corner of the form, the form will be closed after deleting the record.
Example for report::
SELECT p.name, CONCAT('form=person&r=', p.id) AS _Paged FROM Person AS p
SELECT p.name, CONCAT('table=Person&r=', p.id) AS _Paged FROM Person AS p
To automatically delete slave records, use a form and create `beforeDelete` FormElement(s) on the form:
* class: action
* type: beforeDelete
* parameter: sqlAfter={{DELETE FROM <slaveTable> WHERE <slaveTable>.<masteId>={{id:R}} }}
You might also check the form 'form' how the slave records 'FormElement' will be deleted.