Bug 25070: Centralize member-alt-contact-style
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 6 Apr 2020 12:09:06 +0000 (14:09 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 15 Jun 2020 09:53:36 +0000 (11:53 +0200)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-de.inc [deleted file]
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-fr.inc [deleted file]
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-us.inc [deleted file]
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-de.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-de.inc
deleted file mode 100644 (file)
index b760add..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-        <fieldset class="rows" id="memberentry_altaddress">
-            <legend id="alt_contact_lgd">Alternate contact</legend><ol>
-        [% UNLESS noaltcontactsurname %]
-            <li>
-                [% IF ( mandatoryaltcontactsurname ) %]
-                <label for="altcontactsurname" class="required">
-                [% ELSE %]
-                <label for="altcontactsurname">
-                [% END %]
-                Surname:</label>
-                    <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% patron.altcontactsurname | html %]" />
-                [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactfirstname %]
-            <li>
-                [% IF ( mandatoryaltcontactfirstname ) %]
-                <label for="altcontactfirstname" class="required">
-                [% ELSE %]
-                <label for="altcontactfirstname">
-                [% END %]
-                First name:</label>
-                    <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% patron.altcontactfirstname | html %]" />
-                [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactaddress1 %]
-            <li>
-                [% IF ( mandatoryaltcontactaddress1 ) %]
-                <label for="altcontactaddress1" class="required">
-                [% ELSE %]
-                <label for="altcontactaddress1">
-                [% END %]
-                Address:</label>
-                    <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% patron.altcontactaddress1 | html %]" size="40" />
-                [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactaddress2 %]
-            <li>
-                [% IF ( mandatoryaltcontactaddress2 ) %]
-                <label for="altcontactaddress2" class="required">
-                [% ELSE %]
-                <label for="altcontactaddress2">
-                [% END %]
-                Address 2:</label>
-                <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% patron.altcontactaddress2 | html %]" size="40" />
-                [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactzipcode %]
-                        <li>
-                            [% IF ( mandatoryaltcontactzipcode ) %]
-                                <label for="altcontactzipcode" class="required">
-                                [% ELSE %]
-                                <label for="altcontactzipcode">
-                                [% END %]
-                                ZIP/Postal code:</label>
-                    <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% patron.altcontactzipcode | html %]" size="5" />
-                                [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
-                        </li>
-        [% END %]
-        [% UNLESS noaltcontactaddress3 %]
-            <li>
-                [% IF ( mandatoryaltcontactaddress3 ) %]
-                <label for="altcontactaddress3" class="required">
-                [% ELSE %]
-                <label for="altcontactaddress3">
-                [% END %]
-                City:</label>
-                <input type="text" name="altcontactaddress3" id="altcontactcity" value="[% patron.altcontactaddress3 | html %]" size="20" />
-                [% IF cities.count %]or choose
-                    <select class="select_city" data-addressfield="altcontact" name="select_city">
-                        <option value="|||"></option>
-                        [% FOREACH c IN cities %]
-                            [% IF c.city_name == patron.altcontactaddress3 && c.city_state == patron.altcontactstate && c.city_zipcode == patron.altcontactzipcode %]
-                            <option value="[% c.city_zipcode | html %]|[% c.city_name | html %]|[% c.city_state | html %]|[% c.city_country | html %]" selected="selected">
-                            [% ELSE %]
-                            <option value="[% c.city_zipcode | html %]|[% c.city_name | html %]|[% c.city_state | html %]|[% c.city_country | html %]">
-                            [% END %]
-                                [% c.city_name | html %] [% c.city_state | html %] [% c.city_zipcode | html %]
-                            </option>
-                        [% END %]
-                    </select>
-                [% END %]
-                [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactstate %]
-            <li>
-                [% IF ( mandatoryaltcontactstate ) %]
-                <label for="altcontactstate" class="required">
-                [% ELSE %]
-                <label for="altcontactstate">
-                [% END %]
-                State:</label>
-                <input type="text" name="altcontactstate" id="altcontactstate" value="[% patron.altcontactstate | html %]" size="20" />
-                [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactcountry %]
-            <li>
-                [% IF ( mandatoryaltcontactcountry ) %]
-                <label for="altcontactcountry" class="required">
-                [% ELSE %]
-                <label for="altcontactcountry">
-                [% END %]
-                Country:</label>
-                    <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% patron.altcontactcountry | html %]" size="20" />
-                [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactphone %]
-            <li>
-                [% IF ( mandatoryaltcontactphone ) %]
-                <label for="altcontactphone" class="required">
-                [% ELSE %]
-                <label for="altcontactphone">
-                [% END %]
-                Phone:</label>
-                    <input type="text" name="altcontactphone" id="altcontactphone" value="[% patron.altcontactphone | html %]" />
-                [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-            </ol>
-        </fieldset>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-fr.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-fr.inc
deleted file mode 100644 (file)
index 333f5a7..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-<fieldset class="rows" id="memberentry_altaddress">
-    <legend id="alt_contact_lgd">Alternate contact</legend><ol>
-[% UNLESS noaltcontactsurname %]
-    <li>
-    [% IF ( mandatoryaltcontactsurname ) %]
-        <label for="altcontactsurname" class="required">
-    [% ELSE %]
-        <label for="altcontactsurname">
-    [% END %]
-    Surname:</label>
-    <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% patron.altcontactsurname | html %]" />
-    [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
-    </li>
-[% END %]
-[% UNLESS noaltcontactfirstname %]
-    <li>
-    [% IF ( mandatoryaltcontactfirstname ) %]
-        <label for="altcontactfirstname" class="required">
-    [% ELSE %]
-        <label for="altcontactfirstname">
-    [% END %]
-        First name:</label>
-        <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% patron.altcontactfirstname | html %]" />
-    [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
-    </li>
-[% END %]
-[% UNLESS noaltcontactaddress1 %]
-    <li>
-    [% IF ( mandatoryaltcontactaddress1 ) %]
-        <label for="altcontactaddress1" class="required">
-    [% ELSE %]
-        <label for="altcontactaddress1">
-    [% END %]
-    Address:</label>
-    <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% patron.altcontactaddress1 | html %]" size="40" />
-    [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
-    </li>
-[% END %]
-[% UNLESS noaltcontactaddress2 %]
-    <li>
-    [% IF ( mandatoryaltcontactaddress2 ) %]
-        <label for="altcontactaddress2" class="required">
-    [% ELSE %]
-        <label for="altcontactaddress2">
-    [% END %]
-    Address 2:</label>
-    <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% patron.altcontactaddress2 | html %]" size="40" />
-    [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
-    </li>
-[% END %]
-[% UNLESS noaltcontactzipcode %]
-    <li>
-    [% IF ( mandatoryaltcontactzipcode ) %]
-        <label for="altcontactzipcode" class="required">
-    [% ELSE %]
-        <label for="altcontactzipcode">
-    [% END %]
-    ZIP/Postal code:</label>
-    <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% patron.altcontactzipcode | html %]" size="5" />
-    [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
-    </li>
-[% END %]
-[% UNLESS noaltcontactaddress3 %]
-    <li>
-    [% IF ( mandatoryaltcontactaddress3 ) %]
-        <label for="altcontactcity" class="required">
-    [% ELSE %]
-        <label for="altcontactcity">
-    [% END %]
-    City:</label>
-    <input type="text" name="altcontactaddress3" id="altcontactcity" value="[% patron.altcontactaddress3 | html %]" size="20" />
-    [% IF cities.count %]or choose
-        <select class="select_city" data-addressfield="altcontact" name="select_city">
-            <option value="|||"></option>
-            [% FOREACH c IN cities %]
-                [% IF c.city_name == patron.altcontactaddress3 && c.city_state == patron.altcontactstate && c.city_zipcode == patron.altcontactzipcode %]
-                <option value="[% c.city_zipcode | html %]|[% c.city_name | html %]|[% c.city_state | html %]|[% c.city_country | html %]" selected="selected">
-                [% ELSE %]
-                <option value="[% c.city_zipcode | html %]|[% c.city_name | html %]|[% c.city_state | html %]|[% c.city_country | html %]">
-                [% END %]
-                    [% c.city_name | html %] [% c.city_state | html %] [% c.city_zipcode | html %]
-                </option>
-            [% END %]
-        </select>
-    [% END %]
-    [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
-    </li>
-[% END %]
-[% UNLESS noaltcontactstate %]
-    <li>
-    [% IF ( mandatoryaltcontactstate ) %]
-        <label for="altcontactstate" class="required">
-    [% ELSE %]
-        <label for="altcontactstate">
-    [% END %]
-    State:</label>
-    <input type="text" name="altcontactstate" id="altcontactstate" value="[% patron.altcontactstate | html %]" size="20" />
-    [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
-    </li>
-[% END %]
-[% UNLESS noaltcontactcountry %]
-    <li>
-    [% IF ( mandatoryaltcontactcountry ) %]
-        <label for="altcontactcountry" class="required">
-    [% ELSE %]
-        <label for="altcontactcountry">
-    [% END %]
-    Country:</label>
-    <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% patron.altcontactcountry | html %]" size="20" />
-    [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
-</li>
-[% END %]
-[% UNLESS noaltcontactphone %]
-    <li>
-    [% IF ( mandatoryaltcontactphone ) %]
-        <label for="altcontactphone" class="required">
-    [% ELSE %]
-        <label for="altcontactphone">
-    [% END %]
-    Phone:</label>
-    <input type="text" name="altcontactphone" id="altcontactphone" value="[% patron.altcontactphone | html %]" />
-    [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
-    </li>
-[% END %]
-</ol>
-</fieldset>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-us.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-us.inc
deleted file mode 100644 (file)
index 5191897..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-        <fieldset class="rows" id="memberentry_altaddress">
-            <legend id="alt_contact_lgd">Alternate contact</legend><ol>
-        [% UNLESS noaltcontactsurname %]
-            <li>
-                [% IF ( mandatoryaltcontactsurname ) %]
-                <label for="altcontactsurname" class="required">
-                [% ELSE %]
-                <label for="altcontactsurname">
-                [% END %]
-                Surname:</label>
-                    <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% patron.altcontactsurname | html %]" />
-                [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactfirstname %]
-            <li>
-                [% IF ( mandatoryaltcontactfirstname ) %]
-                <label for="altcontactfirstname" class="required">
-                [% ELSE %]
-                <label for="altcontactfirstname">
-                [% END %]
-                First name:</label>
-                    <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% patron.altcontactfirstname | html %]" />
-                [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactaddress1 %]
-            <li>
-                [% IF ( mandatoryaltcontactaddress1 ) %]
-                <label for="altcontactaddress1" class="required">
-                [% ELSE %]
-                <label for="altcontactaddress1">
-                [% END %]
-                Address:</label>
-                    <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% patron.altcontactaddress1 | html %]" size="40" />
-                [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactaddress2 %]
-            <li>
-                [% IF ( mandatoryaltcontactaddress2 ) %]
-                <label for="altcontactaddress2" class="required">
-                [% ELSE %]
-                <label for="altcontactaddress2">
-                [% END %]
-                Address 2:</label>
-                <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% patron.altcontactaddress2 | html %]" size="40" />
-                [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactaddress3 %]
-            <li>
-                [% IF ( mandatoryaltcontactaddress3 ) %]
-                <label for="altcontactcity" class="required">
-                [% ELSE %]
-                <label for="altcontactcity">
-                [% END %]
-                City:</label>
-                <input type="text" name="altcontactaddress3" id="altcontactcity" value="[% patron.altcontactaddress3 | html %]" size="20" />
-                [% IF cities.count %]or choose
-                    <select class="select_city" data-addressfield="altcontact" name="select_city">
-                        <option value="|||"></option>
-                        [% FOREACH c IN cities %]
-                            [% IF c.city_name == patron.altcontactaddress3 && c.city_state == patron.altcontactstate && c.city_zipcode == patron.altcontactzipcode %]
-                            <option value="[% c.city_zipcode | html %]|[% c.city_name | html %]|[% c.city_state | html %]|[% c.city_country | html %]" selected="selected">
-                            [% ELSE %]
-                            <option value="[% c.city_zipcode | html %]|[% c.city_name | html %]|[% c.city_state | html %]|[% c.city_country | html %]">
-                            [% END %]
-                                [% c.city_name | html %] [% c.city_state | html %] [% c.city_zipcode | html %]
-                            </option>
-                        [% END %]
-                    </select>
-                [% END %]
-                [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactstate %]
-            <li>
-                [% IF ( mandatoryaltcontactstate ) %]
-                <label for="altcontactstate" class="required">
-                [% ELSE %]
-                <label for="altcontactstate">
-                [% END %]
-                State:</label>
-                <input type="text" name="altcontactstate" id="altcontactstate" value="[% patron.altcontactstate | html %]" size="20" />
-                [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactzipcode %]
-            <li>
-                [% IF ( mandatoryaltcontactzipcode ) %]
-                <label for="altcontactzipcode" class="required">
-                [% ELSE %]
-                <label for="altcontactzipcode">
-                [% END %]
-                ZIP/Postal code:</label>
-                    <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% patron.altcontactzipcode | html %]" size="5" />
-                [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactcountry %]
-            <li>
-                [% IF ( mandatoryaltcontactcountry ) %]
-                <label for="altcontactcountry" class="required">
-                [% ELSE %]
-                <label for="altcontactcountry">
-                [% END %]
-                Country:</label>
-                    <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% patron.altcontactcountry | html %]" size="20" />
-                [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-        [% UNLESS noaltcontactphone %]
-            <li>
-                [% IF ( mandatoryaltcontactphone ) %]
-                <label for="altcontactphone" class="required">
-                [% ELSE %]
-                <label for="altcontactphone">
-                [% END %]
-                Phone:</label>
-                    <input type="text" name="altcontactphone" id="altcontactphone" value="[% patron.altcontactphone | html %]" />
-                [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
-            </li>
-        [% END %]
-            </ol>
-        </fieldset>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style.inc
new file mode 100644 (file)
index 0000000..875699a
--- /dev/null
@@ -0,0 +1,198 @@
+[% USE Koha %]
+[% BLOCK 'alt-contact-style' %]
+    <fieldset class="rows" id="memberentry_altaddress">
+        <legend id="alt_contact_lgd">Alternate contact</legend><ol>
+        <ol>
+            [% IF Koha.Preference( 'AddressFormat' ) %]
+                [% PROCESS "member-alt-contact-style-${ Koha.Preference( 'AddressFormat' ) }" %]
+            [% ELSE %]
+                [% PROCESS 'member-alt-contact-style-us' %]
+            [% END %]
+        </ol>
+    </fieldset>
+[% END %]
+
+[% BLOCK 'member-alt-contact-style-us' %]
+    [% PROCESS 'alt-contact-style_altcontactsurname' %]
+    [% PROCESS 'alt-contact-style_altcontactfirstname' %]
+    [% PROCESS 'alt-contact-style_altcontactaddress1' %]
+    [% PROCESS 'alt-contact-style_altcontactaddress2' %]
+    [% PROCESS 'alt-contact-style_altcontactaddress3' %]
+    [% PROCESS 'alt-contact-style_altcontactstate' %]
+    [% PROCESS 'alt-contact-style_altcontactzipcode' %]
+    [% PROCESS 'alt-contact-style_altcontactcountry' %]
+    [% PROCESS 'alt-contact-style_altcontactphone' %]
+[% END %]
+
+[% BLOCK 'member-alt-contact-style-de' %]
+    [% PROCESS 'alt-contact-style_altcontactsurname' %]
+    [% PROCESS 'alt-contact-style_altcontactfirstname' %]
+    [% PROCESS 'alt-contact-style_altcontactaddress1' %]
+    [% PROCESS 'alt-contact-style_altcontactaddress2' %]
+    [% PROCESS 'alt-contact-style_altcontactzipcode' %]
+    [% PROCESS 'alt-contact-style_altcontactaddress3' %]
+    [% PROCESS 'alt-contact-style_altcontactstate' %]
+    [% PROCESS 'alt-contact-style_altcontactcountry' %]
+    [% PROCESS 'alt-contact-style_altcontactphone' %]
+[% END %]
+
+[% BLOCK 'member-alt-contact-style-fr' %]
+    [% PROCESS 'alt-contact-style_altcontactsurname' %]
+    [% PROCESS 'alt-contact-style_altcontactfirstname' %]
+    [% PROCESS 'alt-contact-style_altcontactaddress1' %]
+    [% PROCESS 'alt-contact-style_altcontactaddress2' %]
+    [% PROCESS 'alt-contact-style_altcontactzipcode' %]
+    [% PROCESS 'alt-contact-style_altcontactaddress3' %]
+    [% PROCESS 'alt-contact-style_altcontactstate' %]
+    [% PROCESS 'alt-contact-style_altcontactcountry' %]
+    [% PROCESS 'alt-contact-style_altcontactphone' %]
+[% END %]
+
+[% BLOCK 'alt-contact-style_altcontactsurname' %]
+    [% UNLESS noaltcontactsurname %]
+        <li>
+            [% IF ( mandatoryaltcontactsurname ) %]
+                <label for="altcontactsurname" class="required">
+            [% ELSE %]
+                <label for="altcontactsurname">
+            [% END %]
+            Surname:</label>
+            <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% patron.altcontactsurname | html %]" />
+            [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
+        </li>
+    [% END %]
+[% END %]
+
+[% BLOCK 'alt-contact-style_altcontactfirstname' %]
+    [% UNLESS noaltcontactfirstname %]
+        <li>
+            [% IF ( mandatoryaltcontactfirstname ) %]
+                <label for="altcontactfirstname" class="required">
+            [% ELSE %]
+                <label for="altcontactfirstname">
+            [% END %]
+            First name:</label>
+            <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% patron.altcontactfirstname | html %]" />
+            [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
+        </li>
+    [% END %]
+[% END %]
+
+[% BLOCK 'alt-contact-style_altcontactaddress1' %]
+    [% UNLESS noaltcontactaddress1 %]
+        <li>
+            [% IF ( mandatoryaltcontactaddress1 ) %]
+                <label for="altcontactaddress1" class="required">
+            [% ELSE %]
+                <label for="altcontactaddress1">
+            [% END %]
+            Address:</label>
+            <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% patron.altcontactaddress1 | html %]" size="40" />
+            [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
+        </li>
+    [% END %]
+[% END %]
+
+[% BLOCK 'alt-contact-style_altcontactaddress2' %]
+    [% UNLESS noaltcontactaddress2 %]
+        <li>
+            [% IF ( mandatoryaltcontactaddress2 ) %]
+                <label for="altcontactaddress2" class="required">
+            [% ELSE %]
+                <label for="altcontactaddress2">
+            [% END %]
+            Address 2:</label>
+            <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% patron.altcontactaddress2 | html %]" size="40" />
+            [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
+        </li>
+    [% END %]
+[% END %]
+
+[% BLOCK 'alt-contact-style_altcontactzipcode' %]
+    [% UNLESS noaltcontactzipcode %]
+        <li>
+            [% IF ( mandatoryaltcontactzipcode ) %]
+                <label for="altcontactzipcode" class="required">
+            [% ELSE %]
+                <label for="altcontactzipcode">
+            [% END %]
+            ZIP/Postal code:</label>
+<input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% patron.altcontactzipcode | html %]" size="5" />
+            [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
+        </li>
+    [% END %]
+[% END %]
+
+[% BLOCK 'alt-contact-style_altcontactaddress3' %]
+    [% UNLESS noaltcontactaddress3 %]
+        <li>
+            [% IF ( mandatoryaltcontactaddress3 ) %]
+                <label for="altcontactaddress3" class="required">
+            [% ELSE %]
+                <label for="altcontactaddress3">
+            [% END %]
+            City:</label>
+            <input type="text" name="altcontactaddress3" id="altcontactcity" value="[% patron.altcontactaddress3 | html %]" size="20" />
+            [% IF cities.count %]or choose
+                <select class="select_city" data-addressfield="altcontact" name="select_city">
+                    <option value="|||"></option>
+                    [% FOREACH c IN cities %]
+                        [% IF c.city_name == patron.altcontactaddress3 && c.city_state == patron.altcontactstate && c.city_zipcode == patron.altcontactzipcode %]
+                        <option value="[% c.city_zipcode | html %]|[% c.city_name | html %]|[% c.city_state | html %]|[% c.city_country | html %]" selected="selected">
+                        [% ELSE %]
+                        <option value="[% c.city_zipcode | html %]|[% c.city_name | html %]|[% c.city_state | html %]|[% c.city_country | html %]">
+                        [% END %]
+                            [% c.city_name | html %] [% c.city_state | html %] [% c.city_zipcode | html %]
+                        </option>
+                    [% END %]
+                </select>
+            [% END %]
+            [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
+        </li>
+    [% END %]
+[% END %]
+
+[% BLOCK 'alt-contact-style_altcontactstate' %]
+    [% UNLESS noaltcontactstate %]
+        <li>
+            [% IF ( mandatoryaltcontactstate ) %]
+                <label for="altcontactstate" class="required">
+            [% ELSE %]
+                <label for="altcontactstate">
+            [% END %]
+            State:</label>
+            <input type="text" name="altcontactstate" id="altcontactstate" value="[% patron.altcontactstate | html %]" size="20" />
+            [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
+        </li>
+    [% END %]
+[% END %]
+
+[% BLOCK 'alt-contact-style_altcontactcountry' %]
+    [% UNLESS noaltcontactcountry %]
+        <li>
+            [% IF ( mandatoryaltcontactcountry ) %]
+                <label for="altcontactcountry" class="required">
+            [% ELSE %]
+                <label for="altcontactcountry">
+            [% END %]
+            Country:</label>
+            <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% patron.altcontactcountry | html %]" size="20" />
+            [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
+        </li>
+    [% END %]
+[% END %]
+
+[% BLOCK 'alt-contact-style_altcontactphone' %]
+    [% UNLESS noaltcontactphone %]
+        <li>
+            [% IF ( mandatoryaltcontactphone ) %]
+                <label for="altcontactphone" class="required">
+            [% ELSE %]
+                <label for="altcontactphone">
+            [% END %]
+            Phone:</label>
+            <input type="text" name="altcontactphone" id="altcontactphone" value="[% patron.altcontactphone | html %]" />
+            [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
+        </li>
+    [% END %]
+[% END %]
index f42aeff..5fd8cfc 100644 (file)
@@ -6,6 +6,7 @@
 [% USE KohaDates %]
 [% USE Branches %]
 [% PROCESS 'member-alt-address-style.inc' %]
+[% PROCESS 'member-alt-contact-style.inc' %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
     <title>Koha &rsaquo; Patrons &rsaquo;
@@ -746,11 +747,7 @@ legend:hover {
 
                             [% IF ( step_2 ) %]
                                 [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
-                                    [% IF Koha.Preference( 'AddressFormat' ) %]
-                                        [% INCLUDE "member-alt-contact-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
-                                    [% ELSE %]
-                                        [% INCLUDE 'member-alt-contact-style-us.inc' %]
-                                    [% END %]
+                                    [% PROCESS 'alt-contact-style' %]
                                 [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
                             [% END # /IF ( step_2 ) %]