[BUGFIX] EXT:form - hide readonly elements in summary page and emails 31/54131/3
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Wed, 13 Sep 2017 10:51:37 +0000 (12:51 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Thu, 7 Dec 2017 08:07:42 +0000 (09:07 +0100)
Hide readonly form elements within the summary page and emails.

Resolves: #82471
Releases: master, 8.7
Change-Id: I9c42754c935c0b2c62ff1a70f43e7a13d3594f82
Reviewed-on: https://review.typo3.org/54131
Reviewed-by: Daniel Lorenz <daniel.lorenz@extco.de>
Tested-by: Daniel Lorenz <daniel.lorenz@extco.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
typo3/sysext/form/Configuration/Yaml/BaseSetup.yaml
typo3/sysext/form/Documentation/Config/configuration/Index.rst
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/ContentElement.rst
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/ContentElement/renderingOptions/_isReadOnlyFormElement.rst [new file with mode: 0644]
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/StaticText.rst
typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/StaticText/renderingOptions/_isReadOnlyFormElement.rst [new file with mode: 0644]

index 61cfce7..97bd429 100644 (file)
@@ -91,6 +91,10 @@ class RenderAllFormValuesViewHelper extends AbstractViewHelper
                     isset($renderingOptions['_isHiddenFormElement'])
                     && $renderingOptions['_isHiddenFormElement'] === true
                 )
+                || (
+                    isset($renderingOptions['_isReadOnlyFormElement'])
+                    && $renderingOptions['_isReadOnlyFormElement'] === true
+                )
             ) {
                 continue;
             }
index 2b088ee..7fc3d8b 100644 (file)
@@ -381,6 +381,8 @@ TYPO3:
             __inheritances:
               10: 'TYPO3.CMS.Form.mixins.formElementMixins.BaseFormElementMixin'
             implementationClassName: 'TYPO3\CMS\Form\Domain\Model\FormElements\GenericFormElement'
+            renderingOptions:
+              _isReadOnlyFormElement: true
 
           FormElementMixin:
             __inheritances:
index 56c6f88..f3cab2b 100644 (file)
@@ -3202,6 +3202,8 @@ Full default configuration
               enableDatePicker: true
               displayTimeSelector: false
           StaticText:
+            renderingOptions:
+              _isReadOnlyFormElement: true
             formEditor:
               editors:
                 100:
@@ -3231,6 +3233,8 @@ Full default configuration
             properties:
               text: ''
           ContentElement:
+            renderingOptions:
+              _isReadOnlyFormElement: true
             formEditor:
               editors:
                 100:
index 6c5312f..037d7ab 100644 (file)
@@ -15,6 +15,9 @@ Properties
 .. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.contentelement.implementationclassname:
 .. include:: ContentElement/implementationClassName.rst
 
+.. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.contentelement.renderingoptions._isReadOnlyFormElement:
+.. include:: ContentElement/renderingOptions/_isReadOnlyFormElement.rst
+
 .. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.contentelement.properties.contentelementuid:
 .. include:: ContentElement/properties/contentElementUid.rst
 
diff --git a/typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/ContentElement/renderingOptions/_isReadOnlyFormElement.rst b/typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/ContentElement/renderingOptions/_isReadOnlyFormElement.rst
new file mode 100644 (file)
index 0000000..98b2b52
--- /dev/null
@@ -0,0 +1,32 @@
+renderingOptions._isReadOnlyFormElement
+---------------------------------------
+
+:aspect:`Option path`
+      TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.formElementsDefinition.ContentElement.renderingOptions._isReadOnlyFormElement
+
+:aspect:`Data type`
+      bool
+
+:aspect:`Needed by`
+      Frontend
+
+:aspect:`Overwritable within form definition`
+      Yes
+
+:aspect:`form editor can write this property into the form definition (for prototype 'standard')`
+      No
+
+:aspect:`Mandatory`
+      No
+
+:aspect:`Default value (for prototype 'standard')`
+      .. code-block:: yaml
+         :linenos:
+         :emphasize-lines: 3
+
+         ContentElement:
+           renderingOptions:
+             _isReadOnlyFormElement: true
+
+:aspect:`Description`
+      Internal control setting to define that the form element is not visible within the summary page and emails.
\ No newline at end of file
index 5b68549..20ba50d 100644 (file)
@@ -15,6 +15,9 @@ Properties
 .. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.statictext.implementationclassname:
 .. include:: StaticText/implementationClassName.rst
 
+.. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.statictext.renderingoptions._isReadOnlyFormElement:
+.. include:: StaticText/renderingOptions/_isReadOnlyFormElement.rst
+
 .. _typo3.cms.form.prototypes.<prototypeIdentifier>.formelementsdefinition.statictext.properties.text:
 .. include:: StaticText/properties/text.rst
 
diff --git a/typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/StaticText/renderingOptions/_isReadOnlyFormElement.rst b/typo3/sysext/form/Documentation/Config/proto/formElements/formElementTypes/StaticText/renderingOptions/_isReadOnlyFormElement.rst
new file mode 100644 (file)
index 0000000..f4d0c0a
--- /dev/null
@@ -0,0 +1,32 @@
+renderingOptions._isReadOnlyFormElement
+---------------------------------------
+
+:aspect:`Option path`
+      TYPO3.CMS.Form.prototypes.<prototypeIdentifier>.formElementsDefinition.StaticText.renderingOptions._isReadOnlyFormElement
+
+:aspect:`Data type`
+      bool
+
+:aspect:`Needed by`
+      Frontend
+
+:aspect:`Overwritable within form definition`
+      Yes
+
+:aspect:`form editor can write this property into the form definition (for prototype 'standard')`
+      No
+
+:aspect:`Mandatory`
+      No
+
+:aspect:`Default value (for prototype 'standard')`
+      .. code-block:: yaml
+         :linenos:
+         :emphasize-lines: 3
+
+         StaticText:
+           renderingOptions:
+             _isReadOnlyFormElement: true
+
+:aspect:`Description`
+      Internal control setting to define that the form element is not visible within the summary page and emails.
\ No newline at end of file