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

Manual.rst: add 'Best Practice' code to show QFQ log files in realtime. Reformat some content.

parent 8daceb1e
Pipeline #2313 passed with stages
in 2 minutes and 43 seconds
......@@ -269,7 +269,7 @@ Setup a *report* to manage all *forms*:
# Table header.
sql = SELECT CONCAT('p:{{pageAlias:T}}&form=form|A:data-reference=newForm') as _pagen, '#', 'Name', 'Title', 'Table', '' FROM (SELECT 1) AS fake WHERE '{{form:SE}}'=''
head = {{'b|p:id={{pageAlias:T}}&form=copyFormFromExt|t:Copy form from ExtForm|A:data-reference=copyForm' AS _link}}
<table class="table table-hover qfq-table-50 tablesorter tablesorter-filter">
<table class="table table-hover qfq-table-50 tablesorter tablesorter-filter" id="{{pageAlias:T}}-form">
tail = </table>
rbeg = <thead><tr>
rend = </tr></thead>
......@@ -1023,28 +1023,23 @@ Setup in configuration_
* During a download (especially by using wkhtml), temporary files are not deleted automatically. Also the
``wkhtmltopdf`` and ``pdfunite`` command lines will be logged to `QFQ_LOG`_. Use this only to debug problems on download.
.. _REDIRECT_ALL_MAIL_TO:
.. _MAIL_LOG:
Redirect all mail to (catch all)
--------------------------------
MAIL Log
--------
Setup in configuration_
* *redirectAllMailTo=john@doe.com*
* *mailLog*
* During the development, it might be helpful to configure a 'catch all' email address, which QFQ uses as the final receiver
instead of the original intended one.
* The setting will:
* File which `sendEmail` logs sending mail.
* File is relative to the `<site path>` or absolute (starting with '/').
* Replace the 'To' with the configured one.
* Clear 'CC' and 'Bcc'
* Write a note and the original configured receiver at the top of the email body.
_`mail-log-page`
Mail Log page
-------------
Mail Log page (Table MailLog)
-----------------------------
For debugging purposes you may like to add a Mail Log page in the frontend.
The following QFQ code could be used for that purpose (put it in a QFQ PageContent element)::
......@@ -1065,6 +1060,7 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte
rend = </option>
tail = </select>
}
20 {
sql = SELECT IF(@summary = 'true', ' checked', '')
head = <div class='checkbox'><label><input type='checkbox' name='summary' value='true'
......@@ -1089,6 +1085,50 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte
rend = </td></tr>
}
.. _REDIRECT_ALL_MAIL_TO:
Redirect all mail to (catch all)
--------------------------------
Setup in configuration_
* *redirectAllMailTo=john@doe.com*
* During the development, it might be helpful to configure a 'catch all' email address, which QFQ uses as the final receiver
instead of the original intended one.
* The setting will:
* Replace the 'To' with the configured one.
* Clear 'CC' and 'Bcc'
* Write a note and the original configured receiver at the top of the email body.
Show log files realtime
-----------------------
Display QFQ log files in realtime.
The following QFQ code could be used for that purpose (put it in a QFQ PageContent element)::
#
# {{logfile:SU}}
#
10 {
sql = SELECT '{{logfile:SU:::sql.log}}' AS '_=logfile'
20.sql = SELECT CONCAT('p:{{pageAlias:T}}&logfile=sql.log|t:sql.log|b:', IF('{{logfile:SU}}'='sql.log','primary','default')) AS _page, ' '
30.sql = SELECT CONCAT('p:{{pageAlias:T}}&logfile=qfq.log|t:qfq.log|b:', IF('{{logfile:SU}}'='qfq.log','primary','default')) AS _page, ' '
40.sql = SELECT CONCAT('p:{{pageAlias:T}}&logfile=mail.log|t:mail.log|b:', IF('{{logfile:SU}}'='mail.log','primary','default')) AS _page, ' '
head = <p>
tail = </p>
}
# Show selected log file.
100.sql = SELECT 'file:fileadmin/protected/log/{{logfile:SU}}' AS _monitor
100.head = <pre id="monitor-1">Please wait</pre>
_`form-submit-log-page`
Form Submit Log page
......@@ -5412,28 +5452,27 @@ context variable `store`. The active Typo3 front-end user is therefore available
{{ store.typo3.feUser }}
A realistic example
^^^^^^^^^^^^^^^^^^^
The following block shows a more realistic example of a QFQ report.
Example
^^^^^^^
The following block shows an example of a QFQ report.
*10.sql* selects all users who have been assigned files in our file tracker.
.. TODO use content = hide instead of _user once this is implemented
*10.10* then selects all files belonging to this user, prints the username as header
and then displays the files in a nice table with links to the files.
::
and then displays the files in a nice table with links to the files. ::
10.sql = SELECT assigned_to AS _user FROM file_tracker
WHERE assigned_to IS NOT NULL
GROUP BY _user
ORDER BY _user
WHERE assigned_to IS NOT NULL
GROUP BY _user
ORDER BY _user
10.10.sql = SELECT id, path_scan FROM file_tracker
WHERE assigned_to = '{{user:R}}'
10.10.twig = <h2>{{ store.record.user }}</h2>
<table id="file-list" class="table table-hover tablesorter">
<table id="file-list" class="table table-hover tablesorter" id="{{pageAlias:T}}-twig">
<thead><tr><th>ID</th><th>File</th></tr></thead>
<tbody>
{% for row in result %}
......@@ -7446,7 +7485,7 @@ The *tablesorter* options:
* `<uniqueName>` should be a name which is at least unique inside the typo3 content element. Example::
<table {{ 'allperson' AS _tablesorter-view-saver }} class="tablesorter tablesorter-filter tablesorter-column-selector"> ... </table>
<table {{ 'allperson' AS _tablesorter-view-saver }} class="tablesorter tablesorter-filter tablesorter-column-selector" id="{{pageAlias:T}}-demo"> ... </table>
* 'Views' can be saved as:
......@@ -7491,7 +7530,7 @@ Example::
10 {
sql = SELECT id, CONCAT('form&form=person&r=', id) AS _Pagee, lastName, title FROM person
head = <table class="table tablesorter tablesorter-filter tablesorter-pager tablesorter-column-selector">
head = <table class="table tablesorter tablesorter-filter tablesorter-pager tablesorter-column-selector" id="{{pageAlias:T}}-ts1">
<thead><tr><th>Id</th><th data-sorter="false" class="filter-false">Edit</th>
<th>Name</th><th class="filter-select" data-placeholder="Select a title">Title</th>
</tr></thead><tbody>
......
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