View | Details | Raw Unified | Return to bug 3534
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_3534_add_PatronQuickAdd_sysprefs.sql (+2 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('PatronQuickAdd', '0', 'Enables the ability to pay fees and fines from  the OPAC via PayPal', NULL, 'YesNo');
2
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('PatronQuickAddFields', '', 'A list of fields separated by "|" to be displayed along with mandatory fields in the patron quick add form if enabled', NULL, 'Free');
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 369-374 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
369
('PatronSelfRegistrationVerifyByEmail','0',NULL,'If enabled, any patron attempting to register themselves via the OPAC will be required to verify themselves via email to activate his or her account.','YesNo'),
369
('PatronSelfRegistrationVerifyByEmail','0',NULL,'If enabled, any patron attempting to register themselves via the OPAC will be required to verify themselves via email to activate his or her account.','YesNo'),
370
('PatronsPerPage','20','20','Number of Patrons Per Page displayed by default','Integer'),
370
('PatronsPerPage','20','20','Number of Patrons Per Page displayed by default','Integer'),
371
('EnablePayPalOpacPayments',  '0', NULL ,  'Enables the ability to pay fees and fines from  the OPAC via PayPal',  'YesNo' ),
371
('EnablePayPalOpacPayments',  '0', NULL ,  'Enables the ability to pay fees and fines from  the OPAC via PayPal',  'YesNo' ),
372
('PatronQuickAdd',  '0', NULL ,  'Enables the patron quick add form when entering a new patron. Displays only mandatory fields and fields specified in PatronQuickAddFields',  'YesNo' ),
373
('PatronQuickAddFields',  '', NULL ,  'A list of fields separated by "|" to be displayed along with mandatory fields in the patron quick add form if enabled',  'Free' ),
372
('PayPalChargeDescription',  'Koha fee payment', NULL ,  'This preference defines what the user will see the charge listed as in PayPal',  'Free'),
374
('PayPalChargeDescription',  'Koha fee payment', NULL ,  'This preference defines what the user will see the charge listed as in PayPal',  'Free'),
373
('PayPalPwd',  '', NULL ,  'Your PayPal API password',  'Free'),
375
('PayPalPwd',  '', NULL ,  'Your PayPal API password',  'Free'),
374
('PayPalSandboxMode',  '1', NULL ,  'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.',  'YesNo'),
376
('PayPalSandboxMode',  '1', NULL ,  'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.',  'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+7 lines)
Lines 100-105 Patrons: Link Here
100
           class: integer
100
           class: integer
101
         - results per page in the staff client.
101
         - results per page in the staff client.
102
     -
102
     -
103
         - pref: PatronQuickAdd
104
           choices:
105
               yes: Use
106
               no:  "Don't use"
107
         - "the patron quick add form when entering a new patron. Displays only mandatory fields and fields specified here:"
108
         - pref: PatronQuickAddFields
109
     -
103
         - "Use the SMS::Send::"
110
         - "Use the SMS::Send::"
104
         - pref: SMSSendDriver
111
         - pref: SMSSendDriver
105
         - driver to send SMS messages.
112
         - driver to send SMS messages.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-5 / +65 lines)
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
- 

Return to bug 3534