1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Administration › Patron categories › [% IF ( add_form ) %][% IF ( categorycode ) %]Modify category '[% categorycode |html %]'[% ELSE %]New category[% END %][% END %]
3 [% IF ( add_validate ) %]Data recorded[% END %]
4 [% IF ( delete_confirm ) %][% IF ( totalgtzero ) %]Cannot delete: category [% categorycode |html %] in use[% ELSE %]Confirm deletion of category '[% categorycode |html %]'[% END %][% END %]
5 [% IF ( delete_confirmed ) %]Category deleted[% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'calendar.inc' %]
8 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
9 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
10 <script type="text/javascript" id="js">$(document).ready(function() {
11 $("#table_categorie").tablesorter({
14 headers: { 11: { sorter: false}}
15 }).tablesorterPager({container: $("#pagertable_categorie"),positionFixed: false,size: 20});
16 $( "#enrolmentperioddate" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
18 <script type="text/javascript">
21 function isNotNull(f,noalert) {
22 if (f.value.length ==0) {
29 var x=f.value.toUpperCase();
34 function isNum(v,maybenull) {
35 var n = new Number(v.value);
39 if (maybenull==0 && v.value=='') {
46 var t = Date.parse(f.value);
51 // to check if the data are correctly entered.
54 var _alertString=_("Form not submitted because of the following problem(s)");
55 _alertString +="\n-------------------------------------------------------------------\n\n";
56 ff.categorycode.value = ff.categorycode.value.trim();
57 if (ff.categorycode.value.length==0) {
59 _alertString += _("- categorycode missing") + "\n";
62 var patt=/^[a-zA-Z0-9\-_]+$/g;
63 if ( !patt.test(ff.categorycode.value) ) {
65 _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n";
68 if (!(ff.category_type.value)){
70 _alertString += _("- category type missing") + "\n";
72 if (!(isNotNull(ff.description,1))) {
74 _alertString += _("- description missing") + "\n";
76 if (!isNum(ff.upperagelimit,0) && ff.category_type.value=='C') {
78 _alertString += _("- upperagelimit is not a number") + "\n";
81 if(!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) {
83 _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
85 if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){
86 document.getElementById('enrolmentmessage').className = "error";
90 if (ok) { // if there is a problem
99 <style type="text/css">#enrolmentmessage.hint { display : none; }</style>
101 <body id="admin_categorie" class="admin">
102 [% INCLUDE 'header.inc' %]
103 [% INCLUDE 'patrons-admin-search.inc' %]
105 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF ( add_form ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › [% IF ( categorycode ) %]Modify category '[% categorycode |html %]'[% ELSE %]New category[% END %][% END %]
106 [% IF ( add_validate ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › Data recorded[% END %]
107 [% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › [% IF ( totalgtzero ) %]Cannot delete: Category [% categorycode |html %] in use[% ELSE %]Confirm deletion of category '[% categorycode |html %]'[% END %][% END %]
108 [% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › Category deleted[% END %]
109 [% IF ( else ) %]Patron categories[% END %]</div>
111 <div id="doc3" class="yui-t2">
117 [% IF ( add_form ) %]
122 <form name="Aform" action="[% script_name %]" method="post">
123 <input type="hidden" name="op" value="add_validate" />
124 <input type="hidden" name="checked" value="0" />
125 [% IF ( categorycode ) %]
126 <h1>Modify category [% categorycode |html %]</h1>
128 <h1>New category</h1>
130 <fieldset class="rows">
131 <ol>[% IF ( categorycode ) %]
132 <li><span class="label">Category code</span>[% categorycode |html %]
133 <input type="hidden" name="categorycode" value="[% categorycode |html %]" /><input type="hidden" name="is_a_modif" value="1" /></li>
135 <li><label for="categorycode">Category code: </label> <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" /></li>
137 <li><label for="description">Description: </label> <input type="text" name="description" id="description" size="40" maxlength="80" value="[% description |html %]" /></li>
138 <li><label for="enrolmentperiod">Enrollment period: </label>
140 <legend>Choose one</legend>
142 <li><label for="enrolmentperiod" style="width:6em;">In months: </label>
143 <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF ( enrolmentperiod ) %][% enrolmentperiod %][% END %]" /> months</li>
144 <li><label for="enrolmentperioddate" style="width:6em;">Until date: </label>
145 <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% enrolmentperioddate %]" />
146 <div id="enrolmentmessage" class="hint" style="margin-left:0;">Cannot have "months" and "until date" at the same time</div>
151 <li><label for="dateofbirthrequired">Age required: </label> <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% dateofbirthrequired %]" size="3" maxlength="3" /> years</li>
152 <li><label for="upperagelimit">Upperage limit: </label> <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% upperagelimit %]" /> years</li>
153 <li><label for="enrolmentfee">Enrollment fee: </label><input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% enrolmentfee %]" /></li>
154 <li><label for="overduenoticerequired">Overdue notice required: </label> <select name="overduenoticerequired" id="overduenoticerequired">
155 [% IF ( overduenoticerequired ) %]
156 <option value="0">No</option>
157 <option value="1" selected="selected">Yes</option>
159 <option value="0" selected="selected">No</option>
160 <option value="1">Yes</option>
163 <li><label for="hidelostitems">Lost items in staff client</label> <select name="hidelostitems" id="hidelostitems">
164 [% IF ( hidelostitems ) %]
165 <option value="0">Shown</option>
166 <option value="1" selected="selected">Hidden by default</option>
168 <option value="0" selected="selected">Shown</option>
169 <option value="1">Hidden by default</option>
172 <li><label for="reservefee">Hold fee: </label><input type="text" name="reservefee" id="reservefee" size="6" value="[% reservefee %]" /></li>
173 <li><label for="category_type">Category type: </label> <select name="category_type" id="category_type">
174 [% IF ( type_n ) %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
175 [% IF ( type_A ) %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
176 [% IF ( type_C ) %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
177 [% IF ( type_S ) %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
178 [% IF ( type_I ) %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
179 [% IF ( type_P ) %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
180 [% IF ( type_X ) %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
185 [% IF ( EnhancedMessagingPreferences ) %]
186 <fieldset class="rows">
187 <h4>Default messaging preferences for this patron category</h4>
188 [% INCLUDE 'messaging-preference-form.inc' %]
191 <fieldset class="action"><input type="button" value="Save" onclick="Check(this.form);" /> </fieldset>
196 [% IF ( add_validate ) %]
197 <h3>Data recorded</h3>
198 <form action="[% script_name %]" method="post">
199 <input type="submit" value="OK" />
204 [% IF ( delete_confirm ) %]
206 <form action="[% script_name %]" method="post">
208 [% IF ( totalgtzero ) %]
209 Category [% categorycode |html %] is in use. Deletion not possible![% ELSE %]
210 Confirm deletion of category [% categorycode |html %][% END %]</legend>
212 [% IF ( totalgtzero ) %]<div class="dialog alert"><strong>This category is used [% total %] times</strong>. Deletion not possible</div>[% END %]
214 <tr><th scope="row">Category code: </th><td>[% categorycode |html %]</td></tr>
215 <tr><th scope="row">Description: </th><td>[% description |html %]</td></tr>
216 <tr><th scope="row">Enrollment period: </th>
218 [% IF ( enrolmentperiod ) %]
219 [% enrolmentperiod %] months
221 until [% enrolmentperioddate %]
225 <tr><th scope="row">Age required: </th><td>[% dateofbirthrequired %] years</td></tr>
226 <tr><th scope="row">Upperage limit: </th><td>[% upperagelimit %] years</td></tr>
227 <tr><th scope="row">Enrollment fee: </th><td>[% enrolmentfee %]</td></tr>
228 <tr><th scope="row">Receives overdue notices: </th><td>[% IF ( overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td></tr>
229 <tr><th scope="row">Lost items in staff client</th><td>[% IF ( hidelostitems ) %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
230 <tr><th scope="row">Hold fee: </th><td>[% reservefee %]</td></tr>
232 <fieldset class="action">[% IF ( totalgtzero ) %]
233 <input type="submit" value="OK" /></form>
235 <input type="hidden" name="op" value="delete_confirmed" />
236 <input type="hidden" name="categorycode" value="[% categorycode |html %]" /> <input type="submit" value="Delete this category" /> <a class="cancel" href="/cgi-bin/koha/admin/categorie.pl">Cancel</a>
237 [% END %]</fieldset></fieldset></form>
240 [% IF ( delete_confirmed ) %]
241 <h3>Category deleted</h3>
243 <form action="[% script_name %]" method="post">
244 <input type="submit" value="OK" />
251 <script type="text/javascript">
254 // prepare DOM for YUI Toolbar
256 $(document).ready(function() {
260 // YUI Toolbar Functions
262 function yuiToolbar() {
263 new YAHOO.widget.Button("newcategory");
269 <li><a id="newcategory" href="/cgi-bin/koha/admin/categorie.pl?op=add_form">New category</a></li>
272 <h2>Patron category administration</h2>
273 [% IF ( searchfield ) %]
274 You Searched for [% searchfield %]</span>
277 <div id="pagertable_categorie">
278 [% INCLUDE 'table-pager.inc' perpage='20' %]
280 <table id="table_categorie">
282 <th scope="col">Code</th>
283 <th scope="col">Category name</th>
284 <th scope="col">Type</th>
285 <th scope="col">Enrollment period</th>
286 <th scope="col">Age required</th>
287 <th scope="col">Upper age limit</th>
288 <th scope="col">Enrollment fee</th>
289 <th scope="col">Overdue</th>
290 <th scope="col">Lost items</th>
291 <th scope="col">Hold fee</th>
292 [% IF ( EnhancedMessagingPreferences ) %]
293 <th scope="col">Messaging</th>
295 <th scope="col" colspan="2"> </th>
297 [% FOREACH loo IN loop %]
299 <td>[% loo.categorycode |html %]</td>
301 <a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |uri %]">[% loo.description |html %]</a>
304 [% IF ( loo.type_A ) %]Adult[% END %]
305 [% IF ( loo.type_C ) %]Child[% END %]
306 [% IF ( loo.type_P ) %]Prof.[% END %]
307 [% IF ( loo.type_I ) %]Org.[% END %]
308 [% IF ( loo.type_S ) %]Staff[% END %]
309 [% IF ( loo.type_X ) %]Statistical[% END %]
312 [% IF ( loo.enrolmentperiod ) %]
313 [% loo.enrolmentperiod %] months
315 until [% loo.enrolmentperioddate %]
319 <td>[% loo.dateofbirthrequired %] years</td>
320 <td>[% loo.upperagelimit %] years</td>
321 <td>[% loo.enrolmentfee %]</td>
322 <td>[% IF ( loo.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
323 <td>[% IF ( loo.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
324 <td>[% loo.reservefee %]</td>
325 [% IF ( EnhancedMessagingPreferences ) %]
326 <td style="white-space: nowrap; font-size:80%;">
327 [% IF ( loo.messaging_prefs ) %]
328 [% FOREACH prefs IN loo.messaging_prefs %]
329 [% FOREACH transport IN prefs.transports %]
330 [% IF ( transport.transport ) %]
331 [% IF ( prefs.Item_Due ) %]Item due
332 [% ELSIF ( prefs.Advance_Notice ) %]Advance notice
333 [% ELSIF ( prefs.Upcoming_Events ) %]Upcoming events
334 [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
335 [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
336 [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
339 <strong>[% transport.transport %]</strong><br />
340 [% ELSE %]None<br />[% END %]
348 <td><a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |uri %]">Edit</a></td>
349 <td><a href="[% loo.script_name %]?op=delete_confirm&categorycode=[% loo.categorycode |uri %]">Delete</a></td>
354 <div class="dialog alert">No categories have been defined. <a href="/cgi-bin/koha/admin/categorie.pl?op=add_form">Create a new category</a>.</div>
361 [% INCLUDE 'admin-menu.inc' %]
364 [% INCLUDE 'intranet-bottom.inc' %]