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