[Koha-bugs] [Bug 33578] Cannot edit patron restriction types

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 21 12:04:11 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33578

--- Comment #4 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
Quick guess: Maybe the one you edit shouldn't be in the list of existing ones?
    <script>
        var MSG_DUPLICATE_CODE = _("Restriction code is already in use");
        var MSG_DUPLICATE_DISPLAY_TEXT = _("Label is already in use");
        var existing = {

            DISCHARGE: 'Discharge tkk',

            MANUAL: 'Manual',

            OVERDUES: 'Overdues',

            SUSPENSION: 'Suspension',

        };
    </script>

jQuery.validator.addMethod( "restrictionDisplayText", function(value){
    var ex = Object.values(existing).map(function(el) {
        return el.toLowerCase();
    });
    return (value.length > 0 && ex.indexOf(value.toLowerCase()) > -1) ?
        false :
        true;
}, MSG_DUPLICATE_DISPLAY_TEXT);

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list