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 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
9 [% INCLUDE 'datatables.inc' %]
10 <script type="text/javascript" id="js">
12 $(document).ready(function() {
13 $("#table_categorie").dataTable($.extend(true, {}, dataTablesDefaults, {
15 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
16 { "aTargets": [ 3,4,5 ], "sType": "natural" },
18 "aaSorting": [[ 1, "asc" ]],
19 "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
21 "sPaginationType": "four_button"
24 $( "#enrolmentperioddate" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
26 if ( $("#branches option:selected").length < 1 ) {
27 $("#branches option:first").attr("selected", "selected");
30 function isNotNull(f,noalert) {
31 if (f.value.length ==0) {
38 var x=f.value.toUpperCase();
43 function isNum(v,maybenull) {
44 var n = new Number(v.value);
48 if (maybenull==0 && v.value=='') {
55 var t = Date.parse(f.value);
60 // to check if the data are correctly entered.
63 var _alertString=_("Form not submitted because of the following problem(s)");
64 _alertString +="\n-------------------------------------------------------------------\n\n";
65 ff.categorycode.value = ff.categorycode.value.trim();
66 if (ff.categorycode.value.length==0) {
68 _alertString += _("- categorycode missing") + "\n";
71 var patt=/^[a-zA-Z0-9\-_]+$/g;
72 if ( !patt.test(ff.categorycode.value) ) {
74 _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n";
77 if (!(ff.category_type.value)){
79 _alertString += _("- category type missing") + "\n";
81 if (!(isNotNull(ff.description,1))) {
83 _alertString += _("- description missing") + "\n";
85 if (!isNum(ff.upperagelimit,0) && ff.category_type.value=='C') {
87 _alertString += _("- upperagelimit is not a number") + "\n";
90 if(!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) {
92 _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
94 if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){
95 document.getElementById('enrolmentmessage').className = "error";
99 if (ok) { // if there is a problem
108 <style type="text/css">#enrolmentmessage.hint { display : none; }</style>
110 <body id="admin_categorie" class="admin">
111 [% INCLUDE 'header.inc' %]
112 [% INCLUDE 'patrons-admin-search.inc' %]
114 <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 %]
115 [% IF ( add_validate ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › Data recorded[% END %]
116 [% 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 %]
117 [% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › Category deleted[% END %]
118 [% IF ( else ) %]Patron categories[% END %]</div>
120 <div id="doc3" class="yui-t2">
126 [% IF ( add_form ) %]
131 <form name="Aform" action="[% script_name %]" method="post">
132 <input type="hidden" name="op" value="add_validate" />
133 <input type="hidden" name="checked" value="0" />
134 [% IF ( categorycode ) %]
135 <h1>Modify category [% categorycode |html %]</h1>
137 <h1>New category</h1>
139 <fieldset class="rows">
140 <ol>[% IF ( categorycode ) %]
141 <li><span class="label">Category code: </span>[% categorycode |html %]
142 <input type="hidden" name="categorycode" value="[% categorycode |html %]" /><input type="hidden" name="is_a_modif" value="1" /></li>
144 <li><label for="categorycode" class="required">Category code: </label> <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" /></li>
146 <li><label for="description" class="required">Description: </label> <input type="text" name="description" id="description" size="40" maxlength="80" value="[% description |html %]" /></li>
147 <li><label for="enrolmentperiod" class="required">Enrollment period: </label>
149 <legend>Choose one</legend>
151 <li><label for="enrolmentperiod" style="width:6em;">In months: </label>
152 <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF ( enrolmentperiod ) %][% enrolmentperiod %][% END %]" /> months</li>
153 <li><label for="enrolmentperioddate" style="width:6em;">Until date: </label>
154 <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% enrolmentperioddate %]" />
155 <div id="enrolmentmessage" class="hint" style="margin-left:0;">Cannot have "months" and "until date" at the same time</div>
160 <li><label for="dateofbirthrequired">Age required: </label> <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% dateofbirthrequired %]" size="3" maxlength="3" /> years</li>
161 <li><label for="upperagelimit">Upperage limit: </label> <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% upperagelimit %]" /> years</li>
162 <li><label for="enrolmentfee">Enrollment fee: </label><input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% enrolmentfee %]" /></li>
163 <li><label for="overduenoticerequired">Overdue notice required: </label> <select name="overduenoticerequired" id="overduenoticerequired">
164 [% IF ( overduenoticerequired ) %]
165 <option value="0">No</option>
166 <option value="1" selected="selected">Yes</option>
168 <option value="0" selected="selected">No</option>
169 <option value="1">Yes</option>
172 <li><label for="hidelostitems">Lost items in staff client: </label> <select name="hidelostitems" id="hidelostitems">
173 [% IF ( hidelostitems ) %]
174 <option value="0">Shown</option>
175 <option value="1" selected="selected">Hidden by default</option>
177 <option value="0" selected="selected">Shown</option>
178 <option value="1">Hidden by default</option>
181 <li><label for="reservefee">Hold fee: </label><input type="text" name="reservefee" id="reservefee" size="6" value="[% reservefee %]" /></li>
182 <li><label for="category_type" class="required">Category type: </label> <select name="category_type" id="category_type">
183 [% IF ( type_n ) %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
184 [% IF ( type_A ) %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
185 [% IF ( type_C ) %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
186 [% IF ( type_S ) %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
187 [% IF ( type_I ) %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
188 [% IF ( type_P ) %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
189 [% IF ( type_X ) %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
192 <li><label for="branches">Branches limitation: </label>
193 <select id="branches" name="branches" multiple size="10">
194 <option value="">All branches</option>
195 [% FOREACH branch IN branches_loop %]
196 [% IF ( branch.selected ) %]
197 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
199 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
203 <span>Select All if this category type must to be displayed all the time. Otherwise select librairies you want to associate with this value.
209 [% IF ( EnhancedMessagingPreferences ) %]
210 <fieldset class="rows">
211 <h4>Default messaging preferences for this patron category</h4>
212 [% INCLUDE 'messaging-preference-form.inc' %]
215 <fieldset class="action"><input type="button" value="Save" onclick="Check(this.form);" /> </fieldset>
220 [% IF ( add_validate ) %]
221 <h3>Data recorded</h3>
222 <form action="[% script_name %]" method="post">
223 <input type="submit" value="OK" />
228 [% IF ( delete_confirm ) %]
230 <form action="[% script_name %]" method="post">
232 [% IF ( totalgtzero ) %]
233 Category [% categorycode |html %] is in use. Deletion not possible![% ELSE %]
234 Confirm deletion of category [% categorycode |html %][% END %]</legend>
236 [% IF ( totalgtzero ) %]<div class="dialog alert"><strong>This category is used [% total %] times</strong>. Deletion not possible</div>[% END %]
238 <tr><th scope="row">Category code: </th><td>[% categorycode |html %]</td></tr>
239 <tr><th scope="row">Description: </th><td>[% description |html %]</td></tr>
240 <tr><th scope="row">Enrollment period: </th>
242 [% IF ( enrolmentperiod ) %]
243 [% enrolmentperiod %] months
245 until [% enrolmentperioddate %]
249 <tr><th scope="row">Age required: </th><td>[% dateofbirthrequired %] years</td></tr>
250 <tr><th scope="row">Upperage limit: </th><td>[% upperagelimit %] years</td></tr>
251 <tr><th scope="row">Enrollment fee: </th><td>[% enrolmentfee %]</td></tr>
252 <tr><th scope="row">Receives overdue notices: </th><td>[% IF ( overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td></tr>
253 <tr><th scope="row">Lost items in staff client</th><td>[% IF ( hidelostitems ) %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
254 <tr><th scope="row">Hold fee: </th><td>[% reservefee %]</td></tr>
256 <fieldset class="action">[% IF ( totalgtzero ) %]
257 <input type="submit" value="OK" /></form>
259 <input type="hidden" name="op" value="delete_confirmed" />
260 <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>
261 [% END %]</fieldset></fieldset></form>
264 [% IF ( delete_confirmed ) %]
265 <h3>Category deleted</h3>
267 <form action="[% script_name %]" method="post">
268 <input type="submit" value="OK" />
274 <div id="toolbar" class="btn-toolbar">
275 <a class="btn btn-small" id="newcategory" href="/cgi-bin/koha/admin/categorie.pl?op=add_form"><i class="icon-plus"></i> New category</a>
278 <h2>Patron category administration</h2>
279 [% IF ( searchfield ) %]
280 You Searched for [% searchfield %]</span>
283 <div id="pagertable_categorie">
285 <table id="table_categorie">
288 <th scope="col">Code</th>
289 <th scope="col">Category name</th>
290 <th scope="col">Type</th>
291 <th scope="col">Enrollment period</th>
292 <th scope="col">Age required</th>
293 <th scope="col">Upper age limit</th>
294 <th scope="col">Enrollment fee</th>
295 <th scope="col">Overdue</th>
296 <th scope="col">Lost items</th>
297 <th scope="col">Hold fee</th>
298 [% IF ( EnhancedMessagingPreferences ) %]
299 <th scope="col">Messaging</th>
301 <th scope="col">Branches limitations</th>
302 <th scope="col"> </th>
303 <th scope="col"> </th>
307 [% FOREACH loo IN loop %]
309 <td>[% loo.categorycode |html %]</td>
311 <a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |uri %]">[% loo.description |html %]</a>
314 [% IF ( loo.type_A ) %]Adult[% END %]
315 [% IF ( loo.type_C ) %]Child[% END %]
316 [% IF ( loo.type_P ) %]Prof.[% END %]
317 [% IF ( loo.type_I ) %]Org.[% END %]
318 [% IF ( loo.type_S ) %]Staff[% END %]
319 [% IF ( loo.type_X ) %]Statistical[% END %]
322 [% IF ( loo.enrolmentperiod ) %]
323 [% loo.enrolmentperiod %] months
325 until [% loo.enrolmentperioddate %]
329 <td>[% loo.dateofbirthrequired %] years</td>
330 <td>[% loo.upperagelimit %] years</td>
331 <td>[% loo.enrolmentfee %]</td>
332 <td>[% IF ( loo.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
333 <td>[% IF ( loo.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
334 <td>[% loo.reservefee %]</td>
335 [% IF ( EnhancedMessagingPreferences ) %]
336 <td style="white-space: nowrap; font-size:80%;">
337 [% IF ( loo.messaging_prefs ) %]
338 [% FOREACH prefs IN loo.messaging_prefs %]
339 [% FOREACH transport IN prefs.transports %]
340 [% IF ( transport.transport ) %]
341 [% IF ( prefs.Item_Due ) %]Item due
342 [% ELSIF ( prefs.Advance_Notice ) %]Advance notice
343 [% ELSIF ( prefs.Upcoming_Events ) %]Upcoming events
344 [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
345 [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
346 [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
349 <strong>[% transport.transport %]</strong><br />
350 [% ELSE %]None<br />[% END %]
359 [% IF loo.branches.size > 0 %]
360 [% branches_str = "" %]
361 [% FOREACH branch IN loo.branches %]
362 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
364 <span title="[% branches_str %]">
365 [% IF loo.branches.size > 1 %]
366 [% loo.branches.size %] branches limitations
368 [% loo.branches.size %] branch limitation
375 <td><a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |uri %]">Edit</a></td>
376 <td><a href="[% loo.script_name %]?op=delete_confirm&categorycode=[% loo.categorycode |uri %]">Delete</a></td>
382 <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>
389 [% INCLUDE 'admin-menu.inc' %]
392 [% INCLUDE 'intranet-bottom.inc' %]