Bug 5918 : Use the default messaging preferences if the user does not select any
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / memberentrygen.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Patrons &rsaquo; 
3 [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] [% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %][% UNLESS ( opadd ) %] [% surname %], [% firstname %][% END %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'calendar.inc' %]
6 <script type="text/JavaScript" language="JavaScript">
7 //<![CDATA[
8     $(document).ready(function() {
9                 $("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
10         $("#guarantordelete").click(function() {
11             $("#contact-details").hide().find('a').remove();
12             $("#guarantorid, #contactname, #contactfirstname").each(function () { this.value = "" });
13             $("#contactname, #contactfirstname")
14                 .each(function () { this.type = 'text' })
15                 .parent().find('span').remove();
16             $("#guarantorsearch").val("Set to Patron");
17         });
18         $("#select_city").change(function(){
19             var myRegEx=new RegExp(/(.*)\|(.*)/);
20             document.form.select_city.value.match(myRegEx);
21             document.form.zipcode.value=RegExp.$1;
22             document.form.city.value=RegExp.$2;
23         });
24     });
25
26     function clear_entry(node) {
27         var original = node.parentNode.parentNode;
28         $("input[type=text]", original).attr('value', '');
29         $("select", original).attr('value', '');
30     }
31
32     function clone_entry(node) {
33         var original = node.parentNode.parentNode;
34         var clone = original.cloneNode(true);
35         var newId = 50 + parseInt(Math.random() * 100000);
36         $("input", clone).attr('id', function() {
37             return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
38         });
39         $("input", clone).attr('name', function() {
40             return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
41         });
42         $("select", clone).attr('id', function() {
43             return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
44         });
45         $("select", clone).attr('name', function() {
46             return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
47         });
48         $("input#patron_attr_" + newId, clone).attr('value','');
49         $("select#patron_attr_" + newId, clone).attr('value','');
50         original.parentNode.insertBefore(clone, original.nextSibling);
51     }
52                 var MSG_SEPARATOR = _("Separator must be / in field ");
53         var MSG_INCORRECT_DAY = _("Invalid day entered in field ");
54         var MSG_INCORRECT_MONTH = _("Invalid month entered in field ");
55         var MSG_INCORRECT_YEAR = _("Invalid year entered in field ");
56         var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron");
57         var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization");
58         var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
59         var MSG_MISSING_MANDATORY = _("The following fields are mandatory:");
60         var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
61 //]]>
62 </script>
63 <script type="text/javascript" src="[% themelang %]/js/members.js"></script>
64 </head>
65 <body>
66 [% INCLUDE 'header.inc' %]
67 [% INCLUDE 'patron-search.inc' %]
68
69 <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; 
70 [% IF ( opadd ) %]
71                 Add[% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %]
72 [% surname %] [% firstname %]
73 [% ELSE %] 
74 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% firstname %] [% surname %]</a> &rsaquo; <strong>[% IF ( opduplicate ) %]Duplicate[% ELSE %]Modify[% END %][% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %]
75 </strong>[% END %]</div>
76 [% IF ( opadd ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
77    
78    <div id="bd">
79         <div id="yui-main">
80         <div class="yui-b">
81
82         [% IF ( no_add ) %]<div class="dialog alert"><h3>Cannot add patron</h3>
83                 [% 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 %]
84                 [% 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 %]
85
86         [% UNLESS ( no_add ) %]
87         [% IF ( opadd ) %]
88         <h1>
89                 Add[% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %] [% firstname %] [% surname %] 
90         </h1>
91         [% ELSE %]
92         <h1>
93                 [% IF ( opduplicate ) %]Duplicate[% ELSE %]Modify[% END %][% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %]
94 [% firstname %] [% surname %] 
95         </h1>
96         [% END %]
97   
98         [% IF ( check_member ) %]
99                         <div class="dialog alert">
100                                 <h3>Duplicate patron record?</h3>
101                                 <p><a class="popup" href="javascript:Dopop('moremember.pl?print=brief&amp;borrowernumber=[% check_member %]');" >View existing record</a></p>
102                                 <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>
103
104                                 <form name="form_double" action="/cgi-bin/koha/members/memberentry.pl" method="post">
105                                 <input type="hidden" name="nodouble" value="1" />
106                                 <input class="new" type="submit" value="Not a duplicate. Save as new record" />
107                         </div>
108         [% END %]
109
110         [% IF ( debug ) %]
111                 <div id="debug">
112                                 <div>Debug is on (level [% debug %])</div>
113                 </div>
114         [% END %]
115         [% IF ( nok ) %]
116                 <div class="dialog alert">
117                         <p>The following fields are wrong. Please fix them.</p>
118                         <ul>
119                         [% IF ( ERROR_login_exist ) %]
120                                 <li id="ERROR_login_exist">Username/password already exists.</li>
121                         [% END %]
122                         [% IF ( ERROR_cardnumber ) %]
123                                 <li id="ERROR_cardnumber">Cardnumber already in use.</li>
124                         [% END %]
125                         [% IF ( ERROR_age_limitations ) %]
126                                 <li id="ERROR_age_limitations">Patron's age is incorrect for their category.  
127                                         Ages allowed are [% ERROR_age_limitations %].</li>
128                         [% END %]
129                         [% IF ( ERROR_branch ) %]
130                                 <li id="ERROR_branch">Library is invalid.</li>
131                         [% END %]   
132                         [% IF ( ERROR_dateofbirth ) %]
133                                 <li id="ERROR_dateofbirth">Date of birth is invalid.</li>
134                         [% END %]
135                         [% IF ( ERROR_dateenrolled ) %]
136                                 <li id="ERROR_dateenrolled">Date of enrollment is invalid.</li>
137                         [% END %]
138                         [% IF ( ERROR_dateexpiry ) %]
139                                 <li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
140                         [% END %]
141                         [% IF ( ERROR_short_password ) %]
142                                 <li id="ERROR_short_password">Password must be at least [% minPasswordLength %] characters long.</li>
143                         [% END %]
144             [% IF ( ERROR_extended_unique_id_failed ) %]
145                 <li id="ERROR_extended_unique_id_failed">The attribute value 
146                     [% ERROR_extended_unique_id_failed %] is already is use by another patron record.</li>
147                         [% END %]
148                         </ul>
149                 </div>
150         [% END %]
151
152
153 [% UNLESS ( check_member ) %]<form name="form" id="entryform"  action="/cgi-bin/koha/members/memberentry.pl" method="post">
154 <input type="hidden" name="nodouble"  value="[% nodouble %]" /> [% END %]
155 <!--    field always hidden in different form (1,2,3) -->
156 <input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" />
157 <input type="hidden" name="category_type" value="[% category_type %]" />
158 <input type="hidden" name="updtype" value="[% updtype %]" />
159 <input type="hidden" name="select_roadtype" value="[% select_roadtype %]" />
160 <input type="hidden" name="destination" value="[% destination %]" />
161 <input type="hidden" name="check_member" value="[% check_member %]" />
162 <input type="hidden" name="borrowernumber" value="[% IF ( opduplicate ) %][% ELSE %][% borrowernumber %][% END %]" />
163 <input type="hidden" name="nodouble"  value="[% IF ( opduplicate ) %][% ELSE %][% nodouble %][% END %]" />
164 [% IF ( step ) %]<input type="hidden" name="step"  value="[% step %]" />[% END %]
165 [% IF ( opadd ) %]<input type="hidden" name="op" value="insert" />[% ELSIF ( opduplicate ) %]<input type="hidden" name="op" value="insert" />[% ELSE %]<input type="hidden" name="op" value="save" />[% END %]
166
167 [% IF ( step_1 ) %]
168         <fieldset class="rows" id="memberentry_identity">
169                 <legend>[% IF ( I ) %]Organization [% ELSE %]Patron [% END %]identity</legend>
170                 <ol>
171                 [% UNLESS ( I ) %]
172                 [% IF ( title_cgipopup ) %]
173             <li>
174             [% IF ( mandatorytitle ) %]
175                 <label for="btitle" class="required">
176             [% ELSE %]
177                 <label for="btitle">
178             [% END %]
179             Salutation: </label>
180             [% borrotitlepopup %]
181             [% IF ( mandatorytitle ) %]<span class="required">Required</span>[% END %]
182             </li>
183                 [% END %]
184         [% END %]
185                 <li>
186                 [% IF ( mandatorysurname ) %]
187                 <label for="surname" class="required">
188                 [% ELSE %]
189                 <label for="surname">
190                 [% END %]
191                 Surname: </label>
192                 [% IF ( uppercasesurnames ) %]
193                 <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20"  value="[% surname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
194                 [% ELSE %]
195                 <input type="text" id="surname" name="surname" size="20"  value="[% surname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
196                 [% END %]
197                 [% IF ( mandatorysurname ) %]<span class="required">Required</span>[% END %]
198                 </li>
199                 [% UNLESS ( I ) %]
200             <li>
201                 [% IF ( mandatoryfirstname ) %]
202                 <label for="firstname" class="required">
203                 [% ELSE %]
204                 <label for="firstname">
205                 [% END %]
206                 First name: </label>
207                 <input type="text" id="firstname" name="firstname" size="20"  value="[% IF ( opduplicate ) %][% ELSE %][% firstname %][% END %]" />
208                 [% IF ( mandatoryfirstname ) %]<span class="required">Required</span>[% END %]
209             </li>
210             <li>
211                 [% IF ( mandatorydateofbirth ) %]
212                 <label for="dateofbirth" class="required">
213                 [% ELSE %]
214                 <label for="dateofbirth">
215                 [% END %]
216                 Date of birth: </label>
217                                 
218         [% IF ( metric ) %]                     
219                 <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
220 [% ELSE %]
221                 <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
222 [% END %]
223
224                 <img src="[% themelang %]/lib/calendar/cal.gif" id="dateofbirth_button" alt="Show Calendar" />
225         <script language="JavaScript" type="text/javascript">
226             Calendar.setup(
227             {
228                 inputField : "dateofbirth",
229                 ifFormat : "[% DHTMLcalendar_dateformat %]",
230                 button : "dateofbirth_button"
231             }
232             );
233         </script>
234         [% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
235         [% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
236                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
237             </li>
238             <li>
239                 [% IF ( mandatoryinitials ) %]
240                     <label for="initials" class="required">
241                 [% ELSE %]
242                     <label for="initials">
243                 [% END %]
244                 Initials: </label>
245                 <input type="text" id="initials" name="initials" size="20"  value="[% initials %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />  
246                 [% IF ( mandatoryinitials ) %]<span class="required">Required</span>[% END %]
247             </li>
248         [% END %]
249                 <li>
250                         [% IF ( mandatoryothernames ) %]
251                         <label for="othernames" class="required">
252                         [% ELSE %]
253                         <label for="othernames">
254                         [% END %]
255                         Other name: </label>
256                         <input type="text" id="othernames" name="othernames" size="20"  value="[% othernames %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
257 [% IF ( mandatoryothernames ) %]<span class="required">Required</span>[% END %]
258                 [% IF ( I ) %]<input type="hidden" name="sex" value="N" />[% END %]
259                 </li>
260     [% UNLESS ( I ) %]
261                 <li class="radio">
262                 
263                 [% IF ( female ) %]
264                                 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" checked="checked"  />
265 [% ELSE %]
266                                 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
267 [% END %]
268                 [% IF ( male ) %]
269                 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" checked="checked" />
270 [% ELSE %]
271                                 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
272 [% END %]
273 [% IF ( none ) %]
274                                 <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value=""  checked="checked"  />
275 [% ELSE %]
276                                 <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" />
277 [% END %]
278         </li>
279     [% END %]
280                 </ol>
281         </fieldset>
282         
283 [% IF ( showguarantor ) %]<input type="hidden" id="guarantorid" name="guarantorid"   value="[% guarantorid %]" />
284     <fieldset class="rows">
285         <legend>Guarantor Information</legend>
286         <ol>
287 [% IF ( P ) %]
288                 [% IF ( guarantorid ) %]
289                 <li id="contact-details">
290                 [% ELSE %]
291                 <li id="contact-details" style="display: none">
292                 [% END %]
293                     <span class="label">Organization #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
294                 </li>
295                 <li>
296                     <label for="contactname">Organization name: </label>
297                     [% IF ( guarantorid ) %]
298                     <span>[% contactname %]</span>
299                     <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" />
300                     [% ELSE %]
301                     <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
302                     [% END %]
303                 </li>
304 [% ELSE %]
305  [% IF ( C ) %]
306  [% IF ( guarantorid ) %]
307  <li id="contact-details">
308  [% ELSE %]
309  <li id="contact-details" style="display: none">
310  [% END %]
311      <span class="label">Patron #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
312  </li>
313  <li>
314      <label for="contactname">Surname: </label>
315      [% IF ( guarantorid ) %]
316      <span>[% contactname %]</span>
317      <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" />
318      [% ELSE %]
319      <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
320      [% END %]
321  </li>
322  <li>
323      <label for="contactfirstname">First name: </label>
324      [% IF ( guarantorid ) %]
325      <span>[% contactfirstname %]</span>
326      <input name="contactfirstname" id="contactfirstname" type="hidden" size="20" value="[% contactfirstname %]" />
327      [% ELSE %]
328      <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
329      [% END %]
330  </li>
331  [% IF ( relshiploop ) %]
332  <li>
333      <label for="relationship">Relationship: </label>
334      <select name="relationship" id="relationship" >
335          [% FOREACH relshiploo IN relshiploop %]
336          [% IF ( relshiploo.selected ) %]
337          <option value="[% relshiploo.relationship %]" selected="selected" >[% relshiploo.relationship %]</option>
338          [% ELSE %]
339          <option value="[% relshiploo.relationship %]">[% relshiploo.relationship %]</option>
340          [% END %]
341          [% END %]
342      </select>
343  </li>
344  [% END %]
345  [% END %]
346 [% END %]
347         <li>
348             <span class="label">&nbsp;</span>
349             [% IF ( guarantorid ) %]
350             <input id="guarantorsearch" type="button" value="Change" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
351             [% ELSE %]
352             <input id="guarantorsearch" type="button" value="Set to Patron" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
353             [% END %]
354             <input id="guarantordelete" type="button" value="Delete" />
355         </li>
356         </ol>
357     </fieldset>
358
359 [% END %]
360 <fieldset class="rows">
361     <legend>Main address</legend><ol>
362     <li>
363       [% IF ( mandatorystreetnumber ) %]
364       <label for="streetnumber" class="required">
365       [% ELSE %]
366       <label for="streetnumber">
367       [% END %]
368       Street number: </label>
369       <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
370 [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %]
371     </li>
372     [% IF ( road_cgipopup ) %]
373       <li>
374       [% IF ( mandatorystreettype ) %]
375       <label for="streettype" class="required">
376       [% ELSE %]
377       <label for="streettype">
378       [% END %]
379       Street type: </label>
380       [% roadpopup %]
381           [% IF ( mandatorystreettype ) %]<span class="required">Required</span>[% END %]
382       </li>
383     [% END %] 
384     <li>
385       [% IF ( mandatoryaddress ) %]
386       <label for="address" class="required">
387       [% ELSE %]
388       <label for="address">
389       [% END %]
390       Address: </label>
391       <input type="text" id="address" name="address" size="35" value="[% address %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
392           [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %]
393     </li>
394     <li>
395       [% IF ( mandatoryaddress2 ) %]
396       <label for="address2" class="required">
397       [% ELSE %]
398       <label for="address2">
399       [% END %]
400       Address 2: </label>
401       <input type="text" id="address2" name="address2" size="35" value="[% address2 %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
402           [% IF ( mandatoryaddress2 ) %]<span class="required">Required</span>[% END %]
403     </li>  
404     <li>
405       [% IF ( mandatorycity ) %]
406         <label for="city" class="required">
407       [% ELSE %]
408         <label for="city">
409       [% END %]
410       City: </label>
411         
412         <input type="text" id="city" name="city" size="20" value="[% city %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
413         [% IF ( city_cgipopup ) %]or <strong>choose</strong>
414         <select id="select_city" name="select_city">
415         [% FOREACH city_loo IN city_loop %]
416             [% IF ( city_loo.selected ) %]
417             <option value="[% city_loo.city_zipcode %]|[% city_loo.city_name %]" selected="selected">
418             [% ELSE %]
419             <option value="[% city_loo.city_zipcode %]|[% city_loo.city_name %]">
420             [% END %]
421                 [% city_loo.city_name %] [% city_loo.city_zipcode %]
422             </option>
423         [% END %]
424         </select>
425         [% END %]
426           [% IF ( mandatorycity ) %]<span class="required">Required</span>[% END %]
427     </li>
428     <li> 
429       [% IF ( mandatorystate ) %]
430         <label for="state" class="required">
431       [% ELSE %]
432         <label for="state">
433       [% END %]
434       State: </label>
435       <input type="text" name="state" id="state" size="20" value="[% state %]" />
436           [% IF ( mandatorystate ) %]<span class="required">Required</span>[% END %]
437     </li>
438     <li> 
439       [% IF ( mandatoryzipcode ) %]
440         <label for="zipcode" class="required">
441       [% ELSE %]
442         <label for="zipcode">
443       [% END %]
444       Zip/Postal code: </label>
445       <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
446           [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %]
447     </li>
448     
449     <li> 
450       [% IF ( mandatorycountry ) %]
451         <label for="country" class="required">
452       [% ELSE %]
453         <label for="country">
454       [% END %]
455       Country: </label>
456       <input type="text" name="country" id="country" size="20" value="[% country %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
457           [% IF ( mandatorycountry ) %]<span class="required">Required</span>[% END %]
458     </li>    
459   
460         </ol>
461     </fieldset>
462   <fieldset class="rows" id="memberentry_contact">
463     <legend>Contact</legend><ol>
464       <li>
465       [% IF ( mandatoryphone ) %] 
466       <label for="phone" class="required">
467       [% ELSE %]
468       <label for="phone">
469       [% END %]
470       Phone (home): </label>
471       <input type="text" id="phone" name="phone" value="[% phone %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
472           [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
473
474     </li>
475     <li>
476       [% IF ( mandatoryphonepro ) %]
477       <label for="phonepro" class="required">
478       [% ELSE %]
479       <label for="phonepro">
480       [% END %]
481       Phone (work): </label>
482       <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
483           [% IF ( mandatoryphonepro ) %]<span class="required">Required</span>[% END %]
484     </li>
485     <li>
486       [% IF ( mandatorymobile ) %]
487       <label for="mobile" class="required">
488       [% ELSE %]
489       <label for="mobile">
490       [% END %]
491       Phone (cell): </label>
492       <input type="text" id="mobile" name="mobile" value="[% mobile %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
493           [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %]
494     </li>
495     <li>
496       [% IF ( mandatoryemail ) %]
497       <label for="email" class="required">
498       [% ELSE %]
499       <label for="email">
500       [% END %]
501       Primary Email: </label>
502       <input type="text" id="email" name="email" size="45" value="[% email %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />  
503           [% IF ( mandatoryemail ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
504
505     </li>
506     <li>
507       [% IF ( mandatoryemailpro ) %] 
508       <label for="emailpro" class="required">
509       [% ELSE %]
510       <label for="emailpro">
511       [% END %]
512       Secondary Email: </label>
513       <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
514           [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
515     </li>
516     <li>
517       [% IF ( mandatoryfax ) %]
518       <label for="fax" class="required">
519       [% ELSE %]
520       <label for="fax">
521       [% END %]
522       Fax: </label>
523       <input type="text" id="fax" name="fax" value="[% fax %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
524           [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
525     </li>
526         </ol>
527   </fieldset>
528
529
530 <!-- ************************ STEP_1 *********************** -->
531 [% END %]
532 [% IF ( step_6 ) %]
533
534                 <fieldset class="rows" id="memberentry_address">
535                 <legend>Alternate address</legend><ol>
536                         <li>
537                                 [% IF ( mandatoryB_address ) %]
538                                         <label for="B_address" class="required">
539                                 [% ELSE %]
540                                         <label for="B_address">
541                                 [% END %]
542                                 Address: </label>
543                                 <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
544           [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %]
545                         </li>
546                         <li>
547                                 [% IF ( mandatoryB_address2 ) %]
548                                         <label for="B_address2" class="required">
549                                 [% ELSE %]
550                                         <label for="B_address2">
551                                 [% END %]
552                                 Address 2: </label>
553                                 <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
554           [% IF ( mandatoryB_address2 ) %]<span class="required">Required</span>[% END %]
555                         </li>
556                         <li>
557                                 [% IF ( mandatoryB_city ) %]
558                                         <label for="B_city" class="required" >
559                                 [% ELSE %]
560                                         <label for="B_city">
561                                 [% END %]
562                                 City: </label>
563                                 <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" />
564           [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %]
565                         </li>
566                         <li>
567                                 [% IF ( mandatoryB_state ) %]
568                                         <label for="B_state" class="required" >
569                                 [% ELSE %]
570                                         <label for="B_state">
571                                 [% END %]
572                                 State: </label>
573                                 <input type="text" id="B_state" name="B_state" size="20" value="[% B_state %]" />
574           [% IF ( mandatoryB_state ) %]<span class="required">Required</span>[% END %]
575                         </li>
576                         <li>
577                                 [% IF ( mandatoryB_zipcode ) %]
578                                         <label for="B_zipcode" class="required">
579                                 [% ELSE %]
580                                         <label for="B_zipcode">
581                                 [% END %]
582                                 Zip/Postal code: </label>
583                                 <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
584           [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %]
585                         </li>
586                         <li>
587                                 [% IF ( mandatoryB_country ) %]
588                                         <label for="B_country" class="required">
589                                 [% ELSE %]
590                                         <label for="B_country">
591                                 [% END %]
592                                 Country: </label>
593                                 <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
594           [% IF ( mandatoryB_country ) %]<span class="required">Required</span>[% END %]
595                         </li>
596             <li>
597                 [% IF ( mandatoryB_phone ) %]
598                 <label for="B_phone" class="required">
599                 [% ELSE %]
600                 <label for="B_phone">
601                 [% END %]
602                 Phone: </label>  
603                 <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
604                 [% IF ( mandatoryB_phone ) %]<span class="required">Required</span>[% END %]
605             </li>
606                         <li> 
607         [% IF ( mandatoryB_email ) %]
608           <label for="B_email" class="required">
609         [% ELSE %]
610           <label for="B_email">
611         [% END %]
612         Email: </label>
613         <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
614                 [% IF ( mandatoryB_email ) %]<span class="required">Required</span>[% END %] </li>
615             <li>
616                 [% IF ( mandatorycontactnote ) %]
617                 <label for="contactnote" class="required">
618                 [% ELSE %]
619                 <label for="contactnote">
620                 [% END %]
621                 Contact note: </label>
622                 <textarea id="contactnote" name="contactnote" cols="40" rows="2">[% contactnote %]</textarea>
623         [% IF ( mandatorycontactnote ) %]<span class="required">Required</span>[% END %]
624             </li>
625                         </ol>
626                 </fieldset>
627 [% END %]               
628 [% IF ( step_2 ) %]
629                 <fieldset class="rows" id="memberentry_altaddress">       
630                     <legend>Alternate Contact</legend><ol>
631                         <li>
632                             [% IF ( mandatoryaltcontactsurname ) %]
633                                 <label for="altcontactsurname" class="required">
634                                 [% ELSE %]
635                                 <label for="altcontactsurname">
636                                 [% END %]
637                                 Surname:</label>
638                                 <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
639                                 [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
640                         </li>
641                         <li>
642                             [% IF ( mandatoryaltcontactfirstname ) %]
643                                 <label for="altcontactfirstname" class="required">
644                                 [% ELSE %]
645                                 <label for="altcontactfirstname">
646                                 [% END %]
647                                 First name:</label>
648                                 <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
649                                 [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
650                         </li>
651                         <li>
652                             [% IF ( mandatoryaltcontactaddress1 ) %]
653                                 <label for="altcontactaddress1" class="required">
654                                 [% ELSE %]
655                                 <label for="altcontactaddress1">
656                                 [% END %]
657                                 Address:</label>
658                                 <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] size="40" />
659                                 [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
660                         </li>
661                         <li>
662                             [% IF ( mandatoryaltcontactaddress2 ) %]
663                                 <label for="altcontactaddress2" class="required">
664                                 [% ELSE %]
665                                 <label for="altcontactaddress2">
666                                 [% END %]
667                                 Address 2:</label>
668                                 <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] size="40" />
669                                 [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
670                         </li>
671                         <li>
672                             [% IF ( mandatoryaltcontactaddress3 ) %]
673                                 <label for="altcontactaddress3" class="required">
674                                 [% ELSE %]
675                                 <label for="altcontactaddress3">
676                                 [% END %]
677                                 City:</label>
678                                 <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" />
679                                 [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
680                         </li>
681                         <li>
682                             [% IF ( mandatoryaltcontactstate ) %]
683                                 <label for="altcontactstate" class="required">
684                                 [% ELSE %]
685                                 <label for="altcontactstate">
686                                 [% END %]
687                                 State:</label>
688                                 <input type="text" name="altcontactstate" id="altcontactstate" value="[% altcontactstate %]" size="20" />
689                                 [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
690                         </li>
691                         <li>
692                             [% IF ( mandatoryaltcontactzipcode ) %]
693                                 <label for="altcontactzipcode" class="required">
694                                 [% ELSE %]
695                                 <label for="altcontactzipcode">
696                                 [% END %]
697                                 Zip/Postal code:</label>
698                                 <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] size="5" />
699                                 [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
700                         </li>
701                         <li>
702                             [% IF ( mandatoryaltcontactcountry ) %]
703                                 <label for="altcontactcountry" class="required">
704                                 [% ELSE %]
705                                 <label for="altcontactcountry">
706                                 [% END %]
707                                 Country:</label>
708                                 <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] size="20" />
709                                 [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
710                         </li>                   
711                         <li>
712                             [% IF ( mandatoryaltcontactphone ) %]
713                                 <label for="altcontactphone" class="required">
714                                 [% ELSE %]
715                                 <label for="altcontactphone">
716                                 [% END %]
717                                 Phone:</label>
718                                 <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
719                                 [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
720                         </li>
721             </ol>
722         </fieldset>
723
724
725   [% IF ( I ) %]
726         [% IF ( memberofinstution ) %]
727         <fieldset class="rows" id="memberentry_organisation">
728                 <legend>Organizations</legend><ol>
729                 <li>
730                         [% IF ( mandatoryphone ) %] 
731                         <label for="organisations" class="required">
732                         [% ELSE %]
733                         <label for="organisations">
734                         [% END %]
735                         Organization(s): </label>
736                         [% CGIorganisations %]
737           [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]
738                 </li>
739                 </ol>
740         </fieldset>
741         [% END %]
742   [% END %]
743               
744 [% END %]
745 [% IF ( step_3 ) %]
746
747   <fieldset class="rows" id="memberentry_library_management">
748     <legend>Library Management</legend><ol>
749    <li> [% IF ( mandatorycardnumber ) %]
750       <label for="cardnumber" class="required">
751     [% ELSE %]
752       <label for="cardnumber">
753     [% END %] 
754     Card number: </label>
755     <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% cardnumber %][% END %]" />
756           [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]</li>
757     <li>
758       [% IF ( mandatorybranchcode ) %]
759         <label for="branchcode" class="required">
760       [% ELSE %]
761         <label for="branchcode">
762       [% END %]
763       Library: </label>
764       [% CGIbranch %]
765           [% IF ( mandatorybranchcode ) %]<span class="required">Required</span>[% END %]
766     </li>
767     <li>
768         <label for="categorycode">Category: </label>
769         <select id="categorycode" name="categorycode">
770         [% FOREACH typeloo IN typeloop %]
771                         [% FOREACH categoryloo IN typeloo.categoryloop %]
772                                 [% IF ( loop.first ) %]
773                                         [% IF ( categoryloo.typename_C ) %]<optgroup label="Child">[% END %]
774                                         [% IF ( categoryloo.typename_A ) %]<optgroup label="Adult">[% END %]
775                                         [% IF ( categoryloo.typename_S ) %]<optgroup label="Staff">[% END %]
776                                         [% IF ( categoryloo.typename_I ) %]<optgroup label="Organization">[% END %]
777                                         [% IF ( categoryloo.typename_P ) %]<optgroup label="Professional">[% END %]
778                                         [% IF ( categoryloo.typename_X ) %]<optgroup label="Statistical">[% END %]
779                             [% END %]
780                                 [% IF ( categoryloo.categorycodeselected ) %]
781                <option value="[% categoryloo.categorycode %]" selected="selected">[% categoryloo.categoryname %]</option>
782                                 [% ELSE %]
783 <option value="[% categoryloo.categorycode %]">[% categoryloo.categoryname %]</option>
784                                 [% END %]
785                                 [% IF ( loop.last ) %]
786                                 </optgroup>
787                                 [% END %]
788             [% END %]
789        [% END %]
790        </select>
791     </li>
792     <li>
793       [% IF ( mandatorysort1 ) %]
794         <label for="sort1" class="required">
795       [% ELSE %]
796         <label for="sort1">
797       [% END %]
798       Sort 1: </label>
799       [% IF ( CGIsort1 ) %] 
800         [% CGIsort1 %]
801       [% ELSE %]
802         <input  type="text" id="sort1" name="sort1" size="20"  value="[% sort1 %]" />
803           [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
804       [% END %]   
805     </li>
806     <li>
807     [% IF ( mandatorysort2 ) %]
808     <label for="sort2" class="required">
809     [% ELSE %]
810     <label for="sort2">
811     [% END %]
812     Sort 2: </label>
813     [% IF ( CGIsort2 ) %] 
814       [% CGIsort2 %]
815     [% ELSE %]
816       <input  type="text" id="sort2" name="sort2" size="20"  value="[% sort2 %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
817           [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
818     [% END %] 
819     </li>
820         </ol>
821   </fieldset>
822         <fieldset class="rows" id="memberentry_subscription">
823         <legend>Library set-up</legend><ol>
824                 <li>
825                         [% IF ( mandatorydateenrolled ) %]
826                         <label for="dateenrolled" class="required">
827                         [% ELSE %]
828                         <label for="dateenrolled">
829                         [% END %]
830                         Registration date: </label>
831                         <input type="text" id="dateenrolled" name="dateenrolled"  maxlength="10" size="10" [% IF ( metric ) %]onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');"[% END %] value="[% dateenrolled %]" />
832             <img src="[% themelang %]/lib/calendar/cal.gif" id="dateenrolled_button" alt="Show Calendar" />
833       <script language="JavaScript" type="text/javascript">
834         Calendar.setup(
835           {
836             inputField : "dateenrolled",
837             ifFormat : "[% DHTMLcalendar_dateformat %]",
838             button : "dateenrolled_button"
839           }
840         );
841       </script>
842                 [% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
843                 [% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
844                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
845                 </li>
846                 <li>
847                         [% IF ( mandatorydateexpiry ) %]
848                         <label for="dateexpiry" class="required">
849                         [% ELSE %]
850                         <label for="dateexpiry">
851                         [% END %]
852                         Expiry date (leave blank for auto calc) </label>
853                         <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10"  size="10" [% IF ( metric ) %]onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');"[% END %] value="[% UNLESS ( opadd ) %][% dateexpiry %][% END %]" />
854             <img src="[% themelang %]/lib/calendar/cal.gif" id="dateexpiry_button" alt="Show Calendar" />
855       <script language="JavaScript" type="text/javascript">
856         Calendar.setup(
857           {
858             inputField : "dateexpiry",
859             ifFormat : "[% DHTMLcalendar_dateformat %]",
860             button : "dateexpiry_button"
861           }
862         );
863       </script>
864                 [% IF ( mandatorydateexpiry ) %]<span class="required">Required</span>[% END %]
865                 [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
866                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
867                 </li>
868                 <li>
869                         [% IF ( mandatoryopacnote ) %]
870                                 <label for="opacnote" class="required">
871                         [% ELSE %]
872                                 <label for="opacnote">
873                         [% END %]       
874                         OPAC note: </label>
875                         <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% opacnote %]</textarea>
876                         <div class="hint">This message appears on this patron's user page in the OPAC</div>
877           [% IF ( mandatoryopacnote ) %]<span class="required">Required</span>[% END %]
878                 </li>
879                 <li>
880                         [% IF ( mandatoryborrowernotes ) %]     
881                                 <label for="borrowernotes" class="required">
882                         [% ELSE %]
883                                 <label for="borrowernotes">
884                         [% END %]
885                         Circulation note: </label>
886                         <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrowernotes %]</textarea>
887                         <div class="hint">This message displays when checking out to this patron</div>
888           [% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
889                 </li>
890                 </ol>
891         </fieldset>
892         <fieldset class="rows" id="memberentry_userid">
893                 <legend>OPAC/Staff Login</legend><ol>
894                 <li>
895                         [% IF ( mandatoryuserid ) %]
896                         <label for="userid" class="required">
897                         [% ELSE %]
898                         <label for="userid">
899                         [% END %]
900                         Username: </label>
901
902 [% IF ( NoUpdateLogin ) %]
903 <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% IF ( opduplicate ) %][% ELSE %][% userid %][% END %]" />
904 [% ELSE %]
905 <input type="text" id="userid" name="userid" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% userid %][% END %]" />
906 [% END %]
907
908           [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
909                 </li>
910                 <li>
911                         [% IF ( mandatorypassword ) %]
912                         <label for="password" class="required">
913                         [% ELSE %]
914                         <label for="password">
915                         [% END %]
916                         Password: </label>
917                         [% IF ( opadd ) %]
918                         [% IF ( NoUpdateLogin ) %]
919                                 <input type="text" id="password" name="password" size="20"  disabled="disabled" value="[% IF ( opduplicate ) %][% ELSE %][% password %][% END %]" />
920 [% ELSE %]
921                                 <input type="text" id="password" name="password" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% password %][% END %]" />
922 [% END %]
923                         [% ELSE %]
924                         [% IF ( password ) %]
925                                 [% IF ( NoUpdateLogin ) %]
926                                         <input type="text" id="password" name="password" size="20"  disabled="disabled" value="****" />
927                                 [% ELSE %]
928                                         <input type="text" id="password" name="password" size="20" value="[% IF ( opduplicate ) %][% ELSE %]****[% END %]" />
929                                 [% END %]
930                         [% ELSE %]
931                                 [% IF ( NoUpdateLogin ) %]
932                                         <input type="text" id="password" name="password" size="20"  disabled="disabled" value="" />
933                                 [% ELSE %]
934                                         <input type="text" id="password" name="password" size="20" value="" />
935                                 [% END %]
936                         [% END %]
937                         [% END %]
938           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_short_password ) %]<span class="required">Password is too short</span>[% END %]
939 [% IF ( minPasswordLength ) %]<div class="hint">Minimum password length: [% minPasswordLength %]</div>[% END %]
940                 </li></ol>
941                 </fieldset>
942                 <!--this zones are not necessary in modif mode -->
943                 [% UNLESS ( opadd ) %]
944                 <fieldset class="rows">
945                         <legend>Patron Account Flags</legend>
946                         <ol class="radio">
947                         [% FOREACH flagloo IN flagloop %]
948                                 <li><label class="radio" for="yes[% flagloo.name %]">
949                                 [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no Address:[% END %]
950                                 [% IF ( flagloo.key == 'debarred' ) %]Debarred:[% END %]
951                                 [% IF ( flagloo.key == 'lost' ) %]Lost Card:[% END %]
952                 </label>
953                                 <label for="yes[% flagloo.name %]">Yes </label>
954                                 [% IF ( flagloo.yes ) %]
955                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" checked="checked" />
956                                 [% ELSE %]
957                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" />
958                                 [% END %]
959                                 <label for="no[% flagloo.name %]">No </label>
960                                 [% IF ( flagloo.no ) %]
961                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" checked="checked"/>
962                                 [% ELSE %]
963                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" />
964                                 [% END %]
965
966 </li>
967                         [% END %]
968                         </ol>
969                         </fieldset>
970                 [% END %]       
971
972 [% END %]
973
974 [% IF ( step_4 ) %][% IF ( ExtendedPatronAttributes ) %][% UNLESS ( no_patron_attribute_types ) %]
975   <fieldset class="rows" id="memberentry_patron_attributes">
976     <input type="hidden" name="setting_extended_patron_attributes" value="1" />
977     <legend>Additional attributes and identifiers</legend>
978     <table>
979         <tr>
980             <th>Type</th>
981             <th colspan="2">Value</th>
982         </tr>
983         [% FOREACH patron_attribute IN patron_attributes %]
984         <tr>
985             <td>[% patron_attribute.code %] ([% patron_attribute.description %])
986             </td>
987             <td>
988                 <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
989                 [% IF ( patron_attribute.use_dropdown ) %]
990                     <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
991                         <option value="" />
992                         [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
993                             [% IF ( auth_val_loo.selected ) %]
994                                 <option value="[% auth_val_loo.authorised_value %]" selected="selected">
995                                     [% auth_val_loo.lib %]
996                                 </option>
997                             [% ELSE %]
998                                 <option value="[% auth_val_loo.authorised_value %]" >
999                                     [% auth_val_loo.lib %]
1000                                 </option>
1001                             [% END %]
1002                         [% END %]
1003                     </select>
1004                 [% ELSE %]
1005                     <input type="text" maxlength="64" value="[% patron_attribute.value %]"
1006                            id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]"[% IF ( patron_attribute.opduplicate ) %] onclick="this.value=''"[% END %] />
1007                 [% END %]
1008                 [% IF ( patron_attribute.password_allowed ) %]
1009                     (Password: <input type="password" maxlength="64" value="[% patron_attribute.password %]"
1010                            id="[% patron_attribute.form_id %]_password" name="[% patron_attribute.form_id %]_password" />)
1011                 [% END %]
1012             </td>
1013             <td>
1014                 <a href="#" onclick="clear_entry(this); return false;">Clear</a>
1015                 [% IF ( patron_attribute.repeatable ) %]
1016                 <a href="#" onclick="clone_entry(this); return false;">New</a>
1017                 [% END %]
1018             </td>
1019         </tr>
1020         [% END %]
1021     </table>
1022   </fieldset>
1023 [% END %][% END %][% END %]
1024
1025 [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
1026   <fieldset class="rows" id="memberentry_messaging_prefs">
1027     [% IF ( opadd ) %]
1028     <!-- handle changing prefs if creating new patron and changing
1029          the patron category
1030     -->
1031     <script language="javascript" type="text/javascript">//<![CDATA[
1032        $(document).ready(function(){
1033             var message_prefs_dirty = false;
1034             $('#memberentry_messaging_prefs > *').change(function() {
1035                 message_prefs_dirty = true;
1036             });
1037             $('#categorycode').change(function() {
1038                 var categorycode = $(this).val();
1039                 if (message_prefs_dirty) {
1040                     if (!confirm('Change messaging preferences to default for this category?')) {
1041                         return;
1042                     }
1043                 }
1044                 $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode,
1045                     function(data) {
1046                         $.each(data.messaging_preferences, function(i, item) {
1047                             var attrid = item.message_attribute_id;
1048                             var transports = ['email', 'rss', 'sms'];
1049                             $.each(transports, function(j, transport) {
1050                                 if (item['transport-' + transport] != ' ') {
1051                                     $('#' + transport + attrid).attr('checked', item['transport-' + transport]);
1052                                 } else {
1053                                     $('#' + transport + attrid).removeAttr('checked');
1054                                 }
1055                             });
1056                             if (item.digest && item.digest != ' ') {
1057                                 $('#digest' + attrid).attr('checked', item.digest);
1058                             } else {
1059                                 $('#digest' + attrid).removeAttr('checked');
1060                             }
1061                             if (item.takes_days == '1') {
1062                                 $('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance);
1063                             }
1064                         });
1065                         message_prefs_dirty = false;
1066                     }
1067                 );
1068             });
1069         });
1070     //]]>
1071     </script>
1072     [% END %]
1073     <input type="hidden" name="setting_messaging_prefs" value="1" />
1074     <legend>Patron messaging preferences</legend>
1075     [% IF type_only %]
1076         <i>If no preferences are selected, the default preferences for the category chosen will be applied on save, otherwise your selection here is saved</i>
1077     [% END %]
1078     [% INCLUDE 'messaging-preference-form.inc' %]
1079     [% IF ( SMSSendDriver ) %]
1080         <p><label for="SMSnumber">SMS number:</label> 
1081           <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] />
1082         </p>
1083     [% END %]
1084   </fieldset>
1085 [% END %] [% END %]
1086
1087     <fieldset class="action">
1088         <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
1089       [% IF ( opadd ) %]
1090        <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a>
1091            [% ELSE %]
1092           <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
1093            [% END %]
1094     </fieldset>
1095 </form>
1096   
1097 </div>
1098 </div>
1099
1100 [% UNLESS ( opadd ) %]<div class="yui-b">
1101 [% INCLUDE 'members-menu.inc' %]
1102 </div>[% END %]
1103 [% END %]
1104 </div>
1105 [% INCLUDE 'intranet-bottom.inc' %]
1106