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