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 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
10 [% INCLUDE 'datatables-strings.inc' %]
11 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
12 <script type="text/javascript" id="js">
14 $(document).ready(function() {
15 $("#table_categorie").dataTable($.extend(true, {}, dataTablesDefaults, {
17 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
18 { "aTargets": [ 3,4,5 ], "sType": "natural" },
20 "aaSorting": [[ 1, "asc" ]],
21 "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
23 "sPaginationType": "four_button"
26 $( "#enrolmentperioddate" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
28 if ( $("#branches option:selected").length < 1 ) {
29 $("#branches option:first").attr("selected", "selected");
32 function isNotNull(f,noalert) {
33 if (f.value.length ==0) {
40 var x=f.value.toUpperCase();
45 function isNum(v,maybenull) {
46 var n = new Number(v.value);
50 if (maybenull==0 && v.value=='') {
57 var t = Date.parse(f.value);
62 // to check if the data are correctly entered.
65 var _alertString=_("Form not submitted because of the following problem(s)");
66 _alertString +="\n-------------------------------------------------------------------\n\n";
67 ff.categorycode.value = ff.categorycode.value.trim();
68 if (ff.categorycode.value.length==0) {
70 _alertString += _("- categorycode missing") + "\n";
73 var patt=/^[a-zA-Z0-9\-_]+$/g;
74 if ( !patt.test(ff.categorycode.value) ) {
76 _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n";
79 if (!(ff.category_type.value)){
81 _alertString += _("- category type missing") + "\n";
83 if (!(isNotNull(ff.description,1))) {
85 _alertString += _("- description missing") + "\n";
87 if (!isNum(ff.upperagelimit,0) && ff.category_type.value=='C') {
89 _alertString += _("- upperagelimit is not a number") + "\n";
92 if(!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) {
94 _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
96 if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){
97 document.getElementById('enrolmentmessage').className = "error";
101 if (ok) { // if there is a problem
110 <style type="text/css">#enrolmentmessage.hint { display : none; }</style>
112 <body id="admin_categorie" class="admin">
113 [% INCLUDE 'header.inc' %]
114 [% INCLUDE 'patrons-admin-search.inc' %]
116 <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 %]
117 [% IF ( add_validate ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › Data recorded[% END %]
118 [% 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 %]
119 [% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › Category deleted[% END %]
120 [% IF ( else ) %]Patron categories[% END %]</div>
122 <div id="doc3" class="yui-t2">
128 [% IF ( add_form ) %]
133 <form name="Aform" action="[% script_name %]" method="post">
134 <input type="hidden" name="op" value="add_validate" />
135 <input type="hidden" name="checked" value="0" />
136 [% IF ( categorycode ) %]
137 <h1>Modify category [% categorycode |html %]</h1>
139 <h1>New category</h1>
141 <fieldset class="rows">
142 <ol>[% IF ( categorycode ) %]
143 <li><span class="label">Category code</span>[% categorycode |html %]
144 <input type="hidden" name="categorycode" value="[% categorycode |html %]" /><input type="hidden" name="is_a_modif" value="1" /></li>
146 <li><label for="categorycode">Category code: </label> <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" /></li>
148 <li><label for="description">Description: </label> <input type="text" name="description" id="description" size="40" maxlength="80" value="[% description |html %]" /></li>
149 <li><label for="enrolmentperiod">Enrollment period: </label>
151 <legend>Choose one</legend>
153 <li><label for="enrolmentperiod" style="width:6em;">In months: </label>
154 <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF ( enrolmentperiod ) %][% enrolmentperiod %][% END %]" /> months</li>
155 <li><label for="enrolmentperioddate" style="width:6em;">Until date: </label>
156 <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% enrolmentperioddate %]" />
157 <div id="enrolmentmessage" class="hint" style="margin-left:0;">Cannot have "months" and "until date" at the same time</div>
162 <li><label for="dateofbirthrequired">Age required: </label> <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% dateofbirthrequired %]" size="3" maxlength="3" /> years</li>
163 <li><label for="upperagelimit">Upperage limit: </label> <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% upperagelimit %]" /> years</li>
164 <li><label for="enrolmentfee">Enrollment fee: </label><input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% enrolmentfee %]" /></li>
165 <li><label for="overduenoticerequired">Overdue notice required: </label> <select name="overduenoticerequired" id="overduenoticerequired">
166 [% IF ( overduenoticerequired ) %]
167 <option value="0">No</option>
168 <option value="1" selected="selected">Yes</option>
170 <option value="0" selected="selected">No</option>
171 <option value="1">Yes</option>
174 <li><label for="hidelostitems">Lost items in staff client</label> <select name="hidelostitems" id="hidelostitems">
175 [% IF ( hidelostitems ) %]
176 <option value="0">Shown</option>
177 <option value="1" selected="selected">Hidden by default</option>
179 <option value="0" selected="selected">Shown</option>
180 <option value="1">Hidden by default</option>
183 <li><label for="reservefee">Hold fee: </label><input type="text" name="reservefee" id="reservefee" size="6" value="[% reservefee %]" /></li>
184 <li><label for="category_type">Category type: </label> <select name="category_type" id="category_type">
185 [% IF ( type_n ) %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
186 [% IF ( type_A ) %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
187 [% IF ( type_C ) %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
188 [% IF ( type_S ) %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
189 [% IF ( type_I ) %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
190 [% IF ( type_P ) %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
191 [% IF ( type_X ) %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
194 <li><label for="branches">Branches limitation: </label>
195 <select id="branches" name="branches" multiple size="10">
196 <option value="">All branches</option>
197 [% FOREACH branch IN branches_loop %]
198 [% IF ( branch.selected ) %]
199 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
201 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
205 <span>Select All if this category type must to be displayed all the time. Otherwise select librairies you want to associate with this value.
211 [% IF ( EnhancedMessagingPreferences ) %]
212 <fieldset class="rows">
213 <h4>Default messaging preferences for this patron category</h4>
214 [% INCLUDE 'messaging-preference-form.inc' %]
217 <fieldset class="action"><input type="button" value="Save" onclick="Check(this.form);" /> </fieldset>
222 [% IF ( add_validate ) %]
223 <h3>Data recorded</h3>
224 <form action="[% script_name %]" method="post">
225 <input type="submit" value="OK" />
230 [% IF ( delete_confirm ) %]
232 <form action="[% script_name %]" method="post">
234 [% IF ( totalgtzero ) %]
235 Category [% categorycode |html %] is in use. Deletion not possible![% ELSE %]
236 Confirm deletion of category [% categorycode |html %][% END %]</legend>
238 [% IF ( totalgtzero ) %]<div class="dialog alert"><strong>This category is used [% total %] times</strong>. Deletion not possible</div>[% END %]
240 <tr><th scope="row">Category code: </th><td>[% categorycode |html %]</td></tr>
241 <tr><th scope="row">Description: </th><td>[% description |html %]</td></tr>
242 <tr><th scope="row">Enrollment period: </th>
244 [% IF ( enrolmentperiod ) %]
245 [% enrolmentperiod %] months
247 until [% enrolmentperioddate %]
251 <tr><th scope="row">Age required: </th><td>[% dateofbirthrequired %] years</td></tr>
252 <tr><th scope="row">Upperage limit: </th><td>[% upperagelimit %] years</td></tr>
253 <tr><th scope="row">Enrollment fee: </th><td>[% enrolmentfee %]</td></tr>
254 <tr><th scope="row">Receives overdue notices: </th><td>[% IF ( overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td></tr>
255 <tr><th scope="row">Lost items in staff client</th><td>[% IF ( hidelostitems ) %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
256 <tr><th scope="row">Hold fee: </th><td>[% reservefee %]</td></tr>
258 <fieldset class="action">[% IF ( totalgtzero ) %]
259 <input type="submit" value="OK" /></form>
261 <input type="hidden" name="op" value="delete_confirmed" />
262 <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>
263 [% END %]</fieldset></fieldset></form>
266 [% IF ( delete_confirmed ) %]
267 <h3>Category deleted</h3>
269 <form action="[% script_name %]" method="post">
270 <input type="submit" value="OK" />
276 <div id="toolbar" class="btn-toolbar">
277 <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>
280 <h2>Patron category administration</h2>
281 [% IF ( searchfield ) %]
282 You Searched for [% searchfield %]</span>
285 <div id="pagertable_categorie">
287 <table id="table_categorie">
290 <th scope="col">Code</th>
291 <th scope="col">Category name</th>
292 <th scope="col">Type</th>
293 <th scope="col">Enrollment period</th>
294 <th scope="col">Age required</th>
295 <th scope="col">Upper age limit</th>
296 <th scope="col">Enrollment fee</th>
297 <th scope="col">Overdue</th>
298 <th scope="col">Lost items</th>
299 <th scope="col">Hold fee</th>
300 [% IF ( EnhancedMessagingPreferences ) %]
301 <th scope="col">Messaging</th>
303 <th scope="col">Branches limitations</th>
304 <th scope="col"> </th>
305 <th scope="col"> </th>
309 [% FOREACH loo IN loop %]
311 <td>[% loo.categorycode |html %]</td>
313 <a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |uri %]">[% loo.description |html %]</a>
316 [% IF ( loo.type_A ) %]Adult[% END %]
317 [% IF ( loo.type_C ) %]Child[% END %]
318 [% IF ( loo.type_P ) %]Prof.[% END %]
319 [% IF ( loo.type_I ) %]Org.[% END %]
320 [% IF ( loo.type_S ) %]Staff[% END %]
321 [% IF ( loo.type_X ) %]Statistical[% END %]
324 [% IF ( loo.enrolmentperiod ) %]
325 [% loo.enrolmentperiod %] months
327 until [% loo.enrolmentperioddate %]
331 <td>[% loo.dateofbirthrequired %] years</td>
332 <td>[% loo.upperagelimit %] years</td>
333 <td>[% loo.enrolmentfee %]</td>
334 <td>[% IF ( loo.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
335 <td>[% IF ( loo.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
336 <td>[% loo.reservefee %]</td>
337 [% IF ( EnhancedMessagingPreferences ) %]
338 <td style="white-space: nowrap; font-size:80%;">
339 [% IF ( loo.messaging_prefs ) %]
340 [% FOREACH prefs IN loo.messaging_prefs %]
341 [% FOREACH transport IN prefs.transports %]
342 [% IF ( transport.transport ) %]
343 [% IF ( prefs.Item_Due ) %]Item due
344 [% ELSIF ( prefs.Advance_Notice ) %]Advance notice
345 [% ELSIF ( prefs.Upcoming_Events ) %]Upcoming events
346 [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
347 [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
348 [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
351 <strong>[% transport.transport %]</strong><br />
352 [% ELSE %]None<br />[% END %]
361 [% IF loo.branches.size > 0 %]
362 [% branches_str = "" %]
363 [% FOREACH branch IN loo.branches %]
364 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
366 <span title="[% branches_str %]">
367 [% IF loo.branches.size > 1 %]
368 [% loo.branches.size %] branches limitations
370 [% loo.branches.size %] branch limitation
377 <td><a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |uri %]">Edit</a></td>
378 <td><a href="[% loo.script_name %]?op=delete_confirm&categorycode=[% loo.categorycode |uri %]">Delete</a></td>
384 <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>
391 [% INCLUDE 'admin-menu.inc' %]
394 [% INCLUDE 'intranet-bottom.inc' %]