1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Administration › Circulation and fine rules</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <script type="text/javascript">
9 var cancel = confirm(_("Are you sure you want to cancel your changes?"));
10 if ( !cancel ) return;
11 $('#default-circulation-rules td').removeClass('highlighted-row');
12 var edit_row = $("#edit_row");
13 $(edit_row).find("input").each(function(){
14 var type = $(this).attr("type");
15 if (type != "button" && type != "submit" ) {
17 $(this).removeAttr("disabled");
19 if ( type == "checkbox" ) {
20 $(this).attr('checked', false);
23 $(edit_row).find("select").removeAttr("disabled");
24 $(edit_row).find("select option:first").attr("selected", "selected");
25 $(edit_row).find("td:last input[name='clear']").remove();
28 $(document).ready(function() {
29 $('#cap_fine_to_replacement_price').on('change', function(){
30 $('#overduefinescap').prop('disabled', $(this).is(':checked') );
32 $('#selectlibrary').find("input:submit").hide();
33 $('#branch').change(function() {
34 $('#selectlibrary').submit();
36 $(".editrule").click(function(){
37 if ( $(edit_row).find("input[type='text'][value!='']").length > 0 ) {
38 var edit = confirm(_("Are you sure you want to edit another rule?"));
39 if (!edit) return false;
41 $('#default-circulation-rules td').removeClass('highlighted-row');
42 $(this).parent().parent().find("td").each(function (i) {
43 $(this).addClass('highlighted-row');
45 itm = itm.replace(/^\s*|\s*$/g,'');
46 var current_column = $("#edit_row td:eq("+i+")");
48 // specific processing for the Hard due date column
49 var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
51 if (typeof select_value === 'undefined'){
54 input_value = itm.split(' ')[1];
56 $(current_column).find("input[type='text']").val(input_value);
57 $(current_column).find("select").val(select_value);
58 } else if ( i == 12 ) {
59 // specific processing for cap_fine_to_replacement_price
60 var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
61 $('#cap_fine_to_replacement_price').attr('checked', cap_fine_to_replacement_price.is(':checked') );
62 $('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') );
64 $(current_column).find("input[type='text']").val(itm);
65 // select the corresponding option
66 $(current_column).find("select option").each(function(){
67 opt = $(this).text().toLowerCase();
68 opt = opt.replace(/^\s*|\s*$/g,'');
69 if ( opt == itm.toLowerCase() ) {
70 $(this).attr('selected', 'selected');
73 if ( i == 0 || i == 1 ) {
74 // Disable the 2 first columns, we cannot update them.
75 var val = $(current_column).find("select option:selected").val();
76 var name = "categorycode";
80 // Remove potential previous input added
81 $(current_column).find("input").remove();
82 $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
83 } else if ( i == 2 || i == 3 ) {
84 // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed"
85 // The value is "Unlimited" (or an equivalent translated string)
86 // an it should be set to an empty string
87 if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
88 $(current_column).find("input[type='text']").val("");
93 $("#default-circulation-rules tr:last td:eq(0) select").attr('disabled', 'disabled');
94 $("#default-circulation-rules tr:last td:eq(1) select").attr('disabled', 'disabled');
101 <body id="admin_smart-rules" class="admin">
102 [% INCLUDE 'header.inc' %]
103 [% INCLUDE 'cat-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> › Circulation and fine rules</div>
107 <div id="doc3" class="yui-t1">
112 <h1 class="parameters">
113 [% IF ( humanbranch ) %]
114 Defining circulation and fine rules for "[% humanbranch %]"
116 Defining circulation and fine rules for all libraries
120 <p>The rules are applied from most specific to less specific, using the first found in this order:</p>
122 <li>same library, same patron type, same item type</li>
123 <li>same library, same patron type, all item types</li>
124 <li>same library, all patron types, same item type</li>
125 <li>same library, all patron types, all item types</li>
126 <li>default (all libraries), same patron type, same item type</li>
127 <li>default (all libraries), same patron type, all item types</li>
128 <li>default (all libraries), all patron types, same item type</li>
129 <li>default (all libraries), all patron types, all item types</li>
131 <p>To modify a rule, create a new one with the same patron type and item type.</p>
134 <form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary">
136 <select name="branch" id="branch" style="width:20em;">
137 <option value="*">All libraries</option>
138 [% FOREACH branchloo IN branchloop %]
139 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
143 [% IF ( definedbranch ) %]<form action="/cgi-bin/koha/admin/clone-rules.pl" method="post"><label
144 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidden" name="frombranch" value="[% current_branch %]" />
145 <select name="tobranch" id="tobranch">[% FOREACH branchloo IN branchloop %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]</select> <input type="submit" value="Clone" /></form>[% END %]
147 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
148 <input type="hidden" name="op" value="add" />
149 <input type="hidden" name="branch" value="[% current_branch %]"/>
150 <table id="default-circulation-rules">
153 <th>Patron category</th>
155 <th>Current checkouts allowed</th>
156 <th>Current on-site checkouts allowed</th>
159 <th>Hard due date</th>
161 <th>Fine charging interval</th>
162 <th>When to charge</th>
163 <th>Fine grace period</th>
164 <th>Overdue fines cap (amount)</th>
165 <th>Cap fine at replacement price</th>
166 <th>Suspension in days (day)</th>
167 <th>Max. suspension duration (day)</th>
168 <th>Renewals allowed (count)</th>
169 <th>Renewal period</th>
170 <th>No renewal before</th>
171 <th>Automatic renewal</th>
172 <th>Holds allowed (count)</th>
173 <th>On shelf holds allowed</th>
174 <th>Item level holds</th>
175 <th>Rental discount (%)</th>
176 <th colspan="2"> </th>
180 [% FOREACH rule IN rules %]
181 <tr id="row_[% loop.count %]">
182 <td>[% IF ( rule.default_humancategorycode ) %]
185 [% rule.humancategorycode %]
188 <td>[% IF ( rule.default_humanitemtype ) %]
191 [% rule.translated_description %]
194 <td>[% IF ( rule.unlimited_maxissueqty ) %]
197 [% rule.maxissueqty %]
200 <td>[% IF rule.unlimited_maxonsiteissueqty %]
203 [% rule.maxonsiteissueqty %]
206 <td>[% rule.issuelength %]</td>
208 [% rule.lengthunit %]
211 [% IF ( rule.hardduedate ) %]
212 [% IF ( rule.hardduedatebefore ) %]
213 before [% rule.hardduedate %]
214 <input type="hidden" name="hardduedatecomparebackup" value="-1" />
215 [% ELSIF ( rule.hardduedateexact ) %]
216 on [% rule.hardduedate %]
217 <input type="hidden" name="hardduedatecomparebackup" value="0" />
218 [% ELSIF ( rule.hardduedateafter ) %]
219 after [% rule.hardduedate %]
220 <input type="hidden" name="hardduedatecomparebackup" value="1" />
226 <td>[% rule.fine %]</td>
227 <td>[% rule.chargeperiod %]</td>
228 <td>[% IF rule.chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]</td>
229 <td>[% rule.firstremind %]</td>
230 <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
232 [% IF rule.cap_fine_to_replacement_price %]
233 <input type="checkbox" checked="checked" disabled="disabled" />
235 <input type="checkbox" disabled="disabled" />
238 <td>[% rule.finedays %]</td>
239 <td>[% rule.maxsuspensiondays %]</td>
240 <td>[% rule.renewalsallowed %]</td>
241 <td>[% rule.renewalperiod %]</td>
242 <td>[% rule.norenewalbefore %]</td>
244 [% IF ( rule.auto_renew ) %]
250 <td>[% rule.reservesallowed %]</td>
251 <td>[% IF rule.onshelfholds %]Yes[% ELSE %]No[% END %]</td>
252 <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
253 <td>[% rule.rentaldiscount %]</td>
254 <td><a href="#" class="editrule">Edit</a></td>
256 <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% rule.itemtype %]&categorycode=[% rule.categorycode %]&branch=[% rule.current_branch %]">Delete</a>
262 <select name="categorycode" id="categorycode">
263 <option value="*">All</option>
264 [% FOREACH categoryloo IN categoryloop %]
265 <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
270 <select name="itemtype" id="matrixitemtype" style="width:13em;">
271 <option value="*">All</option>
272 [% FOREACH itemtypeloo IN itemtypeloop %]
273 <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option>
277 <td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td>
278 <td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td>
279 <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
281 <select name="lengthunit" id="lengthunit">
282 <option value="days" selected="selected">Days</option>
283 <option value="hours">Hours</option>
287 <select name="hardduedatecompare" id="hardduedatecompare">
288 <option value="-1">Before</option>
289 <option value="0">Exactly on</option>
290 <option value="1">After</option>
292 <input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate %]" class="datepicker" />
293 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
295 <td><input type="text" name="fine" id="fine" size="4" /></td>
296 <td><input type="text" name="chargeperiod" id="chargeperiod" size="2" /></td>
298 <select name="chargeperiod_charge_at" id="chargeperiod_charge_at">
299 <option value="0">End of interval</option>
300 <option value="1">Start of interval</option>
303 <td><input type="text" name="firstremind" id="firstremind" size="2" /> </td>
304 <td><input type="text" name="overduefinescap" id="overduefinescap" size="6" /> </td>
305 <td><input type="checkbox" name="cap_fine_to_replacement_price" id="cap_fine_to_replacement_price" /></td>
306 <td><input type="text" name="finedays" id="fined" size="3" /> </td>
307 <td><input type="text" name="maxsuspensiondays" id="maxsuspensiondays" size="3" /> </td>
308 <td><input type="text" name="renewalsallowed" id="renewalsallowed" size="2" /></td>
309 <td><input type="text" name="renewalperiod" id="renewalperiod" size="3" /></td>
310 <td><input type="text" name="norenewalbefore" id="norenewalbefore" size="3" /></td>
312 <select name="auto_renew" id="auto_renew">
313 <option value="no" selected>No</option>
314 <option value="yes">Yes</option>
317 <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
319 <select name="onshelfholds" id="onshelfholds">
320 <option value="0" selected>No</option>
321 <option value="1">Yes</option>
325 <select id="opacitemholds" name="opacitemholds">
326 <option value="N">Don't allow</option>
327 <option value="Y">Allow</option>
328 <option value="F">Force</option>
331 <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
333 <input type="hidden" name="branch" value="[% current_branch %]"/>
334 <input type="submit" value="Save" class="submit" />
335 <input type="button" name="cancel" value="Clear" onclick="clear_edit();return false;" />
340 <th>Patron category</th>
342 <th>Current checkouts allowed</th>
343 <th>Current on-site checkouts allowed</th>
346 <th>Hard due date</th>
348 <th>Fine charging interval</th>
349 <th>Charge when?</th>
350 <th>Fine grace period</th>
351 <th>Overdue fines cap (amount)</th>
352 <th>Cap fine at replacement price</th>
353 <th>Suspension in days (day)</th>
354 <th>Max. suspension duration (day)</th>
355 <th>Renewals allowed (count)</th>
356 <th>Renewal period</th>
357 <th>No renewal before</th>
358 <th>Automatic renewal</th>
359 <th>Holds allowed (count)</th>
360 <th>On shelf holds allowed</th>
361 <th>Item level holds</th>
362 <th>Rental discount (%)</th>
363 <th colspan="2"> </th>
370 <div id="defaults-for-this-library" class="container">
371 <h3>Default checkout, hold and return policy[% IF ( humanbranch ) %] for [% humanbranch %][% END %]</h3>
372 <p>You can set a default maximum number of checkouts, hold policy and return policy that will be used if none is defined below for a particular item type or category.</p>
373 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
374 <input type="hidden" name="op" value="set-branch-defaults" />
375 <input type="hidden" name="branch" value="[% current_branch %]"/>
379 <th>Total current checkouts allowed</th>
380 <th>Total current on-site checkouts allowed</th>
382 <th>Return policy</th>
387 <td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td>
388 <td><input type="text" name="maxissueqty" size="3" value="[% default_maxissueqty %]"/></td>
389 <td><input type="text" name="maxonsiteissueqty" size="3" value="[% default_maxonsiteissueqty %]"/></td>
391 <select name="holdallowed">
392 [% IF ( default_holdallowed_any ) %]
393 <option value="2" selected="selected">
399 [% IF ( default_holdallowed_same ) %]
400 <option value="1" selected="selected">
406 [% IF ( default_holdallowed_none ) %]
407 <option value="0" selected="selected">
416 <select name="returnbranch">
417 [% IF ( default_returnbranch == 'homebranch' ) %]
418 <option value="homebranch" selected="selected">
420 <option value="homebranch">
424 [% IF ( default_returnbranch == 'holdingbranch' ) %]
425 <option value="holdingbranch" selected="selected">
427 <option value="holdingbranch">
429 Item returns to issuing library
431 [% IF ( default_returnbranch == 'noreturn' ) %]
432 <option value="noreturn" selected="selected">
434 <option value="noreturn">
440 <td><input type="submit" value="Save" class="submit" /></td>
442 <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=*&branch=[% current_branch %]">Unset</a>
448 [% IF ( show_branch_cat_rule_form ) %]
449 <div id="holds-policy-by-patron-category" class="container">
450 <h3>[% IF humanbranch %]Checkout limit by patron category for [% humanbranch %][% ELSE %]Default checkout limit by patron category[% END %]</h3>
451 <p>For this library, you can specify the maximum number of loans that
452 a patron of a given category can make, regardless of the item type.
454 <p>If the total amount loanable for a given patron category is left blank,
455 no limit applies, except possibly for a limit you define for a specific item type.
457 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
458 <input type="hidden" name="op" value="add-branch-cat" />
459 <input type="hidden" name="branch" value="[% current_branch %]"/>
462 <th>Patron category</th>
463 <th>Total current checkouts allowed</th>
464 <th>Total current on-site checkouts allowed</th>
467 [% FOREACH branch_cat_rule_loo IN branch_cat_rule_loop %]
468 [% UNLESS ( loop.odd ) %]
469 <tr class="highlight">
473 <td>[% IF ( branch_cat_rule_loo.default_humancategorycode ) %]
476 [% branch_cat_rule_loo.humancategorycode %]
479 <td>[% IF ( branch_cat_rule_loo.unlimited_maxissueqty ) %]
482 [% branch_cat_rule_loo.maxissueqty %]
485 <td>[% IF ( branch_cat_rule_loo.unlimited_maxonsiteissueqty ) %]
488 [% branch_cat_rule_loo.maxonsiteissueqty %]
493 <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=[% branch_cat_rule_loo.categorycode %]&branch=[% current_branch %]">Delete</a>
499 <select name="categorycode">
500 [% FOREACH categoryloo IN categoryloop %]
501 <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
505 <td><input name="maxissueqty" size="3" /></td>
506 <td><input name="maxonsiteissueqty" size="3" /></td>
507 <td><input type="submit" value="Add" class="submit" /></td>
513 <div id="holds-policy-by-item-type" class="container">
514 <h3>[% IF humanbranch %]Holds policy by item type for [% humanbranch %][% ELSE %]Default holds policy by item type[% END %]</h3>
516 For this library, you can edit rules for given itemtypes, regardless
517 of the patron's category.
520 Currently, this means hold policies.
521 The various policies have the following effects:
524 <li><strong>From any library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li>
525 <li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li>
526 <li><strong>No holds allowed:</strong> No patron may put this book on hold.</li>
528 <p><strong>Note: </strong>If the system preference 'AllowHoldPolicyOverride' is enabled, these policies can be overridden by your circulation staff.</br />
529 <strong>Important: </strong>The policies are based on the patron's home library, not the library where the hold is being placed.
532 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
533 <input type="hidden" name="op" value="add-branch-item" />
534 <input type="hidden" name="branch" value="[% current_branch %]"/>
539 <th>Return policy</th>
542 [% FOREACH branch_item_rule_loo IN branch_item_rule_loop %]
543 [% UNLESS ( loop.odd ) %]
544 <tr class="highlight">
548 <td>[% IF ( branch_item_rule_loo.default_humanitemtype ) %]
551 [% branch_item_rule_loo.translated_description %]
554 <td>[% IF ( branch_item_rule_loo.holdallowed_any ) %]
556 [% ELSIF ( branch_item_rule_loo.holdallowed_same ) %]
562 <td>[% IF ( branch_item_rule_loo.returnbranch == 'homebranch' ) %]
564 [% ELSIF ( branch_item_rule_loo.returnbranch == 'holdingbranch' ) %]
565 Item returns to issuing branch
566 [% ELSIF ( branch_item_rule_loo.returnbranch == 'noreturn' ) %]
569 Error - unknown option
573 <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&itemtype=[% branch_item_rule_loo.itemtype %]&branch=[% current_branch %]">Delete</a>
579 <select name="itemtype">
580 [% FOREACH itemtypeloo IN itemtypeloop %]
581 <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option>
586 <select name="holdallowed">
587 <option value="2">From any library</option>
588 <option value="1">From home library</option>
589 <option value="0">No holds allowed</option>
593 <select name="returnbranch">
594 <option value="homebranch">Item returns home</option>
595 <option value="holdingbranch">Item returns to issuing library</option>
596 <option value="noreturn">Item floats</option>
599 <td><input type="submit" value="Add" class="submit" /></td>
608 [% INCLUDE 'admin-menu.inc' %]
611 [% INCLUDE 'intranet-bottom.inc' %]