Bug 18110: Add a field FR to the syspref AddressFormat
authorBaptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Mon, 27 Feb 2017 09:32:24 +0000 (09:32 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 28 Apr 2017 12:50:19 +0000 (08:50 -0400)
Add a field FR to the syspref AddressFormat

Testplan
1 - Apply patch
2 - Check if there is a field FR in the syspref AddressFormat, enable it
3 - Create a new borrower and check the order of the fields for the address
4 - Check if it's address appears in a propper manner

27/02/17 : Fixed the display

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-fr.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-fr.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-fr.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-fr.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-fr.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref

index ef52c81..1ec1dc4 100644 (file)
@@ -6,7 +6,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
 ('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
 ('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
-('AddressFormat','us','','Choose format to display postal addresses', 'Choice'),
+('AddressFormat','us','us | de | fr','Choose format to display postal addresses', 'Choice'),
 ('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'),
 ('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option.  Example: eng|fre|ita','Textarea'),
 ('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'),
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-fr.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-fr.inc
new file mode 100644 (file)
index 0000000..9c000fa
--- /dev/null
@@ -0,0 +1,148 @@
+<fieldset class="rows" id="memberentry_address">
+<legend id="alt_address_lgd">Alternate address</legend><ol>
+
+[% UNLESS noB_streetnumber %]
+    <li>
+    [% IF ( mandatoryB_streetnumber ) %]
+         <label for="B_streetnumber" class="required">
+    [% ELSE %]
+         <label for="B_streetnumber">
+    [% END %]
+    Street Number: </label>
+    <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% B_streetnumber %]" />
+    [% IF ( mandatoryB_streetnumber ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+
+[% IF roadtypes %]
+    <li>
+    [% IF ( mandatoryB_streettype ) %]
+         <label for="B_streettype" class="required">
+    [% ELSE %]
+         <label for="B_streettype">
+    [% END %]
+    Street type: </label>
+    <select name="B_streettype">
+    <option value=""></option>
+    [% FOR roadtype IN roadtypes %]
+        [% IF roadtype.authorised_value == B_streettype %]
+            <option value="[% roadtype.authorised_value %]" selected="selected">[% roadtype.lib %]</option>
+        [% ELSE %]
+            <option value="[% roadtype.authorised_value %]">[% roadtype.lib %]</option>
+        [% END %]
+    [% END %]
+    </select>
+    [% IF ( mandatoryB_streettype ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+
+[% UNLESS noB_address %]
+    <li>
+    [% IF ( mandatoryB_address ) %]
+        <label for="B_address" class="required">
+    [% ELSE %]
+        <label for="B_address">
+    [% END %]
+        Address: </label>
+        <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" />
+    [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %]
+        </li>
+[% END %]
+
+[% UNLESS noB_address2 %]
+    <li>
+    [% IF ( mandatoryB_address2 ) %]
+        <label for="B_address2" class="required">
+    [% ELSE %]
+        <label for="B_address2">
+    [% END %]
+    Address 2: </label>
+    <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" />
+    [% IF ( mandatoryB_address2 ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+[% UNLESS noB_zipcode %]
+    <li>
+    [% IF ( mandatoryB_zipcode ) %]
+        <label for="B_zipcode" class="required">
+    [% ELSE %]
+        <label for="B_zipcode">
+    [% END %]
+    ZIP/Postal code: </label>
+    <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" />
+    [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+[% UNLESS noB_city %]
+    <li>
+    [% IF ( mandatoryB_city ) %]
+        <label for="B_city" class="required" >
+    [% ELSE %]
+        <label for="B_city">
+    [% END %]
+    City: </label>
+    <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" />
+    [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+[% UNLESS noB_state %]
+    <li>
+    [% IF ( mandatoryB_state ) %]
+        <label for="B_state" class="required" >
+    [% ELSE %]
+        <label for="B_state">
+    [% END %]
+        State: </label>
+        <input type="text" id="B_state" name="B_state" size="20" value="[% B_state %]" />
+    [% IF ( mandatoryB_state ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+[% UNLESS noB_country %]
+    <li>
+    [% IF ( mandatoryB_country ) %]
+        <label for="B_country" class="required">
+    [% ELSE %]
+        <label for="B_country">
+    [% END %]
+        Country: </label>
+        <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" />
+    [% IF ( mandatoryB_country ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+[% UNLESS noB_phone %]
+   <li>
+   [% IF ( mandatoryB_phone ) %]
+       <label for="B_phone" class="required">
+   [% ELSE %]
+       <label for="B_phone">
+   [% END %]
+   Phone: </label>
+   <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" />
+   [% IF ( mandatoryB_phone ) %]<span class="required">Required</span>[% END %]
+   </li>
+[% END %]
+[% UNLESS noB_email %]
+   <li>
+   [% IF ( mandatoryB_email ) %]
+       <label for="B_email" class="required">
+   [% ELSE %]
+       <label for="B_email">
+   [% END %]
+       Email: </label>
+       <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" />
+   [% IF ( mandatoryB_email ) %]<span class="required">Required</span>[% END %] </li>
+[% END %]
+[% UNLESS nocontactnote %]
+    <li>
+    [% IF ( mandatorycontactnote ) %]
+        <label for="contactnote" class="required">
+    [% ELSE %]
+        <label for="contactnote">
+    [% END %]
+        Contact note: </label>
+        <textarea id="contactnote" name="contactnote" cols="40" rows="2">[% contactnote %]</textarea>
+    [% IF ( mandatorycontactnote ) %]<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
new file mode 100644 (file)
index 0000000..ad3d4cd
--- /dev/null
@@ -0,0 +1,112 @@
+<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="[% altcontactsurname %]" />
+    [% 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="[% altcontactfirstname %]" />
+    [% 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="[% altcontactaddress1 %]" 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="[% altcontactaddress2 %]" 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="[% altcontactzipcode %]" 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="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" />
+    [% 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="[% altcontactstate %]" 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="[% altcontactcountry %]" 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="[% altcontactphone %]" />
+    [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+</ol>
+</fieldset>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-fr.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-fr.inc
new file mode 100644 (file)
index 0000000..5d4f197
--- /dev/null
@@ -0,0 +1,21 @@
+[% IF ( address or address2 ) %]
+    [% IF ( address ) %]
+        [% SET roadtype_desc = '' %]
+        [% IF streettype %]
+            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', streettype) %]
+        [% END %]
+        <li>
+        [% IF streetnumber %] [% streetnumber %][% END %]
+        [%IF roadtype_desc %] [% roadtype_desc %][% END %]
+        </li>
+            <li class="patronaddress1">[% address %]
+            </li>
+    [% END %]
+    [% IF ( address2 ) %]
+        <li class="patronaddress2">[% address2 %]</li>
+    [% END %]
+[% END %]
+[% IF ( city ) %]<li class="patroncity">
+    [%IF (zipcode ) %][% zipcode %] [% END %][% city %][% IF ( state ) %]</br>[% state %][% END %]
+    [% IF ( country ) %]<br />[% country %][% END %]</li>
+[% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-fr.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-fr.inc
new file mode 100644 (file)
index 0000000..fa98ba4
--- /dev/null
@@ -0,0 +1,21 @@
+[% IF ( B_address or B_address2 ) %]
+    [% IF ( B_address ) %]
+        [% SET roadtype_desc = '' %]
+        [% IF B_streetnumber %] [% B_streetnumber %][% END %]
+        [% IF B_streettype %]
+            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', B_streettype) %]
+        [% END %]
+        <li class="patronaddress1">[% B_address %]
+        [%IF roadtype_desc %] [% roadtype_desc %][% END %]
+        </li>
+    [% END %]
+    [% IF ( B_address2 ) %]
+        <li class="patronaddress2">[% B_address2 %]</li>
+    [% END %]
+[% END %]
+[% IF ( B_city ) %]<li class="patroncity">
+    [%IF ( B_zipcode ) %][% B_zipcode %] [% END %]
+    [% B_city %]
+    [% IF ( B_state ) %]</br>[% B_state %][% END %]
+    [% IF ( B_country ) %]<br />[% B_country %][% END %]</li>
+[% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-fr.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-fr.inc
new file mode 100644 (file)
index 0000000..e666ef9
--- /dev/null
@@ -0,0 +1,125 @@
+<fieldset class="rows" id="memberentry_mainaddress">
+    <legend id="main_address_lgd">Main address</legend><ol>
+[% UNLESS nostreetnumber %]
+    <li>
+    [% IF ( mandatorystreetnumber ) %]
+        <label for="streetnumber" class="required">
+    [% ELSE %]
+        <label for="streetnumber">
+    [% END %]
+        Street number: </label>
+        <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" />
+    [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+[% UNLESS nostreettype %]
+    [% IF roadtypes %]
+        <li>
+        [% IF ( mandatorystreettype ) %]
+            <label for="streettype" class="required">
+        [% ELSE %]
+            <label for="streettype">
+        [% END %]
+        Street type: </label>
+        <select name="streettype">
+           <option value=""></option>
+        [% FOR roadtype IN roadtypes %]
+            [% IF roadtype.authorised_value == streettype %]
+                <option value="[% roadtype.authorised_value %]" selected="selected">[% roadtype.lib %]</option>
+            [% ELSE %]
+                <option value="[% roadtype.authorised_value %]">[% roadtype.lib %]</option>
+            [% END %]
+        [% END %]
+        </select>
+        [% IF ( mandatorystreettype ) %]<span class="required">Required</span>[% END %]
+        </li>
+    [% END %]
+[% END %]
+[% UNLESS noaddress %]
+    <li>
+    [% IF ( mandatoryaddress ) %]
+        <label for="address" class="required">
+    [% ELSE %]
+        <label for="address">
+    [% END %]
+    Address: </label>
+        <input type="text" id="address" name="address" size="35" value="[% address %]" />
+    [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %]
+      </li>
+[% END %]
+[% UNLESS noaddress2 %]
+    <li>
+    [% IF ( mandatoryaddress2 ) %]
+        <label for="address2" class="required">
+    [% ELSE %]
+        <label for="address2">
+    [% END %]
+        Address 2: </label>
+        <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" />
+    [% IF ( mandatoryaddress2 ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+[% UNLESS nozipcode %]
+    <li>
+    [% IF ( mandatoryzipcode ) %]
+        <label for="zipcode" class="required">
+    [% ELSE %]
+        <label for="zipcode">
+    [% END %]
+    ZIP/Postal code: </label>
+    <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" />
+    [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+[% UNLESS nocity %]
+    <li>
+    [% IF ( mandatorycity ) %]
+    <label for="city" class="required">
+    [% ELSE %]
+        <label for="city">
+    [% END %]
+    City: </label>
+    <input type="text" id="city" name="city" size="20" value="[% city %]" />
+    [% IF cities.count %]or choose
+        <select id="select_city" name="select_city">
+            <option value="|||"></option>
+        [% FOREACH c IN cities %]
+            [% IF c.city_name == city %]
+                <option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]" selected="selected">
+            [% ELSE %]
+                 <option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]">
+            [% END %]
+                [% c.city_name %] [% c.city_state %] [% c.city_zipcode %]
+            </option>
+        [% END %]
+        </select>
+    [% END %]
+    [% IF ( mandatorycity ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+[% UNLESS nostate %]
+    <li>
+    [% IF ( mandatorystate ) %]
+        <label for="state" class="required">
+    [% ELSE %]
+        <label for="state">
+    [% END %]
+        State: </label>
+        <input type="text" name="state" id="state" size="20" value="[% state %]" />
+    [% IF ( mandatorystate ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+[% UNLESS nocountry %]
+    <li>
+    [% IF ( mandatorycountry ) %]
+        <label for="country" class="required">
+    [% ELSE %]
+      <label for="country">
+    [% END %]
+    Country: </label>
+      <input type="text" name="country" id="country" size="20" value="[% country %]" />
+    [% IF ( mandatorycountry ) %]<span class="required">Required</span>[% END %]
+    </li>
+[% END %]
+</ol>
+</fieldset>
index 6f7e60a..0741d3b 100644 (file)
@@ -58,3 +58,4 @@ I18N/L10N:
           choices:
               us: US style ([Street number], [Address] - [City], [ZIP/Postal Code], [Country])
               de: German style ([Address] [Street number] - [ZIP/Postal Code] [City] - [Country])
+              fr: French style ([Street number] [Address] - [ZIP/Postal Code] [City] - [Country])