3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha › Patrons › [% 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">
9 $(document).ready(function() {
10 $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
11 $("#guarantordelete").click(function() {
12 $("#contact-details").hide().find('a').remove();
13 $("#guarantorid, #contactname, #contactfirstname").each(function () { this.value = "" });
14 $("#contactname, #contactfirstname")
15 .each(function () { this.type = 'text' })
16 .parent().find('span').remove();
17 $("#guarantorsearch").val("Set to Patron");
19 $("#select_city").change(function(){
20 var myRegEx=new RegExp(/(.*)\|(.*)\|(.*)\|(.*)/);
21 document.form.select_city.value.match(myRegEx);
22 document.form.zipcode.value=RegExp.$1;
23 document.form.city.value=RegExp.$2;
24 document.form.state.value=RegExp.$3;
25 document.form.country.value=RegExp.$4;
29 update_category_code( "[% categorycode %]" );
31 if ( $("#categorycode_entry").length > 0 ){
32 var category_code = $("#categorycode_entry").find("option:selected").val();
33 update_category_code( category_code );
36 $("#dateofbirth").datepicker({ maxDate: "-1D" });
37 $("#entryform").validate({
38 submitHandler: function(form) {
39 $("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting');
40 if (form.beenSubmitted)
43 form.beenSubmitted = true;
48 var mrform = $("#manual_restriction_form");
49 var mrlink = $("#add_manual_restriction");
51 mrlink.on("click",function(e){
56 $("#cancel_manual_restriction").on("click",function(e){
57 $('#debarred_expiration').val('');
58 $('#add_debarment').val(0);
59 $('#debarred_comment').val('');
66 function clear_entry(node) {
67 var original = $(node).parent();
68 $("textarea", original).attr('value', '');
69 $("select", original).attr('value', '');
72 function clone_entry(node) {
73 var original = $(node).parent();
74 var clone = original.clone();
76 var newId = 50 + parseInt(Math.random() * 100000);
77 $("input,select,textarea", clone).attr('id', function() {
78 return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
80 $("input,select,textarea", clone).attr('name', function() {
81 return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
83 $("label", clone).attr('for', function() {
84 return $(this).attr("for").replace(/patron_attr_\d+/, 'patron_attr_' + newId);
86 $("input#patron_attr_" + newId, clone).attr('value','');
87 $("select#patron_attr_" + newId, clone).attr('value','');
88 $(original).after(clone);
92 function update_category_code(category_code) {
93 if ( $(category_code).is("select") ) {
94 category_code = $("#categorycode_entry").find("option:selected").val();
96 var mytables = $(".attributes_table");
97 $(mytables).find("li").hide();
98 $(mytables).find(" li[data-category_code='"+category_code+"']").show();
99 $(mytables).find(" li[data-category_code='']").show();
102 var MSG_SEPARATOR = _("Separator must be / in field %s");
103 var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
104 var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s");
105 var MSG_INCORRECT_YEAR = _("Invalid year entered in field %s");
106 var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron");
107 var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization");
108 var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
109 var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
110 var MSG_PASSWORD_MISMATCH = _("The passwords entered do not match");
113 <script type="text/javascript" src="[% themelang %]/js/members.js"></script>
115 <body id="pat_memberentrygen" class="pat">
116 [% INCLUDE 'header.inc' %]
117 [% INCLUDE 'patron-search.inc' %]
119 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> ›
120 [% IF (firstname || surname ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]</a> ›[% END %]
121 <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>
123 [% IF ( opadd ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
129 [% IF ( error_alert == "no_email" ) %]
130 <div class="error">This member has no email</div>
132 <div class="error">[% error_alert %]</div>
136 <div class="dialog message">Email has been sent.</div>
139 [% IF ( no_add ) %]<div class="dialog alert"><h3>Cannot add patron</h3>
140 [% IF ( no_branches ) %]<p>There are <strong>no libraries defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/branches.pl">add a library</a>.[% ELSE %]An administrator must define at least one library.[% END %]</p>[% END %]
141 [% IF ( no_categories ) %]<p>There are <strong>no patron categories defined</strong>. [% IF ( CAN_user_parameters ) %]Please <a href="/cgi-bin/koha/admin/categorie.pl">add a patron category</a>.[% ELSE %]An administrator must define at least one patron category.</p>[% END %][% END %]</div>[% END %]
143 [% UNLESS ( no_add ) %]
144 <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>
146 [% IF ( check_member ) %]
147 <div class="dialog alert">
148 <h3>Duplicate patron record?</h3>
149 <p><a class="popup" href="javascript:Dopop('moremember.pl?print=brief&borrowernumber=[% check_member %]');" >View existing record</a></p>
150 <form action="/cgi-bin/koha/members/memberentry.pl" method="get"><input type="hidden" name="op" value="modify" /><input type="hidden" name="borrowernumber" value="[% check_member %]" /><input type="hidden" name="category_type" value="[% check_categorytype %]" /><input class="edit" type="submit" value="It is a duplicate. Edit existing record" /></form>
152 <form name="form_double" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
153 <input type="hidden" name="nodouble" value="1" />
154 <input class="new" type="submit" value="Not a duplicate. Save as new record" />
159 <div class="dialog alert">
160 <p>The following fields are wrong. Please fix them.</p>
162 [% IF ( ERROR_login_exist ) %]
163 <li id="ERROR_login_exist">Username/password already exists.</li>
165 [% IF ERROR_cardnumber_already_exists %]
166 <li id="ERROR_cardnumber">Cardnumber already in use.</li>
168 [% IF ERROR_cardnumber_length %]
169 <li id="ERROR_cardnumber">Cardnumber length is incorrect.</li>
171 [% IF ( ERROR_age_limitations ) %]
172 <li id="ERROR_age_limitations">Patron's age is incorrect for their category.
173 Ages allowed are [% age_low %]-[% age_high %].</li>
175 [% IF ( ERROR_branch ) %]
176 <li id="ERROR_branch">Library is invalid.</li>
178 [% IF ( ERROR_dateofbirth ) %]
179 <li id="ERROR_dateofbirth">Date of birth is invalid.</li>
181 [% IF ( ERROR_dateenrolled ) %]
182 <li id="ERROR_dateenrolled">Date of enrollment is invalid.</li>
184 [% IF ( ERROR_dateexpiry ) %]
185 <li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
187 [% IF ( ERROR_short_password ) %]
188 <li id="ERROR_short_password">Password must be at least [% minPasswordLength %] characters long.</li>
190 [% IF ( ERROR_password_mismatch ) %]
191 <li id="ERROR_password_mismatch">Passwords do not match.</li>
193 [% IF ( ERROR_extended_unique_id_failed ) %]
194 <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>
201 [% UNLESS ( check_member ) %]<form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
202 <input type="hidden" name="nodouble" value="[% nodouble %]" /> [% END %]
203 <!-- field always hidden in different form (1,2,3) -->
204 <input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" />
205 <input type="hidden" name="category_type" value="[% category_type %]" />
206 <input type="hidden" name="updtype" value="[% updtype %]" />
207 <input type="hidden" name="destination" value="[% destination %]" />
208 <input type="hidden" name="check_member" value="[% check_member %]" />
209 <input type="hidden" name="borrowernumber" value="[% UNLESS opduplicate %][% borrowernumber %][% END %]" />
210 <input type="hidden" name="nodouble" value="[% UNLESS opduplicate %][% nodouble %][% END %]" />
211 [% IF ( step ) %]<input type="hidden" name="step" value="[% step %]" />[% END %]
212 [% IF ( opadd ) %]<input type="hidden" name="op" value="insert" />
213 [% ELSIF ( opduplicate ) %]
214 <input type="hidden" name="op" value="insert" />
216 <input type="hidden" name="op" value="save" />
217 [% IF step == 4 || step == 5 || step == 6 || step == 2 || step == 1 %]
218 [%# Only put the cardnumber if we arent showing it in the form later %]
220 <input type="hidden" name="cardnumber" value="[% cardnumber %]" />
226 [%UNLESS notitle && nosurname && nofirstname && nodateofbirth && noinitials && noothernames &&nosex %]
227 <fieldset class="rows" id="memberentry_identity">
228 <legend id="identity_lgd">[% IF ( I ) %]Organization [% ELSE %]Patron [% END %]identity</legend>
232 [% IF ( title_cgipopup ) %]
234 [% IF ( mandatorytitle ) %]
235 <label for="btitle" class="required">
240 [% borrotitlepopup %]
241 [% IF ( mandatorytitle ) %]<span class="required">Required</span>[% END %]
246 [% UNLESS nosurname %]
248 [% IF ( mandatorysurname ) %]
249 <label for="surname" class="required">
251 <label for="surname">
254 [% IF ( uppercasesurnames ) %]
255 <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20" value="[% surname %]" />
257 <input type="text" id="surname" name="surname" size="20" value="[% surname %]" />
259 [% IF ( mandatorysurname ) %]<span class="required">Required</span>[% END %]
263 [% UNLESS nofirstname %]
265 [% IF ( mandatoryfirstname ) %]
266 <label for="firstname" class="required">
268 <label for="firstname">
271 <input type="text" id="firstname" name="firstname" size="20" value="[% UNLESS opduplicate %][% firstname %][% END %]" />
272 [% IF ( mandatoryfirstname ) %]<span class="required">Required</span>[% END %]
275 [% UNLESS nodateofbirth %]
277 [% IF ( mandatorydateofbirth ) %]
278 <label for="dateofbirth" class="required">
280 <label for="dateofbirth">
282 Date of birth: </label>
284 [% IF ( dateformat == "metric" ) %]
285 <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="[% UNLESS opduplicate %][% dateofbirth %][% END %]" />
287 <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% UNLESS opduplicate %][% dateofbirth %][% END %]" />
290 [% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
291 [% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
292 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
295 [% UNLESS noinitials %]
297 [% IF ( mandatoryinitials ) %]
298 <label for="initials" class="required">
300 <label for="initials">
303 <input type="text" id="initials" name="initials" size="20" value="[% UNLESS opduplicate %][% initials %][% END %]" />
304 [% IF ( mandatoryinitials ) %]<span class="required">Required</span>[% END %]
308 [% UNLESS noothernames %]
310 [% IF ( mandatoryothernames ) %]
311 <label for="othernames" class="required">
313 <label for="othernames">
316 <input type="text" id="othernames" name="othernames" size="20" value="[% UNLESS opduplicate %][% othernames %][% END %]" />
317 [% IF ( mandatoryothernames ) %]<span class="required">Required</span>[% END %]
318 [% IF ( I ) %]<input type="hidden" name="sex" value="N" />[% END %]
325 [% UNLESS ( opduplicate ) %]
327 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" checked="checked" />
329 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
332 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" checked="checked" />
334 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
337 <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
339 <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" />
342 <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
343 <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
344 <label for="sex-none">N/A </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
352 [% END # hide fieldset %]
354 [% IF ( showguarantor ) %]<input type="hidden" id="guarantorid" name="guarantorid" value="[% guarantorid %]" />
355 <fieldset class="rows">
356 <legend>Guarantor information</legend>
359 [% IF ( guarantorid ) %]
360 <li id="contact-details">
362 <li id="contact-details" style="display: none">
364 <span class="label">Organization #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
367 <label for="contactname">Organization name: </label>
368 [% IF ( guarantorid ) %]
369 <span>[% contactname %]</span>
370 <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" />
372 <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
377 [% IF ( guarantorid ) %]
378 <li id="contact-details">
380 <li id="contact-details" style="display: none">
382 <span class="label">Patron #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid %]</a>[% END %]
384 [% UNLESS nocontactname %]
386 <label for="contactname">Surname: </label>
387 [% IF ( guarantorid ) %]
388 <span>[% contactname %]</span>
389 <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" />
391 <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
395 [% UNLESS nocontactfirstname %]
397 <label for="contactfirstname">First name: </label>
398 [% IF ( guarantorid ) %]
399 <span>[% contactfirstname %]</span>
400 <input name="contactfirstname" id="contactfirstname" type="hidden" size="20" value="[% contactfirstname %]" />
402 <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]" />
406 [% IF ( relshiploop ) %]
408 <label for="relationship">Relationship: </label>
409 <select name="relationship" id="relationship" >
410 [% FOREACH relshiploo IN relshiploop %]
411 [% IF ( relshiploo.selected ) %]
412 <option value="[% relshiploo.relationship %]" selected="selected" >[% relshiploo.relationship %]</option>
414 <option value="[% relshiploo.relationship %]">[% relshiploo.relationship %]</option>
423 <span class="label"> </span>
424 [% IF ( guarantorid ) %]
425 <input id="guarantorsearch" type="button" value="Change" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
427 <input id="guarantorsearch" type="button" value="Set to patron" onclick="Dopopguarantor('guarantor_search.pl?category_type=[% category_type %]');" />
429 <input id="guarantordelete" type="button" value="Delete" />
435 [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
436 <fieldset class="rows" id="memberentry_mainaddress">
437 <legend id="main_address_lgd">Main address</legend><ol>
438 [% UNLESS nostreetnumber %]
440 [% IF ( mandatorystreetnumber ) %]
441 <label for="streetnumber" class="required">
443 <label for="streetnumber">
445 Street number: </label>
446 <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" />
447 [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %]
450 [% UNLESS nostreettype %]
453 [% IF ( mandatorystreettype ) %]
454 <label for="streettype" class="required">
456 <label for="streettype">
458 Street type: </label>
459 <select name="streettype">
460 <option value=""></option>
461 [% FOR roadtype IN roadtypes %]
462 [% IF roadtype.selected %]
463 <option value="[% roadtype.authorised_value %]" selected="selected">[% roadtype.lib %]</option>
465 <option value="[% roadtype.authorised_value %]">[% roadtype.lib %]</option>
469 [% IF ( mandatorystreettype ) %]<span class="required">Required</span>[% END %]
473 [% UNLESS noaddress %]
475 [% IF ( mandatoryaddress ) %]
476 <label for="address" class="required">
478 <label for="address">
481 <input type="text" id="address" name="address" size="35" value="[% address %]" />
482 [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %]
485 [% UNLESS noaddress2 %]
487 [% IF ( mandatoryaddress2 ) %]
488 <label for="address2" class="required">
490 <label for="address2">
493 <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" />
494 [% IF ( mandatoryaddress2 ) %]<span class="required">Required</span>[% END %]
499 [% IF ( mandatorycity ) %]
500 <label for="city" class="required">
505 <input type="text" id="city" name="city" size="20" value="[% city %]" />
506 [% IF ( city_cgipopup ) %]or <strong>choose</strong>
507 <select id="select_city" name="select_city">
508 [% FOREACH city_loo IN city_loop %]
509 [% IF ( city_loo.selected ) %]
510 <option value="[% city_loo.city_zipcode %]|[% city_loo.city_name %]|[% city_loo.city_state %]|[% city_loo.city_country %]" selected="selected">
512 <option value="[% city_loo.city_zipcode %]|[% city_loo.city_name %]|[% city_loo.city_state %]|[% city_loo.city_country %]">
514 [% city_loo.city_name %] [% city_loo.city_state %] [% city_loo.city_zipcode %]
519 [% IF ( mandatorycity ) %]<span class="required">Required</span>[% END %]
524 [% IF ( mandatorystate ) %]
525 <label for="state" class="required">
530 <input type="text" name="state" id="state" size="20" value="[% state %]" />
531 [% IF ( mandatorystate ) %]<span class="required">Required</span>[% END %]
534 [% UNLESS nozipcode %]
536 [% IF ( mandatoryzipcode ) %]
537 <label for="zipcode" class="required">
539 <label for="zipcode">
541 Zip/Postal code: </label>
542 <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" />
543 [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %]
546 [% UNLESS nocountry %]
548 [% IF ( mandatorycountry ) %]
549 <label for="country" class="required">
551 <label for="country">
554 <input type="text" name="country" id="country" size="20" value="[% country %]" />
555 [% IF ( mandatorycountry ) %]<span class="required">Required</span>[% END %]
560 [% END # nostreet && nocity etc group%]
562 [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
563 <fieldset class="rows" id="memberentry_contact">
564 <legend id="contact_lgd">Contact</legend><ol>
567 [% IF ( mandatoryphone ) %]
568 <label for="phone" class="required">
572 Primary phone: </label>
573 <input type="text" id="phone" name="phone" value="[% phone %]" />
574 [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
578 [% UNLESS nophonepro %]
580 [% IF ( mandatoryphonepro ) %]
581 <label for="phonepro" class="required">
583 <label for="phonepro">
585 Secondary phone: </label>
586 <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]" />
587 [% IF ( mandatoryphonepro ) %]<span class="required">Required</span>[% END %]
590 [% UNLESS nomobile %]
592 [% IF ( mandatorymobile ) %]
593 <label for="mobile" class="required">
597 Mobile phone: </label>
598 <input type="text" id="mobile" name="mobile" value="[% mobile %]" />
599 [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %]
604 [% IF ( mandatoryemail ) %]
605 <label for="email" class="required">
609 Primary email: </label>
610 <input type="text" id="email" name="email" size="45" value="[% email %]" />
611 [% IF ( mandatoryemail ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div>
615 [% UNLESS noemailpro %]
617 [% IF ( mandatoryemailpro ) %]
618 <label for="emailpro" class="required">
620 <label for="emailpro">
622 Secondary email: </label>
623 <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]" />
624 [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %]
629 [% IF ( mandatoryfax ) %]
630 <label for="fax" class="required">
635 <input type="text" id="fax" name="fax" value="[% fax %]" />
636 [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
641 [%END # hide fieldset %]
643 <!-- ************************ STEP_1 *********************** -->
647 [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
648 <fieldset class="rows" id="memberentry_address">
649 <legend id="alt_address_lgd">Alternate address</legend><ol>
650 [% UNLESS noB_address %]
652 [% IF ( mandatoryB_address ) %]
653 <label for="B_address" class="required">
655 <label for="B_address">
658 <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" />
659 [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %]
662 [% UNLESS noB_address2 %]
664 [% IF ( mandatoryB_address2 ) %]
665 <label for="B_address2" class="required">
667 <label for="B_address2">
670 <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" />
671 [% IF ( mandatoryB_address2 ) %]<span class="required">Required</span>[% END %]
674 [% UNLESS noB_city %]
676 [% IF ( mandatoryB_city ) %]
677 <label for="B_city" class="required" >
682 <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" />
683 [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %]
686 [% UNLESS noB_state %]
688 [% IF ( mandatoryB_state ) %]
689 <label for="B_state" class="required" >
691 <label for="B_state">
694 <input type="text" id="B_state" name="B_state" size="20" value="[% B_state %]" />
695 [% IF ( mandatoryB_state ) %]<span class="required">Required</span>[% END %]
698 [% UNLESS noB_zipcode %]
700 [% IF ( mandatoryB_zipcode ) %]
701 <label for="B_zipcode" class="required">
703 <label for="B_zipcode">
705 Zip/Postal code: </label>
706 <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" />
707 [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %]
710 [% UNLESS noB_country %]
712 [% IF ( mandatoryB_country ) %]
713 <label for="B_country" class="required">
715 <label for="B_country">
718 <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" />
719 [% IF ( mandatoryB_country ) %]<span class="required">Required</span>[% END %]
722 [% UNLESS noB_phone %]
724 [% IF ( mandatoryB_phone ) %]
725 <label for="B_phone" class="required">
727 <label for="B_phone">
730 <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" />
731 [% IF ( mandatoryB_phone ) %]<span class="required">Required</span>[% END %]
734 [% UNLESS noB_email %]
736 [% IF ( mandatoryB_email ) %]
737 <label for="B_email" class="required">
739 <label for="B_email">
742 <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" />
743 [% IF ( mandatoryB_email ) %]<span class="required">Required</span>[% END %] </li>
745 [% UNLESS nocontactnote %]
747 [% IF ( mandatorycontactnote ) %]
748 <label for="contactnote" class="required">
750 <label for="contactnote">
752 Contact note: </label>
753 <textarea id="contactnote" name="contactnote" cols="40" rows="2">[% contactnote %]</textarea>
754 [% IF ( mandatorycontactnote ) %]<span class="required">Required</span>[% END %]
759 [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
762 [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
763 <fieldset class="rows" id="memberentry_altaddress">
764 <legend id="alt_contact_lgd">Alternate contact</legend><ol>
765 [% UNLESS noaltcontactsurname %]
767 [% IF ( mandatoryaltcontactsurname ) %]
768 <label for="altcontactsurname" class="required">
770 <label for="altcontactsurname">
773 <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" />
774 [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
777 [% UNLESS noaltcontactfirstname %]
779 [% IF ( mandatoryaltcontactfirstname ) %]
780 <label for="altcontactfirstname" class="required">
782 <label for="altcontactfirstname">
785 <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" />
786 [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
789 [% UNLESS noaltcontactaddress1 %]
791 [% IF ( mandatoryaltcontactaddress1 ) %]
792 <label for="altcontactaddress1" class="required">
794 <label for="altcontactaddress1">
797 <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" />
798 [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
801 [% UNLESS noaltcontactaddress2 %]
803 [% IF ( mandatoryaltcontactaddress2 ) %]
804 <label for="altcontactaddress2" class="required">
806 <label for="altcontactaddress2">
809 <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" size="40" />
810 [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
813 [% UNLESS noaltcontactaddress3 %]
815 [% IF ( mandatoryaltcontactaddress3 ) %]
816 <label for="altcontactaddress3" class="required">
818 <label for="altcontactaddress3">
821 <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" />
822 [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
825 [% UNLESS noaltcontactstate %]
827 [% IF ( mandatoryaltcontactstate ) %]
828 <label for="altcontactstate" class="required">
830 <label for="altcontactstate">
833 <input type="text" name="altcontactstate" id="altcontactstate" value="[% altcontactstate %]" size="20" />
834 [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
837 [% UNLESS noaltcontactzipcode %]
839 [% IF ( mandatoryaltcontactzipcode ) %]
840 <label for="altcontactzipcode" class="required">
842 <label for="altcontactzipcode">
844 Zip/Postal code:</label>
845 <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" />
846 [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
849 [% UNLESS noaltcontactcountry %]
851 [% IF ( mandatoryaltcontactcountry ) %]
852 <label for="altcontactcountry" class="required">
854 <label for="altcontactcountry">
857 <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" size="20" />
858 [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
861 [% UNLESS noaltcontactphone %]
863 [% IF ( mandatoryaltcontactphone ) %]
864 <label for="altcontactphone" class="required">
866 <label for="altcontactphone">
869 <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" />
870 [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
875 [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
880 <fieldset class="rows" id="memberentry_library_management">
881 <legend id="library_management_lgd">Library management</legend><ol>
882 [% UNLESS nocardnumber %]
884 [% IF ( mandatorycardnumber ) %]
885 <label for="cardnumber" class="required">
887 <label for="cardnumber" class="validated">
889 Card number: </label>
890 [% IF minlength_cardnumber == maxlength_cardnumber %]
891 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" title="exactly [% minlength_cardnumber %] characters" />
892 [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
893 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" title="between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters" />
894 [% ELSIF maxlength_cardnumber %]
895 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" maxlength="[% maxlength_cardnumber %]" title="up to [% maxlength_cardnumber %] characters" />
897 <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
899 [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
902 [% UNLESS nobranchcode %]
904 <label for="libraries" class="required">Library:</label>
905 <select name="branchcode" size="1" id="libraries">
906 [%- FOREACH branchloo IN branchloop %]
907 [% IF ( branchloo.selected ) -%]
908 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
910 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
914 <span class="required">Required</span>
918 <label for="categorycode_entry" class="required">Category: </label>
919 <select id="categorycode_entry" name="categorycode" onchange="update_category_code(this);">
920 [% FOREACH typeloo IN typeloop %]
921 [% FOREACH categoryloo IN typeloo.categoryloop %]
922 [% IF ( loop.first ) %]
923 [% IF ( typeloo.typename_C ) %]<optgroup label="Child">[% END %]
924 [% IF ( typeloo.typename_A ) %]<optgroup label="Adult">[% END %]
925 [% IF ( typeloo.typename_S ) %]<optgroup label="Staff">[% END %]
926 [% IF ( typeloo.typename_I ) %]<optgroup label="Organization">[% END %]
927 [% IF ( typeloo.typename_P ) %]<optgroup label="Professional">[% END %]
928 [% IF ( typeloo.typename_X ) %]<optgroup label="Statistical">[% END %]
930 [% IF ( categoryloo.categorycodeselected ) %]
931 <option value="[% categoryloo.categorycode %]" selected="selected" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
933 <option value="[% categoryloo.categorycode %]" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
935 [% IF ( loop.last ) %]
941 <span class="required">Required</span>
945 [% IF ( mandatorysort1 ) %]
946 <label for="sort1" class="required">
951 [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=sort1, size = 20 %]
952 [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
957 [% IF ( mandatorysort2 ) %]
958 <label for="sort2" class="required">
963 [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=sort2, size = 20 %]
964 [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
967 [% IF ( Koha.Preference( 'NorwegianPatronDBEnable' ) == 1 ) %]
969 <label for="sort2">Sync with the Norwegian national patron database:</label>
970 [% IF ( sync == 0 ) %]
971 <input type="radio" id="sync" name="sync" value="1"> Yes
972 <input type="radio" id="sync" name="sync" value="0" checked> No
974 <input type="radio" id="sync" name="sync" value="1" checked> Yes
975 <input type="radio" id="sync" name="sync" value="0"> No
981 [% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
982 <fieldset class="rows" id="memberentry_subscription">
983 <legend id="library_setup_lgd">Library set-up</legend><ol>
984 [% UNLESS nodateenrolled %]
986 [% IF ( mandatorydateenrolled ) %]
987 <label for="from" class="required">
991 Registration date: </label>
992 [% IF ( dateformat == "metric" ) %]
993 <input type="text" id="from" name="dateenrolled" maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled %]" class="datepickerfrom" />
995 <input type="text" id="from" name="dateenrolled" maxlength="10" size="10" value="[% dateenrolled %]" class="datepickerfrom" />
997 [% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
998 [% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
999 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1002 [% UNLESS nodateexpiry %]
1005 <li style="display:none">
1007 [% IF ( mandatorydateexpiry ) %]
1008 <label for="to" class="required">
1012 Expiry date (leave blank for auto calc) </label>
1013 [% IF ( dateformat == "metric" ) %]
1014 [% UNLESS ( opadd ) %]
1015 <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" />
1017 <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" class="datepickerto" />
1020 [% UNLESS ( opadd ) %]
1021 <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% UNLESS opduplicate %][% dateexpiry %][% END %]" class="datepickerto" />
1023 <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" class="datepickerto" />
1026 [% IF ( mandatorydateexpiry ) %]<span class="required">Required</span>[% END %]
1027 [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
1028 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1030 [% UNLESS noopacnote %]
1032 [% IF ( mandatoryopacnote ) %]
1033 <label for="opacnote" class="required">
1035 <label for="opacnote">
1038 <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% UNLESS opduplicate %][% opacnote %][% END %]</textarea>
1039 <div class="hint">This message appears on this patron's user page in the OPAC</div>
1040 [% IF ( mandatoryopacnote ) %]<span class="required">Required</span>[% END %]
1043 [% UNLESS noborrowernotes %]
1045 [% IF ( mandatoryborrowernotes ) %]
1046 <label for="borrowernotes" class="required">
1048 <label for="borrowernotes">
1050 Circulation note: </label>
1051 <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% UNLESS opduplicate %][% borrowernotes %][% END %]</textarea>
1052 <div class="hint">This message displays when checking out to this patron</div>
1053 [% IF ( mandatoryborrowernotes ) %]<span class="required">Required</span>[% END %]
1058 [% END # hide fieldset %]
1060 [% UNLESS nouserid && nopassword %]
1061 <fieldset class="rows" id="memberentry_userid">
1062 <legend id="opac_staff_login_lgd">OPAC/Staff login</legend><ol>
1063 [% UNLESS nouserid %]
1065 [% IF ( mandatoryuserid ) %]
1066 <label for="userid" class="required">
1068 <label for="userid">
1072 [% IF ( NoUpdateLogin ) %]
1073 [% IF ( opduplicate ) %]
1074 <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
1076 <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% userid %]" />
1079 [% IF ( opduplicate ) %]
1080 <input type="text" id="userid" name="userid" size="20" value="" />
1082 <input type="text" id="userid" name="userid" size="20" value="[% userid %]" />
1086 [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %]
1089 [% UNLESS nopassword %]
1091 [% IF ( mandatorypassword ) %]
1092 <label for="password" class="required">
1094 <label for="password">
1098 [% IF ( NoUpdateLogin ) %]
1099 [% IF ( opduplicate ) %]
1100 <input type="password" id="password" name="password" size="20" disabled="disabled" />
1102 <input type="password" id="password" name="password" size="20" disabled="disabled" value="[% password %]" />
1105 [% IF ( opduplicate ) %]
1106 <input type="password" id="password" name="password" size="20" />
1108 <input type="password" id="password" name="password" size="20" value="[% password %]" />
1112 [% IF ( password ) %]
1113 [% IF ( NoUpdateLogin ) %]
1114 <input type="password" id="password" name="password" size="20" disabled="disabled" value="****" />
1116 [% IF ( opduplicate ) %]
1117 <input type="password" id="password" name="password" size="20" />
1119 <input type="password" id="password" name="password" size="20" value="****" />
1123 [% IF ( NoUpdateLogin ) %]
1124 <input type="password" id="password" name="password" size="20" disabled="disabled" value="" />
1126 <input type="password" id="password" name="password" size="20" value="" />
1130 [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_short_password ) %]<span class="required">Password is too short</span>[% END %]
1131 [% IF ( minPasswordLength ) %]<div class="hint">Minimum password length: [% minPasswordLength %]</div>[% END %]
1134 [% IF ( mandatorypassword ) %]
1135 <label for="password2" class="required">
1137 <label for="password2">
1139 Confirm password: </label>
1141 [% IF ( NoUpdateLogin ) %]
1142 [% IF ( opduplicate ) %]
1143 <input type="password" id="password2" name="password2" size="20" disabled="disabled" />
1145 <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="[% password %]" />
1148 [% IF ( opduplicate ) %]
1149 <input type="password" id="password2" name="password2" size="20" />
1151 <input type="password" id="password2" name="password2" size="20" value="[% password %]" />
1155 [% IF ( password ) %]
1156 [% IF ( NoUpdateLogin ) %]
1157 <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="****" />
1159 [% IF ( opduplicate ) %]
1160 <input type="password" id="password2" name="password2" size="20" />
1162 <input type="password" id="password2" name="password2" size="20" value="****" />
1166 [% IF ( NoUpdateLogin ) %]
1167 <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="" />
1169 <input type="password" id="password2" name="password2" size="20" value="" />
1173 [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
1177 [% END # hide fieldset %][% END %]
1178 <!--this zones are not necessary in modif mode -->
1179 [% UNLESS ( opadd || opduplicate ) %]
1180 <fieldset class="rows">
1181 <legend>Patron account flags</legend>
1183 [% FOREACH flagloo IN flagloop %]
1184 <li><label class="radio" for="yes[% flagloo.name %]">
1185 [% IF ( flagloo.key == 'gonenoaddress' ) %]Gone no address:[% END %]
1186 [% IF ( flagloo.key == 'lost' ) %]Lost card:[% END %]
1188 [% IF CAN_user_circulate_manage_restrictions %]
1189 <label for="yes[% flagloo.name %]">Yes </label>
1190 [% IF ( flagloo.yes ) %]
1191 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" checked="checked" />
1193 <input type="radio" id="yes[% flagloo.name %]" name="[% flagloo.name %]" value="1" />
1195 <label for="no[% flagloo.name %]">No </label>
1196 [% IF ( flagloo.no ) %]
1197 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" checked="checked"/>
1199 <input type="radio" id="no[% flagloo.name %]" name="[% flagloo.name %]" value="0" />
1202 [% IF flagloo.yes %]Yes[% ELSE %]No[% END %]
1211 <fieldset class="rows">
1212 <legend>Patron restrictions</legend>
1214 [% IF ( debarments.size < 1 ) %]
1215 <p>Patron is currently unrestricted.</p>
1223 [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
1230 [% FOREACH d IN debarments %]
1232 <td>[% d.type %]</td>
1233 <td>[% d.comment %]</td>
1234 <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
1235 [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
1237 <input type="checkbox" id="debarment_[% d.borrower_debarment_id %]" name="remove_debarment" value="[% d.borrower_debarment_id %]" />
1245 [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
1246 <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
1247 <fieldset id="manual_restriction_form">
1248 <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
1249 <legend>Add manual restriction</legend>
1251 <li><label for="debarred_comment">Comment: </label><input type="text" id="debarred_comment" name="debarred_comment" onchange="$('#add_debarment').val(1);" /></li>
1252 <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);" />
1253 <a href='javascript:void(0)' onclick="$('#debarred_expiration').val('');">Clear date</a></li>
1257 <a class="cancel" id="cancel_manual_restriction" href="#">Cancel</a>
1266 [% IF ( step_4 ) %][% IF ( ExtendedPatronAttributes ) %][% UNLESS ( no_patron_attribute_types ) %]
1267 <fieldset class="rows" id="memberentry_patron_attributes">
1268 <legend>Additional attributes and identifiers</legend>
1269 <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1270 [% FOREACH pa_loo IN patron_attributes %]
1271 [% IF pa_loo.class %]
1272 <fieldset id="aai_[% pa_loo.class %]">
1273 <legend>[% pa_loo.lib %]</legend>
1275 <ol class="attributes_table">
1276 [% FOREACH patron_attribute IN pa_loo.items %]
1277 <li data-category_code="[% patron_attribute.category_code %]">
1278 <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
1279 <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1280 [% IF ( patron_attribute.use_dropdown ) %]
1281 <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
1282 <option value=""></option>
1283 [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1284 [% IF ( auth_val_loo.selected ) %]
1285 <option value="[% auth_val_loo.authorised_value %]" selected="selected">
1286 [% auth_val_loo.lib %]
1289 <option value="[% auth_val_loo.authorised_value %]" >
1290 [% auth_val_loo.lib %]
1296 <textarea rows="2" cols="30" id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">[% patron_attribute.value %]</textarea>
1298 [% IF ( patron_attribute.password_allowed ) %]
1299 (<label class="yesno" for="[% patron_attribute.form_id %]_password">Password:</label> <input type="password" maxlength="64" value="[% patron_attribute.password %]"
1300 id="[% patron_attribute.form_id %]_password" name="[% patron_attribute.form_id %]_password" />)
1302 <a href="#" class="clear-field" onclick="clear_entry(this); return false;">Clear</a>
1303 [% IF ( patron_attribute.repeatable ) %]
1304 <a href="#" class="clone-field" onclick="clone_entry(this); return false;">New</a>
1309 [% IF pa_loo.class %]</fieldset>[% END %]
1312 [% END %][% END %][% END %]
1314 [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
1315 <fieldset class="rows" id="memberentry_messaging_prefs">
1316 <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
1318 <!-- handle changing prefs if creating new patron and changing
1321 <script type="text/javascript">//<![CDATA[
1322 $(document).ready(function(){
1323 var message_prefs_dirty = false;
1324 $('#memberentry_messaging_prefs > *').change(function() {
1325 message_prefs_dirty = true;
1327 $('#categorycode_entry').change(function() {
1328 var categorycode = $(this).val();
1329 if (message_prefs_dirty) {
1330 if (!confirm(_("Change messaging preferences to default for this category?"))) {
1334 $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode,
1336 $.each(data.messaging_preferences, function(i, item) {
1337 var attrid = item.message_attribute_id;
1338 var transports = ['email', 'rss', 'sms'];
1339 $.each(transports, function(j, transport) {
1340 if (item['transports_' + transport] == 1) {
1341 $('#' + transport + attrid).attr('checked', 'checked');
1343 $('#' + transport + attrid).removeAttr('checked');
1346 if (item.digest && item.digest != ' ') {
1347 $('#digest' + attrid).attr('checked', item.digest);
1349 $('#digest' + attrid).removeAttr('checked');
1351 if (item.takes_days == '1') {
1352 $('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance);
1355 message_prefs_dirty = false;
1363 <input type="hidden" name="setting_messaging_prefs" value="1" />
1365 <p>If no preferences are selected, the default preferences for the category chosen will be applied on save, otherwise your selection here is saved</p>
1367 [% INCLUDE 'messaging-preference-form.inc' %]
1368 [% IF ( SMSSendDriver ) %]
1369 <p><label for="SMSnumber">SMS number:</label>
1370 <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
1376 [% UNLESS ( check_member ) %]
1377 <fieldset class="action">
1378 <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
1380 <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a>
1382 <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
1391 [% UNLESS ( opadd ) %]<div class="yui-b">
1392 [% INCLUDE 'members-menu.inc' %]
1396 [% INCLUDE 'intranet-bottom.inc' %]