b3fc5fcb727abbf3444b5d796caade31dd1fbe7a
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / classsources.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Administration &rsaquo; Classification Sources
3 <!-- TMPL_IF name="class_source_form" -->
4   <!-- TMPL_IF name="edit_class_source" -->
5     &rsaquo; Modify classification source
6   <!-- TMPL_ELSE -->
7     &rsaquo; Add classification source
8   <!-- /TMPL_IF -->
9 <!-- /TMPL_IF -->
10 <!-- TMPL_IF name="sort_rule_form" -->
11   <!-- TMPL_IF name="edit_sort_rule" -->
12     &rsaquo; Modify filing rule
13   <!-- TMPL_ELSE -->
14     &rsaquo; Add filing rule
15   <!-- /TMPL_IF -->
16 <!-- /TMPL_IF -->
17 <!-- TMPL_IF name="delete_class_source_form" -->
18   &rsaquo; Confirm deletion of classification source <!-- TMPL_VAR name="class_source" -->
19 <!-- /TMPL_IF -->
20 <!-- TMPL_IF name="delete_sort_rule_form" -->
21   &rsaquo; Confirm deletion of filing rule <!-- TMPL_VAR name="sort_rule" -->
22 <!-- /TMPL_IF -->
23 <!-- TMPL_IF name="delete_sort_rule_impossible" -->
24   &rsaquo; Cannot delete filing rule <!-- TMPL_VAR name="sort_rule" -->
25 <!-- /TMPL_IF -->
26 </title>
27 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
28
29 <script type="text/javascript">
30 //<![CDATA[
31
32 function DoCancel(f) {
33   f.op.value='';
34   document.Aform.submit();
35 }
36
37 function CheckSourceForm(f) {
38     var ok=1;
39     var _alertString="";
40     var alertString2;
41     if (f.class_source.value.length==0) {
42         _alertString += "\n- " + _("Classification source code missing");
43     }
44     if (f.sort_rule.value.length==0) {
45         _alertString += "\n- " + _("Filing rule code missing");
46     }
47     if (f.description.value.length==0) {
48         _alertString += "\n- " + _("Description missing");
49     }
50     if (_alertString.length==0) {
51         document.Aform.submit();
52     } else {
53         alertString2  = _("Form not submitted because of the following problem(s)");
54         alertString2 += "\n------------------------------------------------------------------------------------\n";
55         alertString2 += _alertString;
56         alert(alertString2);
57     }
58 }
59
60 function CheckRuleForm(f) {
61     var ok=1;
62     var _alertString="";
63     var alertString2;
64     if (f.sort_rule.value.length==0) {
65         _alertString += "\n- " + _("Filing rule code missing");
66     }
67     if (f.description.value.length==0) {
68         _alertString += "\n- " + _("Description missing");
69     }
70     if (f.sort_routine.value.length==0) {
71         _alertString += "\n- " + _("Sort routine missing");
72     }
73     if (_alertString.length==0) {
74         document.Aform.submit();
75     } else {
76         alertString2  = _("Form not submitted because of the following problem(s)");
77         alertString2 += "\n------------------------------------------------------------------------------------\n";
78         alertString2 += _alertString;
79         alert(alertString2);
80     }
81 }
82
83 //]]>
84 </script>
85
86 <body>
87 <!-- TMPL_INCLUDE NAME="header.inc" -->
88 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
89
90 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; Classification Sources
91 <!-- TMPL_IF name="class_source_form" -->
92   <!-- TMPL_IF name="edit_class_source" -->
93     &rsaquo; Modify classification source
94   <!-- TMPL_ELSE -->
95     &rsaquo; Add classification source
96   <!-- /TMPL_IF -->
97 <!-- /TMPL_IF -->
98 <!-- TMPL_IF name="sort_rule_form" -->
99   <!-- TMPL_IF name="edit_sort_rule" -->
100     &rsaquo; Modify filing rule
101   <!-- TMPL_ELSE -->
102     &rsaquo; Add filing rule
103   <!-- /TMPL_IF -->
104 <!-- /TMPL_IF -->
105 <!-- TMPL_IF name="delete_class_source_form" -->
106   &rsaquo; Confirm deletion of classification source <!-- TMPL_VAR name="class_source" -->
107 <!-- /TMPL_IF -->
108 <!-- TMPL_IF name="delete_sort_rule_form" -->
109   &rsaquo; Confirm deletion of filing rule <!-- TMPL_VAR name="sort_rule" -->
110 <!-- /TMPL_IF -->
111 <!-- TMPL_IF name="delete_sort_rule_impossible" -->
112   &rsaquo; Cannot delete filing rule <!-- TMPL_VAR name="sort_rule" -->
113 <!-- /TMPL_IF -->
114 </div>
115
116 <div id="doc3" class="yui-t2">
117
118    <div id="bd">
119     <div id="yui-main">
120     <div class="yui-b">
121
122 <!-- TMPL_IF name="class_source_form" -->
123   <!-- TMPL_IF name="edit_class_source" -->
124 <h2>Modify classification source</h2>
125   <!-- TMPL_ELSE -->
126 <h2>Add classification source</h2>
127   <!-- /TMPL_IF -->
128 <form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
129   <input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
130   <fieldset class="rows">
131     <ol>
132       <li><span class="label">Classification source code</span>
133           <!-- TMPL_IF name="edit_class_source" -->
134             <input type="hidden" name="class_source" value="<!-- TMPL_VAR name="class_source" -->" />
135             <!-- TMPL_VAR name="class_source" -->
136           <!-- TMPL_ELSE -->
137             <input type="text" id="class_source" name="class_source"  size="10" maxlength="10" />
138           <!-- /TMPL_IF -->
139        </li>
140        <li><span class="label">Description</span>
141            <input type="text" id="description" name="description" size="50" maxlength="250" 
142                   value="<!-- TMPL_VAR name="description" escape="HTML" -->" />
143        </li>
144        <li><span class="label">Source in use?</span>
145            <input type="checkbox" id="used" name="used" value="used" 
146                   <!-- TMPL_IF name="used" -->checked="yes"<!-- /TMPL_IF--> />
147        </li>
148        <li><span class="label">Filing Rule</span>
149            <select id="sort_rule" name="sort_rule">
150            <!-- TMPL_LOOP name="rules_dropdown" -->
151              <!-- TMPL_IF name="selected" -->
152              <option value="<!-- TMPL_VAR name="rule" -->" selected="selected"><!-- TMPL_VAR name="description" --> (<!-- TMPL_VAR name="rule" -->)</option>
153              <!-- TMPL_ELSE -->
154              <option value="<!-- TMPL_VAR name="rule" -->"><!-- TMPL_VAR name="description" --> (<!-- TMPL_VAR name="rule" -->)</option>
155              <!-- /TMPL_IF -->
156            <!-- /TMPL_LOOP -->
157            </select>
158        </li>    
159     </ol>
160   </fieldset>
161   <p id="action">
162     <input type="button" value="<!-- TMPL_IF name="edit_class_source" -->Save Changes<!-- TMPL_ELSE -->Add Classification Source<!-- /TMPL_IF-->"
163            onclick="CheckSourceForm(this.form)" />
164     <input type="button" value="Cancel" onclick="DoCancel(this.form)" />
165   </p>
166 </form>
167 <!-- /TMPL_IF -->
168
169 <!-- TMPL_IF name="sort_rule_form" -->
170   <!-- TMPL_IF name="edit_sort_rule" -->
171 <h2>Modify filing rule</h2>
172   <!-- TMPL_ELSE -->
173 <h2>Add filing rule</h2>
174   <!-- /TMPL_IF -->
175 <form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
176   <input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
177   <fieldset class="rows">
178     <ol>
179       <li><span class="label">Filing rule code</span>
180           <!-- TMPL_IF name="edit_sort_rule" -->
181             <input type="hidden" name="sort_rule" value="<!-- TMPL_VAR name="sort_rule" -->" />
182             <!-- TMPL_VAR name="sort_rule" -->
183           <!-- TMPL_ELSE -->
184             <input type="text" id="sort_rule" name="sort_rule"  size="10" maxlength="10" />
185           <!-- /TMPL_IF -->
186        </li>
187        <li><span class="label">Description</span>
188            <input type="text" id="description" name="description" size="50" maxlength="250" 
189                   value="<!-- TMPL_VAR name="description" escape="HTML" -->" />
190        </li>
191        <li><span class="label">Filing Routine</span>
192            <input type="text" id="sort_routine" name="sort_routine" size="30" maxlength="30" 
193                   value="<!-- TMPL_VAR name="sort_routine" escape="HTML" -->" />
194        </li>
195     </ol>
196   </fieldset>
197   <p id="action">
198     <input type="button" value="<!-- TMPL_IF name="edit_sort_rule" -->Save Changes<!-- TMPL_ELSE -->Add Filing Rule<!-- /TMPL_IF-->"
199            onclick="CheckRuleForm(this.form)" />
200     <input type="button" value="Cancel" onclick="DoCancel(this.form)" />
201   </p>
202 </form>
203 <!-- /TMPL_IF -->
204
205 <!-- TMPL_IF name="delete_class_source_form" -->
206 <h2>Confirm deletion of classification source <!-- TMPL_VAR name="class_source" -->?</h2>
207 <form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
208   <input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
209   <input type="hidden" name="class_source" value="<!-- TMPL_VAR name="class_source" -->" />
210   <p id="action">
211     <input type="submit" value="Delete classification source" />
212     <input type="button" value="Cancel" onclick="DoCancel(this.form)" />
213   </p>
214 </form>
215 <!-- /TMPL_IF -->
216
217 <!-- TMPL_IF name="delete_sort_rule_form" -->
218 <h2>Confirm deletion of filing rule <!-- TMPL_VAR name="sort_rule" -->?</h2>
219 <form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
220   <input type="hidden" name="op" value="<!-- TMPL_VAR name="confirm_op"-->" />
221   <input type="hidden" name="sort_rule" value="<!-- TMPL_VAR name="sort_rule" -->" />
222   <p id="action">
223     <input type="submit" value="Delete filing rule" />
224     <input type="button" value="Cancel" onclick="DoCancel(this.form)" />
225   </p>
226 </form>
227 <!-- /TMPL_IF -->
228
229 <!-- TMPL_IF name="delete_sort_rule_impossible" -->
230 <h2>Cannot delete filing rule <!-- TMPL_VAR name="sort_rule" --></h2>
231 <p>The filing rule <!-- TMPL_VAR name="sort_rule" --> is used by at least one classification source.  Please
232 remove it from all classification source definitions before trying again.
233 </p>
234 <form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
235   <input type="hidden" name="op" value="<!-- TMPL_VAR name="else"-->" />
236   <input type="hidden" name="sort_rule" value="<!-- TMPL_VAR name="sort_rule" -->" />
237   <p id="action">
238     <input type="button" value="Go back" onclick="DoCancel(this.form)" />
239   </p>
240 <!-- /TMPL_IF -->
241
242 <!-- TMPL_IF name="display_lists" -->
243 <h2>Classification Sources</h2>
244 <!-- TMPL_IF name="added_source" -->
245 <span class="problem">Added classification source <!-- TMPL_VAR name="added_source" --></span>
246 <!-- /TMPL_IF -->
247 <!-- TMPL_IF name="edited_source" -->
248 <span class="problem">Modified classification source <!-- TMPL_VAR name="edited_source" --></span>
249 <!-- /TMPL_IF -->
250 <!-- TMPL_IF name="deleted_source" -->
251 <span class="problem">Deleted classification source <!-- TMPL_VAR name="deleted_source" --></span>
252 <!-- /TMPL_IF -->
253 <table>
254   <tr>
255     <th>Code</th>
256     <th>Description</th>
257     <th>In Use</th>
258     <th>Filing Rule</th>
259     <th>Actions</th>
260   </tr>
261   <!-- TMPL_LOOP name="class_sources" -->
262   <tr>
263     <td><!-- TMPL_VAR name="code" --></td>
264     <td><!-- TMPL_VAR name="description" --></td>
265     <td><!-- TMPL_IF name="used" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --></td>
266     <td><!-- TMPL_VAR name="sortrule" --></td>
267     <td>
268       <a href="<!-- TMPL_VAR name="script_name" -->?op=edit_source&amp;class_source=<!-- TMPL_VAR name="code" escape="HTML" -->">Edit</a>
269       <a href="<!-- TMPL_VAR name="script_name" -->?op=delete_source&amp;class_source=<!-- TMPL_VAR name="code" escape="HTML" -->">
270 Delete</a>
271     </td>
272   </tr>
273   <!-- /TMPL_LOOP -->
274 </table>
275
276 <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
277
278 <p><a href="<!-- TMPL_VAR name="script_name" -->?op=add_source">Add Classification Source</a></p>
279
280 <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
281 <h2>Classification Filing Rules</h2>
282 <!-- TMPL_IF name="added_rule" -->
283 <span class="problem">Added filing rule <!-- TMPL_VAR name="added_rule" --></span>
284 <!-- /TMPL_IF -->
285 <!-- TMPL_IF name="edited_rule" -->
286 <span class="problem">Modified filing rule <!-- TMPL_VAR name="edited_rule" --></span>
287 <!-- /TMPL_IF -->
288 <!-- TMPL_IF name="deleted_rule" -->
289 <span class="problem">Deleted filing rule <!-- TMPL_VAR name="deleted_rule" --></span>
290 <!-- /TMPL_IF -->
291 <table>
292   <tr>
293     <th>Code</th>
294     <th>Description</th>
295     <th>Sorting Routine</th>
296     <th>Actions</th>
297   </tr>
298   <!-- TMPL_LOOP name="class_sort_rules" -->
299   <tr>
300     <td><!-- TMPL_VAR name="rule" --></td>
301     <td><!-- TMPL_VAR name="description" --></td>
302     <td><!-- TMPL_VAR name="sort_routine" --></td>
303     <td>
304       <a href="<!-- TMPL_VAR name="script_name" -->?op=edit_sort_rule&amp;sort_rule=<!-- TMPL_VAR name="rule" escape="HTML" -->">Edit</a>
305       <a href="<!-- TMPL_VAR name="script_name" -->?op=delete_sort_rule&amp;sort_rule=<!-- TMPL_VAR name="rule" escape="HTML" -->">
306 Delete</a>
307     </td>
308   </tr>
309   <!-- /TMPL_LOOP -->
310 </table>
311 <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
312
313 <p><a href="<!-- TMPL_VAR name="script_name" -->?op=add_sort_rule">Add Filing Rule</a></p>
314
315
316
317 <!-- /TMPL_IF -->
318
319 </div>
320 </div>
321 <div class="yui-b">
322 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
323 </div>
324 </div>
325 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->