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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc (-15 / +14 lines)
Lines 19-45 Link Here
19
19
20
<h5>Basic parameters</h5>
20
<h5>Basic parameters</h5>
21
<ul>
21
<ul>
22
	<li><a href="/cgi-bin/koha/admin/branches.pl">Libraries and groups</a></li>
22
    <li><a href="/cgi-bin/koha/admin/branches.pl">Libraries and groups</a></li>
23
	<li><a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a></li>
23
    <li><a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a></li>
24
	<li><a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a></li>
24
    <li><a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a></li>
25
</ul>
25
</ul>
26
26
27
<h5>Patrons and circulation</h5>
27
<h5>Patrons and circulation</h5>
28
<ul>
28
<ul>
29
	<li><a href="/cgi-bin/koha/admin/categories.pl">Patron types and categories</a></li>
29
    <li><a href="/cgi-bin/koha/admin/categories.pl">Patron types and categories</a></li>
30
    <li><a href="/cgi-bin/koha/admin/smart-rules.pl">Circulation and fines rules</a></li>
30
    <li><a href="/cgi-bin/koha/admin/smart-rules.pl">Circulation and fines rules</a></li>
31
	<li><a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a></li>
31
    <li><a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a></li>
32
	<li><a href="/cgi-bin/koha/admin/branch_transfer_limits.pl">Library transfer limits</a></li>
32
    <li><a href="/cgi-bin/koha/admin/branch_transfer_limits.pl">Library transfer limits</a></li>
33
	<li><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport cost matrix</a></li>
33
    <li><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport cost matrix</a></li>
34
	<li><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></li>
34
    <li><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></li>
35
    <li><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></li>
35
    <li><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></li>
36
</ul>
36
</ul>
37
37
38
<h5>Catalog</h5>
38
<h5>Catalog</h5>
39
<ul>
39
<ul>
40
    <li><a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC bibliographic framework</a></li>
40
    <li><a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC bibliographic framework</a></li>
41
	<li><a href="/cgi-bin/koha/admin/koha2marclinks.pl">Koha to MARC mapping</a></li>
41
    <li><a href="/cgi-bin/koha/admin/koha2marclinks.pl">Koha to MARC mapping</a></li>
42
	<li><a href="/cgi-bin/koha/admin/fieldmapping.pl">Keywords to MARC mapping</a></li>
42
    <li><a href="/cgi-bin/koha/admin/fieldmapping.pl">Keywords to MARC mapping</a></li>
43
    <li><a href="/cgi-bin/koha/admin/checkmarc.pl">MARC bibliographic framework test</a></li>
43
    <li><a href="/cgi-bin/koha/admin/checkmarc.pl">MARC bibliographic framework test</a></li>
44
    <li><a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a></li>
44
    <li><a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a></li>
45
    <li><a href="/cgi-bin/koha/admin/classsources.pl">Classification sources</a></li>
45
    <li><a href="/cgi-bin/koha/admin/classsources.pl">Classification sources</a></li>
Lines 51-66 Link Here
51
<h5>Acquisition parameters</h5>
51
<h5>Acquisition parameters</h5>
52
52
53
<ul>
53
<ul>
54
	<li><a href="/cgi-bin/koha/admin/currency.pl">Currencies and exchange rates</a></li>
54
    <li><a href="/cgi-bin/koha/admin/currency.pl">Currencies and exchange rates</a></li>
55
	<li><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a></li>
55
    <li><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a></li>
56
	<li><a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a></li>
56
    <li><a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a></li>
57
58
</ul>
57
</ul>
59
58
60
<h5>Additional parameters</h5>
59
<h5>Additional parameters</h5>
61
60
62
<ul>
61
<ul>
63
	<!-- <li><a href="/cgi-bin/koha/admin/printers.pl">Network Printers</a></li> -->
62
    <!-- <li><a href="/cgi-bin/koha/admin/printers.pl">Network Printers</a></li> -->
64
    <li><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50/SRU servers</a></li>
63
    <li><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50/SRU servers</a></li>
65
    <li><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></li>
64
    <li><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></li>
66
    <li><a href="/cgi-bin/koha/admin/columns_settings.pl">Columns settings</a></li>
65
    <li><a href="/cgi-bin/koha/admin/columns_settings.pl">Columns settings</a></li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt (-102 / +98 lines)
Lines 9-122 Link Here
9
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Administration</div>
9
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Administration</div>
10
10
11
<div id="doc" class="yui-t7">
11
<div id="doc" class="yui-t7">
12
   
12
    <div id="bd">
13
   <div id="bd">
13
        <div id="yui-main" class="sysprefs">
14
	<div id="yui-main" class="sysprefs">
14
            <div class="yui-g"><h1>Koha administration</h1></div>
15
    <div class="yui-g"><h1>Koha administration</h1></div>
15
            <div class="yui-g">
16
	<div class="yui-g">
17
16
18
<div class="yui-u first">
17
                <div class="yui-u first">
19
<form action="/cgi-bin/koha/admin/preferences.pl" method="post">
18
                <form action="/cgi-bin/koha/admin/preferences.pl" method="post">
20
<fieldset>
19
                <fieldset>
21
<h4><a href="/cgi-bin/koha/admin/preferences.pl">Global system preferences</a></h4>
20
                    <h4><a href="/cgi-bin/koha/admin/preferences.pl">Global system preferences</a></h4>
22
	<p>Manage global system preferences like MARC flavor, date format, administrator email, and templates.</p>
21
                    <p>Manage global system preferences like MARC flavor, date format, administrator email, and templates.</p>
23
        <input type="hidden" name="op" value="search" />
22
                    <input type="hidden" name="op" value="search" />
24
        <input type="text" name="searchfield" value="[% searchfield %]" />
23
                    <input type="text" name="searchfield" value="[% searchfield %]" />
25
        <input type="submit" name="ok" class="submit" value="Search" />
24
                    <input type="submit" name="ok" class="submit" value="Search" />
26
</fieldset>
25
                </fieldset>
27
</form>
26
                </form>
28
27
28
                <div class="hint"><h4>Hint:</h4><p>Configure these parameters in the order they appear.</p></div>
29
                <h3>Basic parameters</h3>
30
                <dl>
31
                    <dt><a href="/cgi-bin/koha/admin/branches.pl">Libraries and groups</a></dt>
32
                    <dd>Define libraries and groups.</dd>
33
                    <dt><a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a></dt>
34
                    <dd>Define item types used for circulation rules.</dd>
35
                    <dt><a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a></dt>
36
                    <dd>Define categories and authorized values for them.</dd>
37
                </dl>
29
38
30
<div class="hint"><h4>Hint:</h4><p>Configure these parameters in the order they appear.</p></div>
39
                <h3>Patrons and circulation</h3>
31
<h3>Basic parameters</h3>
40
                <dl>
32
<dl>
41
                    <dt><a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a></dt>
33
        <dt><a href="/cgi-bin/koha/admin/branches.pl">Libraries and groups</a></dt>
42
                    <dd>Define patron categories.</dd>
34
        <dd>Define libraries and groups.</dd>
43
                [% IF CAN_user_parameters_manage_circ_rules %]
35
        <dt><a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a></dt>
44
                    <dt><a href="/cgi-bin/koha/admin/smart-rules.pl">Circulation and fines rules</a></dt>
36
        <dd>Define item types used for circulation rules.</dd>
45
                    <dd>Define circulation and fines rules for combinations of libraries, patron categories, and item types</dd>
37
        <dt><a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a></dt>
46
                [% END %]
38
		<dd>Define categories and authorized values for them.</dd>
47
                    <dt><a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a></dt>
39
</dl>
48
                    <dd>Define extended attributes (identifiers and statistical categories) for patron records</dd>
49
                    <dt><a href="/cgi-bin/koha/admin/branch_transfer_limits.pl">Library transfer limits</a></dt>
50
                    <dd>Limit the ability to transfer items between libraries based on the library sending, the library receiving, and the item type involved. These rules only go into effect if the preference UseBranchTransferLimits is set to ON.</dd>
51
                    <dt><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport cost matrix</a></dt>
52
                    <dd>Define transport costs between branches</dd>
53
                    <dt><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></dt>
54
                    <dd>Define rules for check-in and checkout notifications for combinations of libraries, patron categories, and item types</dd>
55
                    <dt><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></dt>
56
                    <dd>Define cities and towns that your patrons live in.</dd>
57
                </dl>
58
                [% IF CAN_user_plugins %]
59
                    <h3>Plugins</h3>
60
                    <dl>
61
                        <dt><a href="/cgi-bin/koha/plugins/plugins-home.pl">Manage plugins</a></dt>
62
                        <dd>View, manage, configure and run plugins.</dd>
63
                    </dl>
64
                [% END %]
65
                </div>
66
                <div class="yui-u">
67
                <h3>Catalog</h3>
68
                <dl>
69
                    <dt><a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC bibliographic framework</a></dt>
70
                    <dd>Create and manage Bibliographic frameworks that define the characteristics of your MARC Records (field and subfield definitions) as well as templates for the MARC editor.</dd>
71
                    <dt><a href="/cgi-bin/koha/admin/koha2marclinks.pl">Koha to MARC mapping</a></dt>
72
                    <dd>Define the mapping between the Koha transactional database (SQL) and the MARC Bibliographic records. Note that the mapping can be defined through MARC Bibliographic Framework. This tool is just a shortcut to speed up linkage.</dd>
73
                    <dt><a href="/cgi-bin/koha/admin/fieldmapping.pl">Keywords to MARC mapping</a></dt>
74
                    <dd>Define the mapping between keywords and MARC fields, those keywords are used to find some datas independently of the framework.</dd>
75
                    <dt><a href="/cgi-bin/koha/admin/checkmarc.pl">MARC Bibliographic framework test</a></dt>
76
                    <dd>Checks the MARC structure. If you change your MARC Bibliographic framework it's recommended that you run this tool to test for errors in your definition.</dd>
77
                    <dt><a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a></dt>
78
                    <dd>Create and manage Authorities frameworks that define the characteristics of your MARC Records (field and subfield definitions).</dd>
79
                    <dt><a href="/cgi-bin/koha/admin/classsources.pl">Classification sources</a></dt>
80
                    <dd>Define classification sources (i.e., call number schemes) used by your collection.  Also define filing rules used for sorting call numbers.</dd>
81
                    <dt><a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a></dt>
82
                    <dd>Manage rules for automatically matching MARC records during record imports.</dd>
83
                    <dt><a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a></dt>
84
                    <dd>Manage OAI Sets</dd>
85
                    <dt><a href="/cgi-bin/koha/admin/items_search_fields.pl">Items search fields</a></dt>
86
                    <dd>Manage custom fields for items search</dd>
87
                </dl>
40
88
41
<h3>Patrons and circulation</h3>
89
                <h3>Acquisition parameters</h3>
42
<dl>
90
                <dl>
43
	<dt><a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a></dt>
91
                        <dt><a href="/cgi-bin/koha/admin/currency.pl">Currencies and exchange rates</a></dt>
44
	<dd>Define patron categories.</dd>
92
                        <dd>Define currencies and exchange rates used for acquisitions.</dd>
45
[% IF CAN_user_parameters_manage_circ_rules %]
46
    <dt><a href="/cgi-bin/koha/admin/smart-rules.pl">Circulation and fines rules</a></dt>
47
    <dd>Define circulation and fines rules for combinations of libraries, patron categories, and item types</dd>
48
[% END %]
49
    <dt><a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a></dt>
50
    <dd>Define extended attributes (identifiers and statistical categories) for patron records</dd>
51
    <dt><a href="/cgi-bin/koha/admin/branch_transfer_limits.pl">Library transfer limits</a></dt>
52
	<dd>Limit the ability to transfer items between libraries based on the library sending, the library receiving, and the item type involved. These rules only go into effect if the preference UseBranchTransferLimits is set to ON.</dd>
53
    <dt><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport cost matrix</a></dt>
54
    <dd>Define transport costs between branches</dd>
55
    <dt><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></dt>
56
	<dd>Define rules for check-in and checkout notifications for combinations of libraries, patron categories, and item types</dd>
57
    <dt><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></dt>
58
    <dd>Define cities and towns that your patrons live in.</dd>
59
</dl>
60
[% IF CAN_user_plugins %]
61
    <h3>Plugins</h3>
62
    <dl>
63
        <dt><a href="/cgi-bin/koha/plugins/plugins-home.pl">Manage plugins</a></dt>
64
        <dd>View, manage, configure and run plugins.</dd>
65
    </dl>
66
[% END %]
67
</div>
68
<div class="yui-u">
69
<h3>Catalog</h3>
70
<dl>
71
    <dt><a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC bibliographic framework</a></dt>
72
	<dd>Create and manage Bibliographic frameworks that define the characteristics of your MARC Records (field and subfield definitions) as well as templates for the MARC editor.</dd>
73
	<dt><a href="/cgi-bin/koha/admin/koha2marclinks.pl">Koha to MARC mapping</a></dt>
74
	<dd>Define the mapping between the Koha transactional database (SQL) and the MARC Bibliographic records. Note that the mapping can be defined through MARC Bibliographic Framework. This tool is just a shortcut to speed up linkage.</dd>
75
        <dt><a href="/cgi-bin/koha/admin/fieldmapping.pl">Keywords to MARC mapping</a></dt>
76
        <dd>Define the mapping between keywords and MARC fields, those keywords are used to find some datas independently of the framework.</dd>
77
	<dt><a href="/cgi-bin/koha/admin/checkmarc.pl">MARC Bibliographic framework test</a></dt>
78
	<dd>Checks the MARC structure. If you change your MARC Bibliographic framework it's recommended that you run this tool to test for errors in your definition.</dd>
79
    <dt><a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a></dt>
80
    <dd>Create and manage Authorities frameworks that define the characteristics of your MARC Records (field and subfield definitions).</dd>
81
    <dt><a href="/cgi-bin/koha/admin/classsources.pl">Classification sources</a></dt>
82
    <dd>Define classification sources (i.e., call number schemes) used by your collection.  Also define filing rules used for sorting call numbers.</dd>
83
    <dt><a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a></dt>
84
    <dd>Manage rules for automatically matching MARC records during record imports.</dd>
85
    <dt><a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a></dt>
86
    <dd>Manage OAI Sets</dd>
87
    <dt><a href="/cgi-bin/koha/admin/items_search_fields.pl">Items search fields</a></dt>
88
    <dd>Manage custom fields for items search</dd>
89
</dl>
90
91
<h3>Acquisition parameters</h3>
92
<dl>
93
        <dt><a href="/cgi-bin/koha/admin/currency.pl">Currencies and exchange rates</a></dt>
94
        <dd>Define currencies and exchange rates used for acquisitions.</dd>
95
96
        <dt><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a></dt>
97
        <dd>Define your budgets</dd>
98
        
99
        <dt><a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a></dt>
100
        <dd>Define funds within your budgets</dd>
101
93
102
</dl>
94
                        <dt><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a></dt>
95
                        <dd>Define your budgets</dd>
103
96
104
<h3>Additional parameters</h3>
97
                        <dt><a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a></dt>
105
<dl>
98
                        <dd>Define funds within your budgets</dd>
106
	<!-- <dt><a href="/cgi-bin/koha/admin/printers.pl">Network Printers</a></dt>
99
                </dl>
107
	<dd>Printers (UNIX paths).</dd> -->
108
    <dt><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50/SRU servers</a></dt>
109
    <dd>Define which external servers to query for MARC data.</dd>
110
    <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
111
    <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
112
    <dt><a href="/cgi-bin/koha/admin/columns_settings.pl">Configure columns</a></dt>
113
    <dd>Hide or show columns for tables.</dd>
114
    <dt><a href="/cgi-bin/koha/admin/audio_alerts.pl">Audio alerts</a></dt>
115
    <dd>Define which events trigger which sounds</dd>
116
</dl>
117
</div>
118
100
119
</div>
101
                <h3>Additional parameters</h3>
120
</div>
102
                <dl>
103
                    <!-- <dt><a href="/cgi-bin/koha/admin/printers.pl">Network Printers</a></dt>
104
                    <dd>Printers (UNIX paths).</dd> -->
105
                    <dt><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50/SRU servers</a></dt>
106
                    <dd>Define which external servers to query for MARC data.</dd>
107
                    <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
108
                    <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
109
                    <dt><a href="/cgi-bin/koha/admin/columns_settings.pl">Configure columns</a></dt>
110
                    <dd>Hide or show columns for tables.</dd>
111
                    <dt><a href="/cgi-bin/koha/admin/audio_alerts.pl">Audio alerts</a></dt>
112
                    <dd>Define which events trigger which sounds</dd>
113
                </dl>
114
            </div>
115
        </div>
116
    </div>
121
</div>
117
</div>
122
[% INCLUDE 'intranet-bottom.inc' %]
118
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (-76 / +83 lines)
Lines 13-96 Link Here
13
//<![CDATA[
13
//<![CDATA[
14
    $(document).ready(function() {
14
    $(document).ready(function() {
15
        $("#table_categorie").dataTable($.extend(true, {}, dataTablesDefaults, {
15
        $("#table_categorie").dataTable($.extend(true, {}, dataTablesDefaults, {
16
            "aoColumnDefs": [
16
            "aoColumnDefs": [{
17
                { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
17
                "aTargets": [-1, -2],
18
                { "aTargets": [ 3,4,5 ], "sType": "natural" },
18
                "bSortable": false,
19
                "bSearchable": false
20
            }, {
21
                "aTargets": [3, 4, 5],
22
                "sType": "natural"
23
            }, ],
24
            "aaSorting": [
25
                [1, "asc"]
19
            ],
26
            ],
20
            "aaSorting": [[ 1, "asc" ]],
21
            "sPaginationType": "four_button"
27
            "sPaginationType": "four_button"
22
        }));
28
        }));
23
29
24
    $( "#enrolmentperioddate" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
30
        $("#enrolmentperioddate").datepicker({
31
            minDate: 1
32
        }); // Require that "until date" be in the future
25
33
26
    if ( $("#branches option:selected").length < 1 ) {
34
        if ($("#branches option:selected").length < 1) {
27
        $("#branches option:first").attr("selected", "selected");
35
            $("#branches option:first").attr("selected", "selected");
36
        }
37
    });
38
39
    function isNotNull(f, noalert) {
40
        if (f.value.length == 0) {
41
            return false;
42
        }
43
        return true;
44
    }
45
46
    function isNum(v, maybenull) {
47
        var n = new Number(v.value);
48
        if (isNaN(n)) {
49
            return false;
50
        }
51
        if (maybenull == 0 && v.value == '') {
52
            return false;
53
        }
54
        return true;
55
    }
56
57
    // to check if the data are correctly entered.
58
    function Check(ff) {
59
        var ok = 0;
60
        var _alertString = _("Form not submitted because of the following problem(s)");
61
        _alertString += "\n-------------------------------------------------------------------\n\n";
62
        ff.categorycode.value = $.trim(ff.categorycode.value);
63
        if (ff.categorycode.value.length == 0) {
64
            ok = 1;
65
            _alertString += _("- categorycode missing") + "\n";
66
        } else {
67
            var patt = /^[a-zA-Z0-9\-_]+$/g;
68
            if (!patt.test(ff.categorycode.value)) {
69
                ok = 1;
70
                _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n";
71
            }
72
        }
73
        if (!(ff.category_type.value)) {
74
            ok = 1;
75
            _alertString += _("- category type missing") + "\n";
76
        }
77
        if (!(isNotNull(ff.description, 1))) {
78
            ok = 1;
79
            _alertString += _("- description missing") + "\n";
80
        }
81
        if (!isNum(ff.upperagelimit, 0) && ff.category_type.value == 'C') {
82
            ok = 1;
83
            _alertString += _("- upperagelimit is not a number") + "\n";
84
85
        }
86
        if (!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) {
87
            ok = 1;
88
            _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
89
        }
90
        if (ff.enrolmentperioddate.value && ff.enrolmentperiod.value) {
91
            document.getElementById('enrolmentmessage').className = "error";
92
            return false;
93
        }
94
95
        if (ok) { // if there is a problem
96
            alert(_alertString);
97
            return false;
98
        }
99
        // if all is good
100
        ff.submit();
28
    }
101
    }
29
});
102
//]]>
30
	function isNotNull(f,noalert) {
31
		if (f.value.length ==0) {
32
   return false;
33
		}
34
		return true;
35
	}
36
	//
37
	function isNum(v,maybenull) {
38
	var n = new Number(v.value);
39
	if (isNaN(n)) {
40
		return false;
41
		}
42
	if (maybenull==0 && v.value=='') {
43
		return false;
44
	}
45
	return true;
46
	}
47
	// to check if the data are correctly entered.
48
	function Check(ff) {
49
	    var ok=0;
50
		var _alertString=_("Form not submitted because of the following problem(s)");
51
		_alertString +="\n-------------------------------------------------------------------\n\n";
52
                ff.categorycode.value = $.trim(ff.categorycode.value);
53
                if (ff.categorycode.value.length==0) {
54
                   ok=1;
55
                   _alertString += _("- categorycode missing") + "\n";
56
                }
57
                else{
58
                   var patt=/^[a-zA-Z0-9\-_]+$/g;
59
                   if ( !patt.test(ff.categorycode.value) ) {
60
                      ok=1;
61
                      _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n";
62
                   }
63
                }
64
		if (!(ff.category_type.value)){
65
		    ok=1;
66
		    _alertString += _("- category type missing") + "\n";
67
		}
68
		if (!(isNotNull(ff.description,1))) {
69
		    ok=1;
70
			_alertString += _("- description missing") + "\n";
71
		}
72
		if (!isNum(ff.upperagelimit,0) && ff.category_type.value=='C') {
73
		    ok=1;
74
			_alertString += _("- upperagelimit is not a number") + "\n";
75
				
76
		}
77
                if(!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) {
78
                    ok=1;
79
                    _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
80
                }
81
		if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){
82
			document.getElementById('enrolmentmessage').className = "error";
83
			return false;
84
		}
85
		
86
		if (ok) { // if there is a problem
87
		    alert(_alertString);
88
                    return false;
89
                }
90
                // if all is good
91
		ff.submit();
92
	}
93
	//]]>
94
</script>
103
</script>
95
<style type="text/css">#enrolmentmessage.hint { display : none; }</style>
104
<style type="text/css">#enrolmentmessage.hint { display : none; }</style>
96
</head>
105
</head>
Lines 104-113 Link Here
104
[% IF op == 'list' %]Patron categories[% END %]</div>
113
[% IF op == 'list' %]Patron categories[% END %]</div>
105
114
106
<div id="doc3" class="yui-t2">
115
<div id="doc3" class="yui-t2">
107
   
108
   <div id="bd">
116
   <div id="bd">
109
	<div id="yui-main">
117
    <div id="yui-main">
110
	<div class="yui-b">
118
    <div class="yui-b">
111
119
112
[% FOR m IN messages %]
120
[% FOR m IN messages %]
113
    <div class="dialog [% m.type %]">
121
    <div class="dialog [% m.type %]">
114
- 

Return to bug 15099