Lines 8-13
Link Here
|
8 |
//<![CDATA[ |
8 |
//<![CDATA[ |
9 |
$(document).ready(function() { |
9 |
$(document).ready(function() { |
10 |
|
10 |
|
|
|
11 |
$(".toggle_quick_add").click(function(){ |
12 |
$(".toggler").toggle(); |
13 |
return false; |
14 |
}); |
15 |
|
16 |
$(".save_quick_add").click(function(){ |
17 |
$("#quick_add_form label").each(function () { |
18 |
var input_label = $(this).attr('for'); |
19 |
if ( input_label == 'sex-male' || input_label == 'sex-none' ) { return; } |
20 |
$("#entryform label[for='"+input_label+"']").parent().replaceWith( $(this).parent().clone() ); |
21 |
if ( $(this).next().is('select') ) { |
22 |
var cur_sel = $(this).next().val(); |
23 |
$("#entryform label[for='"+input_label+"']").next().find('option[value="'+cur_sel+'"').prop('selected',true); |
24 |
} |
25 |
if ( $(this).next().is('textarea') ) { |
26 |
var cur_text = $(this).next().val(); |
27 |
$("#entryform label[for='"+input_label+"']").next().val( cur_text ); |
28 |
} |
29 |
}); |
30 |
$("#quick_add_form input").each(function(){ |
31 |
var cur_id = $(this).attr('id'); |
32 |
$('#entryform #' + cur_id).val( $(this).val() ); |
33 |
}); |
34 |
$('#entryform input[name="save"]').click(); |
35 |
}); |
36 |
|
11 |
[% IF categorycode %] |
37 |
[% IF categorycode %] |
12 |
update_category_code( "[% categorycode %]" ); |
38 |
update_category_code( "[% categorycode %]" ); |
13 |
[% ELSE %] |
39 |
[% ELSE %] |
Lines 133-139
Link Here
|
133 |
[% END %] |
159 |
[% END %] |
134 |
|
160 |
|
135 |
|
161 |
|
136 |
[% UNLESS ( check_member ) %]<form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off"> |
162 |
[% UNLESS ( check_member ) %]<form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class='toggler' > |
137 |
<input type="hidden" name="nodouble" value="[% nodouble %]" /> [% END %] |
163 |
<input type="hidden" name="nodouble" value="[% nodouble %]" /> [% END %] |
138 |
<!-- field always hidden in different form (1,2,3) --> |
164 |
<!-- field always hidden in different form (1,2,3) --> |
139 |
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" /> |
165 |
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" /> |
Lines 796-802
Link Here
|
796 |
[% ELSE %] |
822 |
[% ELSE %] |
797 |
<input type="password" id="password2" name="password2" size="20" value="" /> |
823 |
<input type="password" id="password2" name="password2" size="20" value="" /> |
798 |
[% END %] |
824 |
[% END %] |
799 |
[% END %] |
825 |
[% END % ] |
800 |
[% END %] |
826 |
[% END %] |
801 |
[% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %] |
827 |
[% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %] |
802 |
</li> |
828 |
</li> |
Lines 1014-1029
Link Here
|
1014 |
|
1040 |
|
1015 |
[% UNLESS ( check_member ) %] |
1041 |
[% UNLESS ( check_member ) %] |
1016 |
<fieldset class="action"> |
1042 |
<fieldset class="action"> |
|
|
1043 |
[% IF opadd %] |
1044 |
<input type="button" class='toggle_quick_add' value="Quick-add/Full form" /> |
1045 |
[% END %] |
1017 |
<input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" /> |
1046 |
<input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" /> |
1018 |
[% IF ( opadd ) %] |
1047 |
[% IF ( opadd ) %] |
1019 |
<a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> |
1048 |
<a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> |
1020 |
[% ELSE %] |
1049 |
[% ELSE %] |
1021 |
<a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a> |
1050 |
<a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a> |
1022 |
[% END %] |
1051 |
[% END %] |
1023 |
</fieldset> |
1052 |
</fieldset> |
1024 |
[% END %] |
1053 |
[% END %] |
|
|
1054 |
|
1025 |
</form> |
1055 |
</form> |
1026 |
|
1056 |
|
|
|
1057 |
[% IF Koha.Preference('PatronQuickAdd') && opadd && !check_member %] |
1058 |
<form id="quick_add_form" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class='toggler'> |
1059 |
<fieldset class="rows quick_add"><legend>Quick Add</legend> |
1060 |
<ol id="quick_add_list"> |
1061 |
</ol> |
1062 |
</fieldset> |
1063 |
|
1064 |
<fieldset class="action"> |
1065 |
<input type="button" class='toggle_quick_add' value="Quick-add/Full form"/> |
1066 |
<input type="button" class="save_quick_add" value="Save" /> |
1067 |
<a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> |
1068 |
</fieldset> |
1069 |
|
1070 |
</form> |
1071 |
<script> |
1072 |
$(document).ready(function () { |
1073 |
$("#entryform").hide(); |
1074 |
[% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %] |
1075 |
var qaddfields = "[% FOREACH field IN q_add_f.unique %][% field %] [% END %]"; |
1076 |
$("#entryform label").each(function () { |
1077 |
var input_label = $(this).attr('for'); |
1078 |
if ( input_label == 'sex-female' ) { input_label='sex'; } |
1079 |
else if ( input_label == 'btitle' ) { input_label='title'; } |
1080 |
if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){ |
1081 |
$(this).parent().clone().appendTo("#quick_add_list"); |
1082 |
if( input_label == 'password') $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list"); |
1083 |
} |
1084 |
}); |
1085 |
}); |
1086 |
</script> |
1087 |
[% END %] |
1027 |
</div> |
1088 |
</div> |
1028 |
</div> |
1089 |
</div> |
1029 |
|
1090 |
|
1030 |
- |
|
|