added mod_validate block to aqbookfund.tmpl
[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" -->'<!-- TMPL_ELSE -->Add 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" --> in Use<!-- TMPL_ELSE -->Confirm Deletion of Category '<!-- TMPL_VAR NAME="categorycode" -->'<!-- /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)) {
58                     ok=1;
59                         _alertString += "- upperagelimit is not a number\n";
60                 }
61                 
62                 if (ok) { // if there is a problem
63                         alert(_alertString);
64             return;
65         }
66         // if all is good
67                 ff.submit();
68         }
69         //]]>
70 </script>
71 </head>
72 <body>
73 <!-- TMPL_INCLUDE NAME="header.inc" -->
74 <!-- TMPL_INCLUDE NAME="patrons-admin-search.inc" -->
75
76 <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" -->'<!-- TMPL_ELSE -->Add category<!-- /TMPL_IF --><!-- /TMPL_IF -->
77 <!-- TMPL_IF NAME="add_validate" --> <a href="/cgi-bin/koha/admin/categorie.pl">Patron Categories</a> &rsaquo; Data recorded<!-- /TMPL_IF -->
78 <!-- 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" --> in Use<!-- TMPL_ELSE -->Confirm Deletion of Category '<!-- TMPL_VAR NAME="categorycode" -->'<!-- /TMPL_IF --><!-- /TMPL_IF -->
79 <!-- TMPL_IF NAME="delete_confirmed" --> <a href="/cgi-bin/koha/admin/categorie.pl">Patron Categories</a> &rsaquo; Category Deleted<!-- /TMPL_IF -->
80 <!-- TMPL_IF NAME="else" -->Patron Categories<!-- /TMPL_IF --></div>
81
82 <div id="doc3" class="yui-t2">
83    
84    <div id="bd">
85         <div id="yui-main">
86         <div class="yui-b">
87
88 <!-- TMPL_IF NAME="add_form" -->
89         
90
91
92         
93         <form name="Aform" action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
94         <input type="hidden" name="op" value="add_validate" />
95         <input type="hidden" name="checked" value="0" />
96 <!-- TMPL_IF NAME="categorycode" -->
97                 <h1>Modify category <!-- TMPL_VAR NAME="categorycode" --></h1>
98         <!-- TMPL_ELSE -->
99                 <h1>Add category</h1>
100         <!-- /TMPL_IF -->
101         <fieldset class="rows">
102         <ol><!-- TMPL_IF NAME="categorycode" -->
103         <li><span class="label">Category code</span><!-- TMPL_VAR NAME="categorycode" -->
104                                 <input type="hidden" name="categorycode" value="<!-- TMPL_VAR NAME="categorycode" -->" /><input type="hidden" name="is_a_modif" value="1" /></li>
105         <!-- TMPL_ELSE -->
106         <li><label for="categorycode">Category code</label><input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" /></li>
107         <!-- /TMPL_IF -->
108         <li><label for="description">Description</label>&nbsp; <input type="text" name="description" id="description" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="description" -->" /></li>
109         <li><label for="enrolmentperiod">Enrollment period</label>&nbsp; <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="enrolmentperiod" -->" /> months</li>
110         <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>
111         <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>
112         <li><label for="enrolmentfee">Enrollment fee</label>$ <input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="<!-- TMPL_VAR NAME="enrolmentfee" -->" /></li>
113         <li><label for="overduenoticerequired">Overdue notice required</label>&nbsp; <select name="overduenoticerequired" id="overduenoticerequired">
114                         <!-- TMPL_IF NAME="overduenoticerequired" -->
115                                                 <option value="0">No</option>
116                                                 <option value="1" selected="selected">Yes</option>
117                         <!-- TMPL_ELSE -->
118                                                 <option value="0" selected="selected">No</option>
119                                                 <option value="1">Yes</option>
120                         <!-- /TMPL_IF -->
121                                         </select></li>
122         <li><label for="reservefee">Reserve fee</label>$ <input type="text" name="reservefee" id="reservefee" size="6" value="<!-- TMPL_VAR NAME="reservefee" -->" /></li>
123         <li><label for="category_type">Category type</label><select name="category_type" id="category_type">
124                                                 <!-- 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 -->
125                                         <!-- TMPL_IF NAME="type_A" --><option value="A" selected="selected">Adult</option><!-- TMPL_ELSE --><option value="A">Adult</option><!-- /TMPL_IF -->
126                                         <!-- TMPL_IF NAME="type_C" --><option value="C" selected="selected">Children</option><!-- TMPL_ELSE --><option value="C">Children</option><!-- /TMPL_IF -->
127                                         <!-- TMPL_IF NAME="type_I" --><option value="I" selected="selected">Organisation</option><!-- TMPL_ELSE --><option value="I">Organisation</option><!-- /TMPL_IF -->
128                                         <!-- TMPL_IF NAME="type_P" --><option value="P" selected="selected">Professional</option><!-- TMPL_ELSE --><option value="P">Professional</option><!-- /TMPL_IF -->
129                                         </select>
130         </li></ol>
131 </fieldset>
132
133         <p>                             <input type="submit" value="<!-- TMPL_IF NAME="categorycode" -->Update Category<!-- TMPL_ELSE -->Add Category<!-- /TMPL_IF -->" onclick="Check(this.form);" /> </p>
134         </form>
135
136 <!-- /TMPL_IF -->
137
138 <!-- TMPL_IF NAME="add_validate" -->
139 <h3>Data recorded</h3>
140         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
141                 <input type="submit" value="OK" />
142         </form>
143
144 <!-- /TMPL_IF -->
145
146 <!-- TMPL_IF NAME="delete_confirm" -->
147         
148                 
149         <!-- TMPL_IF NAME="totalgtzero" --><h3>Cagegory <!-- TMPL_VAR NAME="categorycode" --> is in use.  Deletion not possible!</h3><!-- TMPL_ELSE --><h2>Confirm Deletion of Category <!-- TMPL_VAR NAME="categorycode" --></h2><!-- /TMPL_IF -->
150 <!-- TMPL_IF NAME="totalgtzero" --><div class="error">This category is used <!-- TMPL_VAR NAME="total" --> times. Deletion not possible<!-- /TMPL_IF -->
151         <ul>
152         <li><strong>Category code: </strong><!-- TMPL_VAR NAME="categorycode" --></li>
153         <li><strong>Description: </strong><!-- TMPL_VAR NAME="description" --></li>
154         <li><strong>Enrolment period: </strong><!-- TMPL_VAR NAME="enrolmentperiod" --> months</li>
155         <li><strong>Age Required: </strong><!-- TMPL_VAR NAME="dateofbirthrequired" --> years</li>
156         <li><strong>Upperage limit: </strong><!-- TMPL_VAR NAME="upperagelimit" --> years</li>
157         <li><strong>Enrolment fee: </strong>$<!-- TMPL_VAR NAME="enrolmentfee" --></li>
158         <li><strong>Overdue notice required: </strong><!-- TMPL_IF NAME="overduenoticerequired" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --></li>
159         <li><strong>Reserve fee: </strong>$<!-- TMPL_VAR NAME="reservefee" --></li>
160 </ul>
161                 <!-- TMPL_IF NAME="totalgtzero" -->
162 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="submit" value="OK" /></form>
163                 <!-- TMPL_ELSE -->
164 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
165                         <input type="hidden" name="op" value="delete_confirmed" />
166                         <input type="hidden" name="categorycode" value="<!-- TMPL_VAR NAME="categorycode" -->" /> <input type="submit" value="Delete this Category" /></form> <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="submit" value="Do Not Delete" /></form>
167                 <!-- /TMPL_IF --></div>
168 <!-- /TMPL_IF -->
169
170 <!-- TMPL_IF NAME="delete_confirmed" -->
171 <h3>Category Deleted</h3>
172
173         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
174         <input type="submit" value="OK" />
175         </form>
176 <!-- /TMPL_IF -->
177
178 <!-- TMPL_IF NAME="else" -->
179 <h2>Patron Category Administration</h2>
180 <!-- TMPL_IF NAME="searchfield" -->
181                 You Searched for <!-- TMPL_VAR NAME="searchfield" --></span>
182         <!-- /TMPL_IF -->
183
184         <table>
185                 <tr>
186                         <th scope="col">Code</th>
187                         <th scope="col">Category Name</th>
188                         <th scope="col">Type</th>
189                         <th scope="col">Enrollment Period</th>
190                         <th scope="col">Age Required</th>
191                         <th scope="col">Upper Age Limit</th>
192                         <th scope="col">Enrollment Fee</th>
193                         <th scope="col">Overdue</th>
194                         <th scope="col">Reservation Fee</th>
195                         <th scope="col" colspan="2">&nbsp; </th>
196                 </tr>
197                 <!-- TMPL_LOOP NAME="loop" -->
198                 <!-- TMPL_IF NAME="toggle" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
199                         <td><!-- TMPL_VAR NAME="categorycode" --></td>
200                         <td>
201                             <a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" -->"><!-- TMPL_VAR NAME="description" --></a>
202                         </td>
203                         <td>
204                             <!-- TMPL_IF NAME="type_A" -->Adult<!-- /TMPL_IF -->
205                             <!-- TMPL_IF NAME="type_C" -->Child<!-- /TMPL_IF -->
206                             <!-- TMPL_IF NAME="type_P" -->Prof.<!-- /TMPL_IF -->
207                             <!-- TMPL_IF NAME="type_I" -->Org.<!-- /TMPL_IF -->
208                         </td>
209                         <td><!-- TMPL_VAR NAME="enrolmentperiod" --> months</td>
210                         <td><!-- TMPL_VAR NAME="dateofbirthrequired" --> years</td>
211                         <td><!-- TMPL_VAR NAME="upperagelimit" --> years</td>
212                         <td><!-- TMPL_VAR NAME="enrolmentfee" --></td>
213                         <td><!-- TMPL_IF NAME="overduenoticerequired" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --></td>
214                         <td><!-- TMPL_VAR NAME="reservefee" --></td>
215                         <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" -->">Edit</a></td>
216                                                 <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=delete_confirm&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" -->">Delete</a></td>
217                 </tr>
218                 <!-- /TMPL_LOOP -->
219         </table><form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
220                 <input type="hidden" name="op" value="add_form" />
221                 <input type="submit" value="Add Category" />
222         </form>
223 <!-- /TMPL_IF -->
224
225 </div>
226 </div>
227 <div class="yui-b">
228 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
229 </div>
230 </div>
231 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->