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

F6100 Url Forward Auto: Update Manual.rst. The F.parameter.saveAndClose has...

F6100 Url Forward Auto: Update Manual.rst. The F.parameter.saveAndClose has been removed again. Mode 'close' can be assigned statically or dynamic.
parent 6c75665a
......@@ -1888,7 +1888,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 | 'client | no | url | url-skip-history' (Default: client): See `form-forward`_. |
|Forward Mode | 'auto | close | no | url | url-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`_. |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
......@@ -2003,14 +2003,15 @@ Forward (=forwardMode)
After the user presses *Save*, *Close*, *Delete* or *New*, different actions are possible where the browser redirects to.
* `client` (default) - the QFQ browser Javascript logic, decides to stay on the page or to force a redirection
to a previous page.
* `auto` (default) - the QFQ browser Javascript logic, decides to stay on the page or to force a redirection
to a previous page. The decision depends on:
* *Close* closes the current page and goes back to the previous page. Note: if a new tab is opened and the user presses
QFQ close (in any way) - in that new browser tab there is no previous page! QFQ won't close the tab, instead a message
is shown
* *Close* goes back (feels like close) to the previous page. Note: if there is no history, QFQ won't close the tab,
instead a message is shown.
* *Save* stays on the current page.
* `close` - goes back (feels like close) to the previous page. Note: if there is no history, QFQ won't close the tab,
instead a message is shown.
* `no` - no change, the browser remains on the current side. Close does not close the page. It just triggers a save if
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`.
......@@ -2031,14 +2032,14 @@ Format: [<url>] or [<mode>|<url>]
* `{{SELECT ...}}`
* `<mode>|<url>`
* `<mode>` - Valid keywords are as above: `no|client|url|url-skip-history`
* `<mode>` - Valid keywords are as above: `auto|close|no|url|url-skip-history`
Specifying the mode in `forwardPage` overwrites `formMode` (but only if `formMode` is `url...`).
Also regular QFQ statements like {{var}} or {{SELECT ...}} are possible in `forwardPage`. This is useful to dynamically
redirect to different targets, depending on user input or any other dependencies.
If a forwardMode 'url...' is specified and there is no `forwardPage`, QFQ falls down to `client` mode.
If a forwardMode 'url...' is specified and there is no `forwardPage`, QFQ falls down to `auto` mode.
On a form, the user might click 'save' or 'save,close' or 'close' (with modified data this leads to 'save,close').
The CLIENT `submit_reason` shows the user action:
......@@ -2048,7 +2049,7 @@ The CLIENT `submit_reason` shows the user action:
Example forwardPage
^^^^^^^^^^^^^^^^^^^
* `{{SELECT IF('{{formModeGlobal:S:alnumx}}'='requiredOff', 'no', 'client') }}`
* `{{SELECT IF('{{formModeGlobal:S:alnumx}}'='requiredOff', 'no', 'auto') }}`
* `{{SELECT IF('{{submit_reason:CE:alnumx}}'='save', 'no', 'url'), '|http://example.com' }}`
Type: combined dynamic mode & URL/page
......
......@@ -793,6 +793,7 @@ const F_FORWARD_MODE = 'forwardMode';
const F_FORWARD_PAGE = 'forwardPage';
const F_FORWARD_MODE_AUTO = API_ANSWER_REDIRECT_AUTO;
const F_FORWARD_MODE_CLOSE = API_ANSWER_REDIRECT_CLOSE;
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;
......@@ -862,8 +863,6 @@ const F_ORDER_INTERVAL = 'orderInterval';
const F_ORDER_COLUMN = 'orderColumn';
const F_ORDER_COLUMN_NAME = 'ord';
const F_SAVE_AND_CLOSE = 'saveAndClose';
// FORM_ELEMENT_STATI
const FE_MODE_SHOW = 'show';
const FE_MODE_READONLY = 'readonly';
......
......@@ -208,11 +208,6 @@ class QuickFormQuery {
$this->formSpec[F_FORWARD_MODE] = F_FORWARD_MODE_URL_SKIP_HISTORY;
}
// with forwardMode='auto' check if the tab should be closed too.
if ($this->formSpec[F_FORWARD_MODE] == F_FORWARD_MODE_AUTO && $this->formSpec[F_SAVE_AND_CLOSE] == '1') {
$this->formSpec[F_FORWARD_MODE] = API_ANSWER_REDIRECT_CLOSE;
}
return ([
API_REDIRECT => $this->formSpec[F_FORWARD_MODE],
API_REDIRECT_URL => $forwardPage,
......@@ -554,6 +549,7 @@ class QuickFormQuery {
switch ($forward) {
case F_FORWARD_MODE_AUTO:
case F_FORWARD_MODE_CLOSE:
case F_FORWARD_MODE_NO:
case F_FORWARD_MODE_URL:
case F_FORWARD_MODE_URL_SKIP_HISTORY:
......
......@@ -115,9 +115,9 @@ $UPDATE_ARRAY = array(
],
'18.04.5' => [
"ALTER TABLE `Form` CHANGE `forwardMode` `forwardMode` ENUM('client','no','url','url-skip-history','url-sip','auto') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'client'",
"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'",
"ALTER TABLE `Form` CHANGE `forwardMode` `forwardMode` ENUM('auto','no','url','url-skip-history','url-sip') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'auto';",
"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';",
],
......
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