Merge remote branch 'kc/new/enh/bug_4449' into kcmaster
[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                     ok=1;
73                     _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
74                 }
75                 if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){
76                         document.getElementById('enrolmentmessage').className = "error";
77                         return false;
78                 }
79                 
80                 if (ok) { // if there is a problem
81                     alert(_alertString);
82                     return false;
83                 }
84                 // if all is good
85                 ff.submit();
86         }
87         //]]>
88 </script>
89 </head>
90 <body>
91 <!-- TMPL_INCLUDE NAME="header.inc" -->
92 <!-- TMPL_INCLUDE NAME="patrons-admin-search.inc" -->
93
94 <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 -->
95 <!-- TMPL_IF NAME="add_validate" --> <a href="/cgi-bin/koha/admin/categorie.pl">Patron Categories</a> &rsaquo; Data recorded<!-- /TMPL_IF -->
96 <!-- 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 -->
97 <!-- TMPL_IF NAME="delete_confirmed" --> <a href="/cgi-bin/koha/admin/categorie.pl">Patron Categories</a> &rsaquo; Category Deleted<!-- /TMPL_IF -->
98 <!-- TMPL_IF NAME="else" -->Patron Categories<!-- /TMPL_IF --></div>
99
100 <div id="doc3" class="yui-t2">
101    
102    <div id="bd">
103         <div id="yui-main">
104         <div class="yui-b">
105
106 <!-- TMPL_IF NAME="add_form" -->
107         
108
109
110         
111         <form name="Aform" action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
112         <input type="hidden" name="op" value="add_validate" />
113         <input type="hidden" name="checked" value="0" />
114 <!-- TMPL_IF NAME="categorycode" -->
115                 <h1>Modify category <!-- TMPL_VAR NAME="categorycode" escape="html" --></h1>
116         <!-- TMPL_ELSE -->
117                 <h1>New category</h1>
118         <!-- /TMPL_IF -->
119         <fieldset class="rows">
120         <ol><!-- TMPL_IF NAME="categorycode" -->
121         <li><span class="label">Category code</span><!-- TMPL_VAR NAME="categorycode" escape="html" -->
122                                 <input type="hidden" name="categorycode" value="<!-- TMPL_VAR NAME="categorycode" escape="html" -->" /><input type="hidden" name="is_a_modif" value="1" /></li>
123         <!-- TMPL_ELSE -->
124         <li><label for="categorycode">Category code: </label> &nbsp; <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" /></li>
125         <!-- /TMPL_IF -->
126         <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>
127         <li><label for="enrolmentperiod">Enrollment period: </label> &nbsp; 
128                 <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="<!-- TMPL_IF NAME="enrolmentperiod" --><!-- TMPL_VAR NAME="enrolmentperiod" --><!-- /TMPL_IF -->" /> months <br />
129                 <label for="enrolmentperioddate">Until date: </label> &nbsp;
130                 <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" />
131                 <script type="text/javascript">
132             //<![CDATA[
133                Calendar.setup({
134                     inputField : "enrolmentperioddate",
135                     ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
136                         button : "enrolmentperioddate_button"
137                 });
138                 //]]>
139         </script>
140                 <div id="enrolmentmessage" class="hint">Cannot have "months" and "until date" at the same time</div>
141         </li>
142         <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>
143         <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>
144         <li><label for="enrolmentfee">Enrollment fee: </label><input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="<!-- TMPL_VAR NAME="enrolmentfee" -->" /></li>
145         <li><label for="overduenoticerequired">Overdue notice required: </label> &nbsp; <select name="overduenoticerequired" id="overduenoticerequired">
146                         <!-- TMPL_IF NAME="overduenoticerequired" -->
147                                                 <option value="0">No</option>
148                                                 <option value="1" selected="selected">Yes</option>
149                         <!-- TMPL_ELSE -->
150                                                 <option value="0" selected="selected">No</option>
151                                                 <option value="1">Yes</option>
152                         <!-- /TMPL_IF -->
153                                         </select></li>
154         <li><label for="hidelostitems">Lost items in staff client</label> &nbsp; <select name="hidelostitems" id="hidelostitems">
155                         <!-- TMPL_IF NAME="hidelostitems" -->
156                                                 <option value="0">Shown</option>
157                                                 <option value="1" selected="selected">Hidden by default</option>
158                         <!-- TMPL_ELSE -->
159                                                 <option value="0" selected="selected">Shown</option>
160                                                 <option value="1">Hidden by default</option>
161                         <!-- /TMPL_IF -->
162                                         </select></li>
163         <li><label for="reservefee">Hold fee: </label><input type="text" name="reservefee" id="reservefee" size="6" value="<!-- TMPL_VAR NAME="reservefee" -->" /></li>
164         <li><label for="category_type">Category type: </label> &nbsp; <select name="category_type" id="category_type">
165                                                 <!-- 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 -->
166                                         <!-- TMPL_IF NAME="type_A" --><option value="A" selected="selected">Adult</option><!-- TMPL_ELSE --><option value="A">Adult</option><!-- /TMPL_IF -->
167                                         <!-- TMPL_IF NAME="type_C" --><option value="C" selected="selected">Child</option><!-- TMPL_ELSE --><option value="C">Child</option><!-- /TMPL_IF -->
168                                         <!-- TMPL_IF NAME="type_S" --><option value="S" selected="selected">Staff</option><!-- TMPL_ELSE --><option value="S">Staff</option><!-- /TMPL_IF -->
169                                         <!-- TMPL_IF NAME="type_I" --><option value="I" selected="selected">Organization</option><!-- TMPL_ELSE --><option value="I">Organization</option><!-- /TMPL_IF -->
170                                         <!-- TMPL_IF NAME="type_P" --><option value="P" selected="selected">Professional</option><!-- TMPL_ELSE --><option value="P">Professional</option><!-- /TMPL_IF -->
171                                         <!-- TMPL_IF NAME="type_X" --><option value="X" selected="selected">Statistical</option><!-- TMPL_ELSE --><option value="X">Statistical</option><!-- /TMPL_IF -->
172                                         </select>
173         </li></ol>
174 </fieldset>
175
176     <!-- TMPL_IF NAME="EnhancedMessagingPreferences" -->
177       <fieldset class="rows">
178         <h4>Default messaging preferences for this patron category</h4>
179         <!-- TMPL_INCLUDE NAME="messaging-preference-form.inc" -->
180       </fieldset>
181     <!-- /TMPL_IF -->
182         <fieldset class="action"><input type="button" value="Save" onclick="Check(this.form);" /> </fieldset>
183         </form>
184
185 <!-- /TMPL_IF -->
186
187 <!-- TMPL_IF NAME="add_validate" -->
188 <h3>Data recorded</h3>
189         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
190                 <input type="submit" value="OK" />
191         </form>
192
193 <!-- /TMPL_IF -->
194
195 <!-- TMPL_IF NAME="delete_confirm" -->
196         
197         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
198         <fieldset><legend>      
199         <!-- TMPL_IF NAME="totalgtzero" -->
200         Category <!-- TMPL_VAR NAME="categorycode" escape="html" --> is in use.  Deletion not possible!<!-- TMPL_ELSE -->
201 Confirm Deletion of Category <!-- TMPL_VAR NAME="categorycode" escape="html" --><!-- /TMPL_IF --></legend>
202
203 <!-- 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 -->
204         <table>
205         <tr><th scope="row">Category code: </th><td><!-- TMPL_VAR NAME="categorycode" escape="html" --></td></tr>
206         <tr><th scope="row">Description: </th><td><!-- TMPL_VAR NAME="description" escape="html" --></td></tr>
207         <tr><th scope="row">Enrollment period: </th>
208                 <td>
209                         <!-- TMPL_IF NAME="enrolmentperiod" -->
210                                 <!-- TMPL_VAR NAME="enrolmentperiod" --> months
211                         <!-- TMPL_ELSE -->
212                                 until <!-- TMPL_VAR NAME="enrolmentperioddate" -->
213                         <!-- /TMPL_IF -->
214                 </td>
215         </tr>
216         <tr><th scope="row">Age required: </th><td><!-- TMPL_VAR NAME="dateofbirthrequired" --> years</td></tr>
217         <tr><th scope="row">Upperage limit: </th><td><!-- TMPL_VAR NAME="upperagelimit" --> years</td></tr>
218         <tr><th scope="row">Enrollment fee: </th><td><!-- TMPL_VAR NAME="enrolmentfee" --></td></tr>
219         <tr><th scope="row">Receives overdue notices: </th><td><!-- TMPL_IF NAME="overduenoticerequired" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --></td></tr>
220         <tr><th scope="row">Lost items in staff client</th><td><!-- TMPL_IF NAME="hidelostitems" -->Hidden by default<!-- TMPL_ELSE -->Shown<!-- /TMPL_IF --></td></tr>
221         <tr><th scope="row">Hold fee: </th><td><!-- TMPL_VAR NAME="reservefee" --></td></tr>
222 </table>
223                 <fieldset class="action"><!-- TMPL_IF NAME="totalgtzero" -->
224 <input type="submit" value="OK" /></form>
225                 <!-- TMPL_ELSE -->
226                         <input type="hidden" name="op" value="delete_confirmed" />
227                         <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> 
228                 <!-- /TMPL_IF --></fieldset></fieldset></form>
229 <!-- /TMPL_IF -->
230
231 <!-- TMPL_IF NAME="delete_confirmed" -->
232 <h3>Category Deleted</h3>
233
234         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
235         <input type="submit" value="OK" />
236         </form>
237 <!-- /TMPL_IF -->
238
239 <!-- TMPL_IF NAME="else" -->
240
241 <div id="toolbar">
242         <script type="text/javascript">
243         //<![CDATA[
244
245         // prepare DOM for YUI Toolbar
246
247          $(document).ready(function() {
248             yuiToolbar();
249          });
250
251         // YUI Toolbar Functions
252
253         function yuiToolbar() {
254             new YAHOO.widget.Button("newcategory");
255         }
256
257         //]]>
258         </script>
259         <ul class="toolbar">
260         <li><a id="newcategory" href="/cgi-bin/koha/admin/categorie.pl?op=add_form">New Category</a></li>
261 </ul></div>
262
263 <h2>Patron Category Administration</h2>
264 <!-- TMPL_IF NAME="searchfield" -->
265                 You Searched for <!-- TMPL_VAR NAME="searchfield" --></span>
266         <!-- /TMPL_IF -->
267 <span id="pagertable_categorie" class="pager">
268         <form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
269                 <img src="<!-- TMPL_VAR name="interface" -->/prog/img/first.png" class="first"/>
270                 <img src="<!-- TMPL_VAR name="interface" -->/prog/img/prev.png" class="prev"/>
271                 <input type="text" size="5" class="pagedisplay"/>
272                 <img src="<!-- TMPL_VAR name="interface" -->/prog/img/next.png" class="next"/>
273                 <img src="<!-- TMPL_VAR name="interface" -->/prog/img/last.png" class="last"/>
274                 , entries/page : 
275                 <select class="pagesize">
276                 <option value="10">10</option>
277                         <option selected="selected" value="20">20</option>
278                         <option value="30">30</option>
279                         <option value="40">40</option>
280                         <option value="50">50</option>
281                         <option value="100">100</option>
282                 </select>
283         </form>
284 </span>
285         <table id="table_categorie">
286                 <thead>
287                         <th scope="col">Code</th>
288                         <th scope="col">Category name</th>
289                         <th scope="col">Type</th>
290                         <th scope="col">Enrollment period</th>
291                         <th scope="col">Age required</th>
292                         <th scope="col">Upper age limit</th>
293                         <th scope="col">Enrollment fee</th>
294                         <th scope="col">Overdue</th>
295                         <th scope="col">Lost Items</th>
296                         <th scope="col">Hold fee</th>
297             <!-- TMPL_IF NAME="EnhancedMessagingPreferences" -->
298             <th scope="col">Messaging</th>
299             <!-- /TMPL_IF -->
300                         <th scope="col" colspan="2">&nbsp; </th>
301                 </thead>
302                 <!-- TMPL_LOOP NAME="loop" -->
303                 <!-- TMPL_UNLESS NAME="__odd__" -->
304                         <tr class="highlight">
305                 <!-- TMPL_ELSE -->
306                         <tr>
307                 <!-- /TMPL_UNLESS -->
308                         <td><!-- TMPL_VAR NAME="categorycode" escape="html" --></td>
309                         <td>
310                             <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>
311                         </td>
312                         <td>
313                             <!-- TMPL_IF NAME="type_A" -->Adult<!-- /TMPL_IF -->
314                             <!-- TMPL_IF NAME="type_C" -->Child<!-- /TMPL_IF -->
315                             <!-- TMPL_IF NAME="type_P" -->Prof.<!-- /TMPL_IF -->
316                             <!-- TMPL_IF NAME="type_I" -->Org.<!-- /TMPL_IF -->
317                             <!-- TMPL_IF NAME="type_S" -->Staff<!-- /TMPL_IF -->
318                             <!-- TMPL_IF NAME="type_X" -->Statistical<!-- /TMPL_IF -->
319                         </td>
320                         <td>
321                                 <!-- TMPL_IF NAME="enrolmentperiod" -->
322                                         <!-- TMPL_VAR NAME="enrolmentperiod" --> months
323                                 <!-- TMPL_ELSE -->
324                                         until <!-- TMPL_VAR NAME="enrolmentperioddate" -->
325                                 <!-- /TMPL_IF -->
326                         
327                         </td>
328                         <td><!-- TMPL_VAR NAME="dateofbirthrequired" --> years</td>
329                         <td><!-- TMPL_VAR NAME="upperagelimit" --> years</td>
330                         <td><!-- TMPL_VAR NAME="enrolmentfee" --></td>
331                         <td><!-- TMPL_IF NAME="overduenoticerequired" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --></td>
332                         <td><!-- TMPL_IF NAME="hidelostitems" -->Hidden<!-- TMPL_ELSE -->Shown<!-- /TMPL_IF --></td>
333                         <td><!-- TMPL_VAR NAME="reservefee" --></td>
334                         <!-- TMPL_IF NAME="EnhancedMessagingPreferences" -->
335                         <td>
336                             <!-- TMPL_IF NAME="messaging_prefs" -->
337                                 <!-- TMPL_LOOP NAME="messaging_prefs" -->
338                                     <!-- TMPL_IF NAME="Item DUE" -->Item DUE
339                                     <!-- TMPL_ELSIF NAME="Advance Notice" -->Advance Notice
340                                     <!-- TMPL_ELSIF NAME="Upcoming Events" -->Upcoming Events
341                                     <!-- TMPL_ELSIF NAME="Hold Filled" -->Hold Filled
342                                     <!-- TMPL_ELSIF NAME="Item Check-in" -->Item Check-in
343                                     <!-- TMPL_ELSIF NAME="Item Checkout" -->Item Checkout
344                                     <!-- TMPL_ELSE -->Unknown <!-- /TMPL_IF --> :
345                                     <!-- TMPL_LOOP NAME="transports" -->
346                                         <!-- TMPL_VAR NAME="transport" -->
347                                     <!-- /TMPL_LOOP -->
348                                 <!-- /TMPL_LOOP -->
349                                 <br />
350                             <!-- TMPL_ELSE -->
351                                 none
352                             <!-- /TMPL_IF -->
353                         </td>
354                         <!-- /TMPL_IF -->
355                         <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" escape="url" -->">Edit</a></td>
356                                                 <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=delete_confirm&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" escape="url" -->">Delete</a></td>
357                 </tr>
358                 <!-- /TMPL_LOOP -->
359         </table>
360 <!-- /TMPL_IF -->
361
362 </div>
363 </div>
364 <div class="yui-b">
365 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
366 </div>
367 </div>
368 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->