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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-10 / +6 lines)
Lines 1521-1541 Link Here
1521
                                                        [% END %]
1521
                                                        [% END %]
1522
                                                        [% FOREACH patron_attribute IN pa_loo.items %]
1522
                                                        [% FOREACH patron_attribute IN pa_loo.items %]
1523
                                                            <li data-category_code="[% patron_attribute.category_code | html %]" data-pa_code="[% patron_attribute.code | replace('[^a-zA-Z0-9_-]', '') %]">
1523
                                                            <li data-category_code="[% patron_attribute.category_code | html %]" data-pa_code="[% patron_attribute.code | replace('[^a-zA-Z0-9_-]', '') %]">
1524
                                                                [% IF patron_attribute.mandatory && patron_attribute.category_code == patron_category.categorycode%]
1524
                                                                [% IF patron_attribute.mandatory && patron_attribute.category_code == patron_category.categorycode %]
1525
                                                                    <label for="[% patron_attribute.form_id | html %]" class="required" required="required">[% patron_attribute.description | html %]: </label>
1525
                                                                    <label for="[% patron_attribute.form_id | html %]" class="required" required="required">[% patron_attribute.description | html %]: </label>
1526
                                                                [% ELSIF patron_attribute.mandatory && patron_attribute.category_code != patron_category.categorycode %]
1527
                                                                    <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
1528
                                                                [% ELSE %]
1526
                                                                [% ELSE %]
1529
                                                                    <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
1527
                                                                    <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
1530
                                                                [% END %]
1528
                                                                [% END %]
1531
                                                                [% IF ( patron_attribute.use_dropdown ) %]
1529
                                                                [% IF ( patron_attribute.use_dropdown ) %]
1532
                                                                    [% IF patron_attribute.mandatory && patron_attribute.category_code == patron_category.categorycode %]
1530
                                                                    <select
1533
                                                                        <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">
1531
                                                                        id="[% patron_attribute.form_id | html %]"
1534
                                                                    [% ELSIF patron_attribute.mandatory && patron_attribute.category_code != patron_category.categorycode %]
1532
                                                                        name="[% patron_attribute.form_id | html %]"
1535
                                                                        <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">
1533
                                                                        [% IF patron_attribute.mandatory && patron_attribute.category_code == patron_category.categorycode %]required="required"[% END %]
1536
                                                                    [% ELSE %]
1534
                                                                    >
1537
                                                                        <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">
1538
                                                                    [% END %]
1539
                                                                        <option value=""></option>
1535
                                                                        <option value=""></option>
1540
                                                                        [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1536
                                                                        [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1541
                                                                            [% IF auth_val_loo.authorised_value == patron_attribute.value %]
1537
                                                                            [% IF auth_val_loo.authorised_value == patron_attribute.value %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (-10 / +17 lines)
Lines 159-166 function select_user(borrowernumber, borrower, relationship) { Link Here
159
        fieldset.show();
159
        fieldset.show();
160
160
161
        //Add attribute required so visible new_guarantor_relationship is validated
161
        //Add attribute required so visible new_guarantor_relationship is validated
162
        if($(".new_guarantor_relationship").is(":visible")){
162
        if ($(".new_guarantor_relationship").is(":visible")) {
163
            $(".new_guarantor_relationship").prop('required',true);
163
            $(".new_guarantor_relationship").prop("required", true);
164
        }
164
        }
165
165
166
        if (relationship) {
166
        if (relationship) {
Lines 357-378 $(document).ready(function () { Link Here
357
            else form.beenSubmitted = true;
357
            else form.beenSubmitted = true;
358
            form.submit();
358
            form.submit();
359
        },
359
        },
360
        invalidHandler: function(form, validator) {
360
        invalidHandler: function (form, validator) {
361
            var error_msg = jQuery.validator.messages.missing_fields;
361
            var error_msg = jQuery.validator.messages.missing_fields;
362
            // First remove error messages so that it doesn't
362
            // First remove error messages so that it doesn't
363
            // show in fieldset without errors
363
            // show in fieldset without errors
364
            $("fieldset").each(function(){
364
            $("fieldset").each(function () {
365
                $("#"+$(this).attr("id")+"-error").remove();
365
                $("#" + $(this).attr("id") + "-error").remove();
366
            });
366
            });
367
            $(validator.errorList).each(function() {
367
            $(validator.errorList).each(function () {
368
                var fieldset = $(this.element).parents('[id*="memberentry_"]');
368
                var fieldset = $(this.element).parents('[id*="memberentry_"]');
369
                var fieldset_id = fieldset.attr("id");
369
                var fieldset_id = fieldset.attr("id");
370
                //Add error message only if it doesn't already exist
370
                //Add error message only if it doesn't already exist
371
                if(!$("#"+fieldset_id+"-error").length){
371
                if (!$("#" + fieldset_id + "-error").length) {
372
                    fieldset.find("legend").before('<span id="'+fieldset_id+'-error" class="required">'+error_msg+'</span>');
372
                    fieldset
373
                        .find("legend")
374
                        .before(
375
                            '<span id="' +
376
                                fieldset_id +
377
                                '-error" class="required">' +
378
                                error_msg +
379
                                "</span>"
380
                        );
373
                }
381
                }
374
            });
382
            });
375
        }
383
        },
376
    });
384
    });
377
385
378
    var mrform = $("#manual_restriction_form");
386
    var mrform = $("#manual_restriction_form");
379
- 

Return to bug 34671