Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
0c4f517e
Commit
0c4f517e
authored
Feb 10, 2018
by
Carsten Rose
Committed by
bbaer
Mar 01, 2018
Browse files
Feature 3470: Enter As Submit= on/off - implemented
parent
6d679dd6
Changes
7
Hide whitespace changes
Inline
Side-by-side
extension/Documentation/Manual.rst
View file @
0c4f517e
...
...
@@ -395,6 +395,8 @@ config.qfq.ini
| FORM_LANGUAGE_C_LABEL | | |
| FORM_LANGUAGE_D_LABEL | | |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
| enterAsSubmit | enterAsSubmit = 1 | 0: off, 1: Pressing *enter* in a form means *save* and *close* |
+-----------------------------+-------------------------------------------------+----------------------------------------------------------------------------+
Example: *typo3conf/config.qfq.ini*
...
...
@@ -1965,8 +1967,6 @@ Parameter
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| classBody | string | HTML div with given class, surrounding all *FormElement*. |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| submitButtonText | string | Show save button, with the
<submitButtonText>
at the bottom of the form. |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| extraDeleteForm | string | Name of a form which specifies how to delete the primary record and optional slave records. |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| data-pattern-error | string | Pattern violation: Text for error message used for all FormElements of current form. |
...
...
@@ -2006,6 +2006,10 @@ Parameter
| mode | string | The value `readonly` will activate a global readonly mode of the form - the user can't change any data. |
| | | See :ref:`form-mode-global` |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| enterAsSubmit | digit | 0: off, 1: Pressing *enter* in a form means *save* and *close*. Takes default from `config.qfq.ini`_. |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| submitButtonText | string | Show a save button at the bottom of the form, with
<submitButtonText>
. See `submitButtonText`_. |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| saveButtonActive | - | Make the 'save'-button active on *Form* load (instead of waiting for the first user change). |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| saveButtonText | string | Overwrite default from config.qfq.ini: SAVE_BUTTON_TEXT |
...
...
@@ -2051,6 +2055,8 @@ Parameter
* class = container-fluid
* classBody = qfq-form-right
.. _submitButtonText:
submitButtonText
''''''''''''''''
...
...
extension/config.qfq.example.ini
View file @
0c4f517e
...
...
@@ -124,3 +124,5 @@ WKHTMLTOPDF = /opt/wkhtmltox/bin/wkhtmltopdf
; FORM_LANGUAGE_D_ID = E.g. FORM_LANGUAGE_D_ID = 4
; FORM_LANGUAGE_D_LABEL = E.g. FORM_LANGUAGE_D_ID = Chinese
; Pressing the 'enter' key is equal to save and close
;
enterAsSubmit
=
1
\ No newline at end of file
extension/qfq/qfq/AbstractBuildForm.php
View file @
0c4f517e
...
...
@@ -321,7 +321,7 @@ abstract class AbstractBuildForm {
public
function
getFormTag
()
{
$md5
=
''
;
$attribute
=
$this
->
getFormTagAt
r
ributes
();
$attribute
=
$this
->
getFormTagAt
t
ributes
();
$honeypot
=
$this
->
getHoneypotVars
();
...
...
@@ -399,7 +399,7 @@ abstract class AbstractBuildForm {
*
* @return array
*/
public
function
getFormTagAt
r
ributes
()
{
public
function
getFormTagAt
t
ributes
()
{
$attribute
[
'id'
]
=
$this
->
getFormId
();
$attribute
[
'method'
]
=
'post'
;
...
...
@@ -408,6 +408,7 @@ abstract class AbstractBuildForm {
$attribute
[
'accept-charset'
]
=
'UTF-8'
;
$attribute
[
FE_INPUT_AUTOCOMPLETE
]
=
'on'
;
$attribute
[
'enctype'
]
=
$this
->
getEncType
();
$attribute
[
'data-disable-return-key-submit'
]
=
$this
->
formSpec
[
F_ENTER_AS_SUBMIT
]
==
'1'
?
"false"
:
"true"
;
// attribute meaning is inverted
return
$attribute
;
}
...
...
extension/qfq/qfq/BuildFormBootstrap.php
View file @
0c4f517e
...
...
@@ -495,7 +495,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
*/
public
function
getFormTag
()
{
$attribute
=
$this
->
getFormTagAt
r
ributes
();
$attribute
=
$this
->
getFormTagAt
t
ributes
();
$attribute
[
'class'
]
=
'form-horizontal'
;
$attribute
[
'data-toggle'
]
=
'validator'
;
...
...
extension/qfq/qfq/Constants.php
View file @
0c4f517e
...
...
@@ -499,6 +499,8 @@ const SYSTEM_FORM_LANGUAGE_C_LABEL = 'FORM_LANGUAGE_C_LABEL';
const
SYSTEM_FORM_LANGUAGE_D_ID
=
'FORM_LANGUAGE_D_ID'
;
const
SYSTEM_FORM_LANGUAGE_D_LABEL
=
'FORM_LANGUAGE_D_LABEL'
;
const
SYSTEM_ENTER_AS_SUBMIT
=
'enterAsSubmit'
;
const
DOCUMENTATION_QFQ
=
'DOCUMENTATION_QFQ'
;
const
DOCUMENTATION_QFQ_URL
=
'https://docs.typo3.org/typo3cms/drafts/github/T3DocumentationStarter/Public-Info-053/Manual.html'
;
...
...
@@ -819,6 +821,8 @@ const F_NEW_BUTTON_TOOLTIP = 'newButtonTooltip';
const
F_NEW_BUTTON_CLASS
=
'newButtonClass'
;
const
F_NEW_BUTTON_GLYPH_ICON
=
'newButtonGlyphIcon'
;
const
F_ENTER_AS_SUBMIT
=
SYSTEM_ENTER_AS_SUBMIT
;
// FORM_ELEMENT_STATI
const
FE_MODE_SHOW
=
'show'
;
const
FE_MODE_READONLY
=
'readonly'
;
...
...
extension/qfq/qfq/QuickFormQuery.php
View file @
0c4f517e
...
...
@@ -986,6 +986,7 @@ class QuickFormQuery {
Support
::
setIfNotSet
(
$formSpec
,
F_LDAP_USE_BIND_CREDENTIALS
,
''
);
Support
::
setIfNotSet
(
$formSpec
,
F_MODE
,
''
);
Support
::
setIfNotSet
(
$formSpec
,
F_DB_INDEX_DATA
,
$this
->
store
->
getVar
(
F_DB_INDEX_DATA
,
STORE_SYSTEM
));
Support
::
setIfNotSet
(
$formSpec
,
F_ENTER_AS_SUBMIT
,
$this
->
store
->
getVar
(
SYSTEM_ENTER_AS_SUBMIT
,
STORE_SYSTEM
));
// In case there is no F_MODE defined on the form, check if there is one in STORE_SIP.
if
(
$formSpec
[
F_MODE
]
==
''
)
{
...
...
extension/qfq/qfq/store/Config.php
View file @
0c4f517e
...
...
@@ -206,6 +206,7 @@ class Config {
Support
::
setIfNotSet
(
$config
,
SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS
,
SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS_DEFAULT
);
Support
::
setIfNotSet
(
$config
,
DOCUMENTATION_QFQ
,
DOCUMENTATION_QFQ_URL
);
Support
::
setIfNotSet
(
$config
,
SYSTEM_ENTER_AS_SUBMIT
,
1
);
// Support::setIfNotSet($config, SYSTEM_FILL_STORE_SYSTEM_BY_SQL, SYSTEM_VAR_ADD_BY_SQL_DEFAULT);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment