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 378-383 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
378
('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'),
378
('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'),
379
('PatronsPerPage','20','20','Number of Patrons Per Page displayed by default','Integer'),
379
('PatronsPerPage','20','20','Number of Patrons Per Page displayed by default','Integer'),
380
('EnablePayPalOpacPayments',  '0', NULL ,  'Enables the ability to pay fees and fines from  the OPAC via PayPal',  'YesNo' ),
380
('EnablePayPalOpacPayments',  '0', NULL ,  'Enables the ability to pay fees and fines from  the OPAC via PayPal',  'YesNo' ),
381
('PatronQuickAdd',  '0', NULL ,  'Enables the patron quick add form when entering a new patron. Displays only mandatory fields and fields specified in PatronQuickAddFields',  'YesNo' ),
382
('PatronQuickAddFields',  '', NULL ,  'A list of fields separated by "|" to be displayed along with mandatory fields in the patron quick add form if enabled',  'Free' ),
381
('PayPalChargeDescription',  'Koha fee payment', NULL ,  'This preference defines what the user will see the charge listed as in PayPal',  'Free'),
383
('PayPalChargeDescription',  'Koha fee payment', NULL ,  'This preference defines what the user will see the charge listed as in PayPal',  'Free'),
382
('PayPalPwd',  '', NULL ,  'Your PayPal API password',  'Free'),
384
('PayPalPwd',  '', NULL ,  'Your PayPal API password',  'Free'),
383
('PayPalSandboxMode',  '1', NULL ,  'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.',  'YesNo'),
385
('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 (-4 / +65 lines)
Lines 155-160 function select_user(borrowernumber, borrower) { Link Here
155
155
156
        hint.html(age_string);
156
        hint.html(age_string);
157
    }
157
    }
158
$(document).ready(function() {
159
        $(".toggle_quick_add").click(function(){
160
            $(".toggler").toggle();
161
            return false;
162
        });
163
164
        $(".save_quick_add").click(function(){
165
            $("#quick_add_form label").each(function () {
166
                var input_label = $(this).attr('for');
167
                if ( input_label == 'sex-male' || input_label == 'sex-none' ) { return; }
168
                $("#entryform label[for='"+input_label+"']").parent().replaceWith(  $(this).parent().clone() );
169
                if ( $(this).next().is('select') ) {
170
                    var cur_sel = $(this).next().val();
171
                    $("#entryform label[for='"+input_label+"']").next().find('option[value="'+cur_sel+'"').prop('selected',true);
172
                }
173
                if ( $(this).next().is('textarea') ) {
174
                    var cur_text = $(this).next().val();
175
                    $("#entryform label[for='"+input_label+"']").next().val( cur_text );
176
                }
177
            });
178
            $("#quick_add_form input").each(function(){
179
                var cur_id = $(this).attr('id');
180
                $('#entryform #' + cur_id).val( $(this).val() );
181
            });
182
            $('#entryform input[name="save"]').click();
183
        });
184
    });
158
185
159
        var MSG_SEPARATOR = _("Separator must be / in field %s");
186
        var MSG_SEPARATOR = _("Separator must be / in field %s");
160
        var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
187
        var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
Lines 273-279 function select_user(borrowernumber, borrower) { Link Here
273
	[% END %]
300
	[% END %]
274
301
275
302
276
[% UNLESS ( check_member ) %]<form name="form" id="entryform"  action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
303
[% UNLESS ( check_member ) %]<form name="form" id="entryform"  action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class='toggler' >
277
<input type="hidden" name="nodouble"  value="[% nodouble %]" /> [% END %]
304
<input type="hidden" name="nodouble"  value="[% nodouble %]" /> [% END %]
278
<!--    field always hidden in different form (1,2,3) -->
305
<!--    field always hidden in different form (1,2,3) -->
279
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" />
306
<input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" />
Lines 1150-1165 function select_user(borrowernumber, borrower) { Link Here
1150
1177
1151
[% UNLESS ( check_member ) %]
1178
[% UNLESS ( check_member ) %]
1152
    <fieldset class="action">
1179
    <fieldset class="action">
1180
        [% IF opadd %]
1181
            <input type="button" class='toggle_quick_add' value="Quick-add/Full form" />
1182
        [% END %]
1153
        <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
1183
        <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
1154
      [% IF ( opadd ) %]
1184
     [% IF ( opadd ) %]
1155
       <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a>
1185
       <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a>
1156
	   [% ELSE %]
1186
	   [% ELSE %]
1157
	  <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
1187
	  <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
1158
	   [% END %]
1188
	   [% END %]
1159
    </fieldset>
1189
    </fieldset>
1160
[% END %]
1190
[% END %]
1191
1161
</form>
1192
</form>
1162
  
1193
1194
[% IF Koha.Preference('PatronQuickAdd') && opadd  && !check_member %]
1195
<form id="quick_add_form" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class='toggler'>
1196
    <fieldset class="rows quick_add"><legend>Quick Add</legend>
1197
        <ol id="quick_add_list">
1198
        </ol>
1199
    </fieldset>
1200
1201
    <fieldset class="action">
1202
        <input type="button" class='toggle_quick_add' value="Quick-add/Full form"/>
1203
        <input type="button"  class="save_quick_add" value="Save" />
1204
       <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a>
1205
    </fieldset>
1206
1207
</form>
1208
<script>
1209
    $(document).ready(function () {
1210
        $("#entryform").hide();
1211
        [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
1212
        var qaddfields = "[% FOREACH field IN q_add_f.unique %][% field %] [% END %]";
1213
        $("#entryform label").each(function () {
1214
            var input_label = $(this).attr('for');
1215
            if ( input_label == 'sex-female' ) { input_label='sex'; }
1216
            else if ( input_label == 'btitle' ) { input_label='title'; }
1217
            if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1218
            $(this).parent().clone().appendTo("#quick_add_list");
1219
            if( input_label == 'password') $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list");
1220
            }
1221
         });
1222
    });
1223
</script>
1224
[% END %]
1163
</div>
1225
</div>
1164
</div>
1226
</div>
1165
1227
1166
- 

Return to bug 3534