Commit 6440fd42 authored by Elias Villiger's avatar Elias Villiger
Browse files

Merge branch 'master' into delete-unused-DataImport.php

# Conflicts:
#	extension/qfq/qfq/utils/DataImport.php
parents d9bc79af e5bb6217
Pipeline #856 passed with stage
in 1 minute and 45 seconds
This diff is collapsed.
......@@ -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
*/
......
......@@ -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);
}
/**
......
......@@ -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 = '';
......
......@@ -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();
......
......@@ -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 = '';
......
......@@ -1292,11 +1292,16 @@ const TOKEN_FORM = CLIENT_FORM;
const TOKEN_RECORD_ID = CLIENT_RECORD_ID;
const TOKEN_DEBUG_BODYTEXT = TYPO3_DEBUG_SHOW_BODY_TEXT;
const TOKEN_DB_INDEX = F_DB_INDEX;
const TOKEN_CONTENT = 'content';
const TOKEN_VALID_LIST = 'sql|head|althead|altsql|tail|shead|stail|rbeg|rend|renr|rsep|fbeg|fend|fsep|rbgd|debug|form|r|debugShowBodyText|dbIndex|sqlLog|sqlLogMode';
const TOKEN_VALID_LIST = 'sql|head|althead|altsql|tail|shead|stail|rbeg|rend|renr|rsep|fbeg|fend|fsep|rbgd|debug|form|r|debugShowBodyText|dbIndex|sqlLog|sqlLogMode|content';
const TOKEN_COLUMN_CTRL = '_';
const TOKEN_CONTENT_STORE = 'store';
const TOKEN_CONTENT_HIDE = 'hide';
const TOKEN_CONTENT_SHOW = 'show';
//Report: Column Token
const COLUMN_LINK = 'link';
const COLUMN_EXEC = 'exec';
......
......@@ -34,6 +34,7 @@ class Delete {
* @throws CodeException
* @throws DbException
* @throws UserFormException
* @throws UserReportException
*/
public function __construct($dbIndexData = false, $phpUnit = false) {
......
......@@ -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];
......
......@@ -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) {
......
......@@ -783,6 +783,7 @@ class Database {
* @param $mode
* @throws CodeException
* @throws DbException
* @throws UserFormException
*/
public function createTable($table, $columnDefinition, $mode) {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -59,6 +59,7 @@ class TypeAhead {
* @throws CodeException
* @throws DbException
* @throws UserFormException
* @throws UserReportException
*/
public function process() {
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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);
}
......
......@@ -61,6 +61,7 @@ class SyntaxReportException extends \Exception {
* @return string
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
public function errorMessage() {
$store = Store::getInstance();
......
......@@ -1016,6 +1016,7 @@ class Link {
*
* @param array $vars
*
* @param $contentPure
* @return string
* @throws CodeException
* @throws UserFormException
......
......@@ -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
*/
......
Supports Markdown
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