diff --git a/extension/Documentation/Manual.rst b/extension/Documentation/Manual.rst index 12a3b62d2a8013a5a1f2391562b2f4bc7ce0562c..d87b8dba08fb07c5f0698e7ec59c53253a784cf1 100644 --- a/extension/Documentation/Manual.rst +++ b/extension/Documentation/Manual.rst @@ -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 diff --git a/extension/Source/core/Constants.php b/extension/Source/core/Constants.php index 2c2c250a7b19829b096b615db06fd28b3e04ff36..3cfc88a69809ce020fc5da10e2b3ec8b7d7f67f3 100644 --- a/extension/Source/core/Constants.php +++ b/extension/Source/core/Constants.php @@ -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; diff --git a/extension/Source/core/QuickFormQuery.php b/extension/Source/core/QuickFormQuery.php index 86970c1da0d77e5b6b2da578ffd20f661d0d5411..02b49e52c0aaa6324cd2ac20e471c9543de732ff 100644 --- a/extension/Source/core/QuickFormQuery.php +++ b/extension/Source/core/QuickFormQuery.php @@ -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]); diff --git a/extension/Source/core/database/DatabaseUpdateData.php b/extension/Source/core/database/DatabaseUpdateData.php index 464916771b2923f15b2669433d91ee8d988199ef..05220ff89757fcb69667eee265548544bb4d7a89 100644 --- a/extension/Source/core/database/DatabaseUpdateData.php +++ b/extension/Source/core/database/DatabaseUpdateData.php @@ -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'", + ], + ); diff --git a/extension/Source/sql/copyFormFromExt.sql b/extension/Source/sql/copyFormFromExt.sql index df3489e47e0615c548e22e0bbee21060a0c1bf6d..9e09fc99475d559036197fc6f4a3ad9c30f19ef8 100644 --- a/extension/Source/sql/copyFormFromExt.sql +++ b/extension/Source/sql/copyFormFromExt.sql @@ -1,4 +1,8 @@ -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'); diff --git a/extension/Source/sql/formEditor.sql b/extension/Source/sql/formEditor.sql index e2aeb3c701f216d7fd490eff3eae75f2b4104923..e4994bac87b2da1a9b1f4c39a4ea9bf674d4e867 100644 --- a/extension/Source/sql/formEditor.sql +++ b/extension/Source/sql/formEditor.sql @@ -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}}',