Fix for Bug 4820, Alter layout of Circulation and fines rules page for clarity
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / categorie.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Administration &rsaquo; Patron Categories &rsaquo; <!-- TMPL_IF NAME="add_form" --><!-- TMPL_IF NAME="categorycode" -->Modify category '<!-- TMPL_VAR NAME="categorycode" escape="html" -->'<!-- TMPL_ELSE -->New category<!-- /TMPL_IF --><!-- /TMPL_IF -->
3 <!-- TMPL_IF NAME="add_validate" -->Data recorded<!-- /TMPL_IF -->
4 <!-- TMPL_IF NAME="delete_confirm" --><!-- TMPL_IF NAME="totalgtzero" -->Cannot Delete: Category <!-- TMPL_VAR NAME="categorycode" escape="html" --> in Use<!-- TMPL_ELSE -->Confirm Deletion of Category '<!-- TMPL_VAR NAME="categorycode" escape="html" -->'<!-- /TMPL_IF --><!-- /TMPL_IF -->
5 <!-- TMPL_IF NAME="delete_confirmed" -->Category Deleted<!-- /TMPL_IF --></title>
6 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
7 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
8 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
9 <script type="text/javascript" id="js">$(document).ready(function() {
10         $("#table_categorie").tablesorter({
11                 sortList: [[0,0]],
12                 headers: { 10: { sorter: false}}
13         }).tablesorterPager({container: $("#pagertable_categorie"),positionFixed: false,size: 20});
14 }); </script>
15 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
16 <script type="text/javascript">
17 //<![CDATA[
18         //
19         function isNotNull(f,noalert) {
20                 if (f.value.length ==0) {
21    return false;
22                 }
23                 return true;
24         }
25         //
26         function toUC(f) {
27                 var x=f.value.toUpperCase();
28                 f.value=x;
29                 return true;
30         }
31         //
32         function isNum(v,maybenull) {
33         var n = new Number(v.value);
34         if (isNaN(n)) {
35                 return false;
36                 }
37         if (maybenull==0 && v.value=='') {
38                 return false;
39         }
40         return true;
41         }
42         //
43         function isDate(f) {
44                 var t = Date.parse(f.value);
45                 if (isNaN(t)) {
46                         return false;
47                 }
48         }
49         // to check if the data are correctly entered.
50         function Check(ff) {
51             var ok=0;
52                 var _alertString=_("Form not submitted because of the following problem(s)");
53                 _alertString +="\n-------------------------------------------------------------------\n\n";
54                 if (ff.categorycode.value.length==0) {
55                     ok=1;
56                         _alertString += _("- categorycode missing") + "\n";
57                 }
58                 if (!(ff.category_type.value)){
59                     ok=1;
60                     _alertString += _("- category type missing") + "\n";
61                 }
62                 if (!(isNotNull(ff.description,1))) {
63                     ok=1;
64                         _alertString += _("- description missing") + "\n";
65                 }
66                 if (!isNum(ff.upperagelimit,0) && ff.category_type.value=='C') {
67                     ok=1;
68                         _alertString += _("- upperagelimit is not a number") + "\n";
69                                 
70                 }
71                 if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){
72                         document.getElementById('enrolmentmessage').className = "error";
73                         return false;
74                 }
75                 
76                 if (ok) { // if there is a problem
77                         alert(_alertString);
78              return false;
79         }
80         // if all is good
81                 ff.submit();
82         }
83         //]]>
84 </script>
85 </head>
86 <body>
87 <!-- TMPL_INCLUDE NAME="header.inc" -->
88 <!-- TMPL_INCLUDE NAME="patrons-admin-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; <!-- TMPL_IF NAME="add_form" --> <a href="/cgi-bin/koha/admin/categorie.pl">Patron Categories</a> &rsaquo; <!-- TMPL_IF NAME="categorycode" -->Modify category '<!-- TMPL_VAR NAME="categorycode" escape="html" -->'<!-- TMPL_ELSE -->New category<!-- /TMPL_IF --><!-- /TMPL_IF -->
91 <!-- TMPL_IF NAME="add_validate" --> <a href="/cgi-bin/koha/admin/categorie.pl">Patron Categories</a> &rsaquo; Data recorded<!-- /TMPL_IF -->
92 <!-- TMPL_IF NAME="delete_confirm" --> <a href="/cgi-bin/koha/admin/categorie.pl">Patron Categories</a> &rsaquo; <!-- TMPL_IF NAME="totalgtzero" -->Cannot Delete: Category <!-- TMPL_VAR NAME="categorycode" escape="html" --> in Use<!-- TMPL_ELSE -->Confirm Deletion of Category '<!-- TMPL_VAR NAME="categorycode" escape="html" -->'<!-- /TMPL_IF --><!-- /TMPL_IF -->
93 <!-- TMPL_IF NAME="delete_confirmed" --> <a href="/cgi-bin/koha/admin/categorie.pl">Patron Categories</a> &rsaquo; Category Deleted<!-- /TMPL_IF -->
94 <!-- TMPL_IF NAME="else" -->Patron Categories<!-- /TMPL_IF --></div>
95
96 <div id="doc3" class="yui-t2">
97    
98    <div id="bd">
99         <div id="yui-main">
100         <div class="yui-b">
101
102 <!-- TMPL_IF NAME="add_form" -->
103         
104
105
106         
107         <form name="Aform" action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
108         <input type="hidden" name="op" value="add_validate" />
109         <input type="hidden" name="checked" value="0" />
110 <!-- TMPL_IF NAME="categorycode" -->
111                 <h1>Modify category <!-- TMPL_VAR NAME="categorycode" escape="html" --></h1>
112         <!-- TMPL_ELSE -->
113                 <h1>New category</h1>
114         <!-- /TMPL_IF -->
115         <fieldset class="rows">
116         <ol><!-- TMPL_IF NAME="categorycode" -->
117         <li><span class="label">Category code</span><!-- TMPL_VAR NAME="categorycode" escape="html" -->
118                                 <input type="hidden" name="categorycode" value="<!-- TMPL_VAR NAME="categorycode" escape="html" -->" /><input type="hidden" name="is_a_modif" value="1" /></li>
119         <!-- TMPL_ELSE -->
120         <li><label for="categorycode">Category code: </label> &nbsp; <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" /></li>
121         <!-- /TMPL_IF -->
122         <li><label for="description">Description: </label> &nbsp; <input type="text" name="description" id="description" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="description" escape="html" -->" /></li>
123         <li><label for="enrolmentperiod">Enrollment period: </label> &nbsp; 
124                 <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="<!-- TMPL_IF NAME="enrolmentperiod" --><!-- TMPL_VAR NAME="enrolmentperiod" --><!-- /TMPL_IF -->" /> months <br />
125                 <label for="enrolmentperioddate">Until date: </label> &nbsp;
126                 <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="<!-- TMPL_VAR NAME="enrolmentperioddate" -->" /> <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="enrolmentperioddate_button" alt="Show Calendar" />
127                 <script type="text/javascript">
128             //<![CDATA[
129                Calendar.setup({
130                     inputField : "enrolmentperioddate",
131                     ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
132                         button : "enrolmentperioddate_button"
133                 });
134                 //]]>
135         </script>
136                 <div id="enrolmentmessage" class="hint">Cannot have "months" and "until date" at the same time</div>
137         </li>
138         <li><label for="dateofbirthrequired">Age required: </label> &nbsp; <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="<!-- TMPL_VAR NAME="dateofbirthrequired" -->" size="3" maxlength="3" /> years</li>
139         <li><label for="upperagelimit">Upperage limit: </label> &nbsp; <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="<!-- TMPL_VAR NAME="upperagelimit" -->" /> years</li>
140         <li><label for="enrolmentfee">Enrollment fee: </label><input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="<!-- TMPL_VAR NAME="enrolmentfee" -->" /></li>
141         <li><label for="overduenoticerequired">Overdue notice required: </label> &nbsp; <select name="overduenoticerequired" id="overduenoticerequired">
142                         <!-- TMPL_IF NAME="overduenoticerequired" -->
143                                                 <option value="0">No</option>
144                                                 <option value="1" selected="selected">Yes</option>
145                         <!-- TMPL_ELSE -->
146                                                 <option value="0" selected="selected">No</option>
147                                                 <option value="1">Yes</option>
148                         <!-- /TMPL_IF -->
149                                         </select></li>
150         <li><label for="reservefee">Hold fee: </label><input type="text" name="reservefee" id="reservefee" size="6" value="<!-- TMPL_VAR NAME="reservefee" -->" /></li>
151         <li><label for="category_type">Category type: </label> &nbsp; <select name="category_type" id="category_type">
152                                                 <!-- TMPL_IF NAME="type_n" --><option value="" selected="selected">Select a Category type</option><!-- TMPL_ELSE --><option value="">Select a Category type</option><!-- /TMPL_IF -->
153                                         <!-- TMPL_IF NAME="type_A" --><option value="A" selected="selected">Adult</option><!-- TMPL_ELSE --><option value="A">Adult</option><!-- /TMPL_IF -->
154                                         <!-- TMPL_IF NAME="type_C" --><option value="C" selected="selected">Child</option><!-- TMPL_ELSE --><option value="C">Child</option><!-- /TMPL_IF -->
155                                         <!-- TMPL_IF NAME="type_S" --><option value="S" selected="selected">Staff</option><!-- TMPL_ELSE --><option value="S">Staff</option><!-- /TMPL_IF -->
156                                         <!-- TMPL_IF NAME="type_I" --><option value="I" selected="selected">Organization</option><!-- TMPL_ELSE --><option value="I">Organization</option><!-- /TMPL_IF -->
157                                         <!-- TMPL_IF NAME="type_P" --><option value="P" selected="selected">Professional</option><!-- TMPL_ELSE --><option value="P">Professional</option><!-- /TMPL_IF -->
158                                         <!-- TMPL_IF NXME="type_X" --><option value="X" selected="selected">Statistical</option><!-- TMPL_ELSE --><option value="X">Statistical</option><!-- /TMPL_IF -->
159                                         </select>
160         </li></ol>
161 </fieldset>
162
163     <!-- TMPL_IF NAME="EnhancedMessagingPreferences" -->
164       <fieldset class="rows">
165         <h4>Default messaging preferences for this patron category</h4>
166         <!-- TMPL_INCLUDE NAME="messaging-preference-form.inc" -->
167       </fieldset>
168     <!-- /TMPL_IF -->
169         <fieldset class="action"><input type="button" value="Save" onclick="Check(this.form);" /> </fieldset>
170         </form>
171
172 <!-- /TMPL_IF -->
173
174 <!-- TMPL_IF NAME="add_validate" -->
175 <h3>Data recorded</h3>
176         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
177                 <input type="submit" value="OK" />
178         </form>
179
180 <!-- /TMPL_IF -->
181
182 <!-- TMPL_IF NAME="delete_confirm" -->
183         
184         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
185         <fieldset><legend>      
186         <!-- TMPL_IF NAME="totalgtzero" -->
187         Category <!-- TMPL_VAR NAME="categorycode" escape="html" --> is in use.  Deletion not possible!<!-- TMPL_ELSE -->
188 Confirm Deletion of Category <!-- TMPL_VAR NAME="categorycode" escape="html" --><!-- /TMPL_IF --></legend>
189
190 <!-- TMPL_IF NAME="totalgtzero" --><div class="dialog alert"><strong>This category is used <!-- TMPL_VAR NAME="total" --> times</strong>. Deletion not possible</div><!-- /TMPL_IF -->
191         <table>
192         <tr><th scope="row">Category code: </th><td><!-- TMPL_VAR NAME="categorycode" escape="html" --></td></tr>
193         <tr><th scope="row">Description: </th><td><!-- TMPL_VAR NAME="description" escape="html" --></td></tr>
194         <tr><th scope="row">Enrollment period: </th>
195                 <td>
196                         <!-- TMPL_IF NAME="enrolmentperiod" -->
197                                 <!-- TMPL_VAR NAME="enrolmentperiod" --> months
198                         <!-- TMPL_ELSE -->
199                                 until <!-- TMPL_VAR NAME="enrolmentperioddate" -->
200                         <!-- /TMPL_IF -->
201                 </td>
202         </tr>
203         <tr><th scope="row">Age required: </th><td><!-- TMPL_VAR NAME="dateofbirthrequired" --> years</td></tr>
204         <tr><th scope="row">Upperage limit: </th><td><!-- TMPL_VAR NAME="upperagelimit" --> years</td></tr>
205         <tr><th scope="row">Enrollment fee: </th><td><!-- TMPL_VAR NAME="enrolmentfee" --></td></tr>
206         <tr><th scope="row">Receives overdue notices: </th><td><!-- TMPL_IF NAME="overduenoticerequired" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --></td></tr>
207         <tr><th scope="row">Hold fee: </th><td><!-- TMPL_VAR NAME="reservefee" --></td></tr>
208 </table>
209                 <fieldset class="action"><!-- TMPL_IF NAME="totalgtzero" -->
210 <input type="submit" value="OK" /></form>
211                 <!-- TMPL_ELSE -->
212                         <input type="hidden" name="op" value="delete_confirmed" />
213                         <input type="hidden" name="categorycode" value="<!-- TMPL_VAR NAME="categorycode" escape="html" -->" /> <input type="submit" value="Delete this Category" /> <a class="cancel" href="/cgi-bin/koha/admin/categorie.pl">Cancel</a> 
214                 <!-- /TMPL_IF --></fieldset></fieldset></form>
215 <!-- /TMPL_IF -->
216
217 <!-- TMPL_IF NAME="delete_confirmed" -->
218 <h3>Category Deleted</h3>
219
220         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
221         <input type="submit" value="OK" />
222         </form>
223 <!-- /TMPL_IF -->
224
225 <!-- TMPL_IF NAME="else" -->
226
227 <div id="toolbar">
228         <script type="text/javascript">
229         //<![CDATA[
230
231         // prepare DOM for YUI Toolbar
232
233          $(document).ready(function() {
234             yuiToolbar();
235          });
236
237         // YUI Toolbar Functions
238
239         function yuiToolbar() {
240             new YAHOO.widget.Button("newcategory");
241         }
242
243         //]]>
244         </script>
245         <ul class="toolbar">
246         <li><a id="newcategory" href="/cgi-bin/koha/admin/categorie.pl?op=add_form">New Category</a></li>
247 </ul></div>
248
249 <h2>Patron Category Administration</h2>
250 <!-- TMPL_IF NAME="searchfield" -->
251                 You Searched for <!-- TMPL_VAR NAME="searchfield" --></span>
252         <!-- /TMPL_IF -->
253 <span id="pagertable_categorie" class="pager">
254         <form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
255                 <img src="<!-- TMPL_VAR name="interface" -->/prog/img/first.png" class="first"/>
256                 <img src="<!-- TMPL_VAR name="interface" -->/prog/img/prev.png" class="prev"/>
257                 <input type="text" size="5" class="pagedisplay"/>
258                 <img src="<!-- TMPL_VAR name="interface" -->/prog/img/next.png" class="next"/>
259                 <img src="<!-- TMPL_VAR name="interface" -->/prog/img/last.png" class="last"/>
260                 , entries/page : 
261                 <select class="pagesize">
262                 <option value="10">10</option>
263                         <option selected="selected" value="20">20</option>
264                         <option value="30">30</option>
265                         <option value="40">40</option>
266                         <option value="50">50</option>
267                         <option value="100">100</option>
268                 </select>
269         </form>
270 </span>
271         <table id="table_categorie">
272                 <thead>
273                         <th scope="col">Code</th>
274                         <th scope="col">Category name</th>
275                         <th scope="col">Type</th>
276                         <th scope="col">Enrollment period</th>
277                         <th scope="col">Age required</th>
278                         <th scope="col">Upper age limit</th>
279                         <th scope="col">Enrollment fee</th>
280                         <th scope="col">Overdue</th>
281                         <th scope="col">Hold fee</th>
282             <!-- TMPL_IF NAME="EnhancedMessagingPreferences" -->
283             <th scope="col">Messaging</th>
284             <!-- /TMPL_IF -->
285                         <th scope="col" colspan="2">&nbsp; </th>
286                 </thead>
287                 <!-- TMPL_LOOP NAME="loop" -->
288                 <!-- TMPL_UNLESS NAME="__odd__" -->
289                         <tr class="highlight">
290                 <!-- TMPL_ELSE -->
291                         <tr>
292                 <!-- /TMPL_UNLESS -->
293                         <td><!-- TMPL_VAR NAME="categorycode" escape="html" --></td>
294                         <td>
295                             <a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" escape="url" -->"><!-- TMPL_VAR NAME="description" escape="html" --></a>
296                         </td>
297                         <td>
298                             <!-- TMPL_IF NAME="type_A" -->Adult<!-- /TMPL_IF -->
299                             <!-- TMPL_IF NAME="type_C" -->Child<!-- /TMPL_IF -->
300                             <!-- TMPL_IF NAME="type_P" -->Prof.<!-- /TMPL_IF -->
301                             <!-- TMPL_IF NAME="type_I" -->Org.<!-- /TMPL_IF -->
302                             <!-- TMPL_IF NAME="type_S" -->Staff<!-- /TMPL_IF -->
303                             <!-- TMPL_IF NAME="type_X" -->Statistical<!-- /TMPL_IF -->
304                         </td>
305                         <td>
306                                 <!-- TMPL_IF NAME="enrolmentperiod" -->
307                                         <!-- TMPL_VAR NAME="enrolmentperiod" --> months
308                                 <!-- TMPL_ELSE -->
309                                         until <!-- TMPL_VAR NAME="enrolmentperioddate" -->
310                                 <!-- /TMPL_IF -->
311                         
312                         </td>
313                         <td><!-- TMPL_VAR NAME="dateofbirthrequired" --> years</td>
314                         <td><!-- TMPL_VAR NAME="upperagelimit" --> years</td>
315                         <td><!-- TMPL_VAR NAME="enrolmentfee" --></td>
316                         <td><!-- TMPL_IF NAME="overduenoticerequired" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --></td>
317                         <td><!-- TMPL_VAR NAME="reservefee" --></td>
318                         <!-- TMPL_IF NAME="EnhancedMessagingPreferences" -->
319                         <td>
320                             <!-- TMPL_IF NAME="messaging_prefs" -->
321                                 <!-- TMPL_LOOP NAME="messaging_prefs" -->
322                                     <!-- TMPL_VAR NAME="message_name" --> :
323                                     <!-- TMPL_LOOP NAME="transports" -->
324                                         <!-- TMPL_VAR NAME="transport" -->
325                                     <!-- /TMPL_LOOP -->
326                                 <!-- /TMPL_LOOP -->
327                                 <br />
328                             <!-- TMPL_ELSE -->
329                                 none
330                             <!-- /TMPL_IF -->
331                         </td>
332                         <!-- /TMPL_IF -->
333                         <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" escape="url" -->">Edit</a></td>
334                                                 <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=delete_confirm&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" escape="url" -->">Delete</a></td>
335                 </tr>
336                 <!-- /TMPL_LOOP -->
337         </table>
338 <!-- /TMPL_IF -->
339
340 </div>
341 </div>
342 <div class="yui-b">
343 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
344 </div>
345 </div>
346 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->