2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Administration › Patron categories › [% IF ( add_form ) %][% IF ( categorycode ) %]Modify category '[% categorycode |html %]'[% ELSE %]New category[% END %][% END %]
4 [% IF ( add_validate ) %]Data recorded[% END %]
5 [% IF ( delete_confirm ) %][% IF ( totalgtzero ) %]Cannot delete: category [% categorycode |html %] in use[% ELSE %]Confirm deletion of category '[% categorycode |html %]'[% END %][% END %]
6 [% IF ( delete_confirmed ) %]Category deleted[% END %]</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% INCLUDE 'calendar.inc' %]
9 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
10 [% INCLUDE 'datatables.inc' %]
11 <script type="text/javascript" id="js">
13 $(document).ready(function() {
14 $("#table_categorie").dataTable($.extend(true, {}, dataTablesDefaults, {
16 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
17 { "aTargets": [ 3,4,5 ], "sType": "natural" },
19 "aaSorting": [[ 1, "asc" ]],
20 "sPaginationType": "four_button"
23 $( "#enrolmentperioddate" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
25 if ( $("#branches option:selected").length < 1 ) {
26 $("#branches option:first").attr("selected", "selected");
29 function isNotNull(f,noalert) {
30 if (f.value.length ==0) {
36 function isNum(v,maybenull) {
37 var n = new Number(v.value);
41 if (maybenull==0 && v.value=='') {
46 // to check if the data are correctly entered.
49 var _alertString=_("Form not submitted because of the following problem(s)");
50 _alertString +="\n-------------------------------------------------------------------\n\n";
51 ff.categorycode.value = ff.categorycode.value.trim();
52 if (ff.categorycode.value.length==0) {
54 _alertString += _("- categorycode missing") + "\n";
57 var patt=/^[a-zA-Z0-9\-_]+$/g;
58 if ( !patt.test(ff.categorycode.value) ) {
60 _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n";
63 if (!(ff.category_type.value)){
65 _alertString += _("- category type missing") + "\n";
67 if (!(isNotNull(ff.description,1))) {
69 _alertString += _("- description missing") + "\n";
71 if (!isNum(ff.upperagelimit,0) && ff.category_type.value=='C') {
73 _alertString += _("- upperagelimit is not a number") + "\n";
76 if(!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) {
78 _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
80 if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){
81 document.getElementById('enrolmentmessage').className = "error";
85 if (ok) { // if there is a problem
94 <style type="text/css">#enrolmentmessage.hint { display : none; }</style>
96 <body id="admin_categorie" class="admin">
97 [% INCLUDE 'header.inc' %]
98 [% INCLUDE 'patrons-admin-search.inc' %]
100 <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 %]
101 [% IF ( add_validate ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › Data recorded[% END %]
102 [% 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 %]
103 [% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › Category deleted[% END %]
104 [% IF ( else ) %]Patron categories[% END %]</div>
106 <div id="doc3" class="yui-t2">
112 [% IF ( add_form ) %]
117 <form name="Aform" action="[% script_name %]" method="post">
118 <input type="hidden" name="op" value="add_validate" />
119 <input type="hidden" name="checked" value="0" />
120 [% IF ( categorycode ) %]
121 <h1>Modify category [% categorycode |html %]</h1>
123 <h1>New category</h1>
125 <fieldset class="rows">
126 <ol>[% IF ( categorycode ) %]
127 <li><span class="label">Category code: </span>[% categorycode |html %]
128 <input type="hidden" name="categorycode" value="[% categorycode |html %]" /><input type="hidden" name="is_a_modif" value="1" /></li>
130 <li><label for="categorycode" class="required">Category code: </label> <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" /></li>
132 <li><label for="description" class="required">Description: </label> <input type="text" name="description" id="description" size="40" maxlength="80" value="[% description |html %]" /></li>
133 <li><label for="enrolmentperiod" class="required">Enrollment period: </label>
135 <legend>Choose one</legend>
137 <li><label for="enrolmentperiod" style="width:6em;">In months: </label>
138 <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF ( enrolmentperiod ) %][% enrolmentperiod %][% END %]" /> months</li>
139 <li><label for="enrolmentperioddate" style="width:6em;">Until date: </label>
140 <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% enrolmentperioddate | $KohaDates %]" />
141 <div id="enrolmentmessage" class="hint" style="margin-left:0;">Cannot have "months" and "until date" at the same time</div>
146 <li><label for="dateofbirthrequired">Age required: </label> <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% dateofbirthrequired %]" size="3" maxlength="3" /> years</li>
147 <li><label for="upperagelimit">Upperage limit: </label> <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% upperagelimit %]" /> years</li>
148 <li><label for="enrolmentfee">Enrollment fee: </label><input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% enrolmentfee %]" /></li>
149 <li><label for="overduenoticerequired">Overdue notice required: </label> <select name="overduenoticerequired" id="overduenoticerequired">
150 [% IF ( overduenoticerequired ) %]
151 <option value="0">No</option>
152 <option value="1" selected="selected">Yes</option>
154 <option value="0" selected="selected">No</option>
155 <option value="1">Yes</option>
158 <li><label for="hidelostitems">Lost items in staff client: </label> <select name="hidelostitems" id="hidelostitems">
159 [% IF ( hidelostitems ) %]
160 <option value="0">Shown</option>
161 <option value="1" selected="selected">Hidden by default</option>
163 <option value="0" selected="selected">Shown</option>
164 <option value="1">Hidden by default</option>
167 <li><label for="reservefee">Hold fee: </label><input type="text" name="reservefee" id="reservefee" size="6" value="[% reservefee %]" /></li>
168 <li><label for="category_type" class="required">Category type: </label> <select name="category_type" id="category_type">
169 [% IF ( type_n ) %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
170 [% IF ( type_A ) %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
171 [% IF ( type_C ) %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
172 [% IF ( type_S ) %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
173 [% IF ( type_I ) %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
174 [% IF ( type_P ) %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
175 [% IF ( type_X ) %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
178 <li><label for="branches">Branches limitation: </label>
179 <select id="branches" name="branches" multiple size="10">
180 <option value="">All branches</option>
181 [% FOREACH branch IN branches_loop %]
182 [% IF ( branch.selected ) %]
183 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
185 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
189 <span>Select All if this category type must to be displayed all the time. Otherwise select librairies you want to associate with this value.
192 <li><label for="block_expired">Block expired patrons</label>
193 <select name="block_expired" id="block_expired">
194 [% IF ( BlockExpiredPatronOpacActions == -1 ) %]
195 <option value="-1" selected="selected"> Follow system preference BlockExpiredPatronOpacActions </option>
197 <option value="-1"> Follow system preference BlockExpiredPatronOpacActions </option>
200 [% IF ( BlockExpiredPatronOpacActions == 1 ) %]
201 <option value="1" selected="selected"> Block </option>
203 <option value="1"> Block </option>
206 [% IF ( BlockExpiredPatronOpacActions == 0 ) %]
207 <option value="0" selected="selected"> Don't block </option>
209 <option value="0"> Don't block </option>
212 Should patrons of this category be blocked from opac actions such as renew and reserve when their cards have expired.
217 [% IF ( EnhancedMessagingPreferences ) %]
218 <fieldset class="rows">
219 <h4>Default messaging preferences for this patron category</h4>
220 [% INCLUDE 'messaging-preference-form.inc' %]
223 <fieldset class="action"><input type="button" value="Save" onclick="Check(this.form);" /> </fieldset>
228 [% IF ( add_validate ) %]
229 <h3>Data recorded</h3>
230 <form action="[% script_name %]" method="post">
231 <input type="submit" value="OK" />
236 [% IF ( delete_confirm ) %]
238 <form action="[% script_name %]" method="post">
240 [% IF ( totalgtzero ) %]
241 Category [% categorycode |html %] is in use. Deletion not possible![% ELSE %]
242 Confirm deletion of category [% categorycode |html %][% END %]</legend>
244 [% IF ( totalgtzero ) %]<div class="dialog alert"><strong>This category is used [% total %] times</strong>. Deletion not possible</div>[% END %]
246 <tr><th scope="row">Category code: </th><td>[% categorycode |html %]</td></tr>
247 <tr><th scope="row">Description: </th><td>[% description |html %]</td></tr>
248 <tr><th scope="row">Enrollment period: </th>
250 [% IF ( enrolmentperiod ) %]
251 [% enrolmentperiod %] months
253 until [% enrolmentperioddate | $KohaDates %]
257 <tr><th scope="row">Age required: </th><td>[% dateofbirthrequired %] years</td></tr>
258 <tr><th scope="row">Upperage limit: </th><td>[% upperagelimit %] years</td></tr>
259 <tr><th scope="row">Enrollment fee: </th><td>[% enrolmentfee %]</td></tr>
260 <tr><th scope="row">Receives overdue notices: </th><td>[% IF ( overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td></tr>
261 <tr><th scope="row">Lost items in staff client</th><td>[% IF ( hidelostitems ) %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
262 <tr><th scope="row">Hold fee: </th><td>[% reservefee %]</td></tr>
264 <fieldset class="action">[% IF ( totalgtzero ) %]
265 <input type="submit" value="OK" /></form>
267 <input type="hidden" name="op" value="delete_confirmed" />
268 <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>
269 [% END %]</fieldset></fieldset></form>
272 [% IF ( delete_confirmed ) %]
273 <h3>Category deleted</h3>
275 <form action="[% script_name %]" method="post">
276 <input type="submit" value="OK" />
282 <div id="toolbar" class="btn-toolbar">
283 <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>
286 <h2>Patron category administration</h2>
287 [% IF ( searchfield ) %]
288 You Searched for [% searchfield %]</span>
291 <div id="pagertable_categorie">
293 <table id="table_categorie">
296 <th scope="col">Code</th>
297 <th scope="col">Category name</th>
298 <th scope="col">Type</th>
299 <th scope="col">Enrollment period</th>
300 <th scope="col">Age required</th>
301 <th scope="col">Upper age limit</th>
302 <th scope="col">Enrollment fee</th>
303 <th scope="col">Overdue</th>
304 <th scope="col">Lost items</th>
305 <th scope="col">Hold fee</th>
306 [% IF ( EnhancedMessagingPreferences ) %]
307 <th scope="col">Messaging</th>
309 <th scope="col">Branches limitations</th>
310 <th scope="col"> </th>
311 <th scope="col"> </th>
315 [% FOREACH loo IN loop %]
317 <td>[% loo.categorycode |html %]</td>
319 <a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |uri %]">[% loo.description |html %]</a>
322 [% IF ( loo.type_A ) %]Adult[% END %]
323 [% IF ( loo.type_C ) %]Child[% END %]
324 [% IF ( loo.type_P ) %]Prof.[% END %]
325 [% IF ( loo.type_I ) %]Org.[% END %]
326 [% IF ( loo.type_S ) %]Staff[% END %]
327 [% IF ( loo.type_X ) %]Statistical[% END %]
330 [% IF ( loo.enrolmentperiod ) %]
331 [% loo.enrolmentperiod %] months
333 until [% loo.enrolmentperioddate | $KohaDates %]
337 <td>[% loo.dateofbirthrequired %] years</td>
338 <td>[% loo.upperagelimit %] years</td>
339 <td>[% loo.enrolmentfee %]</td>
340 <td>[% IF ( loo.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
341 <td>[% IF ( loo.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
342 <td>[% loo.reservefee %]</td>
343 [% IF ( EnhancedMessagingPreferences ) %]
344 <td style="white-space: nowrap; font-size:80%;">
345 [% IF ( loo.messaging_prefs ) %]
346 [% FOREACH prefs IN loo.messaging_prefs %]
347 [% FOREACH transport IN prefs.transports %]
348 [% IF ( transport.transport ) %]
349 [% IF ( prefs.Item_Due ) %]Item due
350 [% ELSIF ( prefs.Advance_Notice ) %]Advance notice
351 [% ELSIF ( prefs.Upcoming_Events ) %]Upcoming events
352 [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
353 [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
354 [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
357 <strong>[% transport.transport %]</strong><br />
358 [% ELSE %]None<br />[% END %]
367 [% IF loo.branches.size > 0 %]
368 [% branches_str = "" %]
369 [% FOREACH branch IN loo.branches %]
370 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
372 <span title="[% branches_str %]">
373 [% IF loo.branches.size > 1 %]
374 [% loo.branches.size %] branches limitations
376 [% loo.branches.size %] branch limitation
383 <td><a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |uri %]">Edit</a></td>
384 <td><a href="[% loo.script_name %]?op=delete_confirm&categorycode=[% loo.categorycode |uri %]">Delete</a></td>
390 <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>
397 [% INCLUDE 'admin-menu.inc' %]
400 [% INCLUDE 'intranet-bottom.inc' %]