Commit 7be64978 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Merge remote-tracking branch 'origin/crose_work' into raos_work

parents 83dfdcde bd991dba
......@@ -258,9 +258,10 @@ Server Response
: The response contains a [Minimal Response].
### Record delete
### Record(s) delete
Request the deletion of the record identified by the SIP.
Request the deletion of the record identified by the SIP. The SIP might contain a SIP_TABLE and/or a SIP_FORM.
If both are specified, SIP_FORM will be taken. With SIP_FORM, the tableName is derived from the form.
Request
: api/delete.php
......@@ -273,6 +274,7 @@ URL Parameters
Server Response
: The response contains a [Minimal Response].
[Redirection Response] may be included.
## Glossary
......
......@@ -36,12 +36,14 @@ Setup
* Install the extension via the Extensionmanager.
* If you install the extension by manual download/upload and get an error message
"can't activate extension": rename the downloaded zip file to `qfq.zip`.
"can't activate extension": rename the downloaded zip file to `qfq.zip` or `qfq_<version>.zip` (e.g. version: 0.9.1).
* If the Extensionmanager stops after importing: check your memory limit in php.ini.
* Enable the online Documentation_.
* Copy/rename the file *<ext_dir>/config.example.qfq.ini* to *typo3conf/config.qfq.ini* and configure the necessary values: `config.qfq.ini`_
* Copy/rename the file *<Documentroot>/typo3conf/ext/<ext_dir>/config.example.qfq.ini* to
*<Documentroot>/typo3conf/config.qfq.ini* and configure the necessary values: `config.qfq.ini`_
The configuration file is outside the extension directory to not loose it during updates.
* Play the SQL File *<ext_dir>/qfq/sql/formEditor.sql* to fill the database with the *FormEditor* records.
* Configure Typoscript to include Bootstrap, jQuery, QFQ javascript and CSS files.
......@@ -88,35 +90,42 @@ Setup a *report* to manage all *forms*: Create a Typo3 page and insert a content
config.qfq.ini
--------------
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| Keyword | Example | Description |
+========================+==================================+============================================================================+
| DB_USER | DB_USER=qfqUser | Credentials configured in MySQL |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| DB_PASSWORD | DB_PASSWORD=12345678 | Credentials configured in MySQL |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| DB_SERVER | DB_SERVER=localhost | Hostname of MySQL Server |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| DB_NAME | DB_NAME=qfq_db | Database name |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| DB_NAME_TEST | DB_NAME_TEST=qfq_db_test | Used during development of QFQ |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| DB_INIT | DB_INIT=set names utf8 | Global init for using the database. |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| SQL_LOG | SQL_LOG=sql.log | Filename to log SQL commands: relative to <ext_dir> or absolute. |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| SQL_LOG_MODE | SQL_LOG_MODE=modify | *all*: every statement will be logged - this is a lot |
| | | *modify*: log only statements who change data |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| SHOW_DEBUG_INFO | SHOW_DEBUG_INFO=auto | Possible values: auto|yes|no. For 'auto': If a BE User is logged in, |
| | | debug information will be shown on the fronend. |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| CSS_LINK_CLASS_INTERNAL| CSS_LINK_CLASS_INTERNAL=internal | CSS class name of links which points to internal tagets |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| CSS_LINK_CLASS_EXTERNAL| CSS_LINK_CLASS_EXTERNAL=external | CSS class name of links which points to internal tagets |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| DATE_FORMAT | DATE_FORMAT= yyyy-mm-dd | Possible options: yyyy-mm-dd, dd.mm.yyyy |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| Keyword | Example | Description |
+=========================+=========================================+============================================================================+
| DB_USER | DB_USER=qfqUser | Credentials configured in MySQL |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DB_PASSWORD | DB_PASSWORD=12345678 | Credentials configured in MySQL |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DB_SERVER | DB_SERVER=localhost | Hostname of MySQL Server |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DB_NAME | DB_NAME=qfq_db | Database name |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DB_NAME_TEST | DB_NAME_TEST=qfq_db_test | Used during development of QFQ |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DB_INIT | DB_INIT=set names utf8 | Global init for using the database. |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| SQL_LOG | SQL_LOG=sql.log | Filename to log SQL commands: relative to <ext_dir> or absolute. |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| SQL_LOG_MODE | SQL_LOG_MODE=modify | *all*: every statement will be logged - this is a lot |
| | | *modify*: log only statements who change data |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| SHOW_DEBUG_INFO | SHOW_DEBUG_INFO=auto | Possible values: auto|yes|no. For 'auto': If a BE User is logged in, |
| | | debug information will be shown on the fronend. |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| CSS_LINK_CLASS_INTERNAL | CSS_LINK_CLASS_INTERNAL=internal | CSS class name of links which points to internal tagets |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| CSS_LINK_CLASS_EXTERNAL | CSS_LINK_CLASS_EXTERNAL=external | CSS class name of links which points to internal tagets |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| CSS_CLASS_QFQ_CONTAINER |CSS_CLASS_QFQ_CONTAINER=container | QFQ with own Bootstrap: 'container'. |
| | | QFQ already nested in Bootstrap of mainpage: <empty> |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| CSS_CLASS_QFQ_FORM_PILL |CSS_CLASS_QFQ_FORM_PILL=qfq-color-grey-1 | Wrap around title bar for pills: CSS Class, typically a background color |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| CSS_CLASS_QFQ_FORM_BODY |CSS_CLASS_QFQ_FORM_BODY=qfq-color-grey-2 | Wrap around formelements: CSS Class, typically a background color |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DATE_FORMAT | DATE_FORMAT= yyyy-mm-dd | Possible options: yyyy-mm-dd, dd.mm.yyyy |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
Example: *typo3conf/config.qfq.ini*
......@@ -132,13 +141,16 @@ Example: *typo3conf/config.qfq.ini*
SHOW_DEBUG_INFO = auto
CSS_LINK_CLASS_INTERNAL = internal
CSS_LINK_CLASS_EXT = external
CSS_CLASS_QFQ_CONTAINER =
CSS_CLASS_QFQ_FORM_PILL = qfq-color-grey-1
CSS_CLASS_QFQ_FORM_BODY = qfq-color-grey-2
Documentation
-------------
To render the QFQ reST documentation:
* Take care to have 'unzip' and 'Python setuptools' installed (necessary to run ).
* Take care to have 'unzip' and 'Python setuptools' installed (necessary to run).
Preparation for Ubuntu 16.04::
......
......@@ -32,7 +32,7 @@ QFQ Extension
Quick Form Query, Form, Report, SQL, Query, Generator.
:Copyright:
2016
2017
:Author:
Carsten Rose, Rafael Ostertag
......
; comment
; QFQ configuration
;
; Save this file as: <Documentroot>/typo3conf/config.qfq.ini
DB_USER = <DBUSER>
DB_SERVER = <DBSERVER>
DB_PASSWORD = <DBPW>
......@@ -12,7 +15,7 @@ SQL_LOG = sql.log
; all, modify
SQL_LOG_MODE = modify
; auto|yes|no. 'auto': if BE User is loggend in 'true', else 'false'
; auto|yes|no. 'auto': if BE User is logged in the value will be 'true', else 'false'
SHOW_DEBUG_INFO = auto
CSS_LINK_CLASS_INTERNAL = internal
......@@ -21,5 +24,9 @@ CSS_LINK_CLASS_EXTERNAL = external
; QFQ with own Bootstrap: 'container'. QFQ already nested in Bootstrap of mainpage: <empty>
CSS_CLASS_QFQ_CONTAINER =
; Default background color, specified via CSS class
CSS_CLASS_QFQ_FORM_PILL = qfq-color-grey-1
CSS_CLASS_QFQ_FORM_BODY = qfq-color-grey-2
; yyyy-mm-dd, dd.mm.yyyy
DATE_FORMAT = yyyy-mm-dd
......@@ -11,12 +11,28 @@ namespace qfq;
use qfq;
require_once(__DIR__ . '/../qfq/QuickFormQuery.php');
//require_once(__DIR__ . '/../qfq/store/Store.php');
require_once(__DIR__ . '/../qfq/store/Store.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/exceptions/CodeException.php');
/**
* Return JSON encoded answer
* delete: success
* SIP_MODE_ANSWER: MODE_HTML
* Send header 'location' to targetUrl
*
* SUP_MODE_ANSWER: MODE_JSON
* Send AJAX answer with Status 'success'
*
* delete: failed
* SIP_MODE_ANSWER: MODE_HTML
* No forward, print error message.
*
* SUP_MODE_ANSWER: MODE_JSON
* Send AJAX answer with Status 'error' and 'error message' as JSON encoded
*
*
* JSON Format:
*
* status: success|error
* message: <message>
......@@ -47,17 +63,58 @@ require_once(__DIR__ . '/../qfq/Constants.php');
$answer = array();
$answer[API_REDIRECT] = API_ANSWER_REDIRECT_NO;
$answer[API_MESSAGE] = 'Something failed';
$answer[API_MESSAGE] = '';
$answer[API_STATUS] = API_ANSWER_STATUS_ERROR;
$result[MSG_HEADER] = '';
$result[MSG_CONTENT] = '';
$modeAnswer = false;
$flagSuccess = false;
try {
$qfq = new \qfq\QuickFormQuery(['bodytext' => '']);
$result = $qfq->delete();
$flagSuccess = $qfq->delete();
$targetUrl = Store::getVar(SIP_TARGET_URL, STORE_SIP);
$modeAnswer = Store::getVar(SIP_MODE_ANSWER, STORE_SIP);
switch ($modeAnswer) {
case MODE_JSON:
$answer[API_MESSAGE] = 'delete: success';
$answer[API_REDIRECT] = API_ANSWER_REDIRECT_CLIENT;
$answer[API_STATUS] = API_ANSWER_STATUS_SUCCESS;
break;
case MODE_HTML:
if ($targetUrl === false || $targetUrl === '') {
throw new CodeException('Missing target URL', ERROR_MISSING_VALUE);
}
$result[MSG_HEADER] = "Location: $targetUrl";
break;
default:
throw new CodeException('Unknown mode: ' . $modeAnswer, ERROR_UNKNOWN_MODE);
break;
}
} catch (qfq\UserFormException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
$val = Store::getVar(SYSTEM_FORM_ELEMENT, STORE_SYSTEM);
if ($val !== false) {
$answer[API_FIELD_NAME] = $val;
}
$val = Store::getVar(SYSTEM_FORM_ELEMENT_MESSAGE, STORE_SYSTEM);
if ($val !== false) {
$answer[API_FIELD_MESSAGE] = $val;
}
} catch (qfq\CodeException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
} catch (qfq\DbException $e) {
......@@ -66,17 +123,28 @@ try {
$answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
}
// Fallbak. in case an exception has been thrown and $result is not filled.
if (!isset($result[MSG_HEADER]) && !isset($result[MSG_CONTENT])) {
// In case $modeAnswer is still missing: try to get it again - maybe the SIP store has been initialized before the exception has been thrown.
if ($modeAnswer === false) {
$modeAnswer = Store::getVar(SIP_MODE_ANSWER, STORE_SIP);
}
if ($modeAnswer === MODE_JSON) {
// JSON
$result[MSG_HEADER] = "Content-Type: application/json";
$result[MSG_CONTENT] = json_encode($answer);
} else {
// HTML
if (!$flagSuccess) {
$result[MSG_CONTENT] = "<p>" . $answer[API_MESSAGE] . "</p>";
if (isset($answer[API_FIELD_NAME])) {
$result[MSG_CONTENT] .= "<p>" . $answer[API_FIELD_NAME] . " : " . $answer[API_FIELD_MESSAGE] . "</p>";
}
}
}
if (isset($result[MSG_HEADER]) && $result[MSG_HEADER] !== '') {
// Send header, if given.
if ($result[MSG_HEADER] !== '') {
header($result[MSG_HEADER]);
}
echo $result[MSG_CONTENT];
echo $result[MSG_CONTENT];
\ No newline at end of file
......@@ -861,6 +861,8 @@ abstract class AbstractBuildForm {
* @return string
*/
private function getHelpBlock() {
//TODO: #3066 Class 'hidden' einbauen
// return '<div class="help-block with-errors hidden"></div>';
return '<div class="help-block with-errors"></div>';
}
......@@ -1444,8 +1446,20 @@ abstract class AbstractBuildForm {
}
if ($flagDelete) {
$s = $this->createDeleteUrl($targetTableName, $row[$nameColumnId], RETURN_SIP);
$rowHtml .= Support::wrapTag('<td>', Support::wrapTag("<button type='button' class='record-delete btn btn-default' data-sip='$s'>", '<span class="glyphicon ' . GLYPH_ICON_DELETE . '"></span>'));
$toolTip = 'Delete';
if ($this->showDebugInfo) {
$toolTip .= PHP_EOL . "form = '" . $this->formSpec[F_NAME] . "'" . PHP_EOL . "table = '" . $this->formSpec[F_TABLE_NAME] . "'" . PHP_EOL . "r = '" . $row[$nameColumnId] . "'";
}
// $buttonDelete = $this->buildButtonCode('delete-button', $toolTip, GLYPH_ICON_DELETE, $disabled);
$s = $this->createDeleteUrl($formElement[SUBRECORD_PARAMETER_FORM], $targetTableName, $row[$nameColumnId], RETURN_SIP);
// $rowHtml .= Support::wrapTag('<td>', Support::wrapTag("<button type='button' class='record-delete btn btn-default' data-sip='$s'>", '<span class="glyphicon ' . GLYPH_ICON_DELETE . '"></span>'));
$rowHtml .= Support::wrapTag('<td>', Support::wrapTag("<button type='button' class='record-delete btn btn-default' data-sip='$s' " . Support::doAttribute('title', $toolTip) . ">", '<span class="glyphicon ' . GLYPH_ICON_DELETE . '"></span>'));
}
Support::setIfNotSet($row, FE_SUBRECORD_ROW_CLASS);
......@@ -1727,14 +1741,23 @@ abstract class AbstractBuildForm {
/**
* Create a link (incl. SIP) to delete the current record.
*
* @param string $formName if there is a form, specify that
* @param string $tableName if there is no form , specify the table from where to delete the record.
* @param int $recordId record to delete
* @param string $mode
* * mode=RETURN_URL: return complete URL
* * mode=RETURN_SIP: returns only the sip
* * mode=RETURN_ARRAY: returns array with url ('_url') and all decoded and created parameters.
* @return string String: "API_DIR/delete.php?sip=...."
* @throws CodeException
*/
public function createDeleteUrl($table, $recordId, $mode = RETURN_URL) {
public function createDeleteUrl($formName, $tableName, $recordId, $mode = RETURN_URL) {
//TODO: Umstellen auf Benutzung der Link Klasse.
$queryStringArray = [
SIP_TABLE => $table,
SIP_FORM => $formName,
SIP_TABLE => $tableName,
SIP_RECORD_ID => $recordId,
SIP_MODE_ANSWER => MODE_JSON
];
......@@ -1743,7 +1766,7 @@ abstract class AbstractBuildForm {
$sip = $this->store->getSipInstance();
return $sip->queryStringToSip($queryString, $mode, API_DIR . '/delete.php');
return $sip->queryStringToSip($queryString, $mode, API_DIR . '/' . API_DELETE_PHP);
}
/**
......@@ -2226,16 +2249,16 @@ abstract class AbstractBuildForm {
* @param $toolTip
* @return string
*/
private function createDeleteLink($table, $recordId, $symbol, $toolTip) {
if ($this->showDebugInfo) {
$toolTip .= PHP_EOL . "table = '$table'" . PHP_EOL . "id = '$recordId'";
}
$url = $this->createDeleteUrl($table, $recordId);
return Support::wrapTag('<a ' . Support::doAttribute('href', $url) . ' title="' . $toolTip . '">', $symbol);
}
// private function createDeleteLink($table, $recordId, $symbol, $toolTip) {
//
// if ($this->showDebugInfo) {
// $toolTip .= PHP_EOL . "table = '$table'" . PHP_EOL . "id = '$recordId'";
// }
//
// $url = $this->createDeleteUrl('', $table, $recordId);
//
// return Support::wrapTag('<a ' . Support::doAttribute('href', $url) . ' title="' . $toolTip . '">', $symbol);
//
// }
}
\ No newline at end of file
......@@ -72,7 +72,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
* @param $note
*/
public function fillWrapLabelInputNote($label, $input, $note) {
$this->wrap[WRAP_SETUP_LABEL][WRAP_SETUP_START] = "<div class='col-md-$label'>";
$this->wrap[WRAP_SETUP_LABEL][WRAP_SETUP_START] = "<div class='col-md-$label qfq-label'>";
$this->wrap[WRAP_SETUP_LABEL][WRAP_SETUP_END] = "</div>";
$this->wrap[WRAP_SETUP_INPUT][WRAP_SETUP_START] = "<div class='col-md-$input'>";
$this->wrap[WRAP_SETUP_INPUT][WRAP_SETUP_END] = "</div>";
......@@ -113,7 +113,9 @@ class BuildFormBootstrap extends AbstractBuildForm {
$html .= $this->getFormTag();
$html .= '<div class="tab-content">';
//TODO: Problem fuer Forms ohne Pils
$html .= '<div class="tab-content ' . $this->formSpec[F_CLASS_BODY] . '">';
// $html .= '<div class="col-md-12 ' . $this->formSpec[F_CLASS_BODY] . '">';
return $html;
}
......@@ -168,7 +170,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
$toolTip = 'Delete';
if ($this->showDebugInfo && $recordId > 0) {
$toolTip .= PHP_EOL . "table = '" . $this->formSpec[F_TABLE_NAME] . "'" . PHP_EOL . "r = '" . $recordId . "'";
$toolTip .= PHP_EOL . "form = '" . $this->formSpec[F_NAME] . "'" . PHP_EOL . "table = '" . $this->formSpec[F_TABLE_NAME] . "'" . PHP_EOL . "r = '" . $recordId . "'";
}
$disabled = ($recordId > 0) ? '' : 'disabled';
......@@ -183,10 +185,13 @@ class BuildFormBootstrap extends AbstractBuildForm {
$buttonNew = $this->buildButtonAnchor('form-new-button', $url, $toolTip, GLYPH_ICON_NEW);
}
$html = Support::wrapTag('<div class="btn-group" role="group">', $buttonEditForm);
$html .= Support::wrapTag('<div class="btn-group" role="group">', $buttonSave . $buttonClose);
$html .= Support::wrapTag('<div class="btn-group" role="group">', $buttonDelete);
$html .= Support::wrapTag('<div class="btn-group" role="group">', $buttonNew);
// Arrangement: Edit Form / Save / Close / Delete / New
// Specified in reverse order cause 'pull-right' inverts the order. http://getbootstrap.com/css/#helper-classes-floats
$html = '';
$html .= Support::wrapTag('<div class="btn-group pull-right" role="group">', $buttonNew);
$html .= Support::wrapTag('<div class="btn-group pull-right" role="group">', $buttonDelete);
$html .= Support::wrapTag('<div class="btn-group pull-right" role="group">', $buttonSave . $buttonClose);
$html .= Support::wrapTag('<div class="btn-group pull-right" role="group">', $buttonEditForm);
$html = Support::wrapTag('<div class="btn-toolbar" role="toolbar">', $html);
......@@ -267,12 +272,12 @@ class BuildFormBootstrap extends AbstractBuildForm {
// Pill Dropdown necessary?
if ($ii > $maxVisiblePill) {
$htmlDropdown = Support::wrapTag('<ul class="dropdown-menu">', $pillDropdown, true);
$htmlDropdown = Support::wrapTag('<ul class="dropdown-menu qfq-form-pill ' . $this->formSpec[F_CLASS_PILL] . '">', $pillDropdown, true);
$htmlDropdown = '<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">more <span class="caret"></span></a>' . $htmlDropdown;
$htmlDropdown = Support::wrapTag('<li role="presentation" class="dropdown">', $htmlDropdown, false);
}
$htmlDropdown = Support::wrapTag('<ul id="' . $this->getTabId() . '" class="nav nav-pills" role="tablist">', $pillButton . $htmlDropdown);
$htmlDropdown = Support::wrapTag('<ul id="' . $this->getTabId() . '" class="nav nav-pills qfq-form-pill ' . $this->formSpec[F_CLASS_PILL] . '" role="tablist">', $pillButton . $htmlDropdown);
$htmlDropdown = Support::wrapTag('<div class="col-md-12">', $htmlDropdown);
return $htmlDropdown;
......@@ -340,12 +345,15 @@ class BuildFormBootstrap extends AbstractBuildForm {
$tabId = $this->getTabId();
if (0 < ($recordId = $this->store->getVar(SIP_RECORD_ID, STORE_SIP))) {
$deleteUrl = $this->createDeleteUrl($this->formSpec[F_TABLE_NAME], $recordId);
$deleteUrl = $this->createDeleteUrl($this->formSpec[F_NAME], $this->formSpec[F_TABLE_NAME], $recordId);
}
$actionUpload = FILE_ACTION . '=' . FILE_ACTION_UPLOAD;
$actionDelete = FILE_ACTION . '=' . FILE_ACTION_DELETE;
$apiDir = API_DIR;
$apiDeletePhp = API_DIR . '/' . API_DELETE_PHP;
$html .= '</form>'; // <form class="form-horizontal" ...
$html .= <<<EOF
<script type="text/javascript">
......@@ -356,14 +364,14 @@ class BuildFormBootstrap extends AbstractBuildForm {
var qfqPage = new QfqNS.QfqPage({
tabsId: '$tabId',
formId: '$formId',
submitTo: 'typo3conf/ext/qfq/qfq/api/save.php',
submitTo: '$apiDir/save.php',
deleteUrl: '$deleteUrl',
refreshUrl: "typo3conf/ext/qfq/qfq/api/load.php",
fileUploadTo: 'typo3conf/ext/qfq/qfq/api/file.php?$actionUpload',
fileDeleteUrl: 'typo3conf/ext/qfq/qfq/api/file.php?$actionDelete'
refreshUrl: '$apiDir/load.php',
fileUploadTo: '$apiDir/file.php?$actionUpload',
fileDeleteUrl: '$apiDir/file.php?$actionDelete'
});
var qfqRecordList = new QfqNS.QfqRecordList('typo3conf/ext/qfq/qfq/api/delete.php');
var qfqRecordList = new QfqNS.QfqRecordList('$apiDeletePhp');
})
</script>
EOF;
......@@ -422,7 +430,7 @@ EOF;
public function buildRowPill(array $formElement, $elementHtml) {
$html = '';
$html .= $this->wrapItem(WRAP_SETUP_INPUT, $elementHtml);
$html .= Support::wrapTag('<div class="col-md-12 qfq-form-body ' . $this->formSpec[F_CLASS_BODY] . '">', $elementHtml);
$active = $this->isFirstPill ? ' active' : '';
......
......@@ -44,6 +44,7 @@ class BuildFormPlain extends AbstractBuildForm {
public function fillWrapLabelInputNote($label, $input, $note) {
}
/**
* @return string
*/
......
......@@ -77,7 +77,7 @@ class BuildFormTable extends AbstractBuildForm {
$formEditUrl = $this->createFormEditUrl();
$html .= "<p><a " . Support::doAttribute('href', $formEditUrl) . ">Edit</a><small>[$sipParamString]</small></p>";
$deleteUrl = $this->createDeleteUrl($this->formSpec[F_TABLE_NAME], $this->store->getVar(SIP_RECORD_ID, STORE_SIP));
$deleteUrl = $this->createDeleteUrl($this->formSpec[F_NAME], $this->formSpec[F_TABLE_NAME], $this->store->getVar(SIP_RECORD_ID, STORE_SIP));
$html .= "<p><a " . Support::doAttribute('href', $deleteUrl) . ">Delete</a>";
$html .= $this->wrapItem(WRAP_SETUP_TITLE, $this->formSpec['title'], true);
......
......@@ -23,6 +23,7 @@ const SESSION_FE_USER_GROUP = 'feUserGroup';
const FORM_LOAD = 'form_load';
const FORM_SAVE = 'form_save';
const FORM_UPDATE = 'form_update';
const FORM_DELETE = 'form_delete';
const FORM_PERMISSION_SIP = 'sip';
const FORM_PERMISSION_LOGGED_IN = 'logged_id';
const FORM_PERMISSION_LOGGED_OUT = 'logged_out';
......@@ -176,13 +177,14 @@ const ERROR_IO_CHDIR = 1310;
//Report
const ERROR_UNKNOWN_LINK_QUALIFIER = 1400;
const ERROR_UNDEFINED_RENDER_CONTROL_COMBINATION = 1401;
const ERROR_MISSING_VALUE = 1402;
const ERROR_INVALID_VALUE = 1403;
const ERROR_MULTIPLE_DEFINITION = 1404;
const ERROR_MULTIPLE_URL_PAGE_MAILTO_DEFINITION = 1405;
const ERROR_UNKNOWN_TOKEN = 1406;
const ERROR_TOO_FEW_PARAMETER_FOR_SENDMAIL = 1407;
const ERROR_TOO_MANY_PARAMETER = 1408;
const ERROR_MISSING_REQUIRED_DELETE_QUALIFIER = 1402;
const ERROR_MISSING_VALUE = 1403;
const ERROR_INVALID_VALUE = 1404;
const ERROR_MULTIPLE_DEFINITION = 1405;
const ERROR_MULTIPLE_URL_PAGE_MAILTO_DEFINITION = 1406;
const ERROR_UNKNOWN_TOKEN = 1407;
const ERROR_TOO_FEW_PARAMETER_FOR_SENDMAIL = 1408;
const ERROR_TOO_MANY_PARAMETER = 1409;
// Upload
const ERROR_UPLOAD = 1500;
......@@ -293,6 +295,8 @@ const SYSTEM_SHOW_DEBUG_INFO = 'SHOW_DEBUG_INFO';
const SYSTEM_CSS_LINK_CLASS_INTERNAL = 'CSS_LINK_CLASS_INTERNAL';
const SYSTEM_CSS_LINK_CLASS_EXTERNAL = 'CSS_LINK_CLASS_EXTERNAL';
const SYSTEM_CSS_CLASS_QFQ_CONTAINER = 'CSS_CLASS_QFQ_CONTAINER';
const SYSTEM_CSS_CLASS_QFQ_FORM_PILL = 'CSS_CLASS_QFQ_FORM_PILL';
const SYSTEM_CSS_CLASS_QFQ_FORM_BODY = 'CSS_CLASS_QFQ_FORM_BODY';
// computed automatically during runtime
const SYSTEM_PATH_EXT = 'EXT_PATH';
......@@ -330,7 +334,7 @@ const SIP_RECORD_ID = CLIENT_RECORD_ID; // r
const SIP_TARGET_URL= '_targetUrl'; // URL where to jump after delete()
const SIP_MODE_ANSWER = '_modeAnswer'; // Mode how delete() will answer to client: MODE_HTML, MODE_JSON
const SIP_FORM = CLIENT_FORM;
const SIP_TABLE = '_table'; // delete a record from 'table'
const SIP_TABLE = 'table'; // delete a record from 'table'
const SIP_URLPARAM = 'urlparam';
const SIP_MAKE_URLPARAM_UNIQ = '_makeUrlParamUniq'; // SIPs for 'new records' needs to be uniq per TAB! Therefore add a uniq parameter
// FURTHER: all extracted params from 'urlparam
......@@ -377,6 +381,8 @@ const SQL_LOG_MODE_ALL = 'all';
const SQL_LOG_MODE_MODIFY = 'modify';
// api/save.php, api/delete.php, api/load.php
const API_DELETE_PHP = 'delete.php';
const API_STATUS = 'status';
const API_MESSAGE = 'message';
const API_REDIRECT = 'redirect';
......@@ -442,6 +448,9 @@ const F_REQUIRED_PARAMETER = 'requiredParameter';
const F_SUBMIT_BUTTON_TEXT = 'submitButtonText';
const F_CLASS_PILL = 'classPill';
const F_CLASS_BODY = 'classBody';
// FORM_ELEMENT_STATI
const FE_MODE_SHOW = 'show';
const FE_MODE_READONLY = 'readonly';
......@@ -570,3 +579,22 @@ const SENDMAIL_IDX_X_ID = 7;
const SENDMAIL_IDX_RECEIVER_CC = 8;
const SENDMAIL_IDX_RECEIVER_BCC = 9;
const SENDMAIL_IDX_SRC = 10;
//Report: Column Token
const COLUMN_PPAGE = "Page";
const COLUMN_PPAGEC = "Pagec";
const COLUMN_PPAGED = "Paged";
const COLUMN_PPAGEE = "Pagee";
const COLUMN_PPAGEH = "Pageh";
const COLUMN_PPAGEI = "Pagei";
const COLUMN_PPAGEN = "Pagen";
const COLUMN_PPAGES = "Pages";
const COLUMN_PAGE = "page";
const COLUMN_PAGEC = "pagec";
const COLUMN_PAGED = "paged";
const COLUMN_PAGEE = "pagee";
const COLUMN_PAGEH = "pageh";
const COLUMN_PAGEI = "pagei";
const COLUMN_PAGEN = "pagen";
const COLUMN_PAGES = "pages";
\ No newline at end of file
......@@ -37,19 +37,16 @@ class Delete {
* If the table has a column named COLUMN_PATH_FILE_NAME and the value of that specific record column points
* to a file: delete such a file if their are no other records in the same table which also have a reference to that file.
*
* @param array $form
* @param string $tableName
* @param integer $recordId