Adds helpful note to Home Phone and Home Email fields to remind staff which fields...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / memberentrygen.tmpl
index 2d5630c..f0b90a5 100644 (file)
@@ -1,27 +1,54 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Patrons &rsaquo; 
-<!-- TMPL_IF NAME="opadd" -->  Add<!--TMPL_IF Name="I"--> Organisation <!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult <!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child <!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional <!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff <!--/TMPL_IF -->
-patron <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR name="firstname" --><!-- TMPL_ELSE -->Modify<!--TMPL_IF Name="I"--> Organisation <!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult <!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child <!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional <!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff<!--/TMPL_IF -->
-patron <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR name="firstname" --><!-- /TMPL_IF --></title>
+<!-- TMPL_IF NAME="opadd" -->  Add<!-- TMPL_ELSE --> Modify<!--/TMPL_IF--> <!--TMPL_IF Name="categoryname"--> <!--TMPL_VAR Name="categoryname"--> patron<!-- TMPL_ELSE --><!--TMPL_IF Name="I"--> Organization patron<!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult patron<!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child patron<!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional patron<!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff patron<!--/TMPL_IF --><!--/TMPL_IF --><!--TMPL_UNLESS Name="opadd"--> <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR name="firstname" --><!--/TMPL_UNLESS--></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/members.js"></script>
 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
 <script type="text/JavaScript" language="JavaScript">
 //<![CDATA[
-        $(document).ready(function() {
-               $("#guarantordelete").click(function() {
-                       $("#guarantorid").attr("value","");
-                       $("#contactname").attr("value","");
-                       $("#contactfirstname").attr("value","");
-                       $("#guarantorsearch").attr("value","Find guarantor");
-               });
-                       $("#select_city").change(function(){
-                               var myRegEx=new RegExp(/(.*)\|(.*)/);
-                       document.form.select_city.value.match(myRegEx);
-                       document.form.zipcode.value=RegExp.$1;
-                       document.form.city.value=RegExp.$2;                                     
-               });
-        });
+    $(document).ready(function() {
+               $("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
+        $("#guarantordelete").click(function() {
+            $("#contact-details").hide().find('a').remove();
+            $("#guarantorid, #contactname, #contactfirstname").each(function () { this.value = "" });
+            $("#contactname, #contactfirstname")
+                .each(function () { this.type = 'text' })
+                .parent().find('span').remove();
+            $("#guarantorsearch").val("Set to Patron");
+        });
+        $("#select_city").change(function(){
+            var myRegEx=new RegExp(/(.*)\|(.*)/);
+            document.form.select_city.value.match(myRegEx);
+            document.form.zipcode.value=RegExp.$1;
+            document.form.city.value=RegExp.$2;
+        });
+    });
+
+    function clear_entry(node) {
+        var original = node.parentNode.parentNode;
+        $("input", original).attr('value', '');
+        $("select", original).attr('value', '');
+    }
+
+    function clone_entry(node) {
+        var original = node.parentNode.parentNode;
+        var clone = original.cloneNode(true);
+        var newId = 50 + parseInt(Math.random() * 100000);
+        $("input", clone).attr('id', function() {
+            return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
+        });
+        $("input", clone).attr('name', function() {
+            return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
+        });
+        $("select", clone).attr('id', function() {
+            return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
+        });
+        $("select", clone).attr('name', function() {
+            return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
+        });
+        original.parentNode.insertBefore(clone, original.nextSibling);
+    }
+
 //]]>
 </script>
 </head>
@@ -31,13 +58,13 @@ patron <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR name="firstname" --><!--
 
 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; 
 <!-- TMPL_IF NAME="opadd" -->
-               Add<!--TMPL_IF Name="I"--> Organisation <!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult <!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child <!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional <!--/TMPL_IF --> <!--TMPL_IF Name="S"-->Staff <!--/TMPL_IF -->
-patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" -->
+               Add<!--TMPL_IF Name="categoryname"--> <!--TMPL_VAR Name="categoryname"--> patron<!-- TMPL_ELSE --><!--TMPL_IF Name="I"--> Organization patron<!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult patron<!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child patron<!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional patron<!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff patron<!--/TMPL_IF --><!--/TMPL_IF -->
+<!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" -->
 <!-- TMPL_ELSE --> 
-<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" --></a> &rsaquo; <strong>Modify<!--TMPL_IF Name="I"--> Organisation <!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult <!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child <!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional <!--/TMPL_IF --><!--TMPL_IF Name="S"-->Staff <!--/TMPL_IF -->
-patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /TMPL_IF --></strong></div>
+<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" --></a> &rsaquo; <strong>Modify<!--TMPL_IF Name="categoryname"--> <!--TMPL_VAR Name="categoryname"--> patron<!-- TMPL_ELSE --><!--TMPL_IF Name="I"--> Organization patron<!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult patron<!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child patron<!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional patron<!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff patron<!--/TMPL_IF --><!--/TMPL_IF -->
+</strong><!-- /TMPL_IF --></div>
 
-<div id="doc3" class="yui-t2">
+<!-- TMPL_IF NAME="opadd" --><div id="doc" class="yui-t7"><!-- TMPL_ELSE --><div id="doc3" class="yui-t2"><!-- /TMPL_IF -->
    
    <div id="bd">
        <div id="yui-main">
@@ -46,12 +73,11 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
 
        <!-- TMPL_IF NAME="opadd" -->
        <h1>
-               <!--TMPL_IF Name="I"--> Add organisation patron <!--/TMPL_IF --><!--TMPL_IF Name="A"--> Add adult patron <!--/TMPL_IF --><!--TMPL_IF Name="C"--> Add child patron <!--/TMPL_IF --><!--TMPL_IF Name="P"--> Add professional patron <!--/TMPL_IF --><!--TMPL_IF Name="S"--> Add staff patron <!--/TMPL_IF -->
-<!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" --> 
+               Add<!--TMPL_IF Name="categoryname"--> <!--TMPL_VAR Name="categoryname"--> patron<!-- TMPL_ELSE --><!--TMPL_IF Name="I"--> Organization patron<!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult patron<!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child patron<!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional patron<!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff patron<!--/TMPL_IF --><!--/TMPL_IF --> <!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" --> 
        </h1>
        <!-- TMPL_ELSE -->
-       <h1 >
-               <!--TMPL_IF Name="I"--> Modify organisation patron <!--/TMPL_IF --><!--TMPL_IF Name="A"--> Modify adult patron <!--/TMPL_IF --><!--TMPL_IF Name="C"--> Modify child patron <!--/TMPL_IF --><!--TMPL_IF Name="P"--> Modify professional patron <!--/TMPL_IF --><!--TMPL_IF Name="S"--> Modify staff patron <!--/TMPL_IF -->
+       <h1>
+               Modify<!--TMPL_IF Name="categoryname"--> <!--TMPL_VAR Name="categoryname"--> patron<!-- TMPL_ELSE --><!--TMPL_IF Name="I"--> Organization patron<!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult patron<!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child patron<!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional patron<!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff patron<!--/TMPL_IF --><!--/TMPL_IF -->
 <!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" --> 
        </h1>
        <!-- /TMPL_IF -->
@@ -59,11 +85,11 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
        <!-- TMPL_IF NAME="check_member" -->
                <p>
                <form name="form_double" action="/cgi-bin/koha/members/memberentry.pl" method="post">
-                       <div id="problem">
-                               Duplicate suspected
+                       <div class="dialog alert">
+                               <h3>Duplicate suspected</h3>
                                <a href="javascript:Dopop('borrowers_details.pl?borrowernumber=<!--TMPL_VAR NAME="check_member"-->');" >Detail</a>
                                Duplicate ?
-                               <a href="/cgi-bin/koha/members/memberentry.pl?borrowernumber=<!--TMPL_VAR NAME="check_member"-->&amp;category_type=<!--TMPL_VAR NAME="check_categorytype"-->">Yes</a> 
+                               <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;borrowernumber=<!--TMPL_VAR NAME="check_member"-->&amp;category_type=<!--TMPL_VAR NAME="check_categorytype"-->">Yes</a>
                                &nbsp;&nbsp;&nbsp; No, it is not
                                <!-- TMPL_IF NAME="checked"-->
                                        <input type="checkbox" checked="checked" name="answernodouble" >
@@ -74,28 +100,28 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                </form>
                </p>
        <!--/TMPL_IF-->
-               
+
        <!-- TMPL_IF Name="debug" -->
                <div id="debug">
                                <div>Debug is on (level <!-- TMPL_VAR NAME="debug" -->)</div>
                </div>
        <!-- /TMPL_IF -->
        <!-- TMPL_IF Name="nok" -->
-               <div id="problem">
+               <div class="dialog alert">
                        <p>The following fields are wrong. Please fix them.</p>
                        <ul>
                        <!-- TMPL_IF NAME="ERROR_login_exist" -->
-                               <li id="ERROR_login_exist">login/password already exists.</li>
+                               <li id="ERROR_login_exist">Login/password already exists.</li>
                        <!-- /TMPL_IF -->
                        <!-- TMPL_IF NAME="ERROR_cardnumber" -->
                                <li id="ERROR_cardnumber">Cardnumber already in use.</li>
                        <!-- /TMPL_IF -->
                        <!-- TMPL_IF NAME="ERROR_age_limitations" -->
-                               <li id="ERROR_age_limitations">Patron is too young or too old for their category.  
+                               <li id="ERROR_age_limitations">Patron's age is incorrect for their category.  
                                        Ages allowed are <!-- TMPL_VAR NAME="ERROR_age_limitations"-->.</li>
                        <!-- /TMPL_IF -->
                        <!-- TMPL_IF NAME="ERROR_branch" -->
-                               <li id="ERROR_branch">Branch selected not allowed.</li>
+                               <li id="ERROR_branch">Library is invalid.</li>
                        <!-- /TMPL_IF -->   
                        <!-- TMPL_IF NAME="ERROR_dateofbirth" -->
                                <li id="ERROR_dateofbirth">Date of birth is invalid.</li>
@@ -106,17 +132,23 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                        <!-- TMPL_IF NAME="ERROR_dateexpiry" -->
                                <li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
                        <!-- /TMPL_IF -->
+                       <!-- TMPL_IF NAME="ERROR_short_password" -->
+                               <li id="ERROR_short_password">Password must be at least <!-- TMPL_VAR NAME="minPasswordLength" --> characters long.</li>
+                       <!-- /TMPL_IF -->
+            <!-- TMPL_IF NAME="ERROR_extended_unique_id_failed" -->
+                <li id="ERROR_extended_unique_id_failed">The attribute value 
+                    <!-- TMPL_VAR NAME="ERROR_extended_unique_id_failed" --> is already is use by another patron record.</li>
+                       <!-- /TMPL_IF -->
                        </ul>
                </div>
        <!-- /TMPL_IF -->
        
   
-<form name="form"  action="/cgi-bin/koha/members/memberentry.pl" method="post"> 
+<form name="form" id="entryform"  action="/cgi-bin/koha/members/memberentry.pl" method="post"> 
 <!--    field always hidden in different form (1,2,3) -->
 <input type="hidden" name="BorrowerMandatoryField" value="<!--TMPL_VAR NAME="BorrowerMandatoryField"-->" />
 <input type="hidden" name="category_type" value="<!-- TMPL_VAR name="category_type" -->" />
 <input type="hidden" name="updtype" value="<!-- TMPL_VAR NAME="updtype" -->" />
-<input type="hidden" name="guarantorid"   value="<!-- TMPL_VAR NAME="guarantorid" -->" />
 <input type="hidden" name="select_roadtype" value="<!-- TMPL_VAR NAME="select_roadtype" -->" />
 <input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
 <input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
@@ -127,7 +159,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
 
 <!--TMPL_IF Name="step_1"-->
        <fieldset class="rows" id="memberentry_identity">
-               <legend><!--TMPL_IF Name="I"-->Organisation <!--TMPL_ELSE-->Patron <!--/TMPL_IF-->identity</legend>
+               <legend><!--TMPL_IF Name="I"-->Organization <!--TMPL_ELSE-->Patron <!--/TMPL_IF-->identity</legend>
                <ol>
                <!-- TMPL_UNLESS name="I" -->
                <!-- TMPL_IF NAME="title_cgipopup" -->
@@ -164,7 +196,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                 <!-- TMPL_ELSE -->
                 <label for="firstname">
                 <!-- /TMPL_IF-->
-                Firstname: </label>
+                First name: </label>
                 <input type="text" id="firstname" name="firstname" size="20"  value="<!-- TMPL_VAR NAME="firstname" -->" />
                 <!-- TMPL_IF NAME="mandatoryfirstname" --><span class="required">Required</span><!-- /TMPL_IF -->
             </li>
@@ -175,7 +207,13 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                 <label for="dateofbirth">
                 <!-- /TMPL_IF-->
                 Date of birth: </label>
-                <input type="text" id="dateofbirth" name="dateofbirth" size="20" <!-- TMPL_IF NAME="metric" -->onchange="CheckDate(document.form.dateofbirth);"<!-- /TMPL_IF --> value="<!-- TMPL_VAR NAME="dateofbirth" -->" />
+                               
+       <!-- TMPL_IF NAME="metric" -->                  
+                <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="<!-- TMPL_VAR NAME="dateofbirth" -->" />
+<!-- TMPL_ELSE -->
+                <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="<!-- TMPL_VAR NAME="dateofbirth" -->" />
+<!-- /TMPL_IF -->
+
                 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="dateofbirth_button" alt="Show Calendar" />
         <script language="JavaScript" type="text/javascript">
             Calendar.setup(
@@ -209,37 +247,108 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                        Other name: </label>
                        <input type="text" id="othernames" name="othernames" size="20"  value="<!-- TMPL_VAR NAME="othernames" -->" />
 <!-- TMPL_IF NAME="mandatoryothernames" --><span class="required">Required</span><!-- /TMPL_IF -->
+               <!-- TMPL_IF NAME="I" --><input type="hidden" name="sex" value="N" /><!-- /TMPL_IF -->
                </li>
-    <!--TMPL_IF Name="I"-->
-        <input type="hidden" name="sex" value="N" />
-    <!--TMPL_ELSE-->
-               <li class="radio">  
-                               <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F"  <!-- TMPL_IF NAME="female" --> checked="checked" <!-- /TMPL_IF --> />
-                               <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" <!-- TMPL_IF NAME="male" --> checked="checked" <!-- /TMPL_IF --> />
-                               <label for="sex-male">? </label><input type="radio" name="sex" id="sex-male" value="" <!-- TMPL_IF NAME="none" --> checked="checked" <!-- /TMPL_IF --> />
+    <!--TMPL_UNLESS Name="I"-->
+               <li class="radio">
+               
+               <!-- TMPL_IF NAME="female" -->
+                               <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" checked="checked"  />
+<!-- TMPL_ELSE -->
+                               <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
+<!-- /TMPL_IF -->
+               <!-- TMPL_IF NAME="male" -->
+               <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" checked="checked" />
+<!-- TMPL_ELSE -->
+                               <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
+<!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="none" -->
+                               <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value=""  checked="checked"  />
+<!-- TMPL_ELSE -->
+                               <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" />
+<!-- /TMPL_IF -->
                </li>
-    <!--/TMPL_IF-->
-<!--TMPL_IF EXPR="showguarantor"-->  <li><label for="">Guarantor: </label>
-  <select name="relationship" id="relationship" >
-    <!-- TMPL_LOOP name="relshiploop" -->
-        <!-- TMPL_IF name="selected" -->
-            <option value="<!-- TMPL_VAR name="relationship" -->" selected="selected" ><!-- TMPL_VAR name="relationship" --></option>
-        <!-- TMPL_ELSE -->
-            <option value="<!-- TMPL_VAR name="relationship" -->"><!-- TMPL_VAR name="relationship" --></option>
-        <!-- /TMPL_IF -->
-    <!-- /TMPL_LOOP -->
-    </select>
-  <input name="contactname" id="contactname" type="text"  size="20" value="<!-- TMPL_VAR NAME="contactname" -->" />
-  <input name="contactfirstname" id="contactfirstname" type="text"  size="20" value="<!-- TMPL_VAR NAME="contactfirstname" -->" />
-  <!-- TMPL_IF NAME="guarantorid"-->  
-    <input id="guarantorsearch" type="button" value="Modify Guarantor" onclick="Dopopguarantor('guarantor_search.pl');" />
-  <!-- TMPL_ELSE -->
-    <input id="guarantorsearch" type="button" value="Find guarantor" onclick="Dopopguarantor('guarantor_search.pl');" />
-  <!-- /TMPL_IF --> <input id="guarantordelete" type="button" value="Delete Guarantor" />
-  </li>
-<!--/TMPL_IF-->  
+    <!--/TMPL_UNLESS-->
                </ol>
        </fieldset>
+       
+<!--TMPL_IF Name="showguarantor"--><input type="hidden" id="guarantorid" name="guarantorid"   value="<!-- TMPL_VAR NAME="guarantorid" -->" />
+    <fieldset class="rows">
+        <legend>Guarantor Information</legend>
+        <ol>
+<!--TMPL_IF Name="P"-->
+               <!-- TMPL_IF NAME="guarantorid" -->
+               <li id="contact-details">
+               <!-- TMPL_ELSE -->
+               <li id="contact-details" style="display: none">
+               <!-- /TMPL_IF -->
+                   <span class="label">Organization #:</span> <!-- TMPL_IF NAME="guarantorid" --> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="guarantorid" -->" target="blank"><!-- TMPL_VAR NAME="guarantorid" --></a><!-- /TMPL_IF -->
+               </li>
+               <li>
+                   <label for="contactname">Organization name: </label>
+                   <!-- TMPL_IF NAME="guarantorid" -->
+                   <span><!-- TMPL_VAR NAME="contactname" --></span>
+                   <input name="contactname" id="contactname" type="hidden" size="20" value="<!-- TMPL_VAR NAME="contactname" -->" />
+                   <!-- TMPL_ELSE -->
+                   <input name="contactname" id="contactname" type="text" size="20" value="<!-- TMPL_VAR NAME="contactname" -->" />
+                   <!-- /TMPL_IF -->
+               </li>
+<!-- TMPL_ELSE -->
+ <!-- TMPL_IF NAME="C" -->
+ <!-- TMPL_IF NAME="guarantorid" -->
+ <li id="contact-details">
+ <!-- TMPL_ELSE -->
+ <li id="contact-details" style="display: none">
+ <!-- /TMPL_IF -->
+     <span class="label">Patron #:</span> <!-- TMPL_IF NAME="guarantorid" --> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="guarantorid" -->" target="blank"><!-- TMPL_VAR NAME="guarantorid" --></a><!-- /TMPL_IF -->
+ </li>
+ <li>
+     <label for="contactname">Surname: </label>
+     <!-- TMPL_IF NAME="guarantorid" -->
+     <span><!-- TMPL_VAR NAME="contactname" --></span>
+     <input name="contactname" id="contactname" type="hidden" size="20" value="<!-- TMPL_VAR NAME="contactname" -->" />
+     <!-- TMPL_ELSE -->
+     <input name="contactname" id="contactname" type="text" size="20" value="<!-- TMPL_VAR NAME="contactname" -->" />
+     <!-- /TMPL_IF -->
+ </li>
+ <li>
+     <label for="contactfirstname">First name: </label>
+     <!-- TMPL_IF NAME="guarantorid" -->
+     <span><!-- TMPL_VAR NAME="contactfirstname" --></span>
+     <input name="contactfirstname" id="contactfirstname" type="hidden" size="20" value="<!-- TMPL_VAR NAME="contactfirstname" -->" />
+     <!-- TMPL_ELSE -->
+     <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="<!-- TMPL_VAR NAME="contactfirstname" -->" />
+     <!-- /TMPL_IF -->
+ </li>
+ <!-- TMPL_IF name="relshiploop" -->
+ <li>
+     <label for="relationship">Relationship: </label>
+     <select name="relationship" id="relationship" >
+         <!-- TMPL_LOOP name="relshiploop" -->
+         <!-- TMPL_IF name="selected" -->
+         <option value="<!-- TMPL_VAR name="relationship" -->" selected="selected" ><!-- TMPL_VAR name="relationship" --></option>
+         <!-- TMPL_ELSE -->
+         <option value="<!-- TMPL_VAR name="relationship" -->"><!-- TMPL_VAR name="relationship" --></option>
+         <!-- /TMPL_IF -->
+         <!-- /TMPL_LOOP -->
+     </select>
+ </li>
+ <!-- /TMPL_IF -->
+ <!-- /TMPL_IF -->
+<!--/TMPL_IF -->
+        <li>
+            <span class="label">&nbsp;</span>
+            <!-- TMPL_IF NAME="guarantorid" -->
+            <input id="guarantorsearch" type="button" value="Change" onclick="Dopopguarantor('guarantor_search.pl');" />
+            <!-- TMPL_ELSE -->
+            <input id="guarantorsearch" type="button" value="Set to Patron" onclick="Dopopguarantor('guarantor_search.pl');" />
+            <!-- /TMPL_IF -->
+            <input id="guarantordelete" type="button" value="Delete" />
+        </li>
+        </ol>
+    </fieldset>
+
+<!--/TMPL_IF-->
 <fieldset class="rows">
     <legend>Main address</legend><ol>
     <li>
@@ -302,7 +411,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
       <!--TMPL_ELSE-->
         <label for="zipcode">
       <!-- /TMPL_IF-->
-      Zipcode: </label>
+      Zip/Postal code: </label>
       <input type="text" name="zipcode" id="zipcode" size="10" value="<!-- TMPL_VAR NAME="zipcode" -->" />
          <!-- TMPL_IF NAME="mandatoryzipcode" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
@@ -310,19 +419,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
        </ol>
     </fieldset>
   <fieldset class="rows" id="memberentry_contact">
-    <legend>Contact</legend><ol>       
-<!--TMPL_IF Name="C"-->
-      <h2>Patron</h2>
-      <li> 
-        <!-- TMPL_IF NAME="mandatoryB_email" -->
-          <label for="B_email" class="required">
-        <!--TMPL_ELSE-->
-          <label for="B_email">
-        <!-- /TMPL_IF-->
-        E-mail (home): </label>
-        <input type="text" id="B_email" name="B_email" size="45" value="<!-- TMPL_VAR NAME="B_email" -->" />
-               <!-- TMPL_IF NAME="mandatoryB_email" --><span class="required">Required</span><!-- /TMPL_IF --> </li>
-<!--/TMPL_IF-->
+    <legend>Contact</legend><ol>
       <li>
       <!-- TMPL_IF NAME="mandatoryphone" --> 
       <label for="phone" class="required">
@@ -331,7 +428,8 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
       <!-- /TMPL_IF-->
       Phone (home): </label>
       <input type="text" id="phone" name="phone" value="<!-- TMPL_VAR NAME="phone" -->" />
-         <!-- TMPL_IF NAME="mandatoryphone" --><span class="required">Required</span><!-- /TMPL_IF -->
+         <!-- TMPL_IF NAME="mandatoryphone" --><span class="required">Required</span><!-- /TMPL_IF --><strong><em>Shows on transit slips</em></strong>
+
     </li>
     <li>
       <!-- TMPL_IF NAME="mandatoryphonepro" -->
@@ -359,9 +457,10 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
       <!--TMPL_ELSE-->
       <label for="email">
       <!-- /TMPL_IF-->
-      E-mail (home): </label>
+      Email (home): </label>
       <input type="text" id="email" name="email" size="45" value="<!-- TMPL_VAR NAME="email" -->" />  
-         <!-- TMPL_IF NAME="mandatoryemail" --><span class="required">Required</span><!-- /TMPL_IF -->
+         <!-- TMPL_IF NAME="mandatoryemail" --><span class="required">Required</span><!-- /TMPL_IF --><strong><em>Shows on transit slips</em></strong>
+
     </li>
     <li>
       <!-- TMPL_IF NAME="mandatoryemailpro" --> 
@@ -369,7 +468,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
       <!--TMPL_ELSE-->
       <label for="emailpro">
       <!-- /TMPL_IF-->
-      E-mail (work): </label>
+      Email (work): </label>
       <input type="text" id="emailpro" name="emailpro" size="45" value="<!-- TMPL_VAR NAME="emailpro" -->" />
          <!-- TMPL_IF NAME="mandatoryemailpro" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
@@ -409,7 +508,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                                <!--TMPL_ELSE-->
                                        <label for="B_city">
                                <!-- /TMPL_IF-->
-                               City: </label>
+                               City, State: </label>
                                <input type="text" id="B_city" name="B_city" size="20" value="<!-- TMPL_VAR NAME="B_city" -->" />
          <!-- TMPL_IF NAME="mandatoryB_city" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
@@ -419,8 +518,8 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                                <!--TMPL_ELSE-->
                                        <label for="B_zipcode">
                                <!-- /TMPL_IF-->
-                               Zipcode: </label>
-                               <input type="text" id="B_zipcode" name="B_zipcode" maxlength="5" size="5" value="<!-- TMPL_VAR NAME="B_zipcode" -->" />
+                               Zip/Postal code: </label>
+                               <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="<!-- TMPL_VAR NAME="B_zipcode" -->" />
          <!-- TMPL_IF NAME="mandatoryB_zipcode" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
             <li>
@@ -439,33 +538,23 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
         <!--TMPL_ELSE-->
           <label for="B_email">
         <!-- /TMPL_IF-->
-        E-mail: </label>
+        Email: </label>
         <input type="text" id="B_email" name="B_email" size="45" value="<!-- TMPL_VAR NAME="B_email" -->" />
                <!-- TMPL_IF NAME="mandatoryB_email" --><span class="required">Required</span><!-- /TMPL_IF --> </li>
             <li>
-                <!-- TMPL_IF NAME="mandatorycontacnote" -->
-                <label for="contacnote" class="required">
+                <!-- TMPL_IF NAME="mandatorycontactnote" -->
+                <label for="contactnote" class="required">
                 <!--TMPL_ELSE-->
-                <label for="contacnote">
+                <label for="contactnote">
                 <!-- /TMPL_IF-->
                 Contact note: </label>
                 <textarea id="contactnote" name="contactnote" cols="40" rows="2"><!-- TMPL_VAR NAME="contactnote" --></textarea>
-        <!-- TMPL_IF NAME="mandatorycontacnote" --><span class="required">Required</span><!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="mandatorycontactnote" --><span class="required">Required</span><!-- /TMPL_IF -->
             </li>
                        </ol>
                </fieldset>
-               <fieldset class="rows" id="memberentry_address">       
+               <fieldset class="rows" id="memberentry_altaddress">       
                    <legend>Alternate Contact</legend><ol>
-                       <li>
-                           <!-- TMPL_IF NAME="mandatoryaltcontactfirstname" -->
-                               <label for="altcontactfirstname" class="required">
-                               <!-- TMPL_ELSE -->
-                               <label for="altcontactfirstname">
-                               <!-- /TMPL_IF -->
-                               Firstname:</label>
-                               <input type="text" name="altcontactfirstname" value="<!-- TMPL_VAR NAME="altcontactfirstname" -->">
-                               <!-- TMPL_IF NAME="mandatoryaltcontactfirstname" --><span class="required">Required</span><!-- /TMPL_IF -->
-                       </li>
                        <li>
                            <!-- TMPL_IF NAME="mandatoryaltcontactsurname" -->
                                <label for="altcontactsurname" class="required">
@@ -473,17 +562,27 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                                <label for="altcontactsurname">
                                <!-- /TMPL_IF -->
                                Surname:</label>
-                               <input type="text" name="altcontactsurname" value="<!-- TMPL_VAR NAME="altcontactsurname" -->">
+                               <input type="text" name="altcontactsurname" id="altcontactsurname" value="<!-- TMPL_VAR NAME="altcontactsurname" -->" />
                                <!-- TMPL_IF NAME="mandatoryaltcontactsurname" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
+                       <li>
+                           <!-- TMPL_IF NAME="mandatoryaltcontactfirstname" -->
+                               <label for="altcontactfirstname" class="required">
+                               <!-- TMPL_ELSE -->
+                               <label for="altcontactfirstname">
+                               <!-- /TMPL_IF -->
+                               First name:</label>
+                               <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="<!-- TMPL_VAR NAME="altcontactfirstname" -->" />
+                               <!-- TMPL_IF NAME="mandatoryaltcontactfirstname" --><span class="required">Required</span><!-- /TMPL_IF -->
+                       </li>
                        <li>
                            <!-- TMPL_IF NAME="mandatoryaltcontactaddress1" -->
                                <label for="altcontactaddress1" class="required">
                                <!-- TMPL_ELSE -->
                                <label for="altcontactaddress1">
                                <!-- /TMPL_IF -->
-                               Address line 1:</label>
-                               <input type="text" name="altcontactaddress1" value="<!-- TMPL_VAR NAME="altcontactaddress1" -->" size="40">
+                               Address:</label>
+                               <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="<!-- TMPL_VAR NAME="altcontactaddress1" -->" size="40" />
                                <!-- TMPL_IF NAME="mandatoryaltcontactaddress1" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
@@ -492,8 +591,8 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                                <!-- TMPL_ELSE -->
                                <label for="altcontactaddress2">
                                <!-- /TMPL_IF -->
-                               Address line 2:</label>
-                               <input type="text" name="altcontactaddress2" value="<!-- TMPL_VAR NAME="altcontactaddress2" -->" size="40">
+                               Address 2:</label>
+                               <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="<!-- TMPL_VAR NAME="altcontactaddress2" -->" size="40" />
                                <!-- TMPL_IF NAME="mandatoryaltcontactaddress2" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
@@ -503,7 +602,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                                <label for="altcontactaddress3">
                                <!-- /TMPL_IF -->
                                City, State:</label>
-                               <input type="text" name="altcontactaddress3" value="<!-- TMPL_VAR NAME="altcontactaddress3" -->" size="40">
+                               <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="<!-- TMPL_VAR NAME="altcontactaddress3" -->" size="40" />
                                <!-- TMPL_IF NAME="mandatoryaltcontactaddress3" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
@@ -512,8 +611,8 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                                <!-- TMPL_ELSE -->
                                <label for="altcontactzipcode">
                                <!-- /TMPL_IF -->
-                               ZIP/Post code:</label>
-                               <input type="text" name="altcontactzipcode" value="<!-- TMPL_VAR NAME="altcontactzipcode" -->" size="5">
+                               Zip/Postal code:</label>
+                               <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="<!-- TMPL_VAR NAME="altcontactzipcode" -->" size="5" />
                                <!-- TMPL_IF NAME="mandatoryaltcontactzipcode" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
@@ -523,7 +622,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                                <label for="altcontactphone">
                                <!-- /TMPL_IF -->
                                Phone:</label>
-                               <input type="text" name="altcontactphone" value="<!-- TMPL_VAR NAME="altcontactphone" -->">
+                               <input type="text" name="altcontactphone" id="altcontactphone" value="<!-- TMPL_VAR NAME="altcontactphone" -->" />
                                <!-- TMPL_IF NAME="mandatoryaltcontactphone" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
             </ol>
@@ -533,14 +632,14 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
   <!-- TMPL_IF NAME="I" -->
        <!-- TMPL_IF NAME="memberofinstution" -->
        <fieldset class="rows" id="memberentry_organisation">
-               <legend>Organisations</legend><ol>
+               <legend>Organizations</legend><ol>
                <li>
                        <!-- TMPL_IF NAME="mandatoryphone" --> 
                        <label for="organisations" class="required">
                        <!--TMPL_ELSE-->
                        <label for="organisations">
                        <!-- /TMPL_IF-->
-                       Organisation(s): </label>
+                       Organization(s): </label>
                        <!-- TMPL_VAR NAME="CGIorganisations" -->
          <!-- TMPL_IF NAME="mandatoryphone" --><span class="required">Required</span><!-- /TMPL_IF -->
                </li>
@@ -560,7 +659,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
       <label for="cardnumber">
     <!-- /TMPL_IF--> 
     Card number: </label>
-    <input type="text" id="cardnumber" name="cardnumber" size="10" value="<!-- TMPL_VAR NAME="cardnumber" -->" />
+    <input type="text" id="cardnumber" name="cardnumber" size="20" value="<!-- TMPL_VAR NAME="cardnumber" -->" />
          <!-- TMPL_IF NAME="mandatorycardnumber" --><span class="required">Required</span><!-- /TMPL_IF --></li>
     <li>
       <!-- TMPL_IF NAME="mandatorybranchcode" -->
@@ -568,7 +667,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
       <!--TMPL_ELSE-->
         <label for="branchcode">
       <!-- /TMPL_IF-->
-      Branch: </label>
+      Library: </label>
       <!-- TMPL_VAR NAME="CGIbranch" -->
          <!-- TMPL_IF NAME="mandatorybranchcode" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
@@ -577,12 +676,22 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
         <label for="categorycode">Category: </label>
         <select id="categorycode" name="categorycode">
         <!-- TMPL_LOOP NAME="typeloop" -->
-        <optgroup label="<!-- TMPL_IF EXPR="typename eq 'C'" -->Child<!-- /TMPL_IF --><!-- TMPL_IF EXPR="typename eq 'A'" -->Adult<!-- /TMPL_IF --><!-- TMPL_IF EXPR="typename eq 'S'" -->Staff<!-- /TMPL_IF --><!-- TMPL_IF EXPR="typename eq 'I'" -->Organisation<!-- /TMPL_IF --><!-- TMPL_IF EXPR="typename eq 'P'" -->Professional<!-- /TMPL_IF -->">
+               <!-- TMPL_IF EXPR="typename eq 'C'" --><optgroup label="Child"><!-- /TMPL_IF -->
+               <!-- TMPL_IF EXPR="typename eq 'A'" --><optgroup label="Adult"><!-- /TMPL_IF -->
+               <!-- TMPL_IF EXPR="typename eq 'S'" --><optgroup label="Staff"><!-- /TMPL_IF -->
+               <!-- TMPL_IF EXPR="typename eq 'I'" --><optgroup label="Organization"><!-- /TMPL_IF -->
+               <!-- TMPL_IF EXPR="typename eq 'P'" --><optgroup label="Professional"><!-- /TMPL_IF -->
+               <!-- TMPL_IF EXPR="typename eq 'X'" --><optgroup label="Statistical"><!-- /TMPL_IF -->
                 <!-- TMPL_LOOP NAME="categoryloop" -->
-                <option value="<!-- TMPL_VAR NAME="categorycode" -->" <!-- TMPL_IF NAME="categorycodeselected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR NAME="categoryname" --></option>
+                               <!-- TMPL_IF NAME="categorycodeselected" -->
+               <option value="<!-- TMPL_VAR NAME="categorycode" -->" selected="selected"><!-- TMPL_VAR NAME="categoryname" --></option>
+                               <!-- TMPL_ELSE -->
+<option value="<!-- TMPL_VAR NAME="categorycode" -->"><!-- TMPL_VAR NAME="categoryname" --></option>
+                               <!-- /TMPL_IF -->
                 <!-- /TMPL_LOOP -->
         </optgroup>
         <!-- /TMPL_LOOP -->
+               </select>
     <!-- TMPL_ELSE -->
         <span class="problem">There is no category type to add <!--TMPL_IF Name="A"-->an Adult<!--/TMPL_IF--><!--TMPL_IF Name="C"-->a Child<!--/TMPL_IF--><!--TMPL_IF Name="I"-->an Institution<!--/TMPL_IF--><!--TMPL_IF Name="P"-->a professionnal<!--/TMPL_IF--><!--TMPL_IF Name="S"-->a Staff Member<!--/TMPL_IF-->.</span>
               <a href="/cgi-bin/koha/admin/categorie.pl">Please create one</a>
@@ -647,8 +756,8 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                        <!--TMPL_ELSE-->
                        <label for="dateexpiry">
                        <!-- /TMPL_IF-->
-                       Expiry date: </label>
-                       <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10"  size="10" <!-- TMPL_IF NAME="metric" -->onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');"<!-- /TMPL_IF--> value="<!-- TMPL_VAR NAME="dateexpiry" -->" />
+                       Expiry date (leave blank for auto calc) </label>
+                       <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10"  size="10" <!-- TMPL_IF NAME="metric" -->onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');"<!-- /TMPL_IF--> value="<!-- TMPL_UNLESS NAME="opadd" --><!-- TMPL_VAR NAME="dateexpiry" --><!-- /TMPL_UNLESS -->" />
             <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="dateexpiry_button" alt="Show Calendar" />
       <script language="JavaScript" type="text/javascript">
         Calendar.setup(
@@ -669,7 +778,8 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                                <label for="opacnote">
                        <!-- /TMPL_IF-->        
                        OPAC note: </label>
-                       <textarea id="opacnote" name="opacnote" cols="40" rows="2"><!-- TMPL_VAR NAME="opacnote" --></textarea>
+                       <textarea id="opacnote" name="opacnote" cols="55" rows="5"><!-- TMPL_VAR NAME="opacnote" --></textarea>
+                       <div class="hint">This message appears on this patron's user page in the OPAC</div>
          <!-- TMPL_IF NAME="mandatoryopacnote" --><span class="required">Required</span><!-- /TMPL_IF -->
                </li>
                <li>
@@ -678,8 +788,9 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                        <!--TMPL_ELSE-->
                                <label for="borrowernotes">
                        <!-- /TMPL_IF-->
-                       Library note: </label>
-                       <textarea id="borrowernotes" name="borrowernotes" cols="40" rows="2"><!-- TMPL_VAR NAME="borrowernotes" --></textarea>
+                       Circulation note: </label>
+                       <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5"><!-- TMPL_VAR NAME="borrowernotes" --></textarea>
+                       <div class="hint">This message displays when checking out to this patron</div>
          <!-- TMPL_IF NAME="mandatoryborrowernotes" --><span class="required">Required</span><!-- /TMPL_IF -->
                </li>
                </ol>
@@ -693,7 +804,13 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                        <label for="userid">
                        <!-- /TMPL_IF-->
                        OPAC Login: </label>
-                       <input type="text" id="userid" name="userid" size="20" <!-- TMPL_IF NAME="NoUpdateLogin" -->disabled='true'<!-- /TMPL_IF --> value="<!-- TMPL_VAR NAME="userid" -->" />
+
+<!-- TMPL_IF NAME="NoUpdateLogin" -->
+<input type="text" id="userid" name="userid" size="20" disabled="disabled" value="<!-- TMPL_VAR NAME="userid" -->" />
+<!-- TMPL_ELSE -->
+<input type="text" id="userid" name="userid" size="20" value="<!-- TMPL_VAR NAME="userid" -->" />
+<!-- /TMPL_IF -->
+
          <!-- TMPL_IF NAME="mandatoryuserid" --><span class="required">Required</span><!-- /TMPL_IF -->
                </li>
                <li>
@@ -704,15 +821,28 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                        <!-- /TMPL_IF-->
                        Password: </label>
                        <!--TMPL_IF NAME="opadd"-->
-                               <input type="text" id="password" name="password" size="20"  <!-- TMPL_IF NAME="NoUpdateLogin" -->disabled='true'<!-- /TMPL_IF --> value="<!-- TMPL_VAR NAME="password" -->" />
+                       <!-- TMPL_IF NAME="NoUpdateLogin" -->
+                               <input type="text" id="password" name="password" size="20"  disabled="disabled" value="<!-- TMPL_VAR NAME="password" -->" />
+<!-- TMPL_ELSE -->
+                               <input type="text" id="password" name="password" size="20" value="<!-- TMPL_VAR NAME="password" -->" />
+<!-- /TMPL_IF -->
                        <!--TMPL_ELSE-->
-                               <!--TMPL_IF NAME="password"-->
-                                       <input type="text" id="password" name="password" size="20"  <!-- TMPL_IF NAME="NoUpdateLogin" -->disabled='true'<!-- /TMPL_IF --> value="****" />
-                               <!--TMPL_ELSE-->
-                                       <input type="text" id="password" name="password" size="20"  <!-- TMPL_IF NAME="NoUpdateLogin" -->disabled='true'<!-- /TMPL_IF --> value="" />
-                               <!--/TMPL_IF-->
+                       <!--TMPL_IF NAME="password"-->
+                               <!-- TMPL_IF NAME="NoUpdateLogin" -->
+                                       <input type="text" id="password" name="password" size="20"  disabled="disabled" value="****" />
+                               <!-- TMPL_ELSE -->
+                                       <input type="text" id="password" name="password" size="20" value="****" />
+                               <!-- /TMPL_IF -->
+                       <!--TMPL_ELSE-->
+                               <!-- TMPL_IF NAME="NoUpdateLogin" -->
+                                       <input type="text" id="password" name="password" size="20"  disabled="disabled" value="" />
+                               <!-- TMPL_ELSE -->
+                                       <input type="text" id="password" name="password" size="20" value="" />
+                               <!-- /TMPL_IF -->
+                       <!--/TMPL_IF-->
                        <!--/TMPL_IF-->
-         <!-- TMPL_IF NAME="mandatorypassword" --><span class="required">Required</span><!-- /TMPL_IF -->
+         <!-- TMPL_IF NAME="mandatorypassword" --><span class="required">Required</span><!-- /TMPL_IF --><!-- TMPL_IF NAME="ERROR_short_password" --><span class="required">Password is too short</span><!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="minPasswordLength" --><div class="hint">Minimum password length: <!-- TMPL_VAR NAME="minPasswordLength" --></div><!-- /TMPL_IF -->
                </li></ol>
                </fieldset>
                <!--this zones are not necessary in modif mode -->
@@ -746,7 +876,120 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                        </ol>
                        </fieldset>
                <!-- /TMPL_UNLESS -->   
+
 <!-- /TMPL_IF -->
+
+<!-- TMPL_IF NAME="step_4" --><!-- TMPL_IF NAME="ExtendedPatronAttributes" --><!-- TMPL_UNLESS NAME="no_patron_attribute_types" -->
+  <fieldset class="rows" id="memberentry_patron_attributes">
+    <input type="hidden" name="setting_extended_patron_attributes" value="1" />
+    <legend>Additional attributes and identifiers</legend>
+    <table>
+        <tr>
+            <th>Type</th>
+            <th colspan="2">Value</th>
+        </tr>
+        <!-- TMPL_LOOP NAME='patron_attributes' -->
+        <tr>
+            <td><!-- TMPL_VAR NAME="code" --> (<!-- TMPL_VAR NAME="description" -->)
+            </td>
+            <td>
+                <input type="hidden" id="<!-- TMPL_VAR NAME="form_id" -->_code" name="<!-- TMPL_VAR NAME="form_id" -->_code"
+                       value="<!-- TMPL_VAR NAME="code" ESCAPE="HTML" -->" />
+                <!-- TMPL_IF NAME="use_dropdown" -->
+                    <select id="<!-- TMPL_VAR NAME="form_id" -->" name="<!-- TMPL_VAR NAME="form_id" -->">
+                        <option value="" />
+                        <!-- TMPL_LOOP NAME="auth_val_loop" -->
+                            <!-- TMPL_IF NAME="selected" -->
+                                <option value="<!-- TMPL_VAR NAME="authorised_value" -->" selected="selected">
+                                    <!-- TMPL_VAR NAME="lib" -->
+                                </option>
+                            <!-- TMPL_ELSE -->
+                                <option value="<!-- TMPL_VAR NAME="authorised_value" -->" >
+                                    <!-- TMPL_VAR NAME="lib" -->
+                                </option>
+                            <!-- /TMPL_IF -->
+                        <!-- /TMPL_LOOP -->
+                    </select>
+                <!-- TMPL_ELSE -->
+                    <input type="text" maxlength="64" value="<!-- TMPL_VAR NAME="value" -->"
+                           id="<!-- TMPL_VAR NAME="form_id" -->" name="<!-- TMPL_VAR NAME="form_id" -->" />
+                <!-- /TMPL_IF -->
+                <!-- TMPL_IF NAME="password_allowed" -->
+                    (Password: <input type="password" maxlength="64" value="<!-- TMPL_VAR NAME="password" -->"
+                           id="<!-- TMPL_VAR NAME="form_id" -->_password" name="<!-- TMPL_VAR NAME="form_id" -->_password" />)
+                <!-- /TMPL_IF -->
+            </td>
+            <td>
+                <a href="#" onclick="clear_entry(this); return false;">Clear</a>
+                <!-- TMPL_IF NAME="repeatable" -->
+                <a href="#" onclick="clone_entry(this); return false;">New</a>
+                <!-- /TMPL_IF -->
+            </td>
+        </tr>
+        <!-- /TMPL_LOOP -->
+    </table>
+  </fieldset>
+<!-- /TMPL_IF--><!-- /TMPL_IF --><!-- /TMPL_UNLESS -->
+
+<!-- TMPL_IF NAME="step_5" --><!-- TMPL_IF NAME="EnhancedMessagingPreferences" -->
+  <fieldset class="rows" id="memberentry_messaging_prefs">
+    <!-- TMPL_IF NAME="opadd" -->
+    <!-- handle changing prefs if creating new patron and changing
+         the patron category
+    -->
+    <script language="javascript" type="text/javascript">//<![CDATA[
+       $(document).ready(function(){
+            var message_prefs_dirty = false;
+            $('#memberentry_messaging_prefs > *').change(function() {
+                message_prefs_dirty = true;
+            });
+            $('#categorycode').change(function() {
+                var categorycode = $(this).val();
+                if (message_prefs_dirty) {
+                    if (!confirm('Change messaging preferences to default for this category?')) {
+                        return;
+                    }
+                }
+                $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode,
+                    function(data) {
+                        $.each(data.messaging_preferences, function(i, item) {
+                            var attrid = item.message_attribute_id;
+                            var transports = ['email', 'rss', 'sms'];
+                            $.each(transports, function(j, transport) {
+                                if (item['transport-' + transport] != ' ') {
+                                    $('#' + transport + attrid).attr('checked', item['transport-' + transport]);
+                                } else {
+                                    $('#' + transport + attrid).removeAttr('checked');
+                                }
+                            });
+                            if (item.digest && item.digest != ' ') {
+                                $('#digest' + attrid).attr('checked', item.digest);
+                            } else {
+                                $('#digest' + attrid).removeAttr('checked');
+                            }
+                            if (item.takes_days == '1') {
+                                $('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance);
+                            }
+                        });
+                        message_prefs_dirty = false;
+                    }
+                );
+            });
+        });
+    //]]>
+    </script>
+    <!-- /TMPL_IF -->
+    <input type="hidden" name="setting_messaging_prefs" value="1" />
+    <legend>Patron messaging preferences</legend>
+    <!-- TMPL_INCLUDE NAME="messaging-preference-form.inc" -->
+    <!-- TMPL_IF NAME="SMSSendDriver" -->
+        <p><label for="SMSnumber">SMS number:</label> 
+          <input type="text" id="SMSnumber" name="SMSnumber" value="<!-- TMPL_VAR NAME="SMSnumber"  -->" />
+        </p>
+    <!-- /TMPL_IF -->
+  </fieldset>
+<!-- /TMPL_IF --> <!-- /TMPL_IF -->
+
     <fieldset class="action">
         <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
       <!-- TMPL_IF NAME="opadd" -->
@@ -760,8 +1003,8 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
 </div>
 </div>
 
-<div class="yui-b">
+<!-- TMPL_UNLESS NAME="opadd" --><div class="yui-b">
 <!-- TMPL_INCLUDE NAME="members-menu.inc" -->
-</div>
+</div><!-- /TMPL_UNLESS -->
 </div>
 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->