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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (-2 lines)
Lines 624-631 Link Here
624
    [% INCLUDE 'datatables.inc' %]
624
    [% INCLUDE 'datatables.inc' %]
625
    [% INCLUDE 'columns_settings.inc' %]
625
    [% INCLUDE 'columns_settings.inc' %]
626
    <script>
626
    <script>
627
        var MSG_CATEGORYCODE_CHARS = _("Category code can only contain the following characters: letters, numbers, - and _.");
628
        var MSG_ONE_ENROLLMENTPERIOD = ("Please choose an enrollment period in months OR by date.");
629
        var columns_settings = [% TablesSettings.GetColumns( 'admin', 'categories', 'patron_categories', 'json' ) | $raw %];
627
        var columns_settings = [% TablesSettings.GetColumns( 'admin', 'categories', 'patron_categories', 'json' ) | $raw %];
630
    </script>
628
    </script>
631
    [% Asset.js("js/categories.js") | $raw %]
629
    [% Asset.js("js/categories.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/categories.js (-5 / +6 lines)
Lines 1-3 Link Here
1
/* global __ */
2
1
jQuery.validator.addMethod( "letters_numbers", function(value,element){
3
jQuery.validator.addMethod( "letters_numbers", function(value,element){
2
    var patt = /^[a-zA-Z0-9\-_]+$/g;
4
    var patt = /^[a-zA-Z0-9\-_]+$/g;
3
    if (patt.test(element.value)) {
5
    if (patt.test(element.value)) {
Lines 5-11 jQuery.validator.addMethod( "letters_numbers", function(value,element){ Link Here
5
    } else {
7
    } else {
6
        return false;
8
        return false;
7
    }
9
    }
8
    }, MSG_CATEGORYCODE_CHARS
10
    }, __("Category code can only contain the following characters: letters, numbers, - and _.")
9
);
11
);
10
12
11
jQuery.validator.addMethod( "enrollment_period", function(){
13
jQuery.validator.addMethod( "enrollment_period", function(){
Lines 16-22 jQuery.validator.addMethod( "enrollment_period", function(){ Link Here
16
        } else {
18
        } else {
17
            return true;
19
            return true;
18
        }
20
        }
19
    }, MSG_ONE_ENROLLMENTPERIOD
21
    }, __("Please choose an enrollment period in months OR by date.")
20
);
22
);
21
23
22
24
Lines 91-100 $(document).ready(function() { Link Here
91
        },
93
        },
92
        messages: {
94
        messages: {
93
            enrolmentperiod: {
95
            enrolmentperiod: {
94
                required: MSG_ONE_ENROLLMENTPERIOD
96
                required: __("Please choose an enrollment period in months OR by date.")
95
            },
97
            },
96
            enrolmentperioddate: {
98
            enrolmentperioddate: {
97
                required: MSG_ONE_ENROLLMENTPERIOD
99
                required: __("Please choose an enrollment period in months OR by date.")
98
            }
100
            }
99
        }
101
        }
100
102
101
- 

Return to bug 26229