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