[FEATURE] Enable HTML5 input types 52/55652/2
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 10 Feb 2018 18:18:33 +0000 (13:18 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 10 Feb 2018 18:20:01 +0000 (19:20 +0100)
HTML5 input types are enabled and the default HTML template is
modified accordingly. In order to support the date input type, the
following changes are introduced:
- the TS constants and setup variables dateFormat and dateSplit
  are dropped;
- the rendering format of dates in input forms is left to the browser;
- the rendering format of dates in other contexts is specified in file
  locallang.xlf as index dateFormat, thus allowing for varying formats
  depending on language.

Change-Id: I3a95c4a5f5272a0927cdba9079797cd17390b44c
Resolves: #83843
Reviewed-on: https://review.typo3.org/55652
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
ChangeLog
Configuration/TypoScript/PluginSetup/constants.txt
Configuration/TypoScript/PluginSetup/setup.txt
Resources/Private/Language/locallang.xlf
Resources/Private/Templates/SubscribeHtmlTemplate.html
doc/manual.sxw
ext_tables.sql

index a9a8a2e..7130d62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2018-02-10 Stanislas Rolland  <typo3(arobas)sjbr.ca>
+       * Resolves #83843: Enable HTML5 input types
+
 2017-01-26 Stanislas Rolland  <typo3(arobas)sjbr.ca>
        * Update and cleanup extension configuration
        * Require TYPO3 CMS 7.6
index a0eef88..5a078d9 100644 (file)
@@ -125,12 +125,6 @@ plugin.tx_sremailsubscribe {
 
     # cat=plugin.tx_sremailsubscribe/enable; type=boolean; label= Enable localization: If set, only localized records are shown.
   useLocalization = 0
-
-    # cat=plugin.tx_sremailsubscribe//; type=string; label= Date Format (d-m-y)
-  dateFormat = d-m-Y
-
-    # cat=plugin.tx_sremailsubscribe//; type=string; label= Split char for Date Format (-)
-  dateSplit = -
 }
 
 plugin.tx_sremailsubscribe_pi1 {
index 13e2fe2..87768e1 100644 (file)
@@ -26,8 +26,6 @@ plugin.tx_sremailsubscribe_pi1 {
        useShortUrls = {$plugin.tx_sremailsubscribe.useShortUrls}
        shortUrlLife = {$plugin.tx_sremailsubscribe.shortUrlLife}
        useLocalization = {$plugin.tx_sremailsubscribe.useLocalization}
-       dateFormat = {$plugin.tx_sremailsubscribe.dateFormat}
-       dateSplit = {$plugin.tx_sremailsubscribe.dateSplit}
 
        formName = {$plugin.tx_sremailsubscribe.formName}
        onChangeCountryAttribute = {$plugin.tx_sremailsubscribe.onChangeCountryAttribute}
index 6c3296a..78bf254 100644 (file)
@@ -28,7 +28,7 @@
                                <source>Please enter a surname!</source>
                        </trans-unit>
                        <trans-unit id="date_of_birth_informal" xml:space="preserve">
-                               <source>Date of birth (dd-mm-yyyy)</source>
+                               <source>Date of birth</source>
                        </trans-unit>
                        <trans-unit id="missing_invitation_date_of_birth_informal" xml:space="preserve">
                                <source>Please enter a date of birth!</source>
@@ -687,6 +687,9 @@ If you wish to accept our invitation and confirm your subscription to &lt;b&gt;%
                        <trans-unit id="v_registration_updated_informal" xml:space="preserve">
                                <source>%3$s updated its subscription to %1$s.</source>
                        </trans-unit>
+                       <trans-unit id="dateFormat" xml:space="preserve">
+                               <source>%B %e, %Y</source>
+                       </trans-unit>
                </body>
        </file>
 </xliff>
\ No newline at end of file
index 9d3775b..cab6bb2 100644 (file)
@@ -90,7 +90,7 @@
                <!-- ###SUB_REQUIRED_FIELD_date_of_birth### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_DATE_OF_BIRTH###</p>
                <!-- ###SUB_REQUIRED_FIELD_date_of_birth### -->
-               <input id="tx-sremailsubscribe-pi1-date_of_birth" type="text" size="10" maxlength="###MAXLENGTH_date_of_birth###" title="###TOOLTIP_DATE_OF_BIRTH###" name="###NAME_DATE_OF_BIRTH###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-date_of_birth" type="date" size="10" maxlength="###MAXLENGTH_date_of_birth###" title="###TOOLTIP_DATE_OF_BIRTH###" name="###NAME_DATE_OF_BIRTH###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_date_of_birth### -->
 
                <!-- ###SUB_REQUIRED_FIELD_phone### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_PHONE###</p>
                <!-- ###SUB_REQUIRED_FIELD_phone### -->
-               <input id="tx-sremailsubscribe-pi1-phone" type="text" size="25" maxlength="###MAXLENGTH_phone###" title="###TOOLTIP_PHONE###" name="###NAME_PHONE###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-phone" type="tel" size="25" maxlength="###MAXLENGTH_phone###" title="###TOOLTIP_PHONE###" name="###NAME_PHONE###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_phone### -->
 
                <!-- ###SUB_REQUIRED_FIELD_fax### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_FAX###</p>
                <!-- ###SUB_REQUIRED_FIELD_fax### -->
-               <input id="tx-sremailsubscribe-pi1-fax" type="text" size="25" maxlength="###MAXLENGTH_fax###" title="###TOOLTIP_FAX###" name="###NAME_FAX###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-fax" type="tel" size="25" maxlength="###MAXLENGTH_fax###" title="###TOOLTIP_FAX###" name="###NAME_FAX###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_fax### -->
 
                <!-- ###SUB_REQUIRED_FIELD_email### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_EMAIL###</p>
                <!-- ###SUB_REQUIRED_FIELD_email### -->
-               <input id="tx-sremailsubscribe-pi1-email" type="text" size="40" maxlength="###MAXLENGTH_email###" title="###TOOLTIP_EMAIL###" name="###NAME_EMAIL###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-email" type="email" size="40" maxlength="###MAXLENGTH_email###" title="###TOOLTIP_EMAIL###" name="###NAME_EMAIL###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_email### -->
 
                <!-- ###SUB_REQUIRED_FIELD_www### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_WWW###</p>
                <!-- ###SUB_REQUIRED_FIELD_www### -->
-               <input id="tx-sremailsubscribe-pi1-www" type="text" size="40" maxlength="###MAXLENGTH_www###" title="###TOOLTIP_WWW###" name="###NAME_WWW###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-www" type="url" size="40" maxlength="###MAXLENGTH_www###" title="###TOOLTIP_WWW###" name="###NAME_WWW###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_www### -->
 
@@ -642,7 +642,7 @@ The user is informed that a message has been sent to his email address and that
                <!-- ###SUB_REQUIRED_FIELD_date_of_birth### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_DATE_OF_BIRTH###</p>
                <!-- ###SUB_REQUIRED_FIELD_date_of_birth### -->
-               <input id="tx-sremailsubscribe-pi1-date_of_birth" type="text" size="10" maxlength="###MAXLENGTH_date_of_birth###" title="###TOOLTIP_INVITATION_DATE_OF_BIRTH###" name="###NAME_DATE_OF_BIRTH###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-date_of_birth" type="date" size="10" maxlength="###MAXLENGTH_date_of_birth###" title="###TOOLTIP_INVITATION_DATE_OF_BIRTH###" name="###NAME_DATE_OF_BIRTH###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_date_of_birth### -->
 
@@ -771,7 +771,7 @@ The user is informed that a message has been sent to his email address and that
                <!-- ###SUB_REQUIRED_FIELD_phone### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_PHONE###</p>
                <!-- ###SUB_REQUIRED_FIELD_phone### -->
-               <input id="tx-sremailsubscribe-pi1-phone" type="text" size="25" maxlength="###MAXLENGTH_phone###" title="###TOOLTIP_INVITATION_PHONE###" name="###NAME_PHONE###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-phone" type="tel" size="25" maxlength="###MAXLENGTH_phone###" title="###TOOLTIP_INVITATION_PHONE###" name="###NAME_PHONE###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_phone### -->
 
@@ -786,7 +786,7 @@ The user is informed that a message has been sent to his email address and that
                <!-- ###SUB_REQUIRED_FIELD_fax### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_FAX###</p>
                <!-- ###SUB_REQUIRED_FIELD_fax### -->
-               <input id="tx-sremailsubscribe-pi1-fax" type="text" size="25" maxlength="###MAXLENGTH_fax###" title="###TOOLTIP_INVITATION_FAX###" name="###NAME_FAX###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-fax" type="tel" size="25" maxlength="###MAXLENGTH_fax###" title="###TOOLTIP_INVITATION_FAX###" name="###NAME_FAX###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_fax### -->
 
@@ -801,7 +801,7 @@ The user is informed that a message has been sent to his email address and that
                <!-- ###SUB_REQUIRED_FIELD_email### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_EMAIL###</p>
                <!-- ###SUB_REQUIRED_FIELD_email### -->
-               <input id="tx-sremailsubscribe-pi1-email" type="text" size="40" maxlength="###MAXLENGTH_email###" title="###TOOLTIP_INVITATION_EMAIL###" name="###NAME_EMAIL###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-email" type="email" size="40" maxlength="###MAXLENGTH_email###" title="###TOOLTIP_INVITATION_EMAIL###" name="###NAME_EMAIL###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_email### -->
 
@@ -855,7 +855,7 @@ The user is informed that a message has been sent to his email address and that
                <!-- ###SUB_REQUIRED_FIELD_www### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_WWW###</p>
                <!-- ###SUB_REQUIRED_FIELD_www### -->
-               <input id="tx-sremailsubscribe-pi1-www" type="text" size="40" maxlength="###MAXLENGTH_www###" title="###TOOLTIP_INVITATION_WWW###" name="###NAME_WWW###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-www" type="url" size="40" maxlength="###MAXLENGTH_www###" title="###TOOLTIP_INVITATION_WWW###" name="###NAME_WWW###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_www### -->
 
@@ -1108,7 +1108,7 @@ The user is informed that a message has been sent to the email address and that
                <!-- ###SUB_REQUIRED_FIELD_date_of_birth### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_DATE_OF_BIRTH###</p>
                <!-- ###SUB_REQUIRED_FIELD_date_of_birth### -->
-               <input id="tx-sremailsubscribe-pi1-date_of_birth" type="text" size="10" maxlength="###MAXLENGTH_date_of_birth###" title="###TOOLTIP_DATE_OF_BIRTH###" name="###NAME_DATE_OF_BIRTH###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-date_of_birth" type="date" size="10" maxlength="###MAXLENGTH_date_of_birth###" title="###TOOLTIP_DATE_OF_BIRTH###" name="###NAME_DATE_OF_BIRTH###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_date_of_birth### -->
 
@@ -1237,7 +1237,7 @@ The user is informed that a message has been sent to the email address and that
                <!-- ###SUB_REQUIRED_FIELD_phone### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_PHONE###</p>
                <!-- ###SUB_REQUIRED_FIELD_phone### -->
-               <input id="tx-sremailsubscribe-pi1-phone" type="text" size="25" maxlength="###MAXLENGTH_phone###" title="###TOOLTIP_PHONE###" name="###NAME_PHONE###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-phone" type="tel" size="25" maxlength="###MAXLENGTH_phone###" title="###TOOLTIP_PHONE###" name="###NAME_PHONE###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_phone### -->
 
@@ -1252,7 +1252,7 @@ The user is informed that a message has been sent to the email address and that
                <!-- ###SUB_REQUIRED_FIELD_fax### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_FAX###</p>
                <!-- ###SUB_REQUIRED_FIELD_fax### -->
-               <input id="tx-sremailsubscribe-pi1-fax" type="text" size="25" maxlength="###MAXLENGTH_fax###" title="###TOOLTIP_FAX###" name="###NAME_FAX###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-fax" type="tel" size="25" maxlength="###MAXLENGTH_fax###" title="###TOOLTIP_FAX###" name="###NAME_FAX###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_fax### -->
 
@@ -1267,7 +1267,7 @@ The user is informed that a message has been sent to the email address and that
                <!-- ###SUB_REQUIRED_FIELD_email### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_EMAIL###</p>
                <!-- ###SUB_REQUIRED_FIELD_email### -->
-               <input id="tx-sremailsubscribe-pi1-email" type="text" size="40" maxlength="###MAXLENGTH_email###" title="###TOOLTIP_EMAIL###" name="###NAME_EMAIL###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-email" type="email" size="40" maxlength="###MAXLENGTH_email###" title="###TOOLTIP_EMAIL###" name="###NAME_EMAIL###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_email### -->
 
@@ -1321,7 +1321,7 @@ The user is informed that a message has been sent to the email address and that
                <!-- ###SUB_REQUIRED_FIELD_www### -->
                <p class="tx-sremailsubscribe-pi1-error">###MISSING_WWW###</p>
                <!-- ###SUB_REQUIRED_FIELD_www### -->
-               <input id="tx-sremailsubscribe-pi1-www" type="text" size="40" maxlength="###MAXLENGTH_www###" title="###TOOLTIP_WWW###" name="###NAME_WWW###" class="tx-sremailsubscribe-pi1-text" />
+               <input id="tx-sremailsubscribe-pi1-www" type="url" size="40" maxlength="###MAXLENGTH_www###" title="###TOOLTIP_WWW###" name="###NAME_WWW###" class="tx-sremailsubscribe-pi1-text" />
        </dd>
        <!-- ###SUB_INCLUDED_FIELD_www### -->
 
@@ -1622,7 +1622,7 @@ The user is informed that a message has been sent to the email address and that
                <label for="tx-sremailsubscribe-pi1-email">###LABEL_V_ENTER_SUBSCRIBED_EMAIL###</label>
        </dt>
        <dd>
-               <input type="text" value="###FIELD_email###" name="###PREFIXID###[fetch]" id="tx-sremailsubscribe-pi1-email" size="50" />
+               <input type="email" value="###FIELD_email###" name="###PREFIXID###[fetch]" id="tx-sremailsubscribe-pi1-email" size="50" />
                <!-- ###SUB_ERROR_FIELD_email### -->
                <p class="tx-sremailsubscribe-pi1-error">###EVAL_ERROR_FIELD_email###</p>
                <!-- ###SUB_ERROR_FIELD_email### -->
index 9818ad3..c2c68a6 100644 (file)
Binary files a/doc/manual.sxw and b/doc/manual.sxw differ
index d1f60fd..da7d40a 100644 (file)
@@ -8,6 +8,6 @@ CREATE TABLE tt_address (
        zone varchar(45) DEFAULT '' NOT NULL,
        language varchar(5) DEFAULT '' NOT NULL,
        date_of_birth int(11) DEFAULT '0' NOT NULL,
-       comments text NOT NULL,
+       comments varchar(1024) DEFAULT '' NOT NULL,
        module_sys_dmail_html tinyint(3) DEFAULT '0' NOT NULL
 );
\ No newline at end of file