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");
20 $(edit_row).find("select").removeAttr("disabled");
21 $(edit_row).find("select option:first").attr("selected", "selected");
22 $(edit_row).find("td:last input[name='clear']").remove();
25 $(document).ready(function() {
26 $('#selectlibrary').find("input:submit").hide();
27 $('#branch').change(function() {
28 $('#selectlibrary').submit();
30 $(".editrule").click(function(){
31 if ( $(edit_row).find("input[type='text'][value!='']").length > 0 ) {
32 var edit = confirm(_("Are you sure you want to edit another rule?"));
33 if (!edit) return false;
35 $('#default-circulation-rules td').removeClass('highlighted-row');
36 $(this).parent().parent().find("td").each(function (i) {
37 $(this).addClass('highlighted-row');
39 itm = itm.replace(/^\s*|\s*$/g,'');
40 var current_column = $("#edit_row td:eq("+i+")");
42 $(current_column).find("input[type='text']").val(itm);
43 // select the corresponding option
44 $(current_column).find("select option").each(function(){
45 if ( $(this).text().toLowerCase() == itm.toLowerCase() ) {
46 $(this).attr('selected', 'selected');
49 if ( i == 0 || i == 1 ) {
50 // Disable the 2 first columns, we cannot update them.
51 var val = $(current_column).find("select option:selected").val();
52 var name = "categorycode";
56 // Remove potential previous input added
57 $(current_column).find("input").remove();
58 $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
59 } else if ( i == 2 ) {
60 // If the value is not an integer for "Current checkouts allowed"
61 // The value is "Unlimited" (or an equivalent translated string)
62 // an it should be set to an empty string
63 if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
64 $(current_column).find("input[type='text']").val("");
68 // specific processing for the Hard due date column
69 var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
71 if (typeof select_value === 'undefined'){
74 input_value = itm.split(' ')[1];
76 $(current_column).find("input[type='text']").val(input_value);
77 $(current_column).find("select").val(select_value);
80 $("#default-circulation-rules tr:last td:eq(0) select").attr('disabled', 'disabled');
81 $("#default-circulation-rules tr:last td:eq(1) select").attr('disabled', 'disabled');
88 <body id="admin_smart-rules" class="admin">
89 [% INCLUDE 'header.inc' %]
90 [% INCLUDE 'cat-search.inc' %]
92 <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>
94 <div id="doc3" class="yui-t1">
99 <h1 class="parameters">
100 [% IF ( humanbranch ) %]
101 Defining circulation and fine rules for "[% humanbranch %]"
103 Defining circulation and fine rules for all libraries
107 <p>The rules are applied from most specific to less specific, using the first found in this order:</p>
109 <li>same library, same patron type, same item type</li>
110 <li>same library, same patron type, all item types</li>
111 <li>same library, all patron types, same item type</li>
112 <li>same library, all patron types, all item types</li>
113 <li>default (all libraries), same patron type, same item type</li>
114 <li>default (all libraries), same patron type, all item types</li>
115 <li>default (all libraries), all patron types, same item type</li>
116 <li>default (all libraries), all patron types, all item types</li>
118 <p>To modify a rule, create a new one with the same patron type and item type.</p>
121 <form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary">
123 <select name="branch" id="branch" style="width:20em;">
124 <option value="*">All libraries</option>
125 [% FOREACH branchloo IN branchloop %]
126 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
130 [% IF ( definedbranch ) %]<form action="/cgi-bin/koha/admin/clone-rules.pl" method="post"><label
131 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidden" name="frombranch" value="[% current_branch %]" />
132 <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 %]
134 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
135 <input type="hidden" name="op" value="add" />
136 <input type="hidden" name="branch" value="[% branch %]"/>
137 <table id="default-circulation-rules">
140 <th>Patron category</th>
142 <th>Current checkouts allowed</th>
145 <th>Hard due date</th>
147 <th>Fine charging interval</th>
148 <th>Fine grace period (day)</th>
149 <th>Overdue Fines Cap ($)</th>
150 <th>Suspension in days (day)</th>
151 <th>Renewals allowed (count)</th>
152 <th>Renewal period</th>
153 <th>Holds allowed (count)</th>
154 <th>Rental discount (%)</th>
155 <th colspan="2"> </th>
159 [% FOREACH rule IN rules %]
160 [% UNLESS ( loop.odd ) %]
161 <tr class="highlight" id="row_[% loop.count %]">
163 <tr id="row_[% loop.count %]">
165 <td>[% IF ( rule.default_humancategorycode ) %]
168 [% rule.humancategorycode %]
171 <td>[% IF ( rule.default_humanitemtype ) %]
174 [% rule.humanitemtype %]
177 <td>[% IF ( rule.unlimited_maxissueqty ) %]
180 [% rule.maxissueqty %]
183 <td>[% rule.issuelength %]</td>
185 [% rule.lengthunit %]
188 [% IF ( rule.hardduedate ) %]
189 [% IF ( rule.hardduedatebefore ) %]
190 before [% rule.hardduedate %]
191 <input type="hidden" name="hardduedatecomparebackup" value="-1" />
192 [% ELSIF ( rule.hardduedateexact ) %]
193 on [% rule.hardduedate %]
194 <input type="hidden" name="hardduedatecomparebackup" value="0" />
195 [% ELSIF ( rule.hardduedateafter ) %]
196 after [% rule.hardduedate %]
197 <input type="hidden" name="hardduedatecomparebackup" value="1" />
203 <td>[% rule.fine %]</td>
204 <td>[% rule.chargeperiod %]</td>
205 <td>[% rule.firstremind %]</td>
206 <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
207 <td>[% rule.finedays %]</td>
208 <td>[% rule.renewalsallowed %]</td>
209 <td>[% rule.renewalperiod %]</td>
210 <td>[% rule.reservesallowed %]</td>
211 <td>[% rule.rentaldiscount %]</td>
212 <td><a href="#" class="editrule">Edit</a></td>
214 <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>
220 <select name="categorycode" id="categorycode">
221 <option value="*">All</option>
222 [% FOREACH categoryloo IN categoryloop %]
223 <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
228 <select name="itemtype" id="matrixitemtype" style="width:13em;">
229 <option value="*">All</option>
230 [% FOREACH itemtypeloo IN itemtypeloop %]
231 <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.description %]</option>
235 <td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td>
236 <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
238 <select name="lengthunit" id="lengthunit">
239 <option value="days" selected>Days</option>
240 <option value="hours">Hours</option>
244 <select name="hardduedatecompare" id="hardduedatecompare">
245 <option value="-1">Before</option>
246 <option value="0">Exactly on</option>
247 <option value="1">After</option>
249 <input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate %]" class="datepicker" />
250 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
252 <td><input type="text" name="fine" id="fine" size="4" /></td>
253 <td><input type="text" name="chargeperiod" id="chargeperiod" size="2" /></td>
254 <td><input type="text" name="firstremind" id="firstremind" size="2" /> </td>
255 <td><input type="text" name="overduefinescap" id="overduefinescap" size="6" /> </td>
256 <td><input type="text" name="finedays" id="fined" size="3" /> </td>
257 <td><input type="text" name="renewalsallowed" id="renewalsallowed" size="2" /></td>
258 <td><input type="text" name="renewalperiod" id="renewalperiod" size="3" /></td>
259 <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
260 <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
262 <input type="hidden" name="branch" value="[% current_branch %]"/>
263 <input type="submit" value="Save" class="submit" />
264 <input type="button" name="cancel" value="Clear" onclick="clear_edit();return false;" />
271 <div id="defaults-for-this-library" class="container">
272 <h3>Default checkout, hold and return policy[% IF ( humanbranch ) %] for [% humanbranch %][% END %]</h3>
273 <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>
274 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
275 <input type="hidden" name="op" value="set-branch-defaults" />
276 <input type="hidden" name="branch" value="[% current_branch %]"/>
280 <th>Total current checkouts allowed</th>
282 <th>Return policy</th>
287 <td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td>
288 <td><input type="text" name="maxissueqty" size="3" value="[% default_maxissueqty %]"/></td>
290 <select name="holdallowed">
291 [% IF ( default_holdallowed_any ) %]
292 <option value="2" selected="selected">
298 [% IF ( default_holdallowed_same ) %]
299 <option value="1" selected="selected">
305 [% IF ( default_holdallowed_none ) %]
306 <option value="0" selected="selected">
315 <select name="returnbranch">
316 [% IF ( default_returnbranch == 'homebranch' ) %]
317 <option value="homebranch" selected="selected">
319 <option value="homebranch">
323 [% IF ( default_returnbranch == 'holdingbranch' ) %]
324 <option value="holdingbranch" selected="selected">
326 <option value="holdingbranch">
328 Item returns to issuing library
330 [% IF ( default_returnbranch == 'noreturn' ) %]
331 <option value="noreturn" selected="selected">
333 <option value="noreturn">
339 <td><input type="submit" value="Save" class="submit" /></td>
341 <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=*&branch=[% current_branch %]">Unset</a>
347 [% IF ( show_branch_cat_rule_form ) %]
348 <div id="holds-policy-by-patron-category" class="container">
349 <h3>[% IF humanbranch %]Checkout limit by patron category for [% humanbranch %][% ELSE %]Default checkout limit by patron category[% END %]</h3>
350 <p>For this library, you can specify the maximum number of loans that
351 a patron of a given category can make, regardless of the item type.
353 <p>If the total amount loanable for a given patron category is left blank,
354 no limit applies, except possibly for a limit you define for a specific item type.
356 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
357 <input type="hidden" name="op" value="add-branch-cat" />
358 <input type="hidden" name="branch" value="[% current_branch %]"/>
361 <th>Patron category</th>
362 <th>Total current checkouts allowed</th>
365 [% FOREACH branch_cat_rule_loo IN branch_cat_rule_loop %]
366 [% UNLESS ( loop.odd ) %]
367 <tr class="highlight">
371 <td>[% IF ( branch_cat_rule_loo.default_humancategorycode ) %]
374 [% branch_cat_rule_loo.humancategorycode %]
377 <td>[% IF ( branch_cat_rule_loo.unlimited_maxissueqty ) %]
380 [% branch_cat_rule_loo.maxissueqty %]
384 <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>
390 <select name="categorycode">
391 [% FOREACH categoryloo IN categoryloop %]
392 <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
396 <td><input name="maxissueqty" size="3" /></td>
397 <td><input type="submit" value="Add" class="submit" /></td>
403 <div id="holds-policy-by-item-type" class="container">
404 <h3>[% IF humanbranch %]Holds policy by item type for [% humanbranch %][% ELSE %]Default holds policy by item type[% END %]</h3>
406 For this library, you can edit rules for given itemtypes, regardless
407 of the patron's category.
410 Currently, this means hold policies.
411 The various policies have the following effects:
414 <li><strong>From any library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li>
415 <li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li>
416 <li><strong>No holds allowed:</strong> No patron may put this book on hold.</li>
419 Note that if the system preference
420 <code>AllowHoldPolicyOverride</code> is enabled, these policies can
421 be overridden by your circulation staff. Also, these policies are
422 based on the patron's home library, <em>not</em> the library where the hold is being placed..
425 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
426 <input type="hidden" name="op" value="add-branch-item" />
427 <input type="hidden" name="branch" value="[% current_branch %]"/>
432 <th>Return policy</th>
435 [% FOREACH branch_item_rule_loo IN branch_item_rule_loop %]
436 [% UNLESS ( loop.odd ) %]
437 <tr class="highlight">
441 <td>[% IF ( branch_item_rule_loo.default_humanitemtype ) %]
444 [% branch_item_rule_loo.humanitemtype %]
447 <td>[% IF ( branch_item_rule_loo.holdallowed_any ) %]
449 [% ELSIF ( branch_item_rule_loo.holdallowed_same ) %]
455 <td>[% IF ( branch_item_rule_loo.returnbranch == 'homebranch' ) %]
457 [% ELSIF ( branch_item_rule_loo.returnbranch == 'holdingbranch' ) %]
458 Item returns to issuing branch
459 [% ELSIF ( branch_item_rule_loo.returnbranch == 'noreturn' ) %]
462 Error - unknown option
466 <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>
472 <select name="itemtype">
473 [% FOREACH itemtypeloo IN itemtypeloop %]
474 <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.description %]</option>
479 <select name="holdallowed">
480 <option value="2">From any library</option>
481 <option value="1">From home library</option>
482 <option value="0">No holds allowed</option>
486 <select name="returnbranch">
487 <option value="homebranch">Item returns home</option>
488 <option value="holdingbranch">Item returns to issuing library</option>
489 <option value="noreturn">Item floats</option>
492 <td><input type="submit" value="Add" class="submit" /></td>
501 [% INCLUDE 'admin-menu.inc' %]
504 [% INCLUDE 'intranet-bottom.inc' %]