Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
qfq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
typo3
qfq
Commits
5aee0e86
Commit
5aee0e86
authored
Oct 09, 2019
by
Carsten Rose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into F5695-Multiform
parents
34be39d7
6d9b9daf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
20 deletions
+80
-20
Documentation/Manual.rst
Documentation/Manual.rst
+16
-1
extension/Classes/Core/Helper/DownloadPage.php
extension/Classes/Core/Helper/DownloadPage.php
+1
-0
extension/Classes/Core/QuickFormQuery.php
extension/Classes/Core/QuickFormQuery.php
+38
-15
extension/Classes/Core/Store/Store.php
extension/Classes/Core/Store/Store.php
+5
-4
extension/Classes/Sql/function.sql
extension/Classes/Sql/function.sql
+20
-0
No files found.
Documentation/Manual.rst
View file @
5aee0e86
...
...
@@ -6893,6 +6893,21 @@ Output::
hello world-
.. _strip_tags:
strip_tags: strip html tags
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The SQL function strip_tags(input) returns 'input' without any HTML tags.
Example::
10.sql = SELECT strip_tags('
<a
href=
"https://example.com"
><b>
my name
</b>
<i>
is john
</i></a>
- end of sentence')
Output::
my name is john - end of sentence
.. _download:
Download
...
...
@@ -8323,7 +8338,7 @@ has the form be used. The following report includes the regular `form-editor`_ a
#
All
forms
sql
=
SELECT
CONCAT('
p
:
{{
pageAlias
:
T
}
}
&
form
=
Form
&
r
=
', f.id) as _pagee
, CONCAT(f.name, '
<
span
class
=
"text-muted"
>(
', f.id, '
)</
span
>
')
, QMORE(
f.title
,50)
, QMORE(
strip_tags(f.title)
,50)
, f.tableName
, CONCAT('
p
:
{
{
pageAlias
:
T
}
}
&
formIdHistory
=
', f.id, '
|
s
|
b
|
t
:<
span
class
=
"badge"
>
', COUNT(fsl.id), '
</
span
>
'
, IF(COUNT(fsl.id)=0, '
|
r
:
3
','') ) as _link
...
...
extension/Classes/Core/Helper/DownloadPage.php
View file @
5aee0e86
...
...
@@ -61,6 +61,7 @@ class DownloadPage {
'method'
=>
"GET"
,
'header'
=>
"Accept-language: en
\r\n
"
.
"Cookie: "
.
SESSION_NAME
.
"="
.
$_COOKIE
[
SESSION_NAME
]
.
"
\r\n
"
,
'timeout'
=>
600
,
),
);
$ctx
=
array_merge
(
$ctx
,
$cookie
);
...
...
extension/Classes/Core/QuickFormQuery.php
View file @
5aee0e86
...
...
@@ -373,6 +373,12 @@ class QuickFormQuery {
case
FORM_REST
:
$fillStoreForm
=
new
FillStoreForm
();
$fillStoreForm
->
process
(
$formMode
);
// STORE_TYPO3 has been filled: fire fillStoreVar again.
if
(
!
empty
(
$this
->
formSpec
[
FE_FILL_STORE_VAR
]))
{
$this
->
fillStoreVar
(
$this
->
formSpec
[
FE_FILL_STORE_VAR
]);
}
break
;
}
...
...
@@ -1078,21 +1084,8 @@ class QuickFormQuery {
// Fire FE_FILL_STORE_VAR after the primary form record has been loaded
if
(
!
empty
(
$formSpec
[
FE_FILL_STORE_VAR
]))
{
$rows
=
$this
->
evaluate
->
parse
(
$formSpec
[
FE_FILL_STORE_VAR
],
ROW_EXPECT_0_1
);
unset
(
$formSpec
[
FE_FILL_STORE_VAR
]);
if
(
is_array
(
$rows
))
{
$this
->
store
->
appendToStore
(
$rows
,
STORE_VAR
);
// LOG
if
(
!
empty
(
$form
[
FORM_LOG_ACTIVE
]))
{
Logger
::
logFormLine
(
$form
,
"F:add to STORE_VAR"
,
$rows
);
}
}
else
{
if
(
!
empty
(
$rows
))
{
throw
new
\
UserFormException
(
"Invalid statement for '"
.
FE_FILL_STORE_VAR
.
"': "
.
$formSpec
[
FE_FILL_STORE_VAR
],
ERROR_INVALID_OR_MISSING_PARAMETER
);
}
}
$this
->
fillStoreVar
(
$formSpec
[
FE_FILL_STORE_VAR
]);
// unset($formSpec[FE_FILL_STORE_VAR]);
}
$this
->
formSpec
=
$formSpec
;
...
...
@@ -1136,6 +1129,36 @@ class QuickFormQuery {
return
$formName
;
}
/**
* If $sql selects one row, append the row to STORE_VAR.
*
* @param $sql
* @throws \CodeException
* @throws \DbException
* @throws \UserFormException
* @throws \UserReportException
*/
private
function
fillStoreVar
(
$sql
)
{
if
(
empty
(
$sql
))
{
return
;
}
$rows
=
$this
->
evaluate
->
parse
(
$sql
,
ROW_EXPECT_0_1
);
if
(
is_array
(
$rows
))
{
$this
->
store
->
appendToStore
(
$rows
,
STORE_VAR
);
// LOG
if
(
!
empty
(
$form
[
FORM_LOG_ACTIVE
]))
{
Logger
::
logFormLine
(
$form
,
"F:add to STORE_VAR"
,
$rows
);
}
}
else
{
if
(
!
empty
(
$rows
))
{
throw
new
\
UserFormException
(
"Invalid statement for '"
.
FE_FILL_STORE_VAR
.
"': "
.
$formSpec
[
FE_FILL_STORE_VAR
],
ERROR_INVALID_OR_MISSING_PARAMETER
);
}
}
}
/**
* Depending on $sql reads FormElements to a specific container or all. Preprocess all FormElements.
* This code is dirty: the nearly same function exists in class 'Database' - the difference is only
...
...
extension/Classes/Core/Store/Store.php
View file @
5aee0e86
...
...
@@ -8,12 +8,11 @@
namespace
IMATHUZH\Qfq\Core\Store
;
use
IMATHUZH\Qfq\Core\Database\Database
;
use
IMATHUZH\Qfq\Core\Helper\KeyValueStringParser
;
use
IMATHUZH\Qfq\Core\Helper\Logger
;
use
IMATHUZH\Qfq\Core\Helper\OnArray
;
use
IMATHUZH\Qfq\Core\Helper\Sanitize
;
use
IMATHUZH\Qfq\Core\Helper\Logger
;
use
IMATHUZH\Qfq\Core\Database\Database
;
use
IMATHUZH\Qfq\Core\Helper\Support
;
/*
...
...
@@ -790,15 +789,17 @@ class Store {
$sipArray
=
self
::
getStore
(
STORE_SIP
);
foreach
(
$sipArray
as
$key
=>
$value
)
{
if
(
$key
[
0
]
===
'_'
)
{
continue
;
}
switch
(
$key
)
{
case
SIP_SIP
:
case
SIP_RECORD_ID
:
case
SIP_FORM
;
case
SIP_URLPARAM
:
continue
;
continue
2
;
default
:
$tmpParam
[
$key
]
=
$value
;
}
...
...
extension/Classes/Sql/function.sql
View file @
5aee0e86
...
...
@@ -83,3 +83,23 @@ BEGIN
SET
output
=
IF
(
input
=
''
,
token
,
input
);
RETURN
output
;
END
;
###
#
#
strip_tags
(
input
)
-
copied
from
https
:
//
stackoverflow
.
com
/
questions
/
2627940
/
remove
-
html
-
tags
-
from
-
record
#
DROP
FUNCTION
IF
EXISTS
strip_tags
;
CREATE
FUNCTION
`strip_tags`
(
str
TEXT
)
RETURNS
TEXT
DETERMINISTIC
SQL
SECURITY
INVOKER
BEGIN
DECLARE
start
,
end
INT
DEFAULT
1
;
LOOP
SET
start
=
LOCATE
(
"<"
,
str
,
start
);
IF
(
!
start
)
THEN
RETURN
str
;
END
IF
;
SET
end
=
LOCATE
(
">"
,
str
,
start
);
IF
(
!
end
)
THEN
SET
end
=
start
;
END
IF
;
SET
str
=
INSERT
(
str
,
start
,
end
-
start
+
1
,
""
);
END
LOOP
;
END
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment