1
|
#
|
2
|
# Form
|
3
|
#
|
4
|
# a) List of forms: {{form:S}}='', {{formIdHistory:S}}=''
|
5
|
# b) Edit Form: {{form:S}} - Open form {{form:S}} with record {{r:S}} - typically the FormEditor
|
6
|
# c) Use history of a given form: {{formIdHistory:S}}
|
7
|
#
|
8
|
# {{form:S}}
|
9
|
# {{formIdHistory:S0}} - usage history of form '{{formIdHistory:S}}'
|
10
|
|
11
|
form={{form:SE}}
|
12
|
|
13
|
10.sql = SELECT f.id, f.name, f.title, f.tableName, f.created, COUNT(fsl.id) AS submit_count, MIN(fsl.created) AS submit_first, MAX(fsl.created) AS submit_last, GROUP_CONCAT(DISTINCT fsl.pageId ORDER BY fsl.pageId) AS submit_pages
|
14
|
FROM Form AS f
|
15
|
LEFT JOIN FormSubmitLog AS fsl ON fsl.formId=f.id
|
16
|
WHERE '{{form:SE}}'='' AND {{formIdHistory:S0}}=0
|
17
|
GROUP BY f.id ORDER BY f.name
|
18
|
|
19
|
10.twig = {% if result|length > 0 %}
|
20
|
<table class="table table-hover qfq-table-50 tablesorter tablesorter-filter" id="{{store.typo3.pageAlias}}-form">
|
21
|
<thead class="qfq-sticky"><tr>
|
22
|
<th data-sorter="false" class="filter-false">{{ ('p:'~store.typo3.pageAlias~'|s|N|U:form=Form') | qfqlink }}</th>
|
23
|
<th>id</th>
|
24
|
<th>Name</th>
|
25
|
<th>Title</th>
|
26
|
<th>Table</th>
|
27
|
<th>Created</th>
|
28
|
<th>Last Submit</th>
|
29
|
<th># Submits</th>
|
30
|
<th>Submits from PID</th>
|
31
|
</tr></thead>
|
32
|
<tbody>
|
33
|
|
34
|
{% for row in result %}
|
35
|
<tr>
|
36
|
<td>{{ ('p:'~store.typo3.pageAlias~'|s|E|U:form=Form&r='~row.id) | qfqlink }}</td>
|
37
|
<td>{{ row.id }}</td>
|
38
|
<td>{{ row.name }}</td>
|
39
|
<td>{{ row.title[:50] }}</td>
|
40
|
<td>{{ row.tableName }}</td>
|
41
|
<td>{{ row.created|date("Y-m-d") }}</td>
|
42
|
<td>{{ row.submit_last ? date(row.submit_last).diff(date()).days : "-" }} days ago</td>
|
43
|
<td>
|
44
|
{% if row.submit_count == 0 %}
|
45
|
{% set mode = "|r:3" %}
|
46
|
{% else %}
|
47
|
{% set mode = "" %}
|
48
|
{% endif %}
|
49
|
{{ ('p:'~store.typo3.pageAlias~mode~'|U:formIdHistory='~row.id~'|s|b|t:<span class="badge">'~row.submit_count~'</span>') | qfqlink }}
|
50
|
</td>
|
51
|
|
52
|
<td>{{ row.submit_pages }}</td>
|
53
|
</tr>
|
54
|
{% endfor %}
|
55
|
</tbody></table>
|
56
|
{% endif %}
|
57
|
|
58
|
|
59
|
|
60
|
|
61
|
20.sql = SELECT f.name
|
62
|
, fsl.feUser
|
63
|
, fsl.recordId
|
64
|
, fsl.pageId
|
65
|
, fsl.created
|
66
|
FROM FormSubmitLog AS fsl
|
67
|
LEFT JOIN Form AS f
|
68
|
ON fsl.formId=f.id
|
69
|
WHERE fsl.formId={{formIdHistory:S0}}
|
70
|
ORDER BY fsl.created DESC
|
71
|
|
72
|
20.twig = {% if result|length > 0 %}
|
73
|
<h3>Submit History for {{ result.0.name }}</h3>
|
74
|
<a href="javascript:history.back()">Back</a>
|
75
|
<table class="table table-hover qfq-table-50 tablesorter tablesorter-filter" id="{{store.typo3.pageAlias}}-formHistory">
|
76
|
<thead class="qfq-sticky"><tr><th>Form</th><th>feUser</th><th>recordId</th><th>pageId</th><th>Submit</th></tr></thead>
|
77
|
<tbody>
|
78
|
{% for row in result %}
|
79
|
<tr>
|
80
|
{% for col in row %}
|
81
|
<td>{{ col }}</td>
|
82
|
{% endfor %}
|
83
|
</tr>
|
84
|
{% else %}
|
85
|
{# this should never happen, as we do not provide a link if there is no history #}
|
86
|
<tr><td></td><td></td><td></td><td>no history found</td><td></td><td></td><td></td><td></td><td></td></tr>
|
87
|
{% endfor %}
|
88
|
</tbody></table>
|
89
|
<a href="javascript:history.back()">Back</a>
|
90
|
{% endif %}
|