Commit 0893a40a authored by Carsten  Rose's avatar Carsten Rose
Browse files

API_ANSWER_REDIRECT_URL_SKIP_HISTORY: Implement 'url-skip-history' as an user selectable option.

Manual.rst: update doc of 'url-skip-history'.
DatabaseUpdateData.php: update data structure as well as update given data from 'page' to 'url'.
QuickFormReport.php: remove temporarily fix page/url.
formEditor.sql: update table 'Form.forwardMode' to ('client', 'no', 'url', 'url-skip-history'). FormEditor now uses dynamicUpdate to hide/show FE 'forwardPage'.
parent b6cb6285
......@@ -1359,9 +1359,9 @@ Definition
+-------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|multiDetailFormParameter | string | Optional. Translated Parameter submitted to detailform (like subrecord parameter) |
+-------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|forwardMode | string: 'auto | no | page' | |
+-------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|forwardPage | string / query | If $forward=="page": page to jump to |
|forwardMode | string: 'client | no | url | url-skip-history' | After pressing 'save': |
+-------------------------+----------------------------------------------------------+ 'url' / 'url-skip-history': redirects browser to 'forwardPage'. |
|forwardPage | string | 'client': the browser decides to stay on the page or to force a redirection |
+-------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|bsLabelColumns | string | The bootstrap grid system is based on 12 columns. The sum of *bsLabelColumns*, |
+-------------------------+----------------------------------------------------------+ *bsInputColumns* and *bsNoteColumns* should be 12. These values here are the base values|
......@@ -1426,8 +1426,6 @@ Depending on `r`, the following access permission will be taken:
* `permitEdit=none`: Public accessible forms. It's not possible to update records.
showButton
^^^^^^^^^^
......
......@@ -165,11 +165,10 @@ class QuickFormQuery {
*/
public function getForwardMode() {
$mode = $this->formSpec[F_FORWARD_MODE];
if ($mode === F_FORWARD_MODE_PAGE) {
$mode = API_ANSWER_REDIRECT_URL;
}
return ([API_REDIRECT => $mode, API_REDIRECT_URL => $this->formSpec[F_FORWARD_PAGE]]);
return ([
API_REDIRECT => $this->formSpec[F_FORWARD_MODE],
API_REDIRECT_URL => $this->formSpec[F_FORWARD_PAGE]
]);
}
/**
......
......@@ -42,6 +42,12 @@ $UPDATE_ARRAY = array(
"UPDATE `Form` SET `escapeTypeDefault`='-'",
],
'0.17.6' => [
"ALTER TABLE `Form` CHANGE `forwardMode` `forwardMode` ENUM( 'client', 'no', 'page', 'url', 'url-skip-history' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'client'",
"UPDATE Form SET forwardMode='url' WHERE forwardMode='page'",
"ALTER TABLE `Form` CHANGE `forwardMode` `forwardMode` ENUM( 'client', 'no', 'url', 'url-skip-history' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'client'",
],
);
......
......@@ -92,7 +92,6 @@ class Support {
* @param string $htmlId
* @param string $tooltipText
* @return string
* @internal param string $before
*/
public static function doTooltip($htmlId, $tooltipText) {
......
......@@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS `Form` (
`multiDetailForm` VARCHAR(255) NOT NULL DEFAULT '',
`multiDetailFormParameter` VARCHAR(255) NOT NULL DEFAULT '',
`forwardMode` ENUM('client', 'no', 'page') NOT NULL DEFAULT 'client',
`forwardMode` ENUM('client', 'no', 'url', 'url-skip-history') NOT NULL DEFAULT 'client',
`forwardPage` VARCHAR(255) NOT NULL DEFAULT '',
`bsLabelColumns` VARCHAR(255) NOT NULL DEFAULT '',
......@@ -154,43 +154,45 @@ VALUES
# FormEditor: FormElements for 'form'
INSERT INTO FormElement (formId, name, label, mode, type, checkType, class, ord, size, maxLength, note, clientJs, value,
sql1, parameter, feIdContainer, subrecordOption, modeSql, placeholder, encode)
sql1, parameter, feIdContainer, subrecordOption, modeSql, placeholder, encode, dynamicUpdate)
VALUES
(1, 'name', 'Name', 'required', 'text', 'alnumx', 'native', 120, 0, 0, '', '', '', '', 'autofocus', 1, '', '', '',
'specialchar'),
(1, 'title', 'Title', 'show', 'text', 'all', 'native', 130, 0, 0, '', '', '', '', '', 1, '', '', '', 'none'),
(1, 'noteInternal', 'Note', 'show', 'text', 'all', 'native', 140, '40,3', 0, '', '', '', '', '', 1, '', '', '', 'specialchar'),
(1, 'tableName', 'Table', 'required', 'select', 'all', 'native', 150, 0, 0, '', '', '', '{{!SHOW tables}}', 'emptyItemAtStart', 1, '', '', '', 'specialchar'),
(1, 'requiredParameter', 'Required Parameter', 'show', 'text', 'all', 'native', 200, 0, 0, '', '', '', '', '', 2, '', '', '', 'specialchar'),
(1, 'permitNew', 'Permit New', 'show', 'radio', 'all', 'native', 210, 0, 10, '', '', '', '', '', 2, '', '', '', 'specialchar'),
(1, 'permitEdit', 'Permit Edit', 'show', 'radio', 'all', 'native', 220, 0, 10, '', '', '', '', '', 2, '', '', '', 'specialchar'),
(1, 'escapeTypeDefault', 'Escape type default', 'show', 'radio', 'all', 'native', 230, 0, 10, '', '', '', '', 'itemList=c:config,s:single,d:double,l:ldap search,L:ldap value,m:mysql realEscapeString,-:none', 2, '', '', '', 'specialchar'),
(1, 'render', 'Render', 'show', 'radio', 'all', 'native', 240, 0, 3, '', '', '', '', '', 2, '', '', '', 'specialchar'),
(1, 'showButton', 'Show button', 'show', 'checkbox', 'all', 'native', 250, 0, 5, '', '', '', '', 'checkBoxMode = multi\norientation=vertical', 2, '', '', '', 'specialchar'),
(1, 'forwardMode', 'Forward', 'show', 'radio', 'all', 'native', 300, 0, 0, '', '', '', '', '', 3, '', '', '', 'specialchar'),
(1, 'forwardPage', 'Forward Page', 'show', 'text', 'all', 'native', 310, 0, 0, '', '', '', '', '', 3, '', '', '', 'none'),
(1, 'parameter', 'Parameter', 'show', 'text', 'all', 'native', 320, '40,8', 0, '', '', '', '', '', 3, '', '', '', 'none'),
(1, 'bsLabelColumns', 'BS Label Columns', 'show', 'text', 'all', 'native', 330, 0, 0, '', '', '', '', '', 3, '', '', '{{bsLabelColumns:Y}}', 'specialchar'),
(1, 'bsInputColumns', 'BS Input Columns', 'show', 'text', 'all', 'native', 340, 0, 0, '', '', '', '', '', 3, '', '', '{{bsInputColumns:Y}}', 'specialchar'),
(1, 'bsNoteColumns', 'BS Note Columns', 'show', 'text', 'all', 'native', 350, 0, 0, '', '', '', '', '', 3, '', '', '{{bsNoteColumns:Y}}', 'specialchar'),
(1, 'deleted', 'Deleted', 'show', 'checkbox', 'all', 'native', 360, 0, 0, '', '', '', '', '', 3, '', '', '', 'specialchar'),
(1, 'modified', 'Modified', 'readonly', 'text', 'all', 'native', 370, 0, 20, '', '', '', '', '', 3, '', '', '', 'specialchar'),
(1, 'created', 'Created', 'readonly', 'text', 'all', 'native', 380, 0, 20, '', '', '', '', '', 3, '', '', '', 'specialchar'),
(1, 'multi', 'Multi', 'show', 'fieldset', 'all', 'native', 400, 0, 0, '', '', '', '', '', 4, '', '', '', 'specialchar'),
(1, 'multiMode', 'Multi Mode', 'show', 'radio', 'all', 'native', 410, 0, 0, '', '', '', '', '', 4, '', '', '', 'specialchar'),
'specialchar', 'no'),
(1, 'title', 'Title', 'show', 'text', 'all', 'native', 130, 0, 0, '', '', '', '', '', 1, '', '', '', 'none', 'no'),
(1, 'noteInternal', 'Note', 'show', 'text', 'all', 'native', 140, '40,3', 0, '', '', '', '', '', 1, '', '', '', 'specialchar', 'no'),
(1, 'tableName', 'Table', 'required', 'select', 'all', 'native', 150, 0, 0, '', '', '', '{{!SHOW tables}}',
'emptyItemAtStart', 1, '', '', '', 'specialchar', 'no'),
(1, 'requiredParameter', 'Required Parameter', 'show', 'text', 'all', 'native', 200, 0, 0, '', '', '', '', '', 2, '', '', '', 'specialchar', 'no'),
(1, 'permitNew', 'Permit New', 'show', 'radio', 'all', 'native', 210, 0, 10, '', '', '', '', '', 2, '', '', '', 'specialchar', 'no'),
(1, 'permitEdit', 'Permit Edit', 'show', 'radio', 'all', 'native', 220, 0, 10, '', '', '', '', '', 2, '', '', '', 'specialchar', 'no'),
(1, 'escapeTypeDefault', 'Escape type default', 'show', 'radio', 'all', 'native', 230, 0, 10, '', '', '', '',
'itemList=c:config,s:single,d:double,l:ldap search,L:ldap value,m:mysql realEscapeString,-:none', 2, '', '', '', 'specialchar', 'no'),
(1, 'render', 'Render', 'show', 'radio', 'all', 'native', 240, 0, 3, '', '', '', '', '', 2, '', '', '', 'specialchar', 'no'),
(1, 'showButton', 'Show button', 'show', 'checkbox', 'all', 'native', 250, 0, 5, '', '', '', '', 'checkBoxMode = multi\norientation=vertical', 2, '', '', '', 'specialchar', 'no'),
(1, 'forwardMode', 'Forward', 'show', 'radio', 'all', 'native', 300, 0, 0, '', '', '', '', '', 3, '', '', '', 'specialchar', 'yes'),
(1, 'forwardPage', 'Forward Page', 'show', 'text', 'all', 'native', 310, 0, 0, '', '', '', '', '', 3, '',
'{{SELECT IF( "{{forwardMode:FE:alnumx}}" LIKE "url%", "show", "hidden")}}', '', 'none', 'yes'),
(1, 'parameter', 'Parameter', 'show', 'text', 'all', 'native', 320, '40,8', 0, '', '', '', '', '', 3, '', '', '', 'none', 'no'),
(1, 'bsLabelColumns', 'BS Label Columns', 'show', 'text', 'all', 'native', 330, 0, 0, '', '', '', '', '', 3, '', '', '{{bsLabelColumns:Y}}', 'specialchar', 'no'),
(1, 'bsInputColumns', 'BS Input Columns', 'show', 'text', 'all', 'native', 340, 0, 0, '', '', '', '', '', 3, '', '', '{{bsInputColumns:Y}}', 'specialchar', 'no'),
(1, 'bsNoteColumns', 'BS Note Columns', 'show', 'text', 'all', 'native', 350, 0, 0, '', '', '', '', '', 3, '', '', '{{bsNoteColumns:Y}}', 'specialchar', 'no'),
(1, 'deleted', 'Deleted', 'show', 'checkbox', 'all', 'native', 360, 0, 0, '', '', '', '', '', 3, '', '', '', 'specialchar', 'no'),
(1, 'modified', 'Modified', 'readonly', 'text', 'all', 'native', 370, 0, 20, '', '', '', '', '', 3, '', '', '', 'specialchar', 'no'),
(1, 'created', 'Created', 'readonly', 'text', 'all', 'native', 380, 0, 20, '', '', '', '', '', 3, '', '', '', 'specialchar', 'no'),
(1, 'multi', 'Multi', 'show', 'fieldset', 'all', 'native', 400, 0, 0, '', '', '', '', '', 4, '', '', '', 'specialchar', 'no'),
(1, 'multiMode', 'Multi Mode', 'show', 'radio', 'all', 'native', 410, 0, 0, '', '', '', '', '', 4, '', '', '', 'specialchar', 'no'),
(1, 'multiSql', 'Multi SQL', 'show', 'text', 'all', 'native', 420, '40,3', 0, '', '', '', '', '', 4, '', '', '',
'none'),
'none', 'no'),
(1, 'multiDetailForm', 'Multi Detail Form', 'show', 'text', 'all', 'native', 430, 0, 0, '', '', '', '', '', 4,
'', '', '', 'specialchar'),
'', '', '', 'specialchar', 'no'),
(1, 'multiDetailFormParameter', 'Multi Detail Form Parameter', 'show', 'text', 'all', 'native', 440, 0, 0, '', '',
'', '', '', 4, '', '', '', 'none'),
'', '', '', 4, '', '', '', 'none', 'no'),
(1, '', 'FormElements', 'show', 'subrecord', 'all', 'native', 500, 0, 0, '', '', '',
'{{!SELECT IF( fe.enabled="yes", IF( fe.enabled="yes" AND fe.feIdContainer=0 AND !ISNULL(feCX.id) AND fe.class="native", "danger", IF( fe.class="container", "text-info", IF( fe.class="action", "text-success", ""))), "text-muted") AS _rowClass, IF( fe.enabled="yes", IF(fe.feIdContainer=0 AND !ISNULL(feCX.id) AND fe.class="native", "Please choose a container for this formelement", fe.class), "Disabled") AS _rowTitle, fe.id, CONCAT( IFNULL( CONCAT( feC.name, " (", fe.feIdContainer, ")"),"")) AS Container, fe.name AS "Name|50", fe.label, fe.mode, fe.class, fe.type, fe.ord, IF(fe.dynamicUpdate="yes", \'<span class="glyphicon glyphicon-random"></span>\',"") AS "dyn|||nostrip", fe.parameter FROM FormElement AS fe LEFT JOIN FormElement AS feC ON feC.id=fe.feIdContainer AND feC.formId=fe.formId LEFT JOIN FormElement AS feCX ON feCX.class="container" AND feCX.enabled="yes" AND feCX.formId=fe.formId WHERE fe.formId={{id:R0}} GROUP BY fe.id ORDER BY fe.class DESC, feC.ord, fe.ord, fe.id}}',
'form=formElement\ndetail=id:formId', 5, 'new,edit,delete', '', '', 'none');
'form=formElement\ndetail=id:formId', 5, 'new,edit,delete', '', '', 'none', 'no');
#
......@@ -283,10 +285,10 @@ CREATE TABLE IF NOT EXISTS `MailLog` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`grId` INT(11) NOT NULL DEFAULT '0',
`xId` INT(11) NOT NULL DEFAULT '0',
`receiver` TEXT NOT NULL DEFAULT '',
`receiver` TEXT NOT NULL,
`sender` VARCHAR(255) NOT NULL DEFAULT '',
`subject` VARCHAR(255) NOT NULL DEFAULT '',
`body` TEXT NOT NULL DEFAULT '',
`body` TEXT NOT NULL,
`header` VARCHAR(255) NOT NULL DEFAULT '',
`attach` VARCHAR(255) NOT NULL DEFAULT '',
`src` VARCHAR(255) NOT NULL DEFAULT '',
......
......@@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS `Form` (
`multiDetailForm` VARCHAR(255) NOT NULL DEFAULT '',
`multiDetailFormParameter` VARCHAR(255) NOT NULL DEFAULT '',
`forwardMode` ENUM('client', 'no', 'page') NOT NULL DEFAULT 'client',
`forwardMode` ENUM('client', 'no', 'url', 'url-skip-history') NOT NULL DEFAULT 'client',
`forwardPage` VARCHAR(255) NOT NULL DEFAULT '',
`bsLabelColumns` VARCHAR(255) NOT NULL DEFAULT '',
......
Markdown is supported
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