Bug 15692 - Move some patron entry form JavaScript into members.js
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / memberentrygen.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Patrons &rsaquo; [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% INCLUDE 'calendar.inc' %]
7 <script type="text/javascript">
8 //<![CDATA[
9     $(document).ready(function() {
10
11         [% IF categorycode %]
12             update_category_code( "[% categorycode %]" );
13         [% ELSE %]
14             if ( $("#categorycode_entry").length > 0 ){
15                 var category_code = $("#categorycode_entry").find("option:selected").val();
16                 update_category_code( category_code );
17             }
18         [% END %]
19     });
20
21         var MSG_SEPARATOR = _("Separator must be / in field %s");
22         var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
23         var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s");
24         var MSG_INCORRECT_YEAR = _("Invalid year entered in field %s");
25         var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron");
26         var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization");
27         var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
28         var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
29         var MSG_PASSWORD_MISMATCH = _("The passwords entered do not match");
30         var MSG_PASSWORD_CONTAINS_TRAILING_SPACES = _("Password contains leading and/or trailing spaces.");
31         var LABEL_CHANGE = _("Change");
32         var LABEL_SET_TO_PATRON = _("Set to patron");
33 //]]>
34 </script>
35 <script type="text/javascript" src="[% themelang %]/js/members.js"></script>
36 </head>
37 <body id="pat_memberentrygen" class="pat">
38 [% INCLUDE 'header.inc' %]
39 [% INCLUDE 'patron-search.inc' %]
40
41 <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; 
42 [% IF (firstname || surname ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]</a>  &rsaquo;[% END %]
43 <strong>[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron ([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</strong>
44 </div>
45 [% IF ( opadd ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
46    
47    <div id="bd">
48         <div id="yui-main">
49         <div class="yui-b">
50     [% IF error_alert %]
51         [% IF ( error_alert == "no_email" ) %]
52             <div class="error">This member has no email</div>
53         [% ELSE %]
54             <div class="error">[% error_alert %]</div>
55         [% END %]
56     [% END %]
57     [% IF info_alert %]
58         <div class="dialog message">Email has been sent.</div>
59     [% END %]
60
61         [% IF ( no_add ) %]<div class="dialog alert"><h3>Cannot add patron</h3>
62             [% IF ( no_branches ) %]<p><strong>There are no libraries defined.</strong> [% IF ( CAN_user_parameters ) %]<a href="/cgi-bin/koha/admin/branches.pl">Please add a library.</a>[% ELSE %]An administrator must define at least one library.[% END %]</p>[% END %]
63             [% IF ( no_categories ) %]<p><strong>There are no patron categories defined.</strong> [% IF ( CAN_user_parameters ) %]<a href="/cgi-bin/koha/admin/categories.pl">Please add a patron category.</a>[% ELSE %]An administrator must define at least one patron category.</p>[% END %][% END %]</div>[% END %]
64
65         [% UNLESS ( no_add ) %]
66     <h1>[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</h1>
67   
68         [% IF ( check_member ) %]
69                         <div class="dialog alert">
70                                 <h3>Duplicate patron record?</h3>
71                                 <p><a class="popup" href="javascript:Dopop('moremember.pl?print=brief&amp;borrowernumber=[% check_member %]');" >View existing record</a></p>
72                 <form action="/cgi-bin/koha/members/memberentry.pl" method="get">
73                     <input type="hidden" name="op" value="modify" />
74                     <input type="hidden" name="borrowernumber" value="[% check_member %]" />
75                     <input class="edit" type="submit" value="It is a duplicate. Edit existing record" />
76                 </form>
77
78                 <form name="form_double" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
79                                 <input type="hidden" name="nodouble" value="1" />
80                                 <input class="new" type="submit" value="Not a duplicate. Save as new record" />
81                         </div>
82         [% END %]
83
84         [% IF ( nok ) %]
85                 <div class="dialog alert">
86                         <p>The following fields are wrong. Please fix them.</p>
87                         <ul>
88                         [% IF ( ERROR_login_exist ) %]
89                                 <li id="ERROR_login_exist">Username/password already exists.</li>
90                         [% END %]
91             [% IF ERROR_cardnumber_already_exists %]
92                 <li id="ERROR_cardnumber">Cardnumber already in use.</li>
93             [% END %]
94             [% IF ERROR_cardnumber_length %]
95                 <li id="ERROR_cardnumber">Cardnumber length is incorrect.</li>
96             [% END %]
97                         [% IF ( ERROR_age_limitations ) %]
98                                 <li id="ERROR_age_limitations">Patron's age is incorrect for their category.  
99                     Ages allowed are [% age_low %]-[% age_high %].</li>
100                         [% END %]
101                         [% IF ( ERROR_branch ) %]
102                                 <li id="ERROR_branch">Library is invalid.</li>
103                         [% END %]   
104                         [% IF ( ERROR_dateofbirth ) %]
105                                 <li id="ERROR_dateofbirth">Date of birth is invalid.</li>
106                         [% END %]
107                         [% IF ( ERROR_dateenrolled ) %]
108                                 <li id="ERROR_dateenrolled">Date of enrollment is invalid.</li>
109                         [% END %]
110                         [% IF ( ERROR_dateexpiry ) %]
111                                 <li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
112                         [% END %]
113                         [% IF ( ERROR_short_password ) %]
114                                 <li id="ERROR_short_password">Password must be at least [% minPasswordLength %] characters long.</li>
115                         [% END %]
116                         [% IF ( ERROR_password_mismatch ) %]
117                                 <li id="ERROR_password_mismatch">Passwords do not match.</li>
118                         [% END %]
119             [% IF ( ERROR_extended_unique_id_failed ) %]
120                 <li id="ERROR_extended_unique_id_failed"><strong>[% ERROR_extended_unique_id_failed_description %]</strong> attribute value <i>[% ERROR_extended_unique_id_failed_value %]</i> is already in use by another patron record.</li>
121                         [% END %]
122             [% IF ERROR_bad_email %]
123                 <li id="ERROR_bad_email">The primary email is invalid.</li>
124             [% END %]
125             [% IF ERROR_bad_email_secondary %]
126                 <li id="ERROR_bad_email_secondary">The secondary email is invalid.</li>
127             [% END %]
128             [% IF ERROR_bad_email_alternative %]
129                 <li id="ERROR_bad_email_alternative">The alternative email is invalid.</li>
130             [% END %]
131                         </ul>
132                 </div>
133         [% END %]
134
135
136 [% UNLESS ( check_member ) %]<form name="form" id="entryform"  action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
137 <input type="hidden" name="nodouble"  value="[% nodouble %]" /> [% END %]
138 <!--    field always hidden in different form (1,2,3) -->
139 <input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" />
140 <input type="hidden" name="category_type" value="[% category_type %]" />
141 <input type="hidden" name="updtype" value="[% updtype %]" />
142 <input type="hidden" name="destination" value="[% destination %]" />
143 <input type="hidden" name="check_member" value="[% check_member %]" />
144 <input type="hidden" name="borrowernumber" value="[% UNLESS opduplicate %][% borrowernumber %][% END %]" />
145 <input type="hidden" name="nodouble"  value="[% UNLESS opduplicate %][% nodouble %][% END %]" />
146 [% IF ( step ) %]<input type="hidden" name="step"  value="[% step %]" />[% END %]
147 [% IF ( opadd ) %]<input type="hidden" name="op" value="insert" />
148 [% ELSIF ( opduplicate ) %]
149 <input type="hidden" name="op" value="insert" />
150 [% ELSE %]
151 <input type="hidden" name="op" value="save" />
152 [% IF step == 4 || step == 5 || step == 6 || step == 2 || step == 1 %]
153 [%# Only put the cardnumber if we arent showing it in the form later %]
154 [% IF cardnumber %]
155 <input type="hidden" name="cardnumber" value="[% cardnumber %]" />
156 [% END %]
157 [% END %]
158 [% END %]
159
160 [% IF ( step_1 ) %]
161 [%UNLESS notitle && nosurname && nofirstname && nodateofbirth && noinitials && noothernames &&nosex %]
162         <fieldset class="rows" id="memberentry_identity">
163                 <legend id="identity_lgd">[% IF ( I ) %]Organization [% ELSE %]Patron [% END %]identity</legend>
164                 <ol>
165                 [% UNLESS ( I ) %]
166         [% UNLESS notitle %]
167                 [% IF ( title_cgipopup ) %]
168             <li>
169             [% IF ( mandatorytitle ) %]
170                 <label for="btitle" class="required">
171             [% ELSE %]
172                 <label for="btitle">
173             [% END %]
174             Salutation: </label>
175             [% borrotitlepopup %]
176             [% IF ( mandatorytitle ) %]<span class="required">Required</span>[% END %]
177             </li>
178                 [% END %]
179         [% END %]
180                 [% END %]
181         [% UNLESS nosurname %]
182                 <li>
183                 [% IF ( mandatorysurname ) %]
184                 <label for="surname" class="required">
185                 [% ELSE %]
186                 <label for="surname">
187                 [% END %]
188                 Surname: </label>
189                 [% IF ( uppercasesurnames ) %]
190             <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20"  value="[% surname %]" />
191                 [% ELSE %]
192             <input type="text" id="surname" name="surname" size="20"  value="[% surname %]" />
193                 [% END %]
194                 [% IF ( mandatorysurname ) %]<span class="required">Required</span>[% END %]
195                 </li>
196         [% END %]
197                 [% UNLESS ( I ) %]
198         [% UNLESS nofirstname %]
199             <li>
200                 [% IF ( mandatoryfirstname ) %]
201                 <label for="firstname" class="required">
202                 [% ELSE %]
203                 <label for="firstname">
204                 [% END %]
205                 First name: </label>
206                 <input type="text" id="firstname" name="firstname" size="20"  value="[% UNLESS opduplicate %][% firstname %][% END %]" />
207                 [% IF ( mandatoryfirstname ) %]<span class="required">Required</span>[% END %]
208             </li>
209         [% END %]
210         [% UNLESS nodateofbirth %]
211             <li>
212                 [% IF ( mandatorydateofbirth ) %]
213                 <label for="dateofbirth" class="required">
214                 [% ELSE %]
215                 <label for="dateofbirth">
216                 [% END %]
217                 Date of birth: </label>
218
219         [% IF ( dateformat == "metric" ) %]
220                 <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="[% UNLESS opduplicate %][% dateofbirth %][% END %]" />
221         [% ELSE %]
222                 <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% UNLESS opduplicate %][% dateofbirth %][% END %]" />
223         [% END %]
224
225         [% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
226         [% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
227                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
228             </li>
229         [% END %]
230         [% UNLESS noinitials %]
231             <li>
232                 [% IF ( mandatoryinitials ) %]
233                     <label for="initials" class="required">
234                 [% ELSE %]
235                     <label for="initials">
236                 [% END %]
237                 Initials: </label>
238                 <input type="text" id="initials" name="initials" size="20"  value="[% UNLESS opduplicate %][% initials %][% END %]" />
239                 [% IF ( mandatoryinitials ) %]<span class="required">Required</span>[% END %]
240             </li>
241         [% END %]
242         [% END %]
243         [% UNLESS noothernames %]
244                 <li>
245                         [% IF ( mandatoryothernames ) %]
246                         <label for="othernames" class="required">
247                         [% ELSE %]
248                         <label for="othernames">
249                         [% END %]
250             Other name: </label>
251             <input type="text" id="othernames" name="othernames" size="20"  value="[% UNLESS opduplicate %][% othernames %][% END %]" />
252 [% IF ( mandatoryothernames ) %]<span class="required">Required</span>[% END %]
253                 [% IF ( I ) %]<input type="hidden" name="sex" value="N" />[% END %]
254                 </li>
255         [% END %]
256     [% UNLESS ( I ) %]
257         [% UNLESS nosex %]
258                 <li class="radio">
259
260             [% UNLESS ( opduplicate ) %]
261                 [% IF ( female ) %]
262                     <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" checked="checked"  />
263                 [% ELSE %]
264                     <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
265                 [% END %]
266                 [% IF ( male ) %]
267                     <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" checked="checked" />
268                 [% ELSE %]
269                     <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
270                 [% END %]
271                 [% IF ( none ) %]
272                     <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value=""  checked="checked"  />
273                 [% ELSE %]
274                     <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" />
275                 [% END %]
276             [% ELSE %]
277                 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
278                 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
279                 <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
280             [% END %]
281
282         </li>
283         [% END %]
284     [% END %]
285                 </ol>
286         </fieldset>
287 [% END # hide fieldset %]
288
289 [% IF ( showguarantor ) %]<input type="hidden" id="guarantorid" name="guarantorid"   value="[% guarantorid %]" />
290     <fieldset class="rows">
291         <legend>Guarantor information</legend>
292         <ol>
293 [% IF ( P ) %]
294                 [% IF ( guarantorid ) %]
295                 <li id="contact-details">
296                 [% ELSE %]
297                 <li id="contact-details" style="display: none">
298                 [% END %]
299                     <span class="label">Organization #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
300                 </li>
301                 <li>
302                     <label for="contactname">Organization name: </label>
303                     [% IF ( guarantorid ) %]
304                     <span>[% contactname %]</span>
305                     <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" />
306                     [% ELSE %]
307                     <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
308                     [% END %]
309                 </li>
310 [% ELSE %]
311  [% IF ( C ) %]
312  [% IF ( guarantorid ) %]
313  <li id="contact-details">
314  [% ELSE %]
315  <li id="contact-details" style="display: none">
316  [% END %]
317      <span class="label">Patron #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
318  </li>
319         [% UNLESS nocontactname %]
320  <li>
321      <label for="contactname">Surname: </label>
322      [% IF ( guarantorid ) %]
323      <span>[% contactname %]</span>
324      <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" />
325      [% ELSE %]
326         <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
327      [% END %]
328  </li>
329         [% END %]
330         [% UNLESS nocontactfirstname %]
331  <li>
332      <label for="contactfirstname">First name: </label>
333      [% IF ( guarantorid ) %]
334      <span>[% contactfirstname %]</span>
335      <input name="contactfirstname" id="contactfirstname" type="hidden" size="20" value="[% contactfirstname %]" />
336      [% ELSE %]
337         <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]" />
338      [% END %]
339  </li>
340         [% END %]
341  [% IF ( relshiploop ) %]
342  <li>
343      <label for="relationship">Relationship: </label>
344      <select name="relationship" id="relationship" >
345          [% FOREACH relshiploo IN relshiploop %]
346          [% IF ( relshiploo.selected ) %]
347          <option value="[% relshiploo.relationship %]" selected="selected" >[% relshiploo.relationship %]</option>
348          [% ELSE %]
349          <option value="[% relshiploo.relationship %]">[% relshiploo.relationship %]</option>
350          [% END %]
351          [% END %]
352      </select>
353  </li>
354  [% END %]
355  [% END %]
356 [% END %]
357         <li>
358             <span class="label">&nbsp;</span>
359             [% IF ( guarantorid ) %]
360             <input id="guarantorsearch" type="button" value="Change" onclick="Dopopguarantor('guarantor_search.pl');" />
361             [% ELSE %]
362             <input id="guarantorsearch" type="button" value="Set to patron" onclick="Dopopguarantor('guarantor_search.pl');" />
363             [% END %]
364             <input id="guarantordelete" type="button" value="Delete" />
365         </li>
366     [% IF guarantorid && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
367         <li>
368             <label for="privacy_guarantor_checkouts">Show checkouts to guarantor</label>
369             <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
370                 [% IF privacy_guarantor_checkouts %]
371                     <option value="0">No</option>
372                     <option value="1" selected>Yes</option>
373                 [% ELSE %]
374                     <option value="0" selected>No</option>
375                     <option value="1">Yes</option>
376                 [% END %]
377             </select>
378             <div class="hint">Allow guarantor of this patron to view this patron's checkouts from the OPAC</div>
379         </li>
380     [% END %]
381         </ol>
382     </fieldset>
383
384 [% END %]
385 [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
386     [% IF Koha.Preference( 'AddressFormat' ) %]
387         [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
388     [% ELSE %]
389         [% INCLUDE 'member-main-address-style-us.inc' %]
390     [% END %]
391 [% END # nostreet && nocity etc group%]
392
393 [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
394   <fieldset class="rows" id="memberentry_contact">
395     <legend id="contact_lgd">Contact</legend><ol>
396         [% UNLESS nophone %]
397       <li>
398       [% IF ( mandatoryphone ) %] 
399       <label for="phone" class="required">
400       [% ELSE %]
401       <label for="phone">
402       [% END %]
403       Primary phone: </label>
404         <input type="text" id="phone" name="phone" value="[% phone %]" />
405           [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
406
407     </li>
408         [% END %]
409         [% UNLESS nophonepro %]
410     <li>
411       [% IF ( mandatoryphonepro ) %]
412       <label for="phonepro" class="required">
413       [% ELSE %]
414       <label for="phonepro">
415       [% END %]
416       Secondary phone: </label>
417     <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]" />
418           [% IF ( mandatoryphonepro ) %]<span class="required">Required</span>[% END %]
419     </li>
420         [% END %]
421         [% UNLESS nomobile %]
422     <li>
423       [% IF ( mandatorymobile ) %]
424       <label for="mobile" class="required">
425       [% ELSE %]
426       <label for="mobile">
427       [% END %]
428       Other phone: </label>
429         <input type="text" id="mobile" name="mobile" value="[% mobile %]" />
430           [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %]
431     </li>
432         [% END %]
433         [% UNLESS noemail %]
434     <li>
435       [% IF ( mandatoryemail ) %]
436       <label for="email" class="required">
437       [% ELSE %]
438       <label for="email">
439       [% END %]
440       Primary email: </label>
441         <input type="text" id="email" name="email" size="45" value="[% email %]" />
442           [% IF ( mandatoryemail ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
443
444     </li>
445         [% END %]
446         [% UNLESS noemailpro %]
447     <li>
448       [% IF ( mandatoryemailpro ) %] 
449       <label for="emailpro" class="required">
450       [% ELSE %]
451       <label for="emailpro">
452       [% END %]
453       Secondary email: </label>
454         <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]" />
455           [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
456     </li>
457         [% END %]
458         [% UNLESS nofax %]
459     <li>
460       [% IF ( mandatoryfax ) %]
461       <label for="fax" class="required">
462       [% ELSE %]
463       <label for="fax">
464       [% END %]
465       Fax: </label>
466         <input type="text" id="fax" name="fax" value="[% fax %]" />
467           [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
468     </li>
469         [% END %]
470         </ol>
471   </fieldset>
472 [%END # hide fieldset %]
473
474 <!-- ************************ STEP_1 *********************** -->
475 [% END %]
476 [% IF ( step_6 ) %]
477
478     [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
479         [% IF Koha.Preference( 'AddressFormat' ) %]
480             [% INCLUDE "member-alt-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
481         [% ELSE %]
482             [% INCLUDE 'member-alt-address-style-us.inc' %]
483         [% END %]
484     [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
485 [% END %]
486 [% IF ( step_2 ) %]
487     [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
488         [% IF Koha.Preference( 'AddressFormat' ) %]
489             [% INCLUDE "member-alt-contact-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
490         [% ELSE %]
491             [% INCLUDE 'member-alt-contact-style-us.inc' %]
492         [% END %]
493     [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
494
495 [% END %]
496 [% IF ( step_3 ) %]
497
498   <fieldset class="rows" id="memberentry_library_management">
499     <legend id="library_management_lgd">Library management</legend><ol>
500       [% UNLESS nocardnumber %]
501         <li>
502           [% IF ( mandatorycardnumber ) %]
503             <label for="cardnumber" class="required">
504           [% ELSE %]
505             <label for="cardnumber" class="validated">
506           [% END %]
507           Card number: </label>
508           [% IF minlength_cardnumber == maxlength_cardnumber %]
509                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
510                 [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
511                 <div class="hint">Card number must be exactly [% minlength_cardnumber %] characters.</div>
512           [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
513                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
514                 [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
515                 <div class="hint">Card number must be between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters.</div>
516           [% ELSIF maxlength_cardnumber %]
517                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
518                 [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
519                 <div class="hint">Card number can be up to [% maxlength_cardnumber %] characters.</div>
520           [% ELSE %]
521                 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
522                 [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
523                 <div class="hint">There is no minimum or maximum character length.</div>
524           [% END %]
525         </li>
526       [% END %]
527       [% UNLESS nobranchcode %]
528     <li>
529         <label for="libraries" class="required">Library:</label>
530         <select name="branchcode" size="1" id="libraries">
531         [%- FOREACH branchloo IN branchloop %]
532           [% IF ( branchloo.selected ) -%]
533             <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
534           [%- ELSE -%]
535             <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
536           [%- END -%]
537         [%- END %]
538       </select>
539       <span class="required">Required</span>
540     </li>
541         [% END %]
542     <li>
543         <label for="categorycode_entry" class="required">Category: </label>
544         <select id="categorycode_entry" name="categorycode" onchange="update_category_code(this);">
545         [% FOREACH typeloo IN typeloop %]
546             [% FOREACH categoryloo IN typeloo.categoryloop %]
547                 [% IF ( loop.first ) %]
548                     [% IF ( typeloo.typename_C ) %]<optgroup label="Child">[% END %]
549                     [% IF ( typeloo.typename_A ) %]<optgroup label="Adult">[% END %]
550                     [% IF ( typeloo.typename_S ) %]<optgroup label="Staff">[% END %]
551                     [% IF ( typeloo.typename_I ) %]<optgroup label="Organization">[% END %]
552                     [% IF ( typeloo.typename_P ) %]<optgroup label="Professional">[% END %]
553                     [% IF ( typeloo.typename_X ) %]<optgroup label="Statistical">[% END %]
554                 [% END %]
555                 [% IF ( categoryloo.categorycodeselected ) %]
556                     <option value="[% categoryloo.categorycode %]" selected="selected" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
557                 [% ELSE %]
558                     <option value="[% categoryloo.categorycode %]" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
559                 [% END %]
560                 [% IF ( loop.last ) %]
561                     </optgroup>
562                 [% END %]
563             [% END %]
564        [% END %]
565        </select>
566        <span class="required">Required</span>
567     </li>
568         [% UNLESS nosort1 %]
569     <li>
570       [% IF ( mandatorysort1 ) %]
571         <label for="sort1" class="required">
572       [% ELSE %]
573         <label for="sort1">
574       [% END %]
575       Sort 1: </label>
576       [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=sort1, size = 20 %]
577       [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
578     </li>
579         [% END %]
580         [% UNLESS nosort2 %]
581     <li>
582     [% IF ( mandatorysort2 ) %]
583     <label for="sort2" class="required">
584     [% ELSE %]
585     <label for="sort2">
586     [% END %]
587     Sort 2: </label>
588     [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=sort2, size = 20 %]
589     [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
590     </li>
591         [% END %]
592     [% IF ( Koha.Preference( 'NorwegianPatronDBEnable' ) == 1 ) %]
593         <li>
594             <label for="sort2">Sync with the Norwegian national patron database:</label>
595             [% IF ( sync == 0 ) %]
596                 <input type="radio" id="sync" name="sync" value="1"> Yes
597                 <input type="radio" id="sync" name="sync" value="0" checked> No
598             [% ELSE %]
599                 <input type="radio" id="sync" name="sync" value="1" checked> Yes
600                 <input type="radio" id="sync" name="sync" value="0"> No
601             [% END %]
602         </li>
603     [% END %]
604         </ol>
605   </fieldset>
606     [% UNLESS nodateenrolled &&  noopacnote && noborrowernotes %]
607         <fieldset class="rows" id="memberentry_subscription">
608         <legend id="library_setup_lgd">Library set-up</legend><ol>
609         [% UNLESS nodateenrolled %]
610                 <li>
611                         [% IF ( mandatorydateenrolled ) %]
612             <label for="from" class="required">
613                         [% ELSE %]
614             <label for="from">
615                         [% END %]
616                         Registration date: </label>
617             [% IF ( dateformat == "metric" ) %]
618                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled %]" class="datepickerfrom" />
619             [% ELSE %]
620                 <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled %]" class="datepickerfrom" />
621             [% END %]
622                 [% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
623                 [% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
624                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
625                 </li>
626         [% END %]
627         [% UNLESS nodateexpiry %]
628                 <li>
629         [% ELSE %]
630                 <li style="display:none">
631         [% END %]
632                         [% IF ( mandatorydateexpiry ) %]
633             <label for="to" class="required">
634                         [% ELSE %]
635             <label for="to">
636                         [% END %]
637                         Expiry date (leave blank for auto calc) </label>
638             [% IF ( dateformat == "metric" ) %]
639                                 [% UNLESS ( opadd ) %]
640                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% UNLESS opduplicate %][% dateexpiry %][% END %]" class="datepickerto" />
641                                 [% ELSE %]
642                     <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" class="datepickerto" />
643                                 [% END %]
644                         [% ELSE %]
645                                 [% UNLESS ( opadd ) %]
646                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" value="[% UNLESS opduplicate %][% dateexpiry %][% END %]" class="datepickerto" />
647                                 [% ELSE %]
648                 <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" class="datepickerto" />
649                                 [% END %]
650                         [% END %]
651                 [% IF ( mandatorydateexpiry ) %]<span class="required">Required</span>[% END %]
652                 [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
653                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
654                 </li>
655         [% UNLESS noopacnote %]
656                 <li>
657                         [% IF ( mandatoryopacnote ) %]
658                                 <label for="opacnote" class="required">
659                         [% ELSE %]
660                                 <label for="opacnote">
661                         [% END %]       
662                         OPAC note: </label>
663             <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% UNLESS opduplicate %][% opacnote %][% END %]</textarea>
664                         <div class="hint">This message appears on this patron's user page in the OPAC</div>
665           [% IF ( mandatoryopacnote ) %]<span class="required">Required</span>[% END %]
666                 </li>
667         [% END %]
668         [% UNLESS noborrowernotes %]
669                 <li>
670                         [% IF ( mandatoryborrowernotes ) %]     
671                                 <label for="borrowernotes" class="required">
672                         [% ELSE %]
673                                 <label for="borrowernotes">
674                         [% END %]
675                         Circulation note: </label>
676             <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% UNLESS opduplicate %][% borrowernotes %][% END %]</textarea>
677                         <div class="hint">This message displays when checking out to this patron</div>
678           [% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
679                 </li>
680         [% END %]
681                 </ol>
682         </fieldset>
683     [% END # hide fieldset %]
684
685     [% UNLESS nouserid && nopassword %]
686         <fieldset class="rows" id="memberentry_userid">
687         <legend id="opac_staff_login_lgd">OPAC/Staff login</legend><ol>
688         [% UNLESS nouserid %]
689                 <li>
690                         [% IF ( mandatoryuserid ) %]
691                         <label for="userid" class="required">
692                         [% ELSE %]
693                         <label for="userid">
694                         [% END %]
695                         Username: </label>
696
697 [% IF ( NoUpdateLogin ) %]
698         [% IF ( opduplicate ) %]
699                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
700         [% ELSE %]
701                 <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% userid %]" />
702         [% END %]
703 [% ELSE %]
704         [% IF ( opduplicate ) %]
705                 <input type="text" id="userid" name="userid" size="20" value="" />
706         [% ELSE %]
707                 <input type="text" id="userid" name="userid" size="20" value="[% userid %]" />
708         [% END %]
709 [% END %]
710
711 [%# Dummy input to avoid Firefox from using userid/password saved for authentication %]
712 <input type="text" disabled="disabled" style="display:none" />
713
714           [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
715                 </li>
716         [%END %]
717         [% UNLESS nopassword %]
718                 <li>
719                         [% IF ( mandatorypassword ) %]
720                         <label for="password" class="required">
721                         [% ELSE %]
722                         <label for="password">
723                         [% END %]
724                         Password: </label>
725                         [% IF ( opadd ) %]
726                         [% IF ( NoUpdateLogin ) %]
727                                 [% IF ( opduplicate ) %]
728                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" />
729                                 [% ELSE %]
730                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="[% password %]" />
731                                 [% END %]
732 [% ELSE %]
733                                 [% IF ( opduplicate ) %]
734                                         <input type="password" id="password" name="password" size="20" />
735                                 [% ELSE %]
736                                         <input type="password" id="password" name="password" size="20" value="[% password %]" />
737                                 [% END %]
738 [% END %]
739                         [% ELSE %]
740                         [% IF ( password ) %]
741                                 [% IF ( NoUpdateLogin ) %]
742                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="****" />
743                                 [% ELSE %]
744                                         [% IF ( opduplicate ) %]
745                                                 <input type="password" id="password" name="password" size="20" />
746                                         [% ELSE %]
747                                                 <input type="password" id="password" name="password" size="20" value="****" />
748                                         [% END %]
749                                 [% END %]
750                         [% ELSE %]
751                                 [% IF ( NoUpdateLogin ) %]
752                                         <input type="password" id="password" name="password" size="20"  disabled="disabled" value="" />
753                                 [% ELSE %]
754                                         <input type="password" id="password" name="password" size="20" value="" />
755                                 [% END %]
756                         [% END %]
757                         [% END %]
758           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_short_password ) %]<span class="required">Password is too short</span>[% END %]
759 [% IF ( minPasswordLength ) %]<div class="hint">Minimum password length: [% minPasswordLength %]</div>[% END %]
760                 </li>
761                 <li>
762                         [% IF ( mandatorypassword ) %]
763                         <label for="password2" class="required">
764                         [% ELSE %]
765                         <label for="password2">
766                         [% END %]
767                         Confirm password: </label>
768                         [% IF ( opadd ) %]
769                         [% IF ( NoUpdateLogin ) %]
770                                 [% IF ( opduplicate ) %]
771                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" />
772                                 [% ELSE %]
773                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="[% password %]" />
774                                 [% END %]
775 [% ELSE %]
776                                 [% IF ( opduplicate ) %]
777                                         <input type="password" id="password2" name="password2" size="20" />
778                                 [% ELSE %]
779                                         <input type="password" id="password2" name="password2" size="20" value="[% password %]" />
780                                 [% END %]
781 [% END %]
782                         [% ELSE %]
783                         [% IF ( password ) %]
784                                 [% IF ( NoUpdateLogin ) %]
785                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="****" />
786                                 [% ELSE %]
787                                         [% IF ( opduplicate ) %]
788                                                 <input type="password" id="password2" name="password2" size="20" />
789                                         [% ELSE %]
790                                                 <input type="password" id="password2" name="password2" size="20" value="****" />
791                                         [% END %]
792                                 [% END %]
793                         [% ELSE %]
794                                 [% IF ( NoUpdateLogin ) %]
795                                         <input type="password" id="password2" name="password2" size="20"  disabled="disabled" value="" />
796                                 [% ELSE %]
797                                         <input type="password" id="password2" name="password2" size="20" value="" />
798                                 [% END %]
799                         [% END %]
800                         [% END %]
801           [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
802                 </li>
803                 </ol>
804                 </fieldset>
805         [% END # hide fieldset %][% END %]
806                 <!--this zones are not necessary in modif mode -->
807         [% UNLESS ( opadd || opduplicate ) %]
808                 <fieldset class="rows">
809             <legend>Patron account flags</legend>
810                         <ol class="radio">
811                         [% FOREACH flagloo IN flagloop %]
812                                 <li><label class="radio" for="yes[% flagloo.name %]">
813                 [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no address:[% END %]
814                 [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %]
815                 </label>
816                 [% IF CAN_user_circulate_manage_restrictions %]
817                                 <label for="yes[% flagloo.name %]">Yes </label>
818                                 [% IF ( flagloo.yes ) %]
819                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" checked="checked" />
820                                 [% ELSE %]
821                                 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" />
822                                 [% END %]
823                                 <label for="no[% flagloo.name %]">No </label>
824                                 [% IF ( flagloo.no ) %]
825                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" checked="checked"/>
826                                 [% ELSE %]
827                                 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" />
828                                 [% END %]
829                 [% ELSE %]
830                   [% IF flagloo.yes %]Yes[% ELSE %]No[% END %]
831                 [% END %]
832
833             </li>
834                         [% END %]
835
836                         </ol>
837                         </fieldset>
838
839               <fieldset class="rows">
840                 <legend>Patron restrictions</legend>
841
842                 [% IF ( debarments ) %]
843                     <table>
844                         <thead>
845                             <tr>
846                                  <th>Type</th>
847                                  <th>Comment</th>
848                                  <th>Expiration</th>
849                                  [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
850                                    <th>Remove?</th>
851                                  [% END %]
852                             </tr>
853                         </thead>
854
855                         <tbody>
856                             [% FOREACH d IN debarments %]
857                                 <tr>
858                                     <td>[% d.type %]</td>
859                                     <td>[% d.comment %]</td>
860                                     <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
861                                     [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
862                                       <td>
863                                         <input type="checkbox" id="debarment_[% d.borrower_debarment_id %]" name="remove_debarment" value="[% d.borrower_debarment_id %]" />
864                                       </td>
865                                     [% END %]
866                                 </tr>
867                             [% END %]
868                         </tbody>
869                     </table>
870                 [% ELSE %]
871                     <p>Patron is currently unrestricted.</p>
872                 [% END %]
873
874                 [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
875                     <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
876                     <fieldset id="manual_restriction_form">
877                         <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
878                         <legend>Add manual restriction</legend>
879                         <ol>
880                             <li><label for="debarred_comment">Comment: </label><input type="text" id="debarred_comment" name="debarred_comment" onchange="$('#add_debarment').val(1);" /></li>
881                             <li><label for="debarred_expiration">Expiration: </label><input name="debarred_expiration" id="debarred_expiration" size="10" readonly="readonly" value="" class="datepicker" onchange="$('#add_debarment').val(1);" />
882                                     <a href='javascript:void(0)' onclick="$('#debarred_expiration').val('');">Clear date</a></li>
883
884                         </ol>
885                         <p>
886                             <a class="cancel" id="cancel_manual_restriction" href="#">Cancel</a>
887                         </p>
888                     </fieldset>
889                 [% END %]
890             </fieldset>
891                 [% END %]
892
893 [% END %]
894
895 [% IF ( step_4 ) %][% IF ( ExtendedPatronAttributes ) %][% UNLESS ( no_patron_attribute_types ) %]
896   <fieldset class="rows" id="memberentry_patron_attributes">
897     <legend>Additional attributes and identifiers</legend>
898     <input type="hidden" name="setting_extended_patron_attributes" value="1" />
899     [% FOREACH pa_loo IN patron_attributes %]
900         [% IF pa_loo.class %]
901             <fieldset id="aai_[% pa_loo.class %]">
902             <legend>[% pa_loo.lib %]</legend>
903         [% END %]
904         <ol class="attributes_table">
905             [% FOREACH patron_attribute IN pa_loo.items %]
906                 <li data-category_code="[% patron_attribute.category_code %]">
907                     <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
908                         <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
909                         [% IF ( patron_attribute.use_dropdown ) %]
910                             <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
911                                 <option value=""></option>
912                                 [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
913                                     [% IF ( auth_val_loo.selected ) %]
914                                         <option value="[% auth_val_loo.authorised_value %]" selected="selected">
915                                             [% auth_val_loo.lib %]
916                                         </option>
917                                     [% ELSE %]
918                                         <option value="[% auth_val_loo.authorised_value %]" >
919                                             [% auth_val_loo.lib %]
920                                         </option>
921                                     [% END %]
922                                 [% END %]
923                             </select>
924                         [% ELSE %]
925                             <textarea rows="2" cols="30" id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">[% patron_attribute.value %]</textarea>
926                         [% END %]
927                         [% IF ( patron_attribute.password_allowed ) %]
928                             (<label class="yesno" for="[% patron_attribute.form_id %]_password">Password:</label> <input type="password" maxlength="64" value="[% patron_attribute.password %]"
929                                    id="[% patron_attribute.form_id %]_password" name="[% patron_attribute.form_id %]_password" />)
930                         [% END %]
931                         <a href="#" class="clear-field" onclick="clear_entry(this); return false;">Clear</a>
932                         [% IF ( patron_attribute.repeatable ) %]
933                         <a href="#" class="clone-field" onclick="clone_entry(this); return false;">New</a>
934                         [% END %]
935                 </li>
936             [% END %]
937         </ol>
938         [% IF pa_loo.class %]</fieldset>[% END %]
939     [% END %]
940   </fieldset>
941 [% END %][% END %][% END %]
942
943 [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
944   <fieldset class="rows" id="memberentry_messaging_prefs">
945     <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
946     [% IF ( opadd ) %]
947     <!-- handle changing prefs if creating new patron and changing
948          the patron category
949     -->
950     <script type="text/javascript">//<![CDATA[
951        $(document).ready(function(){
952             var message_prefs_dirty = false;
953             $('#memberentry_messaging_prefs > *').change(function() {
954                 message_prefs_dirty = true;
955             });
956             $('#categorycode_entry').change(function() {
957                 var categorycode = $(this).val();
958                 if (message_prefs_dirty) {
959                     if (!confirm(_("Change messaging preferences to default for this category?"))) {
960                         return;
961                     }
962                 }
963                 $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode,
964                     function(data) {
965                         $.each(data.messaging_preferences, function(i, item) {
966                             var attrid = item.message_attribute_id;
967                             var transports = ['email', 'rss', 'sms'];
968                             $.each(transports, function(j, transport) {
969                                 if (item['transports_' + transport] == 1) {
970                                     $('#' + transport + attrid).attr('checked', 'checked');
971                                 } else {
972                                     $('#' + transport + attrid).removeAttr('checked');
973                                 }
974                             });
975                             if (item.digest && item.digest != ' ') {
976                                 $('#digest' + attrid).attr('checked', item.digest);
977                             } else {
978                                 $('#digest' + attrid).removeAttr('checked');
979                             }
980                             if (item.takes_days == '1') {
981                                 $('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance);
982                             }
983                         });
984                         message_prefs_dirty = false;
985                     }
986                 );
987             });
988         });
989     //]]>
990     </script>
991     [% END %]
992     <input type="hidden" name="setting_messaging_prefs" value="1" />
993     [% INCLUDE 'messaging-preference-form.inc' %]
994     [% IF ( SMSSendDriver ) %]
995         <p><label for="SMSnumber">SMS number:</label>
996             <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
997         </p>
998         <p>
999             <label for="sms_provider_id">SMS provider:</label>
1000             <select id="sms_provider_id" name="sms_provider_id"/>
1001                 <option value="">Unknown</option>
1002                 [% FOREACH s IN sms_providers %]
1003                     [% IF s.id == sms_provider_id %]
1004                         <option value="[% s.id %]" selected="selected">[% s.name %]</option>
1005                     [% ELSE %]
1006                         <option value="[% s.id %]">[% s.name %]</option>
1007                     [% END %]
1008                 [% END %]
1009             </select>
1010         </p>
1011     [% END %]
1012   </fieldset>
1013 [% END %] [% END %]
1014
1015 [% UNLESS ( check_member ) %]
1016     <fieldset class="action">
1017         <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
1018       [% IF ( opadd ) %]
1019        <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a>
1020            [% ELSE %]
1021           <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
1022            [% END %]
1023     </fieldset>
1024 [% END %]
1025 </form>
1026   
1027 </div>
1028 </div>
1029
1030 [% UNLESS ( opadd ) %]<div class="yui-b">
1031 [% INCLUDE 'members-menu.inc' %]
1032 </div>[% END %]
1033 [% END %]
1034 </div>
1035 [% INCLUDE 'intranet-bottom.inc' %]
1036