Bug 9021 - Add SMS via email as an alternative to SMS services via SMS::Send drivers
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / memberentrygen.tt
index 8ce985e..616c2c6 100644 (file)
@@ -14,7 +14,7 @@
             $("#contactname, #contactfirstname")
                 .each(function () { this.type = 'text' })
                 .parent().find('span').remove();
-            $("#guarantorsearch").val("Set to Patron");
+            $("#guarantorsearch").val(_("Set to patron"));
         });
         $("#select_city").change(function(){
             var myRegEx=new RegExp(/(.*)\|(.*)\|(.*)\|(.*)/);
                 update_category_code( category_code );
             }
         [% END %]
-        $("#dateofbirth").datepicker({ maxDate: "-1D" });
+        $("#dateofbirth").datepicker({ maxDate: "-1D", yearRange: "c-120:" });
         $("#entryform").validate({
+            rules: {
+                email: {
+                    email: true
+                },
+                emailpro: {
+                    email: true
+                },
+                B_email: {
+                    email: true
+                }
+            },
             submitHandler: function(form) {
                 $("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting');
                 if (form.beenSubmitted)
         $(mytables).find(" li[data-category_code='']").show();
     }
 
+    function select_user(borrowernumber, borrower) {
+        var form = $('#entryform').get(0);
+        if (form.guarantorid.value) {
+            $("#contact-details").find('a').remove();
+            $("#contactname, #contactfirstname").parent().find('span').remove();
+        }
+
+        var id = borrower.borrowernumber;
+        form.guarantorid.value = id;
+        $('#contact-details')
+            .show()
+            .find('span')
+            .after('<a target="blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + id + '">' + id + '</a>');
+
+        $(form.contactname)
+            .val(borrower.surname)
+            .before('<span>' + borrower.surname + '</span>').get(0).type = 'hidden';
+        $(form.contactfirstname)
+            .val(borrower.firstname)
+            .before('<span>' + borrower.firstname + '</span>').get(0).type = 'hidden';
+
+        form.streetnumber.value = borrower.streetnumber;
+        form.address.value = borrower.address;
+        form.address2.value = borrower.address2;
+        form.city.value = borrower.city;
+        form.state.value = borrower.state;
+        form.zipcode.value = borrower.zipcode;
+        form.country.value = borrower.country;
+        form.branchcode.value = borrower.branchcode;
+
+        form.guarantorsearch.value = _("Change");
+
+        return 0;
+    }
+
+
+
         var MSG_SEPARATOR = _("Separator must be / in field %s");
         var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
         var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s");
         var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
         var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
         var MSG_PASSWORD_MISMATCH = _("The passwords entered do not match");
+        var MSG_PASSWORD_CONTAINS_TRAILING_SPACES = _("Password contains leading and/or trailing spaces.");
 //]]>
 </script>
 <script type="text/javascript" src="[% themelang %]/js/members.js"></script>
     [% END %]
 
        [% IF ( no_add ) %]<div class="dialog alert"><h3>Cannot add patron</h3>
-               [% IF ( no_branches ) %]<p>There are <strong>no libraries defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/branches.pl">add a library</a>.[% ELSE %]An administrator must define at least one library.[% END %]</p>[% END %]
-               [% IF ( no_categories ) %]<p>There are <strong>no patron categories defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/categorie.pl">add a patron category</a>.[% ELSE %]An administrator must define at least one patron category.</p>[% END %][% END %]</div>[% END %]
+            [% IF ( no_branches ) %]<p><strong>There are no libraries defined.</strong> [% IF ( CAN_user_parameters ) %]<a href="/cgi-bin/koha/admin/branches.pl">Please add a library.</a>[% ELSE %]An administrator must define at least one library.[% END %]</p>[% END %]
+            [% IF ( no_categories ) %]<p><strong>There are no patron categories defined.</strong> [% IF ( CAN_user_parameters ) %]<a href="/cgi-bin/koha/admin/categories.pl">Please add a patron category.</a>[% ELSE %]An administrator must define at least one patron category.</p>[% END %][% END %]</div>[% END %]
 
        [% UNLESS ( no_add ) %]
     <h1>[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</h1>
                        <div class="dialog alert">
                                <h3>Duplicate patron record?</h3>
                                <p><a class="popup" href="javascript:Dopop('moremember.pl?print=brief&amp;borrowernumber=[% check_member %]');" >View existing record</a></p>
-                               <form action="/cgi-bin/koha/members/memberentry.pl" method="get"><input type="hidden" name="op" value="modify" /><input type="hidden" name="borrowernumber" value="[% check_member %]" /><input type="hidden" name="category_type" value="[% check_categorytype %]" /><input class="edit" type="submit" value="It is a duplicate. Edit existing record" /></form>
+                <form action="/cgi-bin/koha/members/memberentry.pl" method="get">
+                    <input type="hidden" name="op" value="modify" />
+                    <input type="hidden" name="borrowernumber" value="[% check_member %]" />
+                    <input class="edit" type="submit" value="It is a duplicate. Edit existing record" />
+                </form>
 
                 <form name="form_double" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
                                <input type="hidden" name="nodouble" value="1" />
             [% IF ( ERROR_extended_unique_id_failed ) %]
                 <li id="ERROR_extended_unique_id_failed"><strong>[% ERROR_extended_unique_id_failed_description %]</strong> attribute value <i>[% ERROR_extended_unique_id_failed_value %]</i> is already in use by another patron record.</li>
                        [% END %]
+            [% IF ERROR_bad_email %]
+                <li id="ERROR_bad_email">The primary email is invalid.</li>
+            [% END %]
+            [% IF ERROR_bad_email_secondary %]
+                <li id="ERROR_bad_email_secondary">The secondary email is invalid.</li>
+            [% END %]
+            [% IF ERROR_bad_email_alternative %]
+                <li id="ERROR_bad_email_alternative">The alternative email is invalid.</li>
+            [% END %]
                        </ul>
                </div>
        [% END %]
                     <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
                 [% END %]
                 [% IF ( none ) %]
-                    <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value=""  checked="checked"  />
+                    <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value=""  checked="checked"  />
                 [% ELSE %]
-                    <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" />
+                    <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" />
                 [% END %]
             [% ELSE %]
                 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
                 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
-                <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
+                <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
             [% END %]
 
                </li>
         <li>
             <span class="label">&nbsp;</span>
             [% IF ( guarantorid ) %]
-            <input id="guarantorsearch" type="button" value="Change" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
+            <input id="guarantorsearch" type="button" value="Change" onclick="Dopopguarantor('guarantor_search.pl');" />
             [% ELSE %]
-            <input id="guarantorsearch" type="button" value="Set to patron" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
+            <input id="guarantorsearch" type="button" value="Set to patron" onclick="Dopopguarantor('guarantor_search.pl');" />
             [% END %]
             <input id="guarantordelete" type="button" value="Delete" />
         </li>
+    [% IF guarantorid && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
+        <li>
+            <label for="privacy_guarantor_checkouts">Show checkouts to guarantor</label>
+            <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
+                [% IF privacy_guarantor_checkouts %]
+                    <option value="0">No</option>
+                    <option value="1" selected>Yes</option>
+                [% ELSE %]
+                    <option value="0" selected>No</option>
+                    <option value="1">Yes</option>
+                [% END %]
+            </select>
+            <div class="hint">Allow guarantor of this patron to view this patron's checkouts from the OPAC</div>
+        </li>
+    [% END %]
         </ol>
     </fieldset>
 
 [% END %]
 [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
-<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.selected %]
-            <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 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 ( city_cgipopup ) %]or <strong>choose</strong>
-        <select id="select_city" name="select_city">
-        [% FOREACH city_loo IN city_loop %]
-            [% IF ( city_loo.selected ) %]
-            <option value="[% city_loo.city_zipcode %]|[% city_loo.city_name %]|[% city_loo.city_state %]|[% city_loo.city_country %]" selected="selected">
-            [% ELSE %]
-            <option value="[% city_loo.city_zipcode %]|[% city_loo.city_name %]|[% city_loo.city_state %]|[% city_loo.city_country %]">
-            [% END %]
-                [% city_loo.city_name %] [% city_loo.city_state %] [% city_loo.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 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 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>
+    [% IF Koha.Preference( 'AddressFormat' ) %]
+        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
+    [% ELSE %]
+        [% INCLUDE 'member-main-address-style-us.inc' %]
+    [% END %]
 [% END # nostreet && nocity etc group%]
 
 [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
       [% ELSE %]
       <label for="mobile">
       [% END %]
-      Mobile phone: </label>
+      Other phone: </label>
         <input type="text" id="mobile" name="mobile" value="[% mobile %]" />
          [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %]
     </li>
 [% IF ( step_6 ) %]
 
     [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
-               <fieldset class="rows" id="memberentry_address">
-               <legend id="alt_address_lgd">Alternate address</legend><ol>
-        [% 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_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_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_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">
+        [% IF Koha.Preference( 'AddressFormat' ) %]
+            [% INCLUDE "member-alt-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
         [% 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>
+            [% INCLUDE 'member-alt-address-style-us.inc' %]
         [% END %]
-                       </ol>
-               </fieldset>
     [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
 [% END %]
 [% IF ( step_2 ) %]
     [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
-               <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 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 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 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>
+        [% IF Koha.Preference( 'AddressFormat' ) %]
+            [% INCLUDE "member-alt-contact-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
+        [% ELSE %]
+            [% INCLUDE 'member-alt-contact-style-us.inc' %]
         [% END %]
-            </ol>
-        </fieldset>
     [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
 
 [% END %]
        [% END %]
 [% END %]
 
+[%# Dummy input to avoid Firefox from using userid/password saved for authentication %]
+<input type="text" disabled="disabled" style="display:none" />
+
          [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
                </li>
         [%END %]
               <fieldset class="rows">
                 <legend>Patron restrictions</legend>
 
-                [% IF ( debarments.size < 1 ) %]
-                    <p>Patron is currently unrestricted.</p>
-                [% ELSE %]
+                [% IF ( debarments ) %]
                     <table>
                         <thead>
                             <tr>
                             [% END %]
                         </tbody>
                     </table>
+                [% ELSE %]
+                    <p>Patron is currently unrestricted.</p>
                 [% END %]
+
                 [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
                     <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
                     <fieldset id="manual_restriction_form">
     </script>
     [% END %]
     <input type="hidden" name="setting_messaging_prefs" value="1" />
-    [% IF type_only %]
-        <p>If no preferences are selected, the default preferences for the category chosen will be applied on save, otherwise your selection here is saved</p>
-    [% END %]
     [% INCLUDE 'messaging-preference-form.inc' %]
     [% IF ( SMSSendDriver ) %]
         <p><label for="SMSnumber">SMS number:</label>
             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
         </p>
+        <p>
+            <label for="sms_provider_id">SMS provider:</label>
+            <select id="sms_provider_id" name="sms_provider_id"/>
+                <option value="">Unknown</option>
+                [% FOREACH s IN sms_providers %]
+                    [% IF s.id == sms_provider_id %]
+                        <option value="[% s.id %]" selected="selected">[% s.name %]</option>
+                    [% ELSE %]
+                        <option value="[% s.id %]">[% s.name %]</option>
+                    [% END %]
+                [% END %]
+            </select>
+        </p>
     [% END %]
   </fieldset>
 [% END %] [% END %]