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