Commit d5ce8fcd authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fixes #8067. Feature: url-sip / url-sip-skip-history - Form forwarding can now...

Fixes #8067. Feature: url-sip / url-sip-skip-history - Form forwarding can now be used with SIP encoded parameter.
parent eaf74c12
Pipeline #1749 passed with stage
in 2 minutes and 17 seconds
......@@ -2178,7 +2178,7 @@ Definition
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
|Show button | 'new, delete, close, save' (Default: 'new,delete,close,save'): Shown named buttons in the upper right corner of the form. See `form-showButton`_ |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
|Forward Mode | 'auto | close | no | url | url-skip-history' (Default: auto): See `form-forward`_. |
|Forward Mode | 'auto | close | no | url | url-skip-history | url-sip | url-sip-skip-history' (Default: auto): See `form-forward`_. |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
|Forward (Mode) Page | a) URL / Typo3 page id/alias or b) Forward Mode (via '{{...}}') or combination of a) & b). See `form-forward`_. |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
......@@ -2308,6 +2308,9 @@ After the user presses *Save*, *Close*, *Delete* or *New*, different actions are
there are modified data.
* `url` - the browser redirects to the URL or T3 page named in `Forward URL / Page`. Independent if the user presses `save` or `close`.
* `url-skip-history` - same as `url`, but the current location won't saved in the browser history.
* `url-sip` - like `url`, but any given parameter will be SIP encoded. Only useful if `url` points to current web instance.
* `url-sip-skip-history` - like `url-sip`, but skips the Browser history.
Only with `Forward` == `url` | `url-skip-history`, the definition of `Forward URL / Page` becomes active.
......@@ -7157,7 +7160,6 @@ Result::
Louis Armstrong
Diana Ross
One column 'rend' as linebreak - no extra column '<br>' needed::
10.sql = SELECT p.firstName, " " , p.lastName, " ", p.country FROM exp_person AS p
......
......@@ -917,7 +917,7 @@ const F_FORWARD_MODE_NO = API_ANSWER_REDIRECT_NO;
const F_FORWARD_MODE_URL = API_ANSWER_REDIRECT_URL;
const F_FORWARD_MODE_URL_SKIP_HISTORY = API_ANSWER_REDIRECT_URL_SKIP_HISTORY;
const F_FORWARD_MODE_URL_SIP = 'url-sip';
// client', 'no', 'url', 'url-skip-history'
const F_FORWARD_MODE_URL_SIP_SKIP_HISTORY = 'url-sip-skip-history';
const F_RECORD_LOCK_TIMEOUT_SECONDS = SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS;
const F_SESSION_TIMEOUT_SECONDS = SYSTEM_SESSION_TIMEOUT_SECONDS;
......
......@@ -218,12 +218,20 @@ class QuickFormQuery {
$forwardPage = $this->formSpec[F_FORWARD_PAGE];
if ($this->formSpec[F_FORWARD_MODE] == F_FORWARD_MODE_URL_SIP) {
$forwardPage = store::getSipInstance()->queryStringToSip($forwardPage, RETURN_URL);
// F_FORWARD_MODE_URL_SIP is not defined in API PROTOCOL. At the moment it's only used for 'copyForm'.
// 'copyForm' behaves better if the page is not in history.
// An option for better implementing would be to separate SKIP History from ForwardMode. For API, it can be combined again.
$this->formSpec[F_FORWARD_MODE] = F_FORWARD_MODE_URL_SKIP_HISTORY;
switch ($this->formSpec[F_FORWARD_MODE]) {
case F_FORWARD_MODE_URL_SIP:
$forwardPage = store::getSipInstance()->queryStringToSip($forwardPage, RETURN_URL);
$this->formSpec[F_FORWARD_MODE] = F_FORWARD_MODE_URL;
break;
case F_FORWARD_MODE_URL_SIP_SKIP_HISTORY:
// F_FORWARD_MODE_URL_SIP is not defined in API PROTOCOL. At the moment it's only used for 'copyForm'.
// 'copyForm' behaves better if the page is not in history.
// An option for better implementing would be to separate SKIP History from ForwardMode. For API, it can be combined again.
$forwardPage = store::getSipInstance()->queryStringToSip($forwardPage, RETURN_URL);
$this->formSpec[F_FORWARD_MODE] = F_FORWARD_MODE_URL_SKIP_HISTORY;
break;
default:
break;
}
return ([
......@@ -801,6 +809,7 @@ class QuickFormQuery {
case F_FORWARD_MODE_URL:
case F_FORWARD_MODE_URL_SKIP_HISTORY:
case F_FORWARD_MODE_URL_SIP:
case F_FORWARD_MODE_URL_SIP_SKIP_HISTORY:
$this->formSpec[F_FORWARD_MODE] = $forward;
if (isset($forwardArray[1])) {
$this->formSpec[F_FORWARD_PAGE] = trim($forwardArray[1]);
......
......@@ -116,7 +116,7 @@ $UPDATE_ARRAY = array(
'18.6.0' => [
"ALTER TABLE `Form` CHANGE `forwardMode` `forwardMode` ENUM('auto', 'client','no','url','url-skip-history','url-sip') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'client'",
"UPDATE `Form` SET forwardMode='auto' WHERE forwardMode='client'",
"UPDATE `Form` SET forwardMode='auto' WHERE forwardMode='client'",
"ALTER TABLE `Form` CHANGE `forwardMode` `forwardMode` ENUM('auto', 'close', 'no','url','url-skip-history','url-sip') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'auto';",
],
......@@ -141,6 +141,11 @@ $UPDATE_ARRAY = array(
"ALTER TABLE `Form` ADD `restMethod` SET('get','post','put','delete') NOT NULL DEFAULT '' AFTER `permitEdit`; ",
],
'19.3.2' => [
"ALTER TABLE `Form` CHANGE `forwardMode` `forwardMode` ENUM('auto','close','no','url','url-skip-history','url-sip','url-sip-skip-history' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'auto';",
"UPDATE `Form` SET forwardMode='url-sip-skip-history' WHERE forwardMode='url-sip'",
],
);
......
INSERT INTO `Form` VALUES(80, 'copyFormFromExt', 'Copy a form (external)', '', 'Clipboard', 'sip', 'sip', 'c', 'bootstrap', '', '', 'exclusive', 'close,save', 'none', '', '', '', 'url-sip', '?id={{pageId:T}}&form=form&r={{formId:P0}}', '', '', '', 'submitButtonText = Copy Form', '', '', '', '', 900, 'no', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO `Form`
VALUES (80, 'copyFormFromExt', 'Copy a form (external)', '', 'Clipboard', 'sip', 'sip', 'c', 'bootstrap', '', '',
'exclusive', 'close,save', 'none', '', '', '', 'url-sip-skip-history',
'?id={{pageId:T}}&form=form&r={{formId:P0}}', '', '', '', 'submitButtonText = Copy Form', '', '', '', '', 900,
'no', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO `FormElement` VALUES(NULL, 80, 0, 'no', 'yes', 'idSrc', 'Source Form', 'show', '', 'native', 'select', '', 'specialchar', 'alnumx', '', '', 10, 0, '', '', '', '', '', 'row,label,/label,input,/input,note,/note,/row', '', '', '', '', '', '{{!SELECT f.id, CONCAT(f.name, \" / \", f.title) FROM ExtForm AS f ORDER BY f.name}}', '', '', '', '', '', '', '', 'no', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO `FormElement` VALUES(NULL, 80, 0, 'no', 'yes', 'myNewFormName', 'New Form Name', 'show', '', 'native', 'text', '', 'specialchar', 'alnumx', '', '', 20, 0, '', '', '', '', '', 'row,label,/label,input,/input,note,/note,/row', '', '', '', '', '{{SELECT f.name FROM ExtForm AS f WHERE f.id={{idSrc:F0}} }}', '', '', '', '', '', '', '', '', 'no', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
......
......@@ -19,19 +19,20 @@ CREATE TABLE IF NOT EXISTS `Form`
`requiredParameterNew` VARCHAR(255) NOT NULL DEFAULT '',
`requiredParameterEdit` VARCHAR(255) NOT NULL DEFAULT '',
`dirtyMode` ENUM ('exclusive', 'advisory', 'none') NOT NULL DEFAULT 'exclusive',
`showButton` SET ('new', 'delete', 'close', 'save') NOT NULL DEFAULT 'new,delete,close,save',
`multiMode` ENUM ('none', 'horizontal', 'vertical') NOT NULL DEFAULT 'none',
`multiSql` TEXT NOT NULL,
`multiDetailForm` VARCHAR(255) NOT NULL DEFAULT '',
`multiDetailFormParameter` VARCHAR(255) NOT NULL DEFAULT '',
`showButton` SET ('new', 'delete', 'close', 'save') NOT NULL DEFAULT 'new,delete,close,save',
`multiMode` ENUM ('none', 'horizontal', 'vertical') NOT NULL DEFAULT 'none',
`multiSql` TEXT NOT NULL,
`multiDetailForm` VARCHAR(255) NOT NULL DEFAULT '',
`multiDetailFormParameter` VARCHAR(255) NOT NULL DEFAULT '',
`forwardMode` ENUM ('client', 'no', 'url', 'url-skip-history', 'url-sip') NOT NULL DEFAULT 'client',
`forwardPage` VARCHAR(255) NOT NULL DEFAULT '',
`forwardMode` ENUM ('client', 'no', 'url', 'url-skip-history', 'url-sip',
'url-sip-skip-history') NOT NULL DEFAULT 'client',
`forwardPage` VARCHAR(255) NOT NULL DEFAULT '',
`labelAlign` ENUM ('default', 'left', 'center', 'right') NOT NULL DEFAULT 'default',
`bsLabelColumns` VARCHAR(255) NOT NULL DEFAULT '',
`bsInputColumns` VARCHAR(255) NOT NULL DEFAULT '',
`bsNoteColumns` VARCHAR(255) NOT NULL DEFAULT '',
`labelAlign` ENUM ('default', 'left', 'center', 'right') NOT NULL DEFAULT 'default',
`bsLabelColumns` VARCHAR(255) NOT NULL DEFAULT '',
`bsInputColumns` VARCHAR(255) NOT NULL DEFAULT '',
`bsNoteColumns` VARCHAR(255) NOT NULL DEFAULT '',
`parameter` TEXT NOT NULL,
`parameterLanguageA` TEXT NOT NULL,
......@@ -531,7 +532,7 @@ CREATE TABLE IF NOT EXISTS `Clipboard`
# Form: CopyForm
INSERT INTO Form (id, name, title, tableName, showButton, forwardMode, forwardPage, parameter)
VALUES (3, 'copyForm', 'Copy a form', 'Clipboard', 'close,save', 'url-sip',
VALUES (3, 'copyForm', 'Copy a form', 'Clipboard', 'close,save', 'url-sip-skip-history',
'?id={{pageId:T}}&form=form&r={{formId:P0}}',
'submitButtonText = Copy Form');
......@@ -541,7 +542,7 @@ VALUES (3, 'idSrc', 'Source Form', 'select', 'native', 10,
'{{!SELECT f.id, CONCAT(f.name, " / ", f.title) FROM Form AS f ORDER BY f.name}}', ''),
(3, 'myNewFormName', 'New Form Name', 'text', 'native', 20, '', ''),
(3, 'clearClipboard', '', 'beforeSave', 'action', 100, '',
'sqlValidate={{!SELECT f.id FROM Form AS f WHERE f.name LIKE "{{myName:FE:alnumx}}" LIMIT 1}}\nexpectRecords = 0\nmessageFail = There is already a form with this name\nsqlAfter={{DELETE FROM Clipboard WHERE cookie="{{cookieQfq:C0:alnumx}}" }}'),
'sqlValidate={{!SELECT f.id FROM Form AS f WHERE f.name LIKE "{{myNewFormName:FE:alnumx}}" LIMIT 1}}\nexpectRecords = 0\nmessageFail = There is already a form "{{myNewFormName:FE}}"\nsqlAfter={{DELETE FROM Clipboard WHERE cookie="{{cookieQfq:C0:alnumx}}" }}'),
(3, 'updateClipboardRecord', '', 'afterSave', 'action', 110, '',
'sqlAfter={{UPDATE Clipboard AS c, Form AS f SET c.cookie="{{cookieQfq:C0:alnumx}}", c.formIdPaste=f.id /* PasteForm */ WHERE c.id={{id:R}} AND f.name="{{form:SE}}" }}'),
(3, 'formId', '', 'paste', 'action', 200, '{{!SELECT {{id:P}} AS id, "{{myNewFormName:FE:allbut}}" AS name}}',
......
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