Lines 59-64
$(document).ready(function() {
Link Here
|
59 |
mrform.hide(); |
59 |
mrform.hide(); |
60 |
e.preventDefault(); |
60 |
e.preventDefault(); |
61 |
}); |
61 |
}); |
|
|
62 |
|
63 |
var toggle_quick_add = $(".toggle_quick_add"); |
64 |
$(toggle_quick_add).click(function(e){ |
65 |
toggle_quick_add.toggle(); |
66 |
e.preventDefault(); |
67 |
var toggle_to = ''; |
68 |
var toggle_from = ''; |
69 |
if( $("#entryform:visible").length ) { |
70 |
toggle_to = "#quick_add_form label"; |
71 |
toggle_from = "#entryform label"; |
72 |
} else { |
73 |
toggle_to="#entryform label"; |
74 |
toggle_from = "#quick_add_form label"; |
75 |
} |
76 |
$(toggle_from).each(function() { |
77 |
var input_label = $(this).attr('for'); |
78 |
if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' ) { |
79 |
$(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') ); |
80 |
return; |
81 |
} |
82 |
if( $(this).next().val() != '' ) { $(toggle_to+"[for='"+input_label+"']").next().val( $(this).next().val() );} |
83 |
}); |
84 |
|
85 |
$(".toggler").toggle(); |
86 |
}); |
87 |
|
88 |
$(".save_quick_add").click(function(){ |
89 |
$("#quick_add_form").validate(); |
90 |
if( $("#quick_add_form").valid()){ |
91 |
$('.toggle_quick_add').click(); |
92 |
$('#entryform input[name="save"]').click(); |
93 |
} |
94 |
else {return false;} |
95 |
}); |
96 |
|
62 |
}); |
97 |
}); |
63 |
|
98 |
|
64 |
function clear_entry(node) { |
99 |
function clear_entry(node) { |
Lines 157-196
function select_user(borrowernumber, borrower) {
Link Here
|
157 |
|
192 |
|
158 |
hint.html(age_string); |
193 |
hint.html(age_string); |
159 |
} |
194 |
} |
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 |
}); |
194 |
|
195 |
|
195 |
var MSG_SEPARATOR = _("Separator must be / in field %s"); |
196 |
var MSG_SEPARATOR = _("Separator must be / in field %s"); |
196 |
var MSG_INCORRECT_DAY = _("Invalid day entered in field %s"); |
197 |
var MSG_INCORRECT_DAY = _("Invalid day entered in field %s"); |
Lines 239-244
$(document).ready(function() {
Link Here
|
239 |
[% UNLESS ( no_add ) %] |
240 |
[% UNLESS ( no_add ) %] |
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> |
241 |
<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> |
241 |
|
242 |
|
|
|
243 |
[% IF quickadd && opadd %] |
244 |
<a href="#" class="toggle_quick_add"><i class="fa fa-plus-square"></i> Show full form</a> |
245 |
<a href="#" class="toggle_quick_add" style="display:none"><i class="fa fa-minus-square"></i> Show brief form</a> |
246 |
[% ELSE %] |
247 |
<a href="#" class="toggle_quick_add" style="display:none"><i class="fa fa-plus-square"></i> Show full form</a> |
248 |
<a href="#" class="toggle_quick_add"><i class="fa fa-minus-square"></i> Show brief form</a> |
249 |
[% END %] |
250 |
|
242 |
[% IF ( check_member ) %] |
251 |
[% IF ( check_member ) %] |
243 |
<div class="dialog alert"> |
252 |
<div class="dialog alert"> |
244 |
<h3>Duplicate patron record?</h3> |
253 |
<h3>Duplicate patron record?</h3> |
Lines 309-315
$(document).ready(function() {
Link Here
|
309 |
[% END %] |
318 |
[% END %] |
310 |
|
319 |
|
311 |
|
320 |
|
312 |
[% UNLESS ( check_member ) %]<form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class='toggler' > |
321 |
[% UNLESS ( check_member ) %]<form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class="toggler" > |
313 |
<input type="hidden" name="nodouble" value="[% nodouble %]" /> [% END %] |
322 |
<input type="hidden" name="nodouble" value="[% nodouble %]" /> [% END %] |
314 |
<!-- field always hidden in different form (1,2,3) --> |
323 |
<!-- field always hidden in different form (1,2,3) --> |
315 |
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" /> |
324 |
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" /> |
Lines 1182-1190
$(document).ready(function() {
Link Here
|
1182 |
|
1191 |
|
1183 |
[% UNLESS ( check_member ) %] |
1192 |
[% UNLESS ( check_member ) %] |
1184 |
<fieldset class="action"> |
1193 |
<fieldset class="action"> |
1185 |
[% IF quickadd && opadd %] |
|
|
1186 |
<input type="button" class='toggle_quick_add' value="Quick-add/Full form" /> |
1187 |
[% END %] |
1188 |
<input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" /> |
1194 |
<input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" /> |
1189 |
[% IF ( opadd ) %] |
1195 |
[% IF ( opadd ) %] |
1190 |
<a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> |
1196 |
<a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> |
Lines 1197-1231
$(document).ready(function() {
Link Here
|
1197 |
</form> |
1203 |
</form> |
1198 |
|
1204 |
|
1199 |
[% IF quickadd && opadd && !check_member %] |
1205 |
[% IF quickadd && opadd && !check_member %] |
1200 |
<form id="quick_add_form" class='toggler'> |
1206 |
<form id="quick_add_form" class="toggler"> |
1201 |
<fieldset class="rows quick_add"><legend>Quick Add</legend> |
1207 |
<fieldset class="rows quick_add"><legend>Quick add</legend> |
1202 |
<ol id="quick_add_list"> |
1208 |
<ol id="quick_add_list"> |
1203 |
</ol> |
1209 |
</ol> |
1204 |
</fieldset> |
1210 |
</fieldset> |
1205 |
|
1211 |
|
1206 |
<fieldset class="action"> |
1212 |
<fieldset class="action"> |
1207 |
<input type="button" class='toggle_quick_add' value="Quick-add/Full form"/> |
1213 |
<input type="button" class="save_quick_add" value="Save" /> |
1208 |
<input type="button" class="save_quick_add" value="Save" /> |
1214 |
<a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> |
1209 |
<a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> |
1215 |
</fieldset> |
1210 |
</fieldset> |
1216 |
|
1211 |
|
1217 |
</form> |
1212 |
</form> |
1218 |
<script> |
1213 |
<script> |
1219 |
$(document).ready(function () { |
1214 |
$(document).ready(function () { |
1220 |
$("#entryform").hide(); |
1215 |
$("#entryform").hide(); |
1221 |
[% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %] |
1216 |
[% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %] |
1222 |
var qaddfields = "[% FOREACH field IN q_add_f.unique %][% field %] [% END %]"; |
1217 |
var qaddfields = "[% FOREACH field IN q_add_f.unique %][% field %] [% END %]"; |
1223 |
$("#entryform label").each(function () { |
1218 |
$("#entryform label").each(function () { |
1224 |
var input_label = $(this).attr('for'); |
1219 |
var input_label = $(this).attr('for'); |
1225 |
if ( input_label == 'sex-female' ) { input_label='sex'; } |
1220 |
if ( input_label == 'sex-female' ) { input_label='sex'; } |
1226 |
else if ( input_label == 'btitle' ) { input_label='title'; } |
1221 |
else if ( input_label == 'btitle' ) { input_label='title'; } |
1227 |
if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){ |
1222 |
if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){ |
1228 |
$(this).parent().clone().appendTo("#quick_add_list"); |
1223 |
$(this).parent().clone().appendTo("#quick_add_list"); |
1229 |
if( input_label == 'password') $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list"); |
1224 |
if( input_label == 'password') $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list"); |
1230 |
} |
1225 |
} |
1231 |
}); |
1226 |
}); |
1232 |
}); |
1227 |
}); |
1233 |
</script> |
1228 |
</script> |
|
|
1229 |
[% END %] |
1234 |
[% END %] |
1230 |
</div> |
1235 |
</div> |
1231 |
</div> |
1236 |
</div> |
1232 |
- |
|
|