Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
d8d77c12
Commit
d8d77c12
authored
Sep 09, 2018
by
Carsten Rose
Browse files
B2340 Report: Problematic Bracket - form now on, only ''{[(<'' will change the nesting token.
parent
2109e086
Pipeline
#849
passed with stage
in 1 minute and 38 seconds
Changes
25
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/AbstractBuildForm.php
View file @
d8d77c12
...
...
@@ -35,13 +35,37 @@ require_once(__DIR__ . '/report/Report.php');
* @package qfq
*/
abstract
class
AbstractBuildForm
{
/**
* @var array
*/
protected
$formSpec
=
array
();
// copy of the loaded form
/**
* @var array
*/
protected
$feSpecAction
=
array
();
// copy of all formElement.class='action' of the loaded form
/**
* @var array
*/
protected
$feSpecNative
=
array
();
// copy of all formElement.class='native' of the loaded form
/**
* @var array
*/
protected
$buildElementFunctionName
=
array
();
/**
* @var array
*/
protected
$pattern
=
array
();
/**
* @var array
*/
protected
$wrap
=
array
();
/**
* @var array
*/
protected
$symbol
=
array
();
/**
* @var bool
*/
protected
$showDebugInfoFlag
=
false
;
// protected $feDivClass = array(); // Wrap FormElements in <div class="$feDivClass[type]">
...
...
@@ -80,7 +104,13 @@ abstract class AbstractBuildForm {
*/
protected
$dbArray
=
array
();
/**
* @var bool|mixed
*/
protected
$dbIndexData
=
false
;
/**
* @var bool|string
*/
protected
$dbIndexQfq
=
false
;
/**
...
...
@@ -183,8 +213,12 @@ abstract class AbstractBuildForm {
* formElement.dynamicUpdate-yes values/states
* @throws CodeException
* @throws DbException
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public
function
process
(
$mode
,
$htmlElementNameIdZero
=
false
,
$latestFeSpecNative
=
array
())
{
$htmlHead
=
''
;
...
...
@@ -493,9 +527,12 @@ abstract class AbstractBuildForm {
* @return array|string
* @throws CodeException
* @throws DbException
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws DownloadException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
private
function
processReportSyntax
(
$value
)
{
...
...
@@ -544,8 +581,12 @@ abstract class AbstractBuildForm {
* @return string
* @throws CodeException
* @throws DbException
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public
function
elements
(
$recordId
,
$filter
=
FORM_ELEMENTS_NATIVE
,
$feIdContainer
=
0
,
array
&
$json
,
$modeCollectFe
=
FLAG_DYNAMIC_UPDATE
,
$htmlElementNameIdZero
=
false
,
...
...
@@ -1049,6 +1090,7 @@ abstract class AbstractBuildForm {
* @return string
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
function
deriveNewRecordUrlFromExistingSip
(
&
$toolTipNew
)
{
...
...
@@ -1114,6 +1156,7 @@ abstract class AbstractBuildForm {
* @return string complete rendered HTML input element.
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
function
buildInput
(
array
$formElement
,
$htmlFormElementName
,
$value
,
array
&
$json
,
$mode
=
FORM_LOAD
)
{
$textarea
=
''
;
...
...
@@ -1446,6 +1489,7 @@ abstract class AbstractBuildForm {
* @return string
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
function
buildCheckbox
(
array
$formElement
,
$htmlFormElementName
,
$value
,
array
&
$json
,
$mode
=
FORM_LOAD
)
{
$itemKey
=
array
();
...
...
@@ -2048,6 +2092,7 @@ abstract class AbstractBuildForm {
* @return string
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
function
buildRadio
(
array
$formElement
,
$htmlFormElementName
,
$value
,
array
&
$json
,
$mode
=
FORM_LOAD
)
{
...
...
@@ -2269,6 +2314,7 @@ abstract class AbstractBuildForm {
* @return mixed
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
function
buildSelect
(
array
$formElement
,
$htmlFormElementName
,
$value
,
array
&
$json
,
$mode
=
FORM_LOAD
)
{
$itemKey
=
array
();
...
...
@@ -2337,7 +2383,8 @@ abstract class AbstractBuildForm {
/**
* @param string $linkNew Complete Button, incl. SIP href
* @param string $deleteColumnTitle - if null, no delete column is rendered
* @param $flagDelete
* @param $deleteTitle
* @param array $firstRow First row of all subrecords to extract columntitles
* @param array $control Array with <th> column names / format.
*
...
...
@@ -2376,6 +2423,7 @@ abstract class AbstractBuildForm {
*
* @return string
* @throws CodeException
* @throws DbException
* @throws UserFormException
* @throws UserReportException
*/
...
...
@@ -3132,6 +3180,7 @@ abstract class AbstractBuildForm {
* @return string
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
function
buildDateTime
(
array
$formElement
,
$htmlFormElementName
,
$value
,
array
&
$json
,
$mode
=
FORM_LOAD
)
{
$attribute
=
''
;
...
...
@@ -3329,6 +3378,7 @@ abstract class AbstractBuildForm {
* @return string
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
function
buildEditor
(
array
$formElement
,
$htmlFormElementName
,
$value
,
array
&
$json
,
$mode
=
FORM_LOAD
)
{
$attribute
=
''
;
...
...
@@ -3517,6 +3567,7 @@ abstract class AbstractBuildForm {
* @return mixed
* @throws CodeException
* @throws DbException
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
*/
...
...
@@ -3587,6 +3638,7 @@ abstract class AbstractBuildForm {
* @return mixed
* @throws CodeException
* @throws DbException
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
*/
...
...
@@ -3703,6 +3755,7 @@ EOT;
* @return string
* @throws CodeException
* @throws DbException
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
*/
...
...
extension/qfq/qfq/BodytextParser.php
View file @
d8d77c12
...
...
@@ -111,26 +111,30 @@ class BodytextParser {
return
;
}
$pos
=
0
;
$tokenList
=
'{}<>[]()'
;
// Definition: first line of bodytext, has to be a comment line. If the last char is one of the valid token: set that one.
// Nothing found: set {}.
$nestingOpen
=
'{'
;
$nestingClose
=
'}'
;
if
(
$firstLine
[
0
]
===
'#'
)
{
$token
=
substr
(
$firstLine
,
-
1
);
$pos
=
strpos
(
$tokenList
,
$token
);
if
(
$pos
===
false
)
{
$pos
=
0
;
}
else
{
if
(
$pos
%
2
===
1
)
{
$pos
-=
1
;
}
switch
(
$token
)
{
case
'<'
:
$nestingOpen
=
'<'
;
$nestingClose
=
'>'
;
break
;
case
'['
:
$nestingOpen
=
'['
;
$nestingClose
=
']'
;
break
;
case
'('
:
$nestingOpen
=
'('
;
$nestingClose
=
')'
;
break
;
default
:
break
;
}
}
$nestingOpen
=
substr
(
$tokenList
,
$pos
,
1
);
$nestingClose
=
substr
(
$tokenList
,
$pos
+
1
,
1
);
}
/**
...
...
extension/qfq/qfq/BuildFormBootstrap.php
View file @
d8d77c12
...
...
@@ -574,6 +574,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
* @return string
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
function
tail
()
{
...
...
@@ -654,8 +655,12 @@ EOF;
* @return mixed
* @throws CodeException
* @throws DbException
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public
function
buildPill
(
array
$formElement
,
$htmlFormElementName
,
$value
,
array
&
$json
)
{
$html
=
''
;
...
...
extension/qfq/qfq/BuildFormPlain.php
View file @
d8d77c12
...
...
@@ -65,7 +65,9 @@ class BuildFormPlain extends AbstractBuildForm {
* @return string
* @throws CodeException
* @throws DbException
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
*/
public
function
doSubrecords
()
{
$json
=
array
();
...
...
extension/qfq/qfq/BuildFormTable.php
View file @
d8d77c12
...
...
@@ -68,7 +68,9 @@ class BuildFormTable extends AbstractBuildForm {
* @return string
* @throws CodeException
* @throws DbException
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
*/
public
function
doSubrecords
()
{
//TODO: $json is not returned - which is wrong. In this case, dynamic update won't work for subrecords
...
...
@@ -83,6 +85,7 @@ class BuildFormTable extends AbstractBuildForm {
* @throws CodeException
* @throws DbException
* @throws UserFormException
* @throws UserReportException
*/
public
function
head
(
$mode
=
FORM_LOAD
)
{
$html
=
''
;
...
...
extension/qfq/qfq/Delete.php
View file @
d8d77c12
...
...
@@ -34,6 +34,7 @@ class Delete {
* @throws CodeException
* @throws DbException
* @throws UserFormException
* @throws UserReportException
*/
public
function
__construct
(
$dbIndexData
=
false
,
$phpUnit
=
false
)
{
...
...
extension/qfq/qfq/QuickFormQuery.php
View file @
d8d77c12
...
...
@@ -227,6 +227,9 @@ class QuickFormQuery {
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public
function
process
()
{
$html
=
''
;
...
...
@@ -285,7 +288,7 @@ class QuickFormQuery {
*
* @param $formName
* @param $formLogMode
* @return
* @return
string
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
...
...
@@ -1360,6 +1363,9 @@ class QuickFormQuery {
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
private
function
doReport
()
{
...
...
@@ -1378,10 +1384,7 @@ class QuickFormQuery {
*
* @return string - the html code
* @throws CodeException
* @throws DbException
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
*/
private
function
buildInlineReport
()
{
$uid
=
$this
->
t3data
[
T3DATA_UID
];
...
...
extension/qfq/qfq/Save.php
View file @
d8d77c12
...
...
@@ -541,7 +541,9 @@ class Save {
*
* @return false|string New pathFilename or false on error
* @throws CodeException
* @throws DbException
* @throws UserFormException
* @throws UserReportException
* @internal param $recordId
*/
private
function
doUpload
(
$formElement
,
$sipUpload
,
Sip
$sip
,
&
$modeUpload
)
{
...
...
extension/qfq/qfq/database/Database.php
View file @
d8d77c12
...
...
@@ -783,6 +783,7 @@ class Database {
* @param $mode
* @throws CodeException
* @throws DbException
* @throws UserFormException
*/
public
function
createTable
(
$table
,
$columnDefinition
,
$mode
)
{
...
...
extension/qfq/qfq/form/Dirty.php
View file @
d8d77c12
...
...
@@ -56,6 +56,9 @@ class Dirty {
* @param bool $dbIndexData
* @param bool $dbIndexQfq
* @throws CodeException
* @throws DbException
* @throws UserFormException
* @throws UserReportException
*/
public
function
__construct
(
$phpUnit
=
false
,
$dbIndexData
=
false
,
$dbIndexQfq
=
false
)
{
...
...
@@ -71,6 +74,10 @@ class Dirty {
/**
* @param $dbIndexData
* @param $dbIndexQfq
* @throws CodeException
* @throws DbException
* @throws UserFormException
* @throws UserReportException
*/
private
function
doDbArray
(
$dbIndexData
,
$dbIndexQfq
)
{
...
...
@@ -95,6 +102,7 @@ class Dirty {
* @throws CodeException
* @throws DbException
* @throws UserFormException
* @throws UserReportException
*/
public
function
process
()
{
...
...
@@ -144,7 +152,6 @@ class Dirty {
*
* @return array
* @throws CodeException
* @throws DbException
*/
private
function
acquireDirty
(
$recordId
,
array
$tableVars
,
$recordHashMd5
)
{
...
...
@@ -277,8 +284,6 @@ class Dirty {
* @param int $recordId
* @param string $recordHashMd5 - timestamp e.g. '2017-07-27 14:06:56'
* @param $rcMd5
* @param string $tableId
*
* @return bool true if $recordHashMd5 is different from current record md5 hash.
*/
private
function
isRecordModified
(
$tableName
,
$recordId
,
$recordHashMd5
,
&
$rcMd5
)
{
...
...
@@ -304,7 +309,6 @@ class Dirty {
*
* @return int LOCK_NOT_FOUND | LOCK_FOUND_OWNER | LOCK_FOUND_CONFLICT,
* @throws CodeException
* @throws DbException
*/
public
function
getCheckDirty
(
$tableName
,
$recordId
,
array
&
$recordDirty
,
&
$msg
)
{
...
...
@@ -349,7 +353,6 @@ class Dirty {
* @param bool $flagCheckModifiedFirst
* @return array
* @throws CodeException
* @throws DbException
* @throws UserFormException
*/
public
function
checkDirtyAndRelease
(
$formMode
,
$lockTimeout
,
$dirtyMode
,
$tableName
,
$recordId
,
$flagCheckModifiedFirst
=
false
)
{
...
...
extension/qfq/qfq/form/FormAction.php
View file @
d8d77c12
...
...
@@ -48,6 +48,7 @@ class FormAction {
* @param bool|false $phpUnit
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
function
__construct
(
array
$formSpec
,
Database
$db
,
$phpUnit
=
false
)
{
$this
->
formSpec
=
$formSpec
;
...
...
@@ -252,6 +253,9 @@ class FormAction {
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
private
function
doSendMail
(
array
$feSpecAction
)
{
...
...
extension/qfq/qfq/form/TypeAhead.php
View file @
d8d77c12
...
...
@@ -59,6 +59,7 @@ class TypeAhead {
* @throws CodeException
* @throws DbException
* @throws UserFormException
* @throws UserReportException
*/
public
function
process
()
{
...
...
extension/qfq/qfq/helper/HelperFormElement.php
View file @
d8d77c12
...
...
@@ -32,6 +32,7 @@ class HelperFormElement {
*
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
static
function
explodeParameterInArrayElements
(
array
&
$elements
,
$keyName
)
{
foreach
(
$elements
AS
$key
=>
$element
)
{
...
...
@@ -63,6 +64,7 @@ class HelperFormElement {
* @param bool $flagAllowOverwrite
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
static
function
explodeParameter
(
array
&
$element
,
$keyName
,
$flagAllowOverwrite
=
false
)
{
// Something to explode?
...
...
@@ -96,6 +98,7 @@ class HelperFormElement {
* @return array
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
static
function
setLanguage
(
array
$formSpecFeSpecNative
,
$parameterLanguageFieldName
)
{
...
...
@@ -312,6 +315,7 @@ class HelperFormElement {
* @return array
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
static
function
prepareExtraButton
(
array
$formElement
,
$showInline
)
{
...
...
extension/qfq/qfq/helper/Logger.php
View file @
d8d77c12
...
...
@@ -56,6 +56,7 @@ class Logger {
/**
* In case $filename is not absolute and if we're in the API directory: Check if we're in api - update relative filename
*
* @param $filename
* @return string
*/
private
static
function
relativeToT3Dir
(
$filename
)
{
...
...
@@ -101,6 +102,7 @@ class Logger {
* @param array $form
* @param $pre
* @param $data
* @param bool $flagNewLineFirst
* @throws UserFormException
*/
public
static
function
logFormLine
(
array
$form
,
$pre
,
$data
,
$flagNewLineFirst
=
false
)
{
...
...
extension/qfq/qfq/helper/Support.php
View file @
d8d77c12
...
...
@@ -146,6 +146,11 @@ class Support {
return
$tag
.
$value
.
$closing
;
}
/**
* @param $glyphIcon
* @param string $value
* @return string
*/
public
static
function
renderGlyphIcon
(
$glyphIcon
,
$value
=
''
)
{
return
Support
::
wrapTag
(
"<span class='"
.
GLYPH_ICON
.
"
$glyphIcon
'>"
,
$value
);
}
...
...
extension/qfq/qfq/report/Error.php
View file @
d8d77c12
...
...
@@ -61,6 +61,7 @@ class SyntaxReportException extends \Exception {
* @return string
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public
function
errorMessage
()
{
$store
=
Store
::
getInstance
();
...
...
extension/qfq/qfq/report/Link.php
View file @
d8d77c12
...
...
@@ -1016,6 +1016,7 @@ class Link {
*
* @param array $vars
*
* @param $contentPure
* @return string
* @throws CodeException
* @throws UserFormException
...
...
extension/qfq/qfq/report/Monitor.php
View file @
d8d77c12
...
...
@@ -53,8 +53,7 @@ class Monitor {
* Report: $str: 'file:typo3conf/sql.log|tail:1000|append:1|interval:1000|htmlId:monitor1'
* Fetch: download.php?s=<sip> with sip: file=<filename>&tail=<number of lines>
*
* @param string $str
*
* @param array $vars
* @return string
* @throws CodeException
* @throws UserFormException
...
...
@@ -180,6 +179,7 @@ EOF;
* @param string $filepath
* @param int $lines
* @param bool $adaptive
* @param null $f
* @return string
* @throws DownloadException
*/
...
...
extension/qfq/qfq/report/Report.php
View file @
d8d77c12
...
...
@@ -219,6 +219,9 @@ class Report {
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public
function
process
(
$bodyText
)
{
...
...
@@ -432,6 +435,9 @@ class Report {
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
private
function
triggerReport
(
$cur_level
=
1
,
array
$super_level_array
=
array
(),
$counter
=
0
)
{
...
...
@@ -628,6 +634,9 @@ class Report {
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
private
function
collectRow
(
array
$row
,
array
$keys
,
$full_level
,
$rowIndex
)
{
$content
=
""
;
...
...
@@ -681,6 +690,9 @@ class Report {
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
private
function
renderColumn
(
$columnIndex
,
$columnName
,
$columnValue
,
$full_level
,
$rowIndex
,
&
$flagOutput
)
{
$content
=
""
;
...
...
extension/qfq/qfq/report/SendMail.php
View file @
d8d77c12
...
...
@@ -49,6 +49,9 @@ class SendMail {
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
* @throws \PhpOffice\PhpSpreadsheet\Exception
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public
function
process
(
array
$mailConfig
)
{
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
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