Lines 155-160
function select_user(borrowernumber, borrower) {
Link Here
|
155 |
|
155 |
|
156 |
hint.html(age_string); |
156 |
hint.html(age_string); |
157 |
} |
157 |
} |
|
|
158 |
$(document).ready(function() { |
159 |
$(".toggle_quick_add").click(function(){ |
160 |
var toggle_to = ''; |
161 |
var toggle_from = ''; |
162 |
if( $("#entryform:visible").length ) { |
163 |
toggle_to = "#quick_add_form label"; |
164 |
toggle_from = "#entryform label"; |
165 |
} else { |
166 |
toggle_to="#entryform label"; |
167 |
toggle_from = "#quick_add_form label"; |
168 |
} |
169 |
$(toggle_from).each(function() { |
170 |
var input_label = $(this).attr('for'); |
171 |
if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' ) { |
172 |
$(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') ); |
173 |
return; |
174 |
} |
175 |
if( $(this).next().val() != '' ) { $(toggle_to+"[for='"+input_label+"']").next().val( $(this).next().val() );} |
176 |
}); |
177 |
|
178 |
$(".toggler").toggle(); |
179 |
// return false; |
180 |
}); |
181 |
|
182 |
|
183 |
$(".save_quick_add").click(function(){ |
184 |
$("#quick_add_form").validate(); |
185 |
if( $("#quick_add_form").valid()){ |
186 |
$('.toggle_quick_add').click(); |
187 |
$('#entryform input[name="save"]').click(); |
188 |
} |
189 |
else {return false;} |
190 |
}); |
191 |
}); |
158 |
|
192 |
|
159 |
var MSG_SEPARATOR = _("Separator must be / in field %s"); |
193 |
var MSG_SEPARATOR = _("Separator must be / in field %s"); |
160 |
var MSG_INCORRECT_DAY = _("Invalid day entered in field %s"); |
194 |
var MSG_INCORRECT_DAY = _("Invalid day entered in field %s"); |
Lines 176-187
function select_user(borrowernumber, borrower) {
Link Here
|
176 |
[% INCLUDE 'header.inc' %] |
210 |
[% INCLUDE 'header.inc' %] |
177 |
[% INCLUDE 'patron-search.inc' %] |
211 |
[% INCLUDE 'patron-search.inc' %] |
178 |
|
212 |
|
179 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › |
213 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › |
180 |
[% IF (firstname || surname ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]</a> ›[% END %] |
214 |
[% IF (firstname || surname ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]</a> ›[% END %] |
181 |
<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> |
215 |
<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> |
182 |
</div> |
216 |
</div> |
183 |
[% IF ( opadd ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %] |
217 |
[% IF ( opadd ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %] |
184 |
|
218 |
|
185 |
<div id="bd"> |
219 |
<div id="bd"> |
186 |
<div id="yui-main"> |
220 |
<div id="yui-main"> |
187 |
<div class="yui-b"> |
221 |
<div class="yui-b"> |
Lines 202-208
function select_user(borrowernumber, borrower) {
Link Here
|
202 |
|
236 |
|
203 |
[% UNLESS ( no_add ) %] |
237 |
[% UNLESS ( no_add ) %] |
204 |
<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> |
238 |
<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> |
205 |
|
239 |
|
206 |
[% IF ( check_member ) %] |
240 |
[% IF ( check_member ) %] |
207 |
<div class="dialog alert"> |
241 |
<div class="dialog alert"> |
208 |
<h3>Duplicate patron record?</h3> |
242 |
<h3>Duplicate patron record?</h3> |
Lines 235-246
function select_user(borrowernumber, borrower) {
Link Here
|
235 |
<li id="ERROR_cardnumber">Cardnumber length is incorrect.</li> |
269 |
<li id="ERROR_cardnumber">Cardnumber length is incorrect.</li> |
236 |
[% END %] |
270 |
[% END %] |
237 |
[% IF ( ERROR_age_limitations ) %] |
271 |
[% IF ( ERROR_age_limitations ) %] |
238 |
<li id="ERROR_age_limitations">Patron's age is incorrect for their category. |
272 |
<li id="ERROR_age_limitations">Patron's age is incorrect for their category. |
239 |
Ages allowed are [% age_low %]-[% age_high %].</li> |
273 |
Ages allowed are [% age_low %]-[% age_high %].</li> |
240 |
[% END %] |
274 |
[% END %] |
241 |
[% IF ( ERROR_branch ) %] |
275 |
[% IF ( ERROR_branch ) %] |
242 |
<li id="ERROR_branch">Library is invalid.</li> |
276 |
<li id="ERROR_branch">Library is invalid.</li> |
243 |
[% END %] |
277 |
[% END %] |
244 |
[% IF ( ERROR_dateofbirth ) %] |
278 |
[% IF ( ERROR_dateofbirth ) %] |
245 |
<li id="ERROR_dateofbirth">Date of birth is invalid.</li> |
279 |
<li id="ERROR_dateofbirth">Date of birth is invalid.</li> |
246 |
[% END %] |
280 |
[% END %] |
Lines 273-279
function select_user(borrowernumber, borrower) {
Link Here
|
273 |
[% END %] |
307 |
[% END %] |
274 |
|
308 |
|
275 |
|
309 |
|
276 |
[% UNLESS ( check_member ) %]<form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off"> |
310 |
[% UNLESS ( check_member ) %]<form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class='toggler' > |
277 |
<input type="hidden" name="nodouble" value="[% nodouble %]" /> [% END %] |
311 |
<input type="hidden" name="nodouble" value="[% nodouble %]" /> [% END %] |
278 |
<!-- field always hidden in different form (1,2,3) --> |
312 |
<!-- field always hidden in different form (1,2,3) --> |
279 |
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" /> |
313 |
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" /> |
Lines 531-537
function select_user(borrowernumber, borrower) {
Link Here
|
531 |
<legend id="contact_lgd">Contact</legend><ol> |
565 |
<legend id="contact_lgd">Contact</legend><ol> |
532 |
[% UNLESS nophone %] |
566 |
[% UNLESS nophone %] |
533 |
<li> |
567 |
<li> |
534 |
[% IF ( mandatoryphone ) %] |
568 |
[% IF ( mandatoryphone ) %] |
535 |
<label for="phone" class="required"> |
569 |
<label for="phone" class="required"> |
536 |
[% ELSE %] |
570 |
[% ELSE %] |
537 |
<label for="phone"> |
571 |
<label for="phone"> |
Lines 581-587
function select_user(borrowernumber, borrower) {
Link Here
|
581 |
[% END %] |
615 |
[% END %] |
582 |
[% UNLESS noemailpro %] |
616 |
[% UNLESS noemailpro %] |
583 |
<li> |
617 |
<li> |
584 |
[% IF ( mandatoryemailpro ) %] |
618 |
[% IF ( mandatoryemailpro ) %] |
585 |
<label for="emailpro" class="required"> |
619 |
<label for="emailpro" class="required"> |
586 |
[% ELSE %] |
620 |
[% ELSE %] |
587 |
<label for="emailpro"> |
621 |
<label for="emailpro"> |
Lines 794-800
function select_user(borrowernumber, borrower) {
Link Here
|
794 |
<label for="opacnote" class="required"> |
828 |
<label for="opacnote" class="required"> |
795 |
[% ELSE %] |
829 |
[% ELSE %] |
796 |
<label for="opacnote"> |
830 |
<label for="opacnote"> |
797 |
[% END %] |
831 |
[% END %] |
798 |
OPAC note: </label> |
832 |
OPAC note: </label> |
799 |
<textarea id="opacnote" name="opacnote" cols="55" rows="5">[% UNLESS opduplicate %][% opacnote %][% END %]</textarea> |
833 |
<textarea id="opacnote" name="opacnote" cols="55" rows="5">[% UNLESS opduplicate %][% opacnote %][% END %]</textarea> |
800 |
<div class="hint">This message appears on this patron's user page in the OPAC</div> |
834 |
<div class="hint">This message appears on this patron's user page in the OPAC</div> |
Lines 803-809
function select_user(borrowernumber, borrower) {
Link Here
|
803 |
[% END %] |
837 |
[% END %] |
804 |
[% UNLESS noborrowernotes %] |
838 |
[% UNLESS noborrowernotes %] |
805 |
<li> |
839 |
<li> |
806 |
[% IF ( mandatoryborrowernotes ) %] |
840 |
[% IF ( mandatoryborrowernotes ) %] |
807 |
<label for="borrowernotes" class="required"> |
841 |
<label for="borrowernotes" class="required"> |
808 |
[% ELSE %] |
842 |
[% ELSE %] |
809 |
<label for="borrowernotes"> |
843 |
<label for="borrowernotes"> |
Lines 1150-1165
function select_user(borrowernumber, borrower) {
Link Here
|
1150 |
|
1184 |
|
1151 |
[% UNLESS ( check_member ) %] |
1185 |
[% UNLESS ( check_member ) %] |
1152 |
<fieldset class="action"> |
1186 |
<fieldset class="action"> |
|
|
1187 |
[% IF quickadd && opadd %] |
1188 |
<input type="button" class='toggle_quick_add' value="Quick-add/Full form" /> |
1189 |
[% END %] |
1153 |
<input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" /> |
1190 |
<input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" /> |
1154 |
[% IF ( opadd ) %] |
1191 |
[% IF ( opadd ) %] |
1155 |
<a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> |
1192 |
<a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> |
1156 |
[% ELSE %] |
1193 |
[% ELSE %] |
1157 |
<a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a> |
1194 |
<a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a> |
1158 |
[% END %] |
1195 |
[% END %] |
1159 |
</fieldset> |
1196 |
</fieldset> |
1160 |
[% END %] |
1197 |
[% END %] |
|
|
1198 |
|
1199 |
</form> |
1200 |
|
1201 |
[% IF quickadd && opadd && !check_member %] |
1202 |
<form id="quick_add_form" class='toggler'> |
1203 |
<fieldset class="rows quick_add"><legend>Quick Add</legend> |
1204 |
<ol id="quick_add_list"> |
1205 |
</ol> |
1206 |
</fieldset> |
1207 |
|
1208 |
<fieldset class="action"> |
1209 |
<input type="button" class='toggle_quick_add' value="Quick-add/Full form"/> |
1210 |
<input type="button" class="save_quick_add" value="Save" /> |
1211 |
<a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> |
1212 |
</fieldset> |
1213 |
|
1161 |
</form> |
1214 |
</form> |
1162 |
|
1215 |
<script> |
|
|
1216 |
$(document).ready(function () { |
1217 |
$("#entryform").hide(); |
1218 |
[% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %] |
1219 |
var qaddfields = "[% FOREACH field IN q_add_f.unique %][% field %] [% END %]"; |
1220 |
$("#entryform label").each(function () { |
1221 |
var input_label = $(this).attr('for'); |
1222 |
if ( input_label == 'sex-female' ) { input_label='sex'; } |
1223 |
else if ( input_label == 'btitle' ) { input_label='title'; } |
1224 |
if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){ |
1225 |
$(this).parent().clone().appendTo("#quick_add_list"); |
1226 |
if( input_label == 'password') $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list"); |
1227 |
} |
1228 |
}); |
1229 |
}); |
1230 |
</script> |
1231 |
[% END %] |
1163 |
</div> |
1232 |
</div> |
1164 |
</div> |
1233 |
</div> |
1165 |
|
1234 |
|