@@ -, +, @@ --- .../prog/en/modules/members/memberentrygen.tt | 139 +++++++++++---------- 1 file changed, 72 insertions(+), 67 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -59,6 +59,41 @@ $(document).ready(function() { mrform.hide(); e.preventDefault(); }); + + var toggle_quick_add = $(".toggle_quick_add"); + $(toggle_quick_add).click(function(e){ + toggle_quick_add.toggle(); + e.preventDefault(); + var toggle_to = ''; + var toggle_from = ''; + if( $("#entryform:visible").length ) { + toggle_to = "#quick_add_form label"; + toggle_from = "#entryform label"; + } else { + toggle_to="#entryform label"; + toggle_from = "#quick_add_form label"; + } + $(toggle_from).each(function() { + var input_label = $(this).attr('for'); + if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' ) { + $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') ); + return; + } + if( $(this).next().val() != '' ) { $(toggle_to+"[for='"+input_label+"']").next().val( $(this).next().val() );} + }); + + $(".toggler").toggle(); + }); + + $(".save_quick_add").click(function(){ + $("#quick_add_form").validate(); + if( $("#quick_add_form").valid()){ + $('.toggle_quick_add').click(); + $('#entryform input[name="save"]').click(); + } + else {return false;} + }); + }); function clear_entry(node) { @@ -157,40 +192,6 @@ function select_user(borrowernumber, borrower) { hint.html(age_string); } -$(document).ready(function() { - $(".toggle_quick_add").click(function(){ - var toggle_to = ''; - var toggle_from = ''; - if( $("#entryform:visible").length ) { - toggle_to = "#quick_add_form label"; - toggle_from = "#entryform label"; - } else { - toggle_to="#entryform label"; - toggle_from = "#quick_add_form label"; - } - $(toggle_from).each(function() { - var input_label = $(this).attr('for'); - if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' ) { - $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') ); - return; - } - if( $(this).next().val() != '' ) { $(toggle_to+"[for='"+input_label+"']").next().val( $(this).next().val() );} - }); - - $(".toggler").toggle(); -// return false; - }); - - - $(".save_quick_add").click(function(){ - $("#quick_add_form").validate(); - if( $("#quick_add_form").valid()){ - $('.toggle_quick_add').click(); - $('#entryform input[name="save"]').click(); - } - else {return false;} - }); - }); var MSG_SEPARATOR = _("Separator must be / in field %s"); var MSG_INCORRECT_DAY = _("Invalid day entered in field %s"); @@ -239,6 +240,14 @@ $(document).ready(function() { [% UNLESS ( no_add ) %]

[% 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 %])

+ [% IF quickadd && opadd %] + Show full form + + [% ELSE %] + + Show brief form + [% END %] + [% IF ( check_member ) %]

Duplicate patron record?

@@ -309,7 +318,7 @@ $(document).ready(function() { [% END %] -[% UNLESS ( check_member ) %]
+[% UNLESS ( check_member ) %] [% END %] @@ -1182,9 +1191,6 @@ $(document).ready(function() { [% UNLESS ( check_member ) %]
- [% IF quickadd && opadd %] - - [% END %] [% IF ( opadd ) %] Cancel @@ -1197,35 +1203,34 @@ $(document).ready(function() { [% IF quickadd && opadd && !check_member %] -
-
Quick Add -
    -
-
- -
- - - Cancel -
- -
- +
+
Quick add +
    +
+
+ +
+ + Cancel +
+ +
+ [% END %]
--