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 if (ff.categorycode.value.length==0) {
58 _alertString += _("- categorycode missing") + "\n";
60 if (!(ff.category_type.value)){
62 _alertString += _("- category type missing") + "\n";
64 if (!(isNotNull(ff.description,1))) {
66 _alertString += _("- description missing") + "\n";
68 if (!isNum(ff.upperagelimit,0) && ff.category_type.value=='C') {
70 _alertString += _("- upperagelimit is not a number") + "\n";
73 if(!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) {
75 _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
77 if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){
78 document.getElementById('enrolmentmessage').className = "error";
82 if (ok) { // if there is a problem
91 <style type="text/css">#enrolmentmessage.hint { display : none; }</style>
93 <body id="admin_categorie" class="admin">
94 [% INCLUDE 'header.inc' %]
95 [% INCLUDE 'patrons-admin-search.inc' %]
97 <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 %]
98 [% IF ( add_validate ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › Data recorded[% END %]
99 [% 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 %]
100 [% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › Category deleted[% END %]
101 [% IF ( else ) %]Patron categories[% END %]</div>
103 <div id="doc3" class="yui-t2">
109 [% IF ( add_form ) %]
114 <form name="Aform" action="[% script_name %]" method="post">
115 <input type="hidden" name="op" value="add_validate" />
116 <input type="hidden" name="checked" value="0" />
117 [% IF ( categorycode ) %]
118 <h1>Modify category [% categorycode |html %]</h1>
120 <h1>New category</h1>
122 <fieldset class="rows">
123 <ol>[% IF ( categorycode ) %]
124 <li><span class="label">Category code</span>[% categorycode |html %]
125 <input type="hidden" name="categorycode" value="[% categorycode |html %]" /><input type="hidden" name="is_a_modif" value="1" /></li>
127 <li><label for="categorycode">Category code: </label> <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" /></li>
129 <li><label for="description">Description: </label> <input type="text" name="description" id="description" size="40" maxlength="80" value="[% description |html %]" /></li>
130 <li><label for="enrolmentperiod">Enrollment period: </label>
132 <legend>Choose one</legend>
134 <li><label for="enrolmentperiod" style="width:6em;">In months: </label>
135 <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF ( enrolmentperiod ) %][% enrolmentperiod %][% END %]" /> months</li>
136 <li><label for="enrolmentperioddate" style="width:6em;">Until date: </label>
137 <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% enrolmentperioddate %]" />
138 <div id="enrolmentmessage" class="hint" style="margin-left:0;">Cannot have "months" and "until date" at the same time</div>
143 <li><label for="dateofbirthrequired">Age required: </label> <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% dateofbirthrequired %]" size="3" maxlength="3" /> years</li>
144 <li><label for="upperagelimit">Upperage limit: </label> <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% upperagelimit %]" /> years</li>
145 <li><label for="enrolmentfee">Enrollment fee: </label><input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% enrolmentfee %]" /></li>
146 <li><label for="overduenoticerequired">Overdue notice required: </label> <select name="overduenoticerequired" id="overduenoticerequired">
147 [% IF ( overduenoticerequired ) %]
148 <option value="0">No</option>
149 <option value="1" selected="selected">Yes</option>
151 <option value="0" selected="selected">No</option>
152 <option value="1">Yes</option>
155 <li><label for="hidelostitems">Lost items in staff client</label> <select name="hidelostitems" id="hidelostitems">
156 [% IF ( hidelostitems ) %]
157 <option value="0">Shown</option>
158 <option value="1" selected="selected">Hidden by default</option>
160 <option value="0" selected="selected">Shown</option>
161 <option value="1">Hidden by default</option>
164 <li><label for="reservefee">Hold fee: </label><input type="text" name="reservefee" id="reservefee" size="6" value="[% reservefee %]" /></li>
165 <li><label for="category_type">Category type: </label> <select name="category_type" id="category_type">
166 [% IF ( type_n ) %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
167 [% IF ( type_A ) %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
168 [% IF ( type_C ) %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
169 [% IF ( type_S ) %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
170 [% IF ( type_I ) %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
171 [% IF ( type_P ) %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
172 [% IF ( type_X ) %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
177 [% IF ( EnhancedMessagingPreferences ) %]
178 <fieldset class="rows">
179 <h4>Default messaging preferences for this patron category</h4>
180 [% INCLUDE 'messaging-preference-form.inc' %]
183 <fieldset class="action"><input type="button" value="Save" onclick="Check(this.form);" /> </fieldset>
188 [% IF ( add_validate ) %]
189 <h3>Data recorded</h3>
190 <form action="[% script_name %]" method="post">
191 <input type="submit" value="OK" />
196 [% IF ( delete_confirm ) %]
198 <form action="[% script_name %]" method="post">
200 [% IF ( totalgtzero ) %]
201 Category [% categorycode |html %] is in use. Deletion not possible![% ELSE %]
202 Confirm deletion of category [% categorycode |html %][% END %]</legend>
204 [% IF ( totalgtzero ) %]<div class="dialog alert"><strong>This category is used [% total %] times</strong>. Deletion not possible</div>[% END %]
206 <tr><th scope="row">Category code: </th><td>[% categorycode |html %]</td></tr>
207 <tr><th scope="row">Description: </th><td>[% description |html %]</td></tr>
208 <tr><th scope="row">Enrollment period: </th>
210 [% IF ( enrolmentperiod ) %]
211 [% enrolmentperiod %] months
213 until [% enrolmentperioddate %]
217 <tr><th scope="row">Age required: </th><td>[% dateofbirthrequired %] years</td></tr>
218 <tr><th scope="row">Upperage limit: </th><td>[% upperagelimit %] years</td></tr>
219 <tr><th scope="row">Enrollment fee: </th><td>[% enrolmentfee %]</td></tr>
220 <tr><th scope="row">Receives overdue notices: </th><td>[% IF ( overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td></tr>
221 <tr><th scope="row">Lost items in staff client</th><td>[% IF ( hidelostitems ) %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
222 <tr><th scope="row">Hold fee: </th><td>[% reservefee %]</td></tr>
224 <fieldset class="action">[% IF ( totalgtzero ) %]
225 <input type="submit" value="OK" /></form>
227 <input type="hidden" name="op" value="delete_confirmed" />
228 <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>
229 [% END %]</fieldset></fieldset></form>
232 [% IF ( delete_confirmed ) %]
233 <h3>Category deleted</h3>
235 <form action="[% script_name %]" method="post">
236 <input type="submit" value="OK" />
243 <script type="text/javascript">
246 // prepare DOM for YUI Toolbar
248 $(document).ready(function() {
252 // YUI Toolbar Functions
254 function yuiToolbar() {
255 new YAHOO.widget.Button("newcategory");
261 <li><a id="newcategory" href="/cgi-bin/koha/admin/categorie.pl?op=add_form">New category</a></li>
264 <h2>Patron category administration</h2>
265 [% IF ( searchfield ) %]
266 You Searched for [% searchfield %]</span>
269 <div id="pagertable_categorie">
270 [% INCLUDE 'table-pager.inc' perpage='20' %]
272 <table id="table_categorie">
274 <th scope="col">Code</th>
275 <th scope="col">Category name</th>
276 <th scope="col">Type</th>
277 <th scope="col">Enrollment period</th>
278 <th scope="col">Age required</th>
279 <th scope="col">Upper age limit</th>
280 <th scope="col">Enrollment fee</th>
281 <th scope="col">Overdue</th>
282 <th scope="col">Lost items</th>
283 <th scope="col">Hold fee</th>
284 [% IF ( EnhancedMessagingPreferences ) %]
285 <th scope="col">Messaging</th>
287 <th scope="col" colspan="2"> </th>
289 [% FOREACH loo IN loop %]
291 <td>[% loo.categorycode |html %]</td>
293 <a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |url %]">[% loo.description |html %]</a>
296 [% IF ( loo.type_A ) %]Adult[% END %]
297 [% IF ( loo.type_C ) %]Child[% END %]
298 [% IF ( loo.type_P ) %]Prof.[% END %]
299 [% IF ( loo.type_I ) %]Org.[% END %]
300 [% IF ( loo.type_S ) %]Staff[% END %]
301 [% IF ( loo.type_X ) %]Statistical[% END %]
304 [% IF ( loo.enrolmentperiod ) %]
305 [% loo.enrolmentperiod %] months
307 until [% loo.enrolmentperioddate %]
311 <td>[% loo.dateofbirthrequired %] years</td>
312 <td>[% loo.upperagelimit %] years</td>
313 <td>[% loo.enrolmentfee %]</td>
314 <td>[% IF ( loo.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
315 <td>[% IF ( loo.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
316 <td>[% loo.reservefee %]</td>
317 [% IF ( EnhancedMessagingPreferences ) %]
318 <td style="white-space: nowrap; font-size:80%;">
319 [% IF ( loo.messaging_prefs ) %]
320 [% FOREACH prefs IN loo.messaging_prefs %]
321 [% FOREACH transport IN prefs.transports %]
322 [% IF ( transport.transport ) %]
323 [% IF ( prefs.Item_Due ) %]Item due
324 [% ELSIF ( prefs.Advance_Notice ) %]Advance notice
325 [% ELSIF ( prefs.Upcoming_Events ) %]Upcoming events
326 [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
327 [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
328 [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
331 <strong>[% transport.transport %]</strong><br />
332 [% ELSE %]None<br />[% END %]
340 <td><a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |url %]">Edit</a></td>
341 <td><a href="[% loo.script_name %]?op=delete_confirm&categorycode=[% loo.categorycode |url %]">Delete</a></td>
346 <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>
353 [% INCLUDE 'admin-menu.inc' %]
356 [% INCLUDE 'intranet-bottom.inc' %]