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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-8 / +10 lines)
Lines 320-325 Link Here
320
320
321
[% IF show_guarantor || guarantor %]
321
[% IF show_guarantor || guarantor %]
322
    [% SET possible_relationships = Koha.Preference('borrowerRelationship') %]
322
    [% SET possible_relationships = Koha.Preference('borrowerRelationship') %]
323
    <span id="memberentry_guarantor_anchor">
323
    <fieldset id="memberentry_guarantor" class="rows">
324
    <fieldset id="memberentry_guarantor" class="rows">
324
        <legend>Guarantor information</legend>
325
        <legend>Guarantor information</legend>
325
326
Lines 357-362 Link Here
357
                            [% END %]
358
                            [% END %]
358
359
359
                            <li>
360
                            <li>
361
                            </span>
360
                                <label for="relationship">Relationship: </label>
362
                                <label for="relationship">Relationship: </label>
361
                                <span>[% r.relationship | html %]</span>
363
                                <span>[% r.relationship | html %]</span>
362
                            </li>
364
                            </li>
Lines 446-451 Link Here
446
                [% END %]
448
                [% END %]
447
            </ol>
449
            </ol>
448
    </fieldset>
450
    </fieldset>
451
    </span>
449
[% END %]
452
[% END %]
450
453
451
454
Lines 1273-1281 Link Here
1273
                if( $("#entryform:visible").length ) {
1276
                if( $("#entryform:visible").length ) {
1274
                    toggle_to = "#quick_add_form label";
1277
                    toggle_to = "#quick_add_form label";
1275
                    toggle_from = "#entryform label";
1278
                    toggle_from = "#entryform label";
1279
                    $("#memberentry_guarantor").appendTo("#quick_add_form");
1276
                } else {
1280
                } else {
1277
                    toggle_to="#entryform label";
1281
                    toggle_to="#entryform label";
1278
                    toggle_from = "#quick_add_form label";
1282
                    toggle_from = "#quick_add_form label";
1283
                    $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
1279
                }
1284
                }
1280
                $(toggle_from).each(function() {
1285
                $(toggle_from).each(function() {
1281
                    var input_label = $(this).attr('for');
1286
                    var input_label = $(this).attr('for');
Lines 1293-1298 Link Here
1293
                $("#quick_add_form").validate();
1298
                $("#quick_add_form").validate();
1294
                if( $("#quick_add_form").valid()){
1299
                if( $("#quick_add_form").valid()){
1295
                    $('.toggle_quick_add').click();
1300
                    $('.toggle_quick_add').click();
1301
                    $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
1296
                    $('#saverecord').click();
1302
                    $('#saverecord').click();
1297
                }
1303
                }
1298
                else {return false;}
1304
                else {return false;}
Lines 1340-1346 Link Here
1340
                $("#entryform,#saverecord").hide();
1346
                $("#entryform,#saverecord").hide();
1341
                [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
1347
                [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
1342
                var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field | html %]",[% END %]];
1348
                var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field | html %]",[% END %]];
1343
                var skipped_fields = ["contactname","contactfirstname","relationship"]; //Guarantor form is pulled as a whole, ignore individual fields
1344
                $("#entryform label").each(function () {
1349
                $("#entryform label").each(function () {
1345
                    var input_label = $(this).attr('for');
1350
                    var input_label = $(this).attr('for');
1346
                    if ( input_label == 'sex-female' ) {
1351
                    if ( input_label == 'sex-female' ) {
Lines 1349-1355 Link Here
1349
                    else if ( input_label == 'btitle' ) {
1354
                    else if ( input_label == 'btitle' ) {
1350
                        input_label='title';
1355
                        input_label='title';
1351
                    }
1356
                    }
1352
                    if ( skipped_fields.indexOf( input_label ) != -1 ) { input_label=""; }
1353
                    if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1357
                    if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1354
                       $(this).parent().clone().appendTo("#quick_add_list");
1358
                       $(this).parent().clone().appendTo("#quick_add_list");
1355
                       [% UNLESS mandatorypassword %]
1359
                       [% UNLESS mandatorypassword %]
Lines 1357-1371 Link Here
1357
                       [% END %]
1361
                       [% END %]
1358
                    }
1362
                    }
1359
                });
1363
                });
1360
                    if( $("#memberentry_guarantor").length ) {
1364
                if ( $("#memberentry_guarantor").length ) {
1361
                        $("#memberentry_guarantor").clone().appendTo("#quick_add_list").css("margin",0);
1365
                    $("#memberentry_guarantor").appendTo("#quick_add_form");
1362
                        $("#quick_add_form #memberentry_guarantor").append("<p>" + _("Note: Quick add guarantor form populates address fields in full form") + "</p>");
1366
                }
1363
                        $("#quick_add_list #guarantordelete").prop('id','qagd');
1364
                    }
1365
                $("#qagd").click(function() { $("#guarantordelete").click(); });
1366
                $("#quick_add_form").show();
1367
                $("#quick_add_form").show();
1367
            });
1368
            });
1368
        [% END %]
1369
        [% END %]
1370
        $("#guarantor_template").hide();
1369
1371
1370
    </script>
1372
    </script>
1371
    [% Asset.js("js/members.js") | $raw %]
1373
    [% Asset.js("js/members.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (-4 / +1 lines)
Lines 281-289 $(document).ready(function(){ Link Here
281
281
282
    $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
282
    $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
283
283
284
    $('#guarantor_template').hide();
284
    $('body').on('click', '#guarantor_search', function(e) {
285
286
    $('#guarantor_search').on('click', function(e) {
287
        e.preventDefault();
285
        e.preventDefault();
288
        var newin = window.open('guarantor_search.pl','popup','width=600,height=400,resizable=no,toolbar=false,scrollbars=yes,top');
286
        var newin = window.open('guarantor_search.pl','popup','width=600,height=400,resizable=no,toolbar=false,scrollbars=yes,top');
289
    });
287
    });
290
- 

Return to bug 23905