Lines 3-23
Link Here
|
3 |
[% SET footerjs = 1 %] |
3 |
[% SET footerjs = 1 %] |
4 |
[% INCLUDE 'doc-head-open.inc' %] |
4 |
[% INCLUDE 'doc-head-open.inc' %] |
5 |
<title>Koha › Administration › Classification sources |
5 |
<title>Koha › Administration › Classification sources |
6 |
[% IF ( class_source_form ) %] |
6 |
[% IF op == 'add_source' %] |
7 |
› |
|
|
8 |
[% IF ( edit_class_source ) %]Modify classification source[% ELSE %]Add classification source[% END %] |
9 |
[% END %] |
10 |
[% IF ( sort_rule_form ) %] |
11 |
› |
7 |
› |
12 |
[% IF ( edit_sort_rule ) %]Modify filing rule[% ELSE %]Add filing rule[% END %] |
8 |
[% IF class_source %]Modify classification source[% ELSE %]Add classification source[% END %] |
13 |
[% END %] |
9 |
[% ELSIF op == 'add_sort_rule' %] |
14 |
[% IF ( delete_class_source_form ) %] |
10 |
› |
15 |
› Confirm deletion of classification source [% class_source | html %] |
11 |
[% IF sort_rule %]Modify filing rule[% ELSE %]Add filing rule[% END %] |
16 |
[% ELSIF ( delete_sort_rule_form ) %] |
12 |
[% ELSIF op == 'add_split_rule' %] |
17 |
› Confirm deletion of filing rule [% sort_rule | html %] |
13 |
› |
18 |
[% ELSIF ( delete_sort_rule_impossible ) %] |
14 |
[% IF split_rule %]Modify splitting rule[% ELSE %]Add splitting rule[% END %] |
19 |
› Cannot delete filing rule [% sort_rule | html %] |
|
|
20 |
[% END %] |
15 |
[% END %] |
|
|
16 |
|
21 |
</title> |
17 |
</title> |
22 |
[% INCLUDE 'doc-head-close.inc' %] |
18 |
[% INCLUDE 'doc-head-close.inc' %] |
23 |
</head> |
19 |
</head> |
Lines 30-47
Link Here
|
30 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> |
26 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> |
31 |
› <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> |
27 |
› <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> |
32 |
› <a href="/cgi-bin/koha/admin/classsources.pl">Classification sources</a> |
28 |
› <a href="/cgi-bin/koha/admin/classsources.pl">Classification sources</a> |
33 |
[% IF ( class_source_form ) %] |
29 |
[% IF op == 'add_source' %] |
34 |
› [% IF ( edit_class_source ) %]Modify classification source[% ELSE %]Add classification source[% END %] |
30 |
› [% IF class_source %]Modify classification source[% ELSE %]Add classification source[% END %] |
35 |
[% END %] |
31 |
[% ELSIF op == 'add_sort_rule' %] |
36 |
[% IF ( sort_rule_form ) %] |
32 |
› [% IF sort_rule %]Modify filing rule[% ELSE %]Add filing rule[% END %] |
37 |
› [% IF ( edit_sort_rule ) %]Modify filing rule[% ELSE %]Add filing rule[% END %] |
33 |
[% ELSIF op == 'add_split_rule' %] |
38 |
[% END %] |
34 |
› [% IF split_rule %]Modify splitting rule[% ELSE %]Add splitting rule[% END %] |
39 |
[% IF ( delete_class_source_form ) %] |
|
|
40 |
› Confirm deletion of classification source <span class="ex">'[% class_source | html %]'</span> |
41 |
[% ELSIF ( delete_sort_rule_form ) %] |
42 |
› Confirm deletion of filing rule <span class="ex">'[% sort_rule | html %]'</span> |
43 |
[% ELSIF ( delete_sort_rule_impossible ) %] |
44 |
› Cannot delete filing rule <span class="ex">'[% sort_rule | html %]'</span> |
45 |
[% END %] |
35 |
[% END %] |
46 |
</div> |
36 |
</div> |
47 |
|
37 |
|
Lines 50-96
Link Here
|
50 |
<div class="col-sm-10 col-sm-push-2"> |
40 |
<div class="col-sm-10 col-sm-push-2"> |
51 |
<main> |
41 |
<main> |
52 |
|
42 |
|
53 |
[% IF ( class_source_form ) %] |
43 |
[% FOR m IN messages %] |
54 |
[% IF ( edit_class_source ) %] |
44 |
<div class="dialog [% m.type %]"> |
|
|
45 |
[% SWITCH m.code %] |
46 |
[% CASE 'error_on_update_source' %] |
47 |
An error occurred when updating this classification source. |
48 |
[% CASE 'success_on_update_source' %] |
49 |
Classification source updated successfully. |
50 |
[% CASE 'error_on_insert_source' %] |
51 |
An error occurred when adding this classification source. Perhaps the code already exists? |
52 |
[% CASE 'success_on_insert_source' %] |
53 |
Classification source added successfully. |
54 |
[% CASE 'error_on_delete_source' %] |
55 |
An error occurred when deleting this classification source. |
56 |
[% CASE 'success_on_delete_source' %] |
57 |
Classification source deleted successfully. |
58 |
[% CASE 'error_on_update_sort_rule' %] |
59 |
An error occurred when adding this filing rule. Perhaps the code already exists? |
60 |
[% CASE 'success_on_update_sort_rule' %] |
61 |
Filing rule updated successfully. |
62 |
[% CASE 'error_on_insert_sort_rule' %] |
63 |
An error occurred when adding this filing rule. Perhaps the code already exists? |
64 |
[% CASE 'success_on_insert_sort_rule' %] |
65 |
Filing rule added successfully. |
66 |
[% CASE 'error_on_delete_sort_rule' %] |
67 |
An error occurred when deleting this filing rule. Perhaps it is used by at least one classification source? |
68 |
[% CASE 'success_on_delete_sort_rule' %] |
69 |
Filing rule deleted successfully. |
70 |
[% CASE 'error_on_update_split_rule' %] |
71 |
An error occurred when adding this splitting rule. Perhaps the code already exists? |
72 |
[% CASE 'success_on_update_split_rule' %] |
73 |
Splitting rule updated successfully. |
74 |
[% CASE 'error_on_insert_split_rule' %] |
75 |
An error occurred when adding this splitting rule. Perhaps the code already exists? |
76 |
[% CASE 'success_on_insert_split_rule' %] |
77 |
Splitting rule added successfully. |
78 |
[% CASE 'error_on_delete_split_rule' %] |
79 |
An error occurred when deleting this splitting rule. Perhaps it is used by at least one classification source? |
80 |
[% CASE 'success_on_delete_split_rule' %] |
81 |
Splitting rule deleted successfully. |
82 |
[% CASE %] |
83 |
[% m.code %] |
84 |
[% END %] |
85 |
</div> |
86 |
[% END %] |
87 |
|
88 |
|
89 |
[% IF op == 'add_source' %] |
90 |
[% IF class_source %] |
55 |
<h2>Modify classification source</h2> |
91 |
<h2>Modify classification source</h2> |
56 |
[% ELSE %] |
92 |
[% ELSE %] |
57 |
<h2>Add classification source</h2> |
93 |
<h2>Add classification source</h2> |
58 |
[% END %] |
94 |
[% END %] |
59 |
<form action="[% script_name | html %]" name="Aform" class="validated" method="post"> |
95 |
<form action="[% script_name | html %]" name="Aform" class="validated" method="post"> |
60 |
<input type="hidden" name="op" value="[% confirm_op | html %]" /> |
96 |
<input type="hidden" name="op" value="add_source_validate" /> |
61 |
<fieldset class="rows"> |
97 |
<fieldset class="rows"> |
62 |
<ol> |
98 |
<ol> |
63 |
<li> |
99 |
<li> |
64 |
[% IF ( edit_class_source ) %] |
100 |
[% IF class_source %] |
65 |
<span class="label">Classification source code: </span> |
101 |
<span class="label">Classification source code: </span> |
66 |
<input type="hidden" name="class_source" value="[% class_source | html %]" /> |
102 |
<input type="hidden" name="cn_source" value="[% class_source.cn_source | html %]" /> |
67 |
[% class_source | html %] |
103 |
[% class_source.cn_source | html %] |
68 |
[% ELSE %] |
104 |
[% ELSE %] |
69 |
<label class="required" for="class_source">Classification source code: </label> |
105 |
<label class="required" for="class_source">Classification source code: </label> |
70 |
<input class="required" required="required" type="text" id="class_source" name="class_source" size="10" maxlength="10" /> |
106 |
<input class="required" required="required" type="text" id="class_source" name="cn_source" size="10" maxlength="10" /> |
71 |
<span class="required">Required</span> |
107 |
<span class="required">Required</span> |
72 |
[% END %] |
108 |
[% END %] |
73 |
</li> |
109 |
</li> |
74 |
<li><label class="required" for="description">Description: </label> |
110 |
<li><label class="required" for="description">Description: </label> |
75 |
<input class="required" required="required" type="text" id="description" name="description" size="50" maxlength="250" value="[% description | html %]" /> |
111 |
<input class="required" required="required" type="text" id="description" name="description" size="50" maxlength="250" value="[% class_source.description | html %]" /> |
76 |
<span class="required">Required</span> |
112 |
<span class="required">Required</span> |
77 |
</li> |
113 |
</li> |
78 |
<li><label for="used">Source in use?</label> |
114 |
<li><label for="used">Source in use?</label> |
79 |
[% IF ( used ) %]<input type="checkbox" id="used" name="used" value="used" checked="checked" />[% ELSE %] |
115 |
[% IF ( class_source.used ) %]<input type="checkbox" id="used" name="used" value="used" checked="checked" />[% ELSE %] |
80 |
<input type="checkbox" id="used" name="used" value="used" />[% END %] |
116 |
<input type="checkbox" id="used" name="used" value="used" />[% END %] |
81 |
</li> |
117 |
</li> |
82 |
<li><label class="required" for="sort_rule">Filing rule: </label> |
118 |
<li> |
83 |
<select class="required" required="required" id="sort_rule" name="sort_rule"> |
119 |
<label class="required" for="class_sort_rule">Filing rule: </label> |
84 |
[% FOREACH rules_dropdow IN rules_dropdown %] |
120 |
<select class="required" required="required" id="class_sort_rule" name="class_sort_rule"> |
85 |
[% IF ( rules_dropdow.selected ) %] |
121 |
[% FOREACH r IN sort_rules %] |
86 |
<option value="[% rules_dropdow.rule | html %]" selected="selected">[% rules_dropdow.description | html %] ([% rules_dropdow.rule | html %])</option> |
122 |
[% IF class_source.class_sort_rule == r.class_sort_rule %] |
87 |
[% ELSE %] |
123 |
<option value="[% r.class_sort_rule | html %]" selected="selected">[% r.description | html %] ([% r.class_sort_rule | html %])</option> |
88 |
<option value="[% rules_dropdow.rule | html %]">[% rules_dropdow.description | html %] ([% rules_dropdow.rule | html %])</option> |
124 |
[% ELSE %] |
89 |
[% END %] |
125 |
<option value="[% r.class_sort_rule | html %]">[% r.description | html %] ([% r.class_sort_rule | html %])</option> |
90 |
[% END %] |
126 |
[% END %] |
91 |
</select> |
127 |
[% END %] |
92 |
<span class="required">Required</span> |
128 |
</select> |
93 |
</li> |
129 |
<span class="required">Required</span> |
|
|
130 |
</li> |
131 |
<li> |
132 |
<label class="required" for="class_split_rule">Splitting rule: </label> |
133 |
<select class="required" required="required" id="split_rule" name="class_split_rule"> |
134 |
[% FOREACH r IN split_rules %] |
135 |
[% IF class_source.class_split_rule == r.class_split_rule %] |
136 |
<option value="[% r.class_split_rule | html %]" selected="selected">[% r.description | html %] ([% r.class_split_rule | html %])</option> |
137 |
[% ELSE %] |
138 |
<option value="[% r.class_split_rule | html %]">[% r.description | html %] ([% r.class_split_rule | html %])</option> |
139 |
[% END %] |
140 |
[% END %] |
141 |
</select> |
142 |
<span class="required">Required</span> |
143 |
</li> |
94 |
</ol> |
144 |
</ol> |
95 |
</fieldset> |
145 |
</fieldset> |
96 |
<fieldset class="action"> |
146 |
<fieldset class="action"> |
Lines 100-137
Link Here
|
100 |
</form> |
150 |
</form> |
101 |
[% END %] |
151 |
[% END %] |
102 |
|
152 |
|
103 |
[% IF ( sort_rule_form ) %] |
153 |
[% IF op == 'add_sort_rule' %] |
104 |
[% IF ( edit_sort_rule ) %] |
154 |
[% IF sort_rule %] |
105 |
<h2>Modify filing rule</h2> |
155 |
<h2>Modify filing rule</h2> |
106 |
[% ELSE %] |
156 |
[% ELSE %] |
107 |
<h2>Add filing rule</h2> |
157 |
<h2>Add filing rule</h2> |
108 |
[% END %] |
158 |
[% END %] |
109 |
<form action="[% script_name | html %]" name="Aform" class="validated" method="post"> |
159 |
<form action="[% script_name | html %]" name="Aform" class="validated" method="post"> |
110 |
<input type="hidden" name="op" value="[% confirm_op | html %]" /> |
160 |
<input type="hidden" name="op" value="add_sort_rule_validate" /> |
111 |
<fieldset class="rows"> |
161 |
<fieldset class="rows"> |
112 |
<ol> |
162 |
<ol> |
113 |
<li> |
163 |
<li> |
114 |
[% IF ( edit_sort_rule ) %] |
164 |
[% IF sort_rule %] |
115 |
<span class="label">Filing rule code: </span> |
165 |
<span class="label">Filing rule code: </span> |
116 |
<input type="hidden" name="sort_rule" value="[% sort_rule | html %]" /> |
166 |
<input type="hidden" name="class_sort_rule" value="[% sort_rule.class_sort_rule | html %]" /> |
117 |
[% sort_rule | html %] |
167 |
[% sort_rule.class_sort_rule | html %] |
118 |
[% ELSE %] |
168 |
[% ELSE %] |
119 |
<label for="sort_rule" class="required">Filing rule code: </label> |
169 |
<label for="class_sort_rule" class="required">Filing rule code: </label> |
120 |
<input class="required" required="required" type="text" id="sort_rule" name="sort_rule" size="10" maxlength="10" /> |
170 |
<input class="required" required="required" type="text" id="class_sort_rule" name="class_sort_rule" size="10" maxlength="10" /> |
121 |
<span class="required">Required</span> |
171 |
<span class="required">Required</span> |
122 |
[% END %] |
172 |
[% END %] |
123 |
</li> |
173 |
</li> |
124 |
<li><label for="description" class="required">Description: </label> |
174 |
<li><label for="description" class="required">Description: </label> |
125 |
<input class="required" required="required" type="text" id="description" name="description" size="50" maxlength="250" value="[% description | html %]" /> |
175 |
<input class="required" required="required" type="text" id="description" name="description" size="50" maxlength="250" value="[% sort_rule.description | html %]" /> |
126 |
<span class="required">Required</span> |
176 |
<span class="required">Required</span> |
127 |
</li> |
177 |
</li> |
128 |
<li><label for="sort_routine" class="required">Filing routine: </label> |
178 |
<li><label for="sort_routine" class="required">Filing routine: </label> |
129 |
<select class="required" required="required" id="sort_routine" name="sort_routine"> |
179 |
<select class="required" required="required" id="sort_routine" name="sort_routine"> |
130 |
[% FOREACH routines_dropdow IN routines_dropdown %] |
180 |
[% FOREACH routine_name IN sort_routines %] |
131 |
[% IF ( routines_dropdow.selected ) %] |
181 |
[% IF routine_name == sort_rule.sort_routine %] |
132 |
<option value="[% routines_dropdow.routine | html %]" selected="selected">[% routines_dropdow.routine | html %]</option> |
182 |
<option value="[% routine_name | html %]" selected="selected">[% routine_name | html %]</option> |
133 |
[% ELSE %] |
183 |
[% ELSE %] |
134 |
<option value="[% routines_dropdow.routine | html %]">[% routines_dropdow.routine | html %]</option> |
184 |
<option value="[% routine_name | html %]">[% routine_name %]</option> |
135 |
[% END %] |
185 |
[% END %] |
136 |
[% END %] |
186 |
[% END %] |
137 |
</select> |
187 |
</select> |
Lines 146-245
Link Here
|
146 |
</form> |
196 |
</form> |
147 |
[% END %] |
197 |
[% END %] |
148 |
|
198 |
|
149 |
[% IF ( delete_class_source_form ) %] |
199 |
[% IF op == 'add_split_rule' %] |
150 |
<div class="dialog alert"> |
200 |
[% IF split_rule %] |
151 |
<h3>Confirm deletion of classification source <span class="ex">'[% class_source | html %]'</span>?</h3> |
201 |
<h2>Modify splitting rule</h2> |
152 |
<form action="[% script_name | html %]" name="Aform" method="post"> |
202 |
[% ELSE %] |
153 |
<input type="hidden" name="op" value="[% confirm_op | html %]" /> |
203 |
<h2>Add splitting rule</h2> |
154 |
<input type="hidden" name="class_source" value="[% class_source | html %]" /> |
204 |
[% END %] |
155 |
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete classification source</button> |
205 |
<form action="[% script_name | html %]" name="Aform" class="validated" method="post"> |
156 |
</form> |
206 |
<input type="hidden" name="op" value="add_split_rule_validate" /> |
157 |
<form action="[% script_name | html %]" method="get"> |
207 |
<fieldset class="rows"> |
158 |
<button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button> |
208 |
<ol> |
159 |
</form> |
209 |
<li> |
160 |
</div> |
210 |
[% IF split_rule %] |
161 |
[% END %] |
211 |
<span class="label">Splitting rule code: </span> |
162 |
|
212 |
<input type="hidden" name="class_split_rule" value="[% split_rule.class_split_rule | html %]" /> |
163 |
[% IF ( delete_sort_rule_form ) %] |
213 |
[% split_rule.class_split_rule | html %] |
164 |
<div class="dialog alert"> |
214 |
[% ELSE %] |
165 |
<h3>Confirm deletion of filing rule <span class="ex">'[% sort_rule | html %]'</span>?</h3> |
215 |
<label for="class_split_rule" class="required">Splitting rule code: </label> |
166 |
<form action="[% script_name | html %]" name="Aform" method="post"> |
216 |
<input class="required" required="required" type="text" id="class_split_rule" name="class_split_rule" size="10" maxlength="10" /> |
167 |
<input type="hidden" name="op" value="[% confirm_op | html %]" /> |
217 |
<span class="required">Required</span> |
168 |
<input type="hidden" name="sort_rule" value="[% sort_rule | html %]" /> |
218 |
[% END %] |
169 |
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete filing rule</button> |
219 |
</li> |
170 |
</form> |
220 |
<li><label for="description" class="required">Description: </label> |
171 |
<form action="[% script_name | html %]" method="get"> |
221 |
<input class="required" required="required" type="text" id="description" name="description" size="50" maxlength="250" value="[% split_rule.description | html %]" /> |
172 |
<button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button> |
222 |
<span class="required">Required</span> |
173 |
</form> |
223 |
</li> |
174 |
</div> |
224 |
<li><label for="split_routine" class="required">Splitting routine: </label> |
175 |
[% END %] |
225 |
<select class="required" required="required" id="split_routine" name="split_routine"> |
|
|
226 |
[% FOREACH routine_name IN split_routines %] |
227 |
[% IF routine_name == split_rule.split_routine %] |
228 |
<option value="[% routine_name | html %]" selected="selected">[% routine_name | html %]</option> |
229 |
[% ELSE %] |
230 |
<option value="[% routine_name | html %]">[% routine_name | html %]</option> |
231 |
[% END %] |
232 |
[% END %] |
233 |
</select> |
234 |
<span class="required">Required</span> |
235 |
</li> |
236 |
<li id="regex_block"> |
237 |
<label for="split_regex" class="required">Regular expression: </label> |
238 |
<input type="text" name="split_regex" id="split_regex" value="[% split_rule.split_regex | html %]" /> |
239 |
<span class="required">Required</span> |
240 |
</li> |
176 |
|
241 |
|
177 |
[% IF ( delete_sort_rule_impossible ) %] |
242 |
</ol> |
178 |
<div class="dialog alert"><h3>Cannot delete filing rule <span class="ex">'[% sort_rule | html %]'</span></h3> |
243 |
</fieldset> |
179 |
<p>The filing rule [% sort_rule | html %] is used by at least one classification source. Please |
244 |
<fieldset class="action"> |
180 |
remove it from all classification source definitions before trying again. |
245 |
<input type="submit" value="Save" /> |
181 |
</p> |
246 |
<a class="cancel" href="/cgi-bin/koha/admin/classsources.pl">Cancel</a> |
182 |
<form action="[% script_name | html %]" method="get"> |
247 |
</fieldset> |
183 |
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button> |
248 |
</form> |
184 |
</form> |
|
|
185 |
</div> |
186 |
[% END %] |
249 |
[% END %] |
187 |
|
250 |
|
188 |
[% IF ( display_lists ) %] |
251 |
[% IF op == 'list' %] |
189 |
|
252 |
|
190 |
<div id="toolbar" class="btn-toolbar"> |
253 |
<div id="toolbar" class="btn-toolbar"> |
191 |
<a class="btn btn-default btn-sm" id="newsource" href="[% script_name | url %]?op=add_source"><i class="fa fa-plus"></i> New classification source</a> |
254 |
<a class="btn btn-default btn-sm" id="newsource" href="[% script_name | url %]?op=add_source"><i class="fa fa-plus"></i> New classification source</a> |
192 |
<a class="btn btn-default btn-sm" id="newrule" href="[% script_name | url %]?op=add_sort_rule"><i class="fa fa-plus"></i> New filing rule</a> |
255 |
<a class="btn btn-default btn-sm" id="newrule" href="[% script_name | url %]?op=add_sort_rule"><i class="fa fa-plus"></i> New filing rule</a> |
|
|
256 |
<a class="btn btn-default btn-sm" id="newrule" href="[% script_name | url %]?op=add_split_rule"><i class="fa fa-plus"></i> New splitting rule</a> |
193 |
</div> |
257 |
</div> |
194 |
|
258 |
|
195 |
<h2>Classification sources</h2> |
259 |
<h2>Classification sources</h2> |
196 |
[% IF ( added_source ) %] |
|
|
197 |
<div class="dialog message">Added classification source [% added_source | html %]</div> |
198 |
[% END %] |
199 |
[% IF ( edited_source ) %] |
200 |
<div class="dialog message">Modified classification source [% edited_source | html %]</div> |
201 |
[% END %] |
202 |
[% IF ( deleted_source ) %] |
203 |
<div class="dialog message">Deleted classification source [% deleted_source | html %]</div> |
204 |
[% END %] |
205 |
[% IF ( failed_add_source ) %] |
206 |
<div class="dialog message">Failed to add classification source [% failed_add_source | html %]. Perhaps the code already exists?</div> |
207 |
[% END %] |
208 |
<table> |
260 |
<table> |
209 |
<tr> |
261 |
<tr> |
210 |
<th>Code</th> |
262 |
<th>Code</th> |
211 |
<th>Description</th> |
263 |
<th>Description</th> |
212 |
<th>In use</th> |
264 |
<th>In use</th> |
213 |
<th>Filing rule</th> |
265 |
<th>Filing rule</th> |
|
|
266 |
<th>Splitting rule</th> |
214 |
<th>Actions</th> |
267 |
<th>Actions</th> |
215 |
</tr> |
268 |
</tr> |
216 |
[% FOREACH class_source IN class_sources %] |
269 |
[% FOREACH class_source IN class_sources %] |
217 |
<tr> |
270 |
<tr> |
218 |
<td>[% class_source.code | html %]</td> |
271 |
<td>[% class_source.cn_source | html %]</td> |
219 |
<td>[% class_source.description | html %]</td> |
272 |
<td>[% class_source.description |html | html %]</td> |
220 |
<td>[% IF ( class_source.used ) %]Yes[% ELSE %]No[% END %]</td> |
273 |
<td>[% IF ( class_source.used ) %]Yes[% ELSE %]No[% END %]</td> |
221 |
<td>[% class_source.sortrule | html %]</td> |
274 |
<td>[% class_source.class_sort_rule | html %]</td> |
|
|
275 |
<td>[% class_source.class_split_rule | html %]</td> |
222 |
<td class="actions"> |
276 |
<td class="actions"> |
223 |
<a class="btn btn-default btn-xs" href="[% class_source.script_name | url %]?op=edit_source&class_source=[% class_source.code | uri %]"><i class="fa fa-pencil"></i> Edit</a> |
277 |
<a class="btn btn-default btn-xs" href="[% script_name | url %]?op=add_source&cn_source=[% class_source.cn_source | uri %]"><i class="fa fa-pencil"></i> Edit</a> |
224 |
<a class="btn btn-default btn-xs" href="[% class_source.script_name | url %]?op=delete_source&class_source=[% class_source.code | uri %]"><i class="fa fa-trash"></i> Delete</a> |
278 |
<a class="btn btn-default btn-xs delete_class_source" href="[% script_name | url %]?op=delete_source&cn_source=[% class_source.cn_source | uri%]"><i class="fa fa-trash"></i> Delete</a> |
225 |
</td> |
279 |
</td> |
226 |
</tr> |
280 |
</tr> |
227 |
[% END %] |
281 |
[% END %] |
228 |
</table> |
282 |
</table> |
229 |
|
283 |
|
230 |
<h2>Classification filing rules</h2> |
284 |
<h2>Classification filing rules</h2> |
231 |
[% IF ( added_rule ) %] |
|
|
232 |
<div class="dialog message">Added filing rule [% added_rule | html %]</div> |
233 |
[% END %] |
234 |
[% IF ( edited_rule ) %] |
235 |
<div class="dialog message">Modified filing rule [% edited_rule | html %]</div> |
236 |
[% END %] |
237 |
[% IF ( deleted_rule ) %] |
238 |
<div class="dialog message">Deleted filing rule [% deleted_rule | html %]</div> |
239 |
[% END %] |
240 |
[% IF ( failed_add_rule ) %] |
241 |
<div class="dialog message">Failed to add filing rule [% failed_add_rule | html %]. Perhaps the code already exists?</div> |
242 |
[% END %] |
243 |
<table> |
285 |
<table> |
244 |
<tr> |
286 |
<tr> |
245 |
<th>Code</th> |
287 |
<th>Code</th> |
Lines 247-265
Link Here
|
247 |
<th>Sorting routine</th> |
289 |
<th>Sorting routine</th> |
248 |
<th>Actions</th> |
290 |
<th>Actions</th> |
249 |
</tr> |
291 |
</tr> |
250 |
[% FOREACH class_sort_rule IN class_sort_rules %] |
292 |
[% FOREACH rule IN sort_rules %] |
|
|
293 |
<tr> |
294 |
<td>[% rule.class_sort_rule | html %]</td> |
295 |
<td>[% rule.description |html | html %]</td> |
296 |
<td>[% rule.sort_routine | html %]</td> |
297 |
<td class="actions"> |
298 |
<a class="btn btn-default btn-xs" href="[% script_name | html %]?op=add_sort_rule&class_sort_rule=[% rule.class_sort_rule |url %]"><i class="fa fa-pencil"></i> Edit</a> |
299 |
<a class="btn btn-default btn-xs delete_sort_rule" href="[% script_name | html %]?op=delete_sort_rule&class_sort_rule=[% rule.class_sort_rule |url %]"><i class="fa fa-trash"></i> Delete</a> |
300 |
</td> |
301 |
</tr> |
302 |
[% END %] |
303 |
</table> |
304 |
|
305 |
<h2>Classification splitting rules</h2> |
306 |
<table> |
307 |
<tr> |
308 |
<th>Code</th> |
309 |
<th>Description</th> |
310 |
<th>Splitting routine</th> |
311 |
<th>Actions</th> |
312 |
</tr> |
313 |
[% FOREACH rule IN split_rules %] |
251 |
<tr> |
314 |
<tr> |
252 |
<td>[% class_sort_rule.rule | html %]</td> |
315 |
<td>[% rule.class_split_rule | html %]</td> |
253 |
<td>[% class_sort_rule.description | html %]</td> |
316 |
<td>[% rule.description | html %]</td> |
254 |
<td>[% class_sort_rule.sort_routine | html %]</td> |
317 |
<td>[% rule.split_routine | html %]</td> |
255 |
<td class="actions"> |
318 |
<td class="actions"> |
256 |
<a class="btn btn-default btn-xs" href="[% class_sort_rule.script_name | url %]?op=edit_sort_rule&sort_rule=[% class_sort_rule.rule | uri %]"><i class="fa fa-pencil"></i> Edit</a> |
319 |
<a class="btn btn-default btn-xs" href="[% script_name | url %]?op=add_split_rule&class_split_rule=[% rule.class_split_rule | uri %]"><i class="fa fa-pencil"></i> Edit</a> |
257 |
<a class="btn btn-default btn-xs" href="[% class_sort_rule.script_name | url %]?op=delete_sort_rule&sort_rule=[% class_sort_rule.rule | uri %]"><i class="fa fa-trash"></i> Delete</a> |
320 |
<a class="btn btn-default btn-xs delete_split_rule" href="[% script_name | url %]?op=delete_split_rule&class_split_rule=[% rule.class_split_rule | uri %]"><i class="fa fa-trash"></i> Delete</a> |
258 |
</td> |
321 |
</td> |
259 |
</tr> |
322 |
</tr> |
260 |
[% END %] |
323 |
[% END %] |
261 |
</table> |
324 |
</table> |
262 |
|
325 |
|
|
|
326 |
|
263 |
[% END %] |
327 |
[% END %] |
264 |
|
328 |
|
265 |
</main> |
329 |
</main> |
Lines 274-278
Link Here
|
274 |
|
338 |
|
275 |
[% MACRO jsinclude BLOCK %] |
339 |
[% MACRO jsinclude BLOCK %] |
276 |
[% Asset.js("js/admin-menu.js") | $raw %] |
340 |
[% Asset.js("js/admin-menu.js") | $raw %] |
|
|
341 |
|
342 |
<script> |
343 |
function update_regex_block(){ |
344 |
if ( $("#split_routine option:selected").val() == 'RegEx' ) { |
345 |
$("#regex_block").show(); |
346 |
$("#split_regex").attr('required', 'required'); |
347 |
} else { |
348 |
$("#regex_block").hide(); |
349 |
$("#split_regex").removeAttr('required'); |
350 |
} |
351 |
}; |
352 |
$(document).ready(function(){ |
353 |
update_regex_block(); |
354 |
$("#split_routine").on("change", function(){ |
355 |
update_regex_block(); |
356 |
}); |
357 |
|
358 |
$(".delete_class_source").on("click", function(e){ |
359 |
return confirm(_("Are you sure you want to delete this class source?")); |
360 |
}); |
361 |
$(".delete_sort_rule").on("click", function(e){ |
362 |
return confirm(_("Are you sure you want to delete this filing rule?")); |
363 |
}); |
364 |
$(".delete_split_rule").on("click", function(e){ |
365 |
return confirm(_("Are you sure you want to delete this splitting rule?")); |
366 |
}); |
367 |
}); |
368 |
|
369 |
</script> |
277 |
[% END %] |
370 |
[% END %] |
278 |
[% INCLUDE 'intranet-bottom.inc' %] |
371 |
[% INCLUDE 'intranet-bottom.inc' %] |
279 |
- |
|
|