8 [% USE CirculationRules %]
10 [% PROCESS 'i18n.inc' %]
11 [% SET footerjs = 1 %]
13 [% SET branchcode = humanbranch || undef %]
15 [% SET categorycodes = [] %]
16 [% FOREACH pc IN patron_categories %]
17 [% categorycodes.push( pc.id ) %]
19 [% categorycodes.push(undef) %]
21 [% SET itemtypes = [] %]
22 [% FOREACH i IN itemtypeloop %]
23 [% itemtypes.push( i.itemtype ) %]
25 [% itemtypes.push(undef) %]
27 [% INCLUDE 'doc-head-open.inc' %]
28 <title>[% FILTER collapse %]
29 [% t("Circulation and fine rules") | html %] ›
30 [% t("Administration") | html %] ›
31 [% t("Koha") | html %]
33 [% INCLUDE 'doc-head-close.inc' %]
36 <body id="admin_smart-rules" class="admin">
37 [% WRAPPER 'header.inc' %]
38 [% INCLUDE 'prefs-admin-search.inc' %]
41 [% WRAPPER 'sub-header.inc' %]
42 [% WRAPPER breadcrumbs %]
43 [% WRAPPER breadcrumb_item %]
44 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
46 [% WRAPPER breadcrumb_item bc_active= 1 %]
47 <span>Circulation and fine rules</span>
49 [% END #/ WRAPPER breadcrumbs %]
50 [% END #/ WRAPPER sub-header.inc %]
52 <div class="main container-fluid">
54 <div class="col-sm-10 col-sm-push-2">
56 <h1 class="parameters">
58 Defining circulation and fine rules for "[% Branches.GetName( humanbranch ) | html %]"
60 Defining circulation and fine rules for all libraries
64 <div class="page-section bg-info">
65 <p>The rules are applied from most specific to less specific, using the first found in this order:</p>
67 <li>same library, same patron category, same item type</li>
68 <li>same library, same patron category, all item types</li>
69 <li>same library, all patron categories, same item type</li>
70 <li>same library, all patron categories, all item types</li>
71 <li>default (all libraries), same patron category, same item type</li>
72 <li>default (all libraries), same patron category, all item types</li>
73 <li>default (all libraries), all patron categories, same item type</li>
74 <li>default (all libraries), all patron categories, all item types</li>
77 <p>Where an itemtype has a parent, the rule will display as "Parent->Child" and the number of
78 current checkouts allowed will be limited to either the maximum for the parent (counting sibling types)
79 or the specific rule's type, whichever is less.</p>
80 <p>To modify a rule, create a new one with the same patron category and item type.</p>
83 <div class="page-section">
84 [% UNLESS restricted_to_own_library %]
85 <form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary">
87 <select name="branch" id="branch" style="width:20em;">
88 <option value="*">Standard rules for all libraries</option>
89 [% PROCESS options_for_libraries libraries => Branches.all( selected => current_branch, unfiltered => 1 ) %]
92 [% IF ( definedbranch ) %]
93 <form action="/cgi-bin/koha/admin/clone-rules.pl" method="post">
94 <label for="tobranch"><strong>Clone these rules to:</strong></label>
95 <input type="hidden" name="frombranch" value="[% current_branch | html %]" />
96 <select name="tobranch" id="tobranch">
97 [% PROCESS options_for_libraries libraries => Branches.all( unfiltered => 1 ) %]
99 <input type="submit" id="clone_rules" class="btn btn-primary" value="Clone" />
105 <div class="page-section">
106 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
107 <input type="hidden" name="op" value="add" />
108 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
109 <table id="default-circulation-rules">
113 <th class="fixed_sort">Patron category</th>
115 <th class="fixed_sort">Item type</th>
116 <th class="noExport">Actions</th>
118 <th>Current checkouts allowed</th>
119 <th>Current on-site checkouts allowed</th>
123 <th>Hard due date</th>
124 <th>Decreased loan period for high holds (day)</th>
126 <th>Fine charging interval</th>
127 <th>When to charge</th>
128 <th>Fine/suspension grace period</th>
129 <th>Overdue fines cap (amount)</th>
130 <th>Cap fine at replacement price</th>
131 <th>Suspension in days (day)</th>
132 <th>Max. suspension duration (day)</th>
133 <th>Suspension charging interval</th>
134 <th>Renewals allowed (count)</th>
135 [% IF Koha.Preference('UnseenRenewals') %]
136 <th>Unseen renewals allowed (count)</th>
138 <th>Renewal period</th>
139 <th>No renewal before</th>
140 <th>Automatic renewal</th>
141 <th>No automatic renewal after</th>
142 <th>No automatic renewal after (hard limit)</th>
143 <th>Holds allowed (total)</th>
144 <th>Holds allowed (daily)</th>
145 <th>Holds per record (count)</th>
146 <th>On shelf holds allowed</th>
147 <th>OPAC item level holds</th>
148 [% IF Koha.Preference('ArticleRequests') %]
149 <th>Article requests</th>
151 <th>Rental discount (%)</th>
152 [% IF Koha.Preference('UseRecalls') %]
153 <th>Recalls allowed (total)</th>
154 <th>Recalls per record (count)</th>
155 <th>On shelf recalls allowed</th>
156 <th>Recall due date interval (day)</th>
157 <th>Recall overdue fine amount</th>
158 <th>Recall pickup period (day)</th>
160 <th class="noExport">Actions</th>
164 [% SET row_count = 0 %]
165 [% FOREACH c IN categorycodes %]
166 [% SET c = '' UNLESS c.defined %]
167 [% FOREACH i IN itemtypes %]
168 [% SET i = '' UNLESS i.defined %]
169 [% SET note = all_rules.$c.$i.note %]
170 [% SET maxissueqty = all_rules.$c.$i.maxissueqty %]
171 [% SET maxonsiteissueqty = all_rules.$c.$i.maxonsiteissueqty %]
172 [% SET issuelength = all_rules.$c.$i.issuelength %]
173 [% SET daysmode = all_rules.$c.$i.daysmode %]
174 [% SET lengthunit = all_rules.$c.$i.lengthunit %]
175 [% SET hardduedate = all_rules.$c.$i.hardduedate %]
176 [% SET hardduedatecompare = all_rules.$c.$i.hardduedatecompare %]
177 [% SET fine = all_rules.$c.$i.fine %]
178 [% SET chargeperiod = all_rules.$c.$i.chargeperiod %]
179 [% SET chargeperiod_charge_at = all_rules.$c.$i.chargeperiod_charge_at %]
180 [% SET firstremind = all_rules.$c.$i.firstremind %]
181 [% SET overduefinescap = all_rules.$c.$i.overduefinescap %]
182 [% SET cap_fine_to_replacement_price = all_rules.$c.$i.cap_fine_to_replacement_price %]
183 [% SET finedays = all_rules.$c.$i.finedays %]
184 [% SET maxsuspensiondays = all_rules.$c.$i.maxsuspensiondays %]
185 [% SET suspension_chargeperiod = all_rules.$c.$i.suspension_chargeperiod %]
186 [% SET renewalsallowed = all_rules.$c.$i.renewalsallowed %]
187 [% SET unseenrenewalsallowed = all_rules.$c.$i.unseen_renewals_allowed %]
188 [% SET renewalperiod = all_rules.$c.$i.renewalperiod %]
189 [% SET norenewalbefore = all_rules.$c.$i.norenewalbefore %]
190 [% SET auto_renew = all_rules.$c.$i.auto_renew %]
191 [% SET no_auto_renewal_after = all_rules.$c.$i.no_auto_renewal_after %]
192 [% SET no_auto_renewal_after_hard_limit = all_rules.$c.$i.no_auto_renewal_after_hard_limit %]
193 [% SET reservesallowed = all_rules.$c.$i.reservesallowed %]
194 [% SET holds_per_day = all_rules.$c.$i.holds_per_day %]
195 [% SET holds_per_record = all_rules.$c.$i.holds_per_record %]
196 [% SET onshelfholds = all_rules.$c.$i.onshelfholds %]
197 [% SET opacitemholds = all_rules.$c.$i.opacitemholds %]
198 [% SET article_requests = all_rules.$c.$i.article_requests %]
199 [% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %]
200 [% SET decreaseloanholds = all_rules.$c.$i.decreaseloanholds %]
201 [% SET recalls_allowed = all_rules.$c.$i.recalls_allowed %]
202 [% SET recalls_per_record = all_rules.$c.$i.recalls_per_record %]
203 [% SET on_shelf_recalls = all_rules.$c.$i.on_shelf_recalls %]
204 [% SET recall_due_date_interval = all_rules.$c.$i.recall_due_date_interval %]
205 [% SET recall_overdue_fine = all_rules.$c.$i.recall_overdue_fine %]
206 [% SET recall_shelf_time = all_rules.$c.$i.recall_shelf_time %]
208 [% SET show_rule = note || maxissueqty || maxonsiteissueqty || issuelength || daysmode || lengthunit || hardduedate || hardduedatecompare || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || unseenrenewalsallowed || renewalperiod || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || rentaldiscount || decreaseloanholds || recalls_allowed || recalls_per_record || on_shelf_recalls || recall_due_date_interval || recall_overdue_fine || recall_shelf_time %]
210 [% SET row_count = row_count + 1 %]
211 <tr row_countd="row_[% row_count | html %]">
212 <td>[% IF ( c == undef ) %]
217 <td data-code="[% c | html %]">
221 [% Categories.GetName(c) | html %]
224 <td>[% IF ( i == undef ) %]
229 <td data-code="[% i | html %]">
233 [% ItemTypes.GetDescription(i,1) | html %]
237 <a href="#" class="editrule btn btn-default btn-xs"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
238 <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% i || '*' | html %]&categorycode=[% c || '*' | html %]&branch=[% current_branch | html %]"><i class="fa fa-trash-can"></i> Delete</a>
241 [% IF note.defined && note != '' %]
242 <a name="viewnote" data-toggle="popover" title="Note" data-content="[% note | html %]" data-placement="top" data-trigger="hover">View note</a>
243 [% ELSE %]<span> </span>[% END %]
246 [% IF maxissueqty.defined && maxissueqty != '' %]
247 [% maxissueqty | html %]
249 <span>Unlimited</span>
253 [% IF maxonsiteissueqty.defined && maxonsiteissueqty != '' %]
254 [% maxonsiteissueqty | html %]
256 <span>Unlimited</span>
259 <td>[% issuelength | html %]</td>
260 <td data-code="[% daysmode | html %]">
261 [% SWITCH daysmode %]
262 [% CASE 'Calendar' %]<span title="Use the calendar to skip days the library is closed">Skip closed days</span>
263 [% CASE 'Datedue' %]<span title="Use the calendar to push the due date to the next open day">Next open day</span>
264 [% CASE 'Days' %]<span title="Ignore the calendar">Ignore the calendar</span>
265 [% CASE 'Dayweek' %]<span title="Use the calendar to push the due date to the next open matching weekday for weekly loan periods, or the next open day otherwise">Same week day</span>
266 [% CASE %]<span title="Use the system preference 'useDaysMode' as a default value">Default</span>
269 <td data-code="[% lengthunit | html %]">
270 [% IF ( lengthunit == 'days' ) %]
272 [% ELSIF ( lengthunit == 'hours') %]
275 <span>Undefined</span>
278 <td data-code="[% hardduedatecompare | html %]">
279 [% IF ( hardduedate ) %]
280 [% IF ( hardduedatecompare == '-1' ) %]
281 before [% hardduedate | $KohaDates %]
282 <input type="hidden" name="hardduedatecomparebackup" value="-1" />
283 [% ELSIF ( hardduedatecompare == '0' ) %]
284 on [% hardduedate | $KohaDates %]
285 <input type="hidden" name="hardduedatecomparebackup" value="0" />
286 [% ELSIF ( hardduedatecompare == '1' ) %]
287 after [% hardduedate | $KohaDates %]
288 <input type="hidden" name="hardduedatecomparebackup" value="1" />
291 <span>None defined</span>
294 <td>[% decreaseloanholds | html %]</td>
295 <td>[% fine | $Price %]</td>
296 <td>[% chargeperiod | html %]</td>
297 <td>[% IF chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]</td>
298 <td>[% firstremind | html %]</td>
299 <td>[% IF overduefinescap %][% overduefinescap | $Price %][% ELSE %][% END %]</td>
301 [% IF cap_fine_to_replacement_price %]
302 <input type="checkbox" checked="checked" disabled="disabled" />
304 <input type="checkbox" disabled="disabled" />
307 <td>[% finedays | html %]</td>
308 <td>[% maxsuspensiondays | html %]</td>
309 <td>[% suspension_chargeperiod | html %]</td>
310 <td>[% renewalsallowed | html %]</td>
311 [% IF Koha.Preference('UnseenRenewals') %]
313 [% IF unseenrenewalsallowed.defined && unseenrenewalsallowed != '' %]
314 [% unseenrenewalsallowed | html %]
316 <span>Unlimited</span>
320 <td>[% renewalperiod | html %]</td>
321 <td>[% norenewalbefore | html %]</td>
322 <td data-code="[%- IF auto_renew -%]yes[%- ELSE -%]no[%- END -%]">
329 <td>[% no_auto_renewal_after | html %]</td>
330 <td>[% no_auto_renewal_after_hard_limit | $KohaDates %]</td>
332 [% IF reservesallowed.defined && reservesallowed != '' %]
333 [% reservesallowed | html %]
335 <span>Unlimited</span>
339 [% IF holds_per_day.defined && holds_per_day != '' %]
340 [% holds_per_day | html %]
342 <span>Unlimited</span>
346 [% IF holds_per_record.defined && holds_per_record != '' %]
347 [% holds_per_record | html %]
349 <span>Unlimited</span>
352 <td data-code="[% onshelfholds | html %]">
353 [% IF onshelfholds == 1 %]
355 [% ELSIF onshelfholds == 2 %]
356 <span>If all unavailable</span>
358 <span>If any unavailable</span>
361 <td data-code="[% opacitemholds | html %]">
362 [% IF opacitemholds == 'F'%]
364 [% ELSIF opacitemholds == 'Y'%]
367 <span>Don't allow</span>
370 [% IF Koha.Preference('ArticleRequests') %]
371 <td data-code="[% article_requests | html %]">
372 [% IF article_requests == 'no' %]
374 [% ELSIF article_requests == 'yes' %]
376 [% ELSIF article_requests == 'bib_only' %]
377 <span>Record only</span>
378 [% ELSIF article_requests == 'item_only' %]
379 <span>Item only</span>
383 <td>[% rentaldiscount | html %]</td>
384 [% IF Koha.Preference('UseRecalls') %]
385 <td>[% recalls_allowed | html %]</td>
386 <td>[% recalls_per_record | html %]</td>
387 <td data-code="[% on_shelf_recalls | html %]">
388 [% IF on_shelf_recalls == 'all' %]
389 <span>If all unavailable</span>
391 <span>If any unavailable</span>
394 <td>[% recall_due_date_interval | html %]</td>
395 <td>[% recall_overdue_fine | $Price %]</td>
396 <td>[% recall_shelf_time | html %]</td>
399 <a href="#" class="editrule btn btn-default btn-xs"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
400 <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% i || '*' | uri %]&categorycode=[% c || '*' | uri %]&branch=[% current_branch | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
406 <tr class="noExport" id="edit_row">
409 <select name="categorycode" id="categorycode">
410 <option value="*">All</option>
411 [% FOREACH patron_category IN patron_categories%]
412 <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
418 <select name="itemtype" id="matrixitemtype" style="width:13em;">
419 <option value="*">All</option>
420 [% FOREACH itemtypeloo IN itemtypeloop %]
421 [% NEXT IF itemtypeloo.parent_type %]
422 [% SET children = itemtypeloo.children_with_localization %]
423 [% IF children.count %]
424 <optgroup label="[% itemtypeloo.translated_description | html %]">
425 <option value="[% itemtypeloo.itemtype | html %]">[% itemtypeloo.translated_description | html %] (All)</option>
426 [% FOREACH child IN children %]
427 <option value="[% child.itemtype | html %]">[% child.translated_description | html %]</option>
431 <option value="[% itemtypeloo.itemtype | html %]">[% itemtypeloo.translated_description | html %]</option>
437 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
438 <button type="submit" class="btn btn-primary btn-xs"><i class="fa fa-save"></i> Save</button>
439 <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button>
441 <td><input type="text" name="note" id="note" size="15" value="" maxlength="100"></td>
442 <td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td>
443 <td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td>
444 <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
446 <select name="daysmode" id="daysmode">
447 <option value="" title="Use the system preference 'useDaysMode' as a default value">Default</option>
448 <option value="Calendar" title="Use the calendar to skip days the library is closed">Skip closed days</option>
449 <option value="Datedue" title="Use the calendar to push the due date to the next open day">Next open day</option>
450 <option value="Days" title="Ignore the calendar">Ignore the calendar</option>
451 <option value="Dayweek" title="Use the calendar to push the due date to the next open matching weekday for weekly loan periods, or the next open day otherwise">Same week day</option>
455 <select name="lengthunit" id="lengthunit">
456 <option value="days" selected="selected">Days</option>
457 <option value="hours">Hours</option>
461 <select name="hardduedatecompare" id="hardduedatecompare">
462 <option value="-1">Before</option>
463 <option value="0">Exactly on</option>
464 <option value="1">After</option>
466 <input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate | html %]" class="flatpickr" />
467 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
469 <td><input type="text" name="decreaseloanholds" id="decreaseloanholds" size="2" /></td>
470 <td><input type="text" name="fine" id="fine" size="4" inputmode="decimal" pattern="^\d+(\.\d{2})?$" /></td>
471 <td><input type="text" name="chargeperiod" id="chargeperiod" size="2" /></td>
473 <select name="chargeperiod_charge_at" id="chargeperiod_charge_at">
474 <option value="0">End of interval</option>
475 <option value="1">Start of interval</option>
478 <td><input type="text" name="firstremind" id="firstremind" size="2" /> </td>
479 <td><input type="text" name="overduefinescap" id="overduefinescap" size="6" inputmode="decimal" pattern="^\d+(\.\d{2})?$" /> </td>
480 <td><input type="checkbox" name="cap_fine_to_replacement_price" id="cap_fine_to_replacement_price" /></td>
481 <td><input type="text" name="finedays" id="fined" size="3" /> </td>
482 <td><input type="text" name="maxsuspensiondays" id="maxsuspensiondays" size="3" /> </td>
483 <td><input type="text" name="suspension_chargeperiod" id="suspension_chargeperiod" size="3" /> </td>
484 <td><input type="text" name="renewalsallowed" id="renewalsallowed" size="2" /></td>
485 [% IF Koha.Preference('UnseenRenewals') %]
486 <td><input type="text" name="unseen_renewals_allowed" id="unseen_renewals_allowed" size="2" /></td>
488 <td><input type="text" name="renewalperiod" id="renewalperiod" size="3" /></td>
489 <td><input type="text" name="norenewalbefore" id="norenewalbefore" size="3" /></td>
491 <select name="auto_renew" id="auto_renew">
492 <option value="no" selected>No</option>
493 <option value="yes">Yes</option>
496 <td><input type="text" name="no_auto_renewal_after" id="no_auto_renewal_after" size="3" /></td>
498 <input type="text" size="10" name="no_auto_renewal_after_hard_limit" id="no_auto_renewal_after_hard_limit" value="[% no_auto_renewal_after_hard_limit | html %]" class="flatpickr"/>
499 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
501 <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
502 <td><input type="text" name="holds_per_day" id="holds_per_day" size="2" /></td>
503 <td><input type="text" name="holds_per_record" id="holds_per_record" size="2" /></td>
505 <select name="onshelfholds" id="onshelfholds">
506 <option value="1">Yes</option>
507 <option value="0">If any unavailable</option>
508 <option value="2">If all unavailable</option>
512 <select id="opacitemholds" name="opacitemholds">
513 <option value="N">Don't allow</option>
514 <option value="Y">Allow</option>
515 <option value="F">Force</option>
518 [% IF Koha.Preference('ArticleRequests') %]
520 <select id="article_requests" name="article_requests">
521 <option value="no">No</option>
522 <option value="yes">Yes</option>
523 <option value="bib_only">Record only</option>
524 <option value="item_only">Item only</option>
528 <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
529 [% IF Koha.Preference('UseRecalls') %]
530 <td><input type="text" name="recalls_allowed" id="recalls_allowed" size="3"></td>
531 <td><input type="text" name="recalls_per_record" id="recalls_per_record" size="3"></td>
533 <select name="on_shelf_recalls" id="on_shelf_recalls">
534 <option value="any">If any unavailable</option>
535 <option value="all">If all unavailable</option>
538 <td><input type="text" name="recall_due_date_interval" id="recall_due_date_interval" size="3"></td>
539 <td><input type="text" name="recall_overdue_fine" id="recall_overdue_fine" size="6" inputmode="decimal" pattern="^\d+(\.\d{2})?$"></td>
540 <td><input type="text" name="recall_shelf_time" id="recall_shelf_time" size="3"></td>
543 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
544 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
545 <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button>
552 <th>Patron category</th>
557 <th>Current checkouts allowed</th>
558 <th>Current on-site checkouts allowed</th>
562 <th>Hard due date</th>
563 <th>Decreased loan period for high holds (day)</th>
565 <th>Fine charging interval</th>
566 <th>Charge when?</th>
567 <th>Fine/suspension grace period</th>
568 <th>Overdue fines cap (amount)</th>
569 <th>Cap fine at replacement price</th>
570 <th>Suspension in days (day)</th>
571 <th>Max. suspension duration (day)</th>
572 <th>Suspension charging interval</th>
573 <th>Renewals allowed (count)</th>
574 [% IF Koha.Preference('UnseenRenewals') %]
575 <th>Unseen renewals allowed (count)</th>
577 <th>Renewal period</th>
578 <th>No renewal before</th>
579 <th>Automatic renewal</th>
580 <th>No automatic renewal after</th>
581 <th>No automatic renewal after (hard limit)</th>
582 <th>Holds allowed (total)</th>
583 <th>Holds allowed (daily)</th>
584 <th>Holds per record (count)</th>
585 <th>On shelf holds allowed</th>
586 <th>OPAC item level holds</th>
587 [% IF Koha.Preference('ArticleRequests') %]
588 <th>Article requests</th>
590 <th>Rental discount (%)</th>
591 [% IF Koha.Preference('UseRecalls') %]
592 <th>Recalls allowed (total)</th>
593 <th>Recalls per record (count)</th>
594 <th>On shelf recalls allowed</th>
595 <th>Recall due date interval (day)</th>
596 <th>Recall overdue fine amount</th>
597 <th>Recall pickup period (day)</th>
604 </div><!-- ./page-section -->
606 <div id="defaults-for-this-library" class="page-section">
607 <h2>Default checkout, hold and return policy[% IF humanbranch %] for [% Branches.GetName( humanbranch ) | html %][% END %]</h2>
608 <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>
609 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
610 <input type="hidden" name="op" value="set-branch-defaults" />
611 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
615 <th>Total current checkouts allowed</th>
616 <th>Total current on-site checkouts allowed</th>
617 <th>Maximum total holds allowed (count)</th>
619 <th>Hold pickup library match</th>
620 <th>Return policy</th>
621 <th class="noExport">Actions</th>
623 [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty', { want_rule => 1 } ) %]
624 [% SET patron_maxonsiteissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxonsiteissueqty', { want_rule => 1 } ) %]
625 [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds', { want_rule => 1 } ) %]
626 [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed', { want_rule => 1 } ) %]
627 [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy', { want_rule => 1 }) %]
628 [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch', { want_rule => 1 }) %]
629 [% SET default_checkout_hold_and_return_policy = ( patron_maxissueqty || patron_maxonsiteissueqty || rule_value || holdallowed || hold_fulfillment_policy || returnbranch ) %]
632 [% IF ( default_checkout_hold_and_return_policy ) %]
641 <input type="text" name="patron_maxissueqty" size="9" value="[% patron_maxissueqty.rule_value | html %]" placeholder="Unlimited"/>
644 <input type="text" name="patron_maxonsiteissueqty" size="9" value="[% patron_maxonsiteissueqty.rule_value | html %]" placeholder="Unlimited"/>
647 <input name="max_holds" size="9" value="[% rule_value.rule_value | html %]" placeholder="Unlimited"/>
650 <select name="holdallowed">
655 [% IF holdallowed.rule_value == 'from_any_library' %]
656 <option value="from_any_library" selected="selected">
658 <option value="from_any_library">
663 [% IF holdallowed.rule_value == 'from_local_hold_group' %]
664 <option value="from_local_hold_group" selected="selected">
666 <option value="from_local_hold_group">
668 From local hold group
671 [% IF holdallowed.rule_value == 'from_home_library' %]
672 <option value="from_home_library" selected="selected">
674 <option value="from_home_library">
679 [% IF holdallowed.rule_value == 'not_allowed' %]
680 <option value="not_allowed" selected="selected">
682 <option value="not_allowed">
689 <select name="hold_fulfillment_policy">
695 [% IF hold_fulfillment_policy.rule_value == 'any' %]
696 <option value="any" selected="selected">
705 [% IF hold_fulfillment_policy.rule_value == 'holdgroup' %]
706 <option value="holdgroup" selected="selected">
710 <option value="holdgroup">
715 [% IF hold_fulfillment_policy.rule_value == 'patrongroup' %]
716 <option value="patrongroup" selected="selected">
720 <option value="patrongroup">
725 [% IF hold_fulfillment_policy.rule_value == 'homebranch' %]
726 <option value="homebranch" selected="selected">
730 <option value="homebranch">
735 [% IF hold_fulfillment_policy.rule_value == 'holdingbranch' %]
736 <option value="holdingbranch" selected="selected">
737 item's holding library
740 <option value="holdingbranch">
741 item's holding library
747 <select name="returnbranch">
753 [% IF returnbranch.rule_value == 'homebranch' %]
754 <option value="homebranch" selected="selected">
756 <option value="homebranch">
760 [% IF returnbranch.rule_value == 'holdingbranch' %]
761 <option value="holdingbranch" selected="selected">
763 <option value="holdingbranch">
765 Item returns to issuing library
767 [% IF returnbranch.rule_value == 'noreturn' %]
768 <option value="noreturn" selected="selected">
770 <option value="noreturn">
774 [% IF returnbranch.rule_value == 'returnbylibrarygroup' %]
775 <option value="returnbylibrarygroup" selected="selected">
777 <option value="returnbylibrarygroup">
779 Item floats by library group
784 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
785 [% IF ( default_checkout_hold_and_return_policy ) %]
786 <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=*&branch=[% current_branch | html %]" id="unset"><i class="fa fa-undo"></i> Unset</a>
794 [% IF ( show_branch_cat_rule_form ) %]
795 <div id="holds-policy-by-patron-category" class="page-section">
796 <h2>[% IF humanbranch %]Checkout, hold policy by patron category for [% Branches.GetName( humanbranch ) | html %][% ELSE %]Default checkout, hold policy by patron category[% END %]</h2>
797 <p>For this library, you can specify the maximum number of loans that
798 a patron of a given category can make, regardless of the item type.
800 <p>If the total amount loanable for a given patron category is left blank,
801 no limit applies, except possibly for a limit you define for a specific item type.
803 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
804 <input type="hidden" name="op" value="add-branch-cat" />
805 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
808 <th>Patron category</th>
809 <th>Total current checkouts allowed</th>
810 <th>Total current on-site checkouts allowed</th>
811 <th>Total holds allowed</th>
814 [% FOREACH c IN categorycodes %]
816 [% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxissueqty' ) %]
817 [% SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxonsiteissueqty' ) %]
818 [% SET max_holds = CirculationRules.Search( branchcode, c, undef, 'max_holds' ) %]
820 [% IF ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %]
826 [% Categories.GetName(c) | html %]
830 [% IF patron_maxissueqty.defined && patron_maxissueqty != '' %]
831 [% patron_maxissueqty | html %]
833 <span>Unlimited</span>
837 [% IF patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' %]
838 [% patron_maxonsiteissueqty | html %]
840 <span>Unlimited</span>
844 [% IF max_holds.defined && max_holds != '' %]
845 [% max_holds | html %]
847 <span>Unlimited</span>
852 <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=[% c | html %]&branch=[% current_branch | html %]"><i class="fa fa-trash-can"></i> Delete</a>
859 <select name="categorycode">
860 [% FOREACH patron_category IN patron_categories%]
861 <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
865 <td><input name="patron_maxissueqty" size="3" type="text" /></td>
866 <td><input name="patron_maxonsiteissueqty" size="3" type="text" /></td>
867 <td><input name="max_holds" size="3" type="text" /></td>
868 <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td>
875 <div id="waiting-hold-cancel-category" class="page-section">
877 <h2>Waiting hold cancellation policy for [% Branches.GetName( humanbranch ) | html %]</h2>
879 <h2>Default waiting hold cancellation policy</h2>
881 <p>Specify if waiting holds can be cancelled for a given patron category.</p>
882 <form id="set-waiting-hold-cancellation" method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
883 <input type="hidden" name="op" value="set-waiting-hold-cancellation" />
884 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
887 <th>Patron category</th>
889 <th>Cancellation allowed</th>
892 [% FOREACH c IN categorycodes %]
893 [% SET c = '*' UNLESS c.defined AND c != '' %]
894 [% FOREACH i IN itemtypes %]
895 [% SET i = '*' UNLESS i.defined AND i != '' %]
897 [% SET waiting_hold_cancellation = CirculationRules.Search( current_branch, c, i, 'waiting_hold_cancellation' ) %]
899 [% IF ( waiting_hold_cancellation.defined && waiting_hold_cancellation != '' ) %]
905 [% Categories.GetName(c) | html %]
912 [% ItemTypes.GetDescription(i,1) | html %]
916 [% IF waiting_hold_cancellation %]
923 <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=del-waiting-hold-cancellation&waiting_hold_cancellation_category=[% c | uri %]&waiting_hold_cancellation_itemtype=[% i | uri %]&branch=[% current_branch | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
931 <select name="waiting_hold_cancellation_category" id="waiting_hold_cancellation_category">
932 <option value="*">All</option>
933 [% FOREACH patron_category IN patron_categories %]
934 <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
939 <select name="waiting_hold_cancellation_itemtype" id="waiting_hold_cancellation_itemtype">
940 <option value="*">All</option>
941 [% FOREACH itemtype IN itemtypeloop %]
942 <option value="[% itemtype.itemtype | html %]">[% ItemTypes.GetDescription(itemtype.itemtype) | html %]</option>
947 <select name="waiting_hold_cancellation_policy" id="waiting_hold_cancellation_policy">
948 <option value="0" selected>No</option>
949 <option value="1">Yes</option>
952 <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td>
958 [% IF Koha.Preference('ArticleRequests') %]
959 <div id="open-article-requests-limit-patron-category" class="page-section">
961 <h2>Daily open article requests limit for [% Branches.GetName( humanbranch ) | html %]</h2>
963 <h2>Default open article requests limit</h2>
965 <p>Specify the maximum number simultaneous current article requests a patron of a given category can have.</p>
966 <form id="set-article-requests-daily-limit" method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
967 <input type="hidden" name="op" value="add-open-article-requests-limit" />
968 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
971 <th>Patron category</th>
972 <th>Total article requests</th>
975 [% FOREACH c IN categorycodes %]
977 [% SET open_article_requests_limit = CirculationRules.Search( branchcode, c, undef, 'open_article_requests_limit' ) %]
979 [% IF ( open_article_requests_limit.defined && open_article_requests_limit != '' ) %]
982 [% Categories.GetName(c) | html %]
985 [% IF open_article_requests_limit.defined && open_article_requests_limit != '' %]
986 [% open_article_requests_limit | html %]
988 <span>Unlimited</span>
993 <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=del-open-article-requests-limit&categorycode=[% c | html %]&branch=[% current_branch | html %]"><i class="fa fa-trash-can"></i> Delete</a>
1000 <select name="categorycode">
1001 [% FOREACH patron_category IN patron_categories %]
1002 <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
1006 <td><input name="open_article_requests_limit" size="3" type="text" /></td>
1007 <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td>
1013 <div id="article-request-fee-category" class="page-section">
1014 [% IF humanbranch %]
1015 <h2>Article request fees for [% Branches.GetName( humanbranch ) | html %]</h2>
1017 <h2>Default article request fees</h2>
1019 <p>Specify the article request fee for a given patron category.</p>
1020 <form id="set-article-request-fee" method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
1021 <input type="hidden" name="op" value="set-article-request-fee" />
1022 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
1025 <th>Patron category</th>
1029 [% FOREACH c IN categorycodes %]
1030 [% SET c = '*' UNLESS c.defined AND c != '' %]
1032 [% SET article_request_fee = CirculationRules.Search( current_branch, c, undef, 'article_request_fee' ) %]
1034 [% IF ( article_request_fee.defined && article_request_fee != '' ) %]
1040 [% Categories.GetName(c) | html %]
1044 [% IF article_request_fee.defined && article_request_fee != '' %]
1045 [% article_request_fee | $Price %]
1050 <td class="actions">
1051 <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=del-article-request-fee&article_request_fee_category=[% c | uri %]&branch=[% current_branch | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
1058 <select name="article_request_fee_category" id="article_request_fee_category">
1059 <option value="*">All</option>
1060 [% FOREACH patron_category IN patron_categories%]
1061 <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
1065 <td><input name="article_request_fee" size="5" type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" /></td>
1066 <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td>
1073 <div id="refund-lost-item-fee-on-return" class="page-section">
1074 [% IF current_branch == '*' %]
1075 <h2>Default lost item fee refund on return policy</h2>
1077 <h2>Lost item fee refund on return policy for [% Branches.GetName(current_branch) | html %]</h2>
1079 <p>Specify the default policy for lost item fees on return.</p>
1080 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
1081 <input type="hidden" name="op" value="mod-refund-lost-item-fee-rule" />
1082 <input type="hidden" name="branch" value="[% current_branch | html %]" />
1085 <th>Refund lost item replacement fee</th>
1086 <th>Refund lost item processing fee</th>
1091 <select name="lostreturn">
1092 [%# Default branch %]
1093 [% IF ( current_branch == '*' ) %]
1094 [% IF ( defaultRefundRule == 'refund' ) %]
1095 <option value="refund" selected="selected">Refund lost item charge</option>
1096 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1097 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1098 <option value="restore">Refund lost item charge and restore overdue fine</option>
1099 <option value="0">Leave lost item charge</option>
1100 [% ELSIF ( defaultRefundRule == 'refund_unpaid' ) %]
1101 <option value="refund">Refund lost item charge</option>
1102 <option value="refund_unpaid" selected="selected">Refund lost item charge (only if unpaid)</option>
1103 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1104 <option value="restore">Refund lost item charge and restore overdue fine</option>
1105 <option value="0">Leave lost item charge</option>
1106 [% ELSIF ( defaultRefundRule == 'charge' ) %]
1107 <option value="refund">Refund lost item charge</option>
1108 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1109 <option value="charge" selected="selected">Refund lost item charge and charge new overdue fine</option>
1110 <option value="restore">Refund lost item charge and restore overdue fine</option>
1111 <option value="0">Leave lost item charge</option>
1112 [% ELSIF ( defaultRefundRule == 'restore' ) %]
1113 <option value="refund">Refund lost item charge</option>
1114 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1115 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1116 <option value="restore" selected="selected">Refund lost item charge and restore overdue fine</option>
1117 <option value="0">Leave lost item charge</option>
1118 [% ELSIF ( defaultRefundRule == 0 ) %]
1119 <option value="refund">Refund lost item charge</option>
1120 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1121 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1122 <option value="restore">Refund lost item charge and restore overdue fine</option>
1123 <option value="0" selected="selected">Leave lost item charge</option>
1125 <option value="refund">Refund lost item charge</option>
1126 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1127 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1128 <option value="restore">Refund lost item charge and restore overdue fine</option>
1129 <option value="0">Leave lost item charge</option>
1132 [%# Branch-specific %]
1133 [% IF ( not refundLostItemFeeRule ) %]
1134 <option value="*" selected="selected">
1138 [% IF defaultRefundRule == 'refund' %]
1139 <span>Use default (Refund lost item charge)</span>
1140 [% ELSIF defaultRefundRule == 'refund_unpaid' %]
1141 Use default (Refund lost item charge (only if unpaid))
1142 [% ELSIF defaultRefundRule == 'charge' %]
1143 <span>Use default (Refund lost item charge and charge new overdue fine)</span>
1144 [% ELSIF defaultRefundRule == 'restore' %]
1145 <span>Use default (Refund lost item charge and restore overdue fine)</span>
1147 <span>Use default (Leave lost item charge)</span>
1150 [% IF ( not refundLostItemFeeRule ) %]
1151 <option value="refund">Refund lost item charge</option>
1152 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1153 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1154 <option value="restore">Refund lost item charge and restore overdue fine</option>
1155 <option value="0">Leave lost item charge</option>
1157 [% IF ( refundLostItemFeeRule.rule_value == 'refund' ) %]
1158 <option value="refund" selected="selected">Refund lost item charge</option>
1159 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1160 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1161 <option value="restore">Refund lost item charge and restore overdue fine</option>
1162 <option value="0">Leave lost item charge</option>
1163 [% ELSIF ( refundLostItemFeeRule.rule_value == 'refund_unpaid' ) %]
1164 <option value="refund">Refund lost item charge</option>
1165 <option value="refund_unpaid" selected="selected">Refund lost item charge (only if unpaid)</option>
1166 <option value="charge" selected="selected">Refund lost item charge and charge new overdue fine</option>
1167 <option value="restore">Refund lost item charge and restore overdue fine</option>
1168 <option value="0">Leave lost item charge</option>
1169 [% ELSIF ( refundLostItemFeeRule.rule_value == 'charge' ) %]
1170 <option value="refund">Refund lost item charge</option>
1171 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1172 <option value="charge" selected="selected">Refund lost item charge and charge new overdue fine</option>
1173 <option value="restore">Refund lost item charge and restore overdue fine</option>
1174 <option value="0">Leave lost item charge</option>
1175 [% ELSIF ( refundLostItemFeeRule.rule_value == 'restore' ) %]
1176 <option value="refund">Refund lost item charge</option>
1177 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1178 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1179 <option value="restore" selected="selected">Refund lost item charge and restore overdue fine</option>
1180 <option value="0">Leave lost item charge</option>
1181 [% ELSIF ( refundLostItemFeeRule.rule_value == 0 ) %]
1182 <option value="refund">Refund lost item charge</option>
1183 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1184 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1185 <option value="restore">Refund lost item charge and restore overdue fine</option>
1186 <option value="0" selected="selected">Leave lost item charge</option>
1193 <select name="processingreturn">
1194 [%# Default branch %]
1195 [% IF ( current_branch == '*' ) %]
1196 [% IF ( defaultProcessingRefundRule == 'refund' ) %]
1197 <option value="refund" selected="selected">Refund lost item processing charge</option>
1198 <option value="refund_unpaid">Refund lost item processing charge (only if unpaid)</option>
1199 <option value="0">Leave lost item processing charge</option>
1200 [% ELSIF ( defaultProcessingRefundRule == 'refund_unpaid' ) %]
1201 <option value="refund">Refund lost item charge</option>
1202 <option value="refund_unpaid" selected="selected">Refund lost item processing charge (only if unpaid)</option>
1203 <option value="0">Leave lost item processing charge</option>
1204 [% ELSIF ( defaultProcessingRefundRule == 0 ) %]
1205 <option value="refund">Refund lost item processing charge</option>
1206 <option value="refund_unpaid">Refund lost item processing charge (only if unpaid)</option>
1207 <option value="0" selected="selected">Leave lost item processing charge</option>
1209 <option value="refund">Refund lost item processing charge</option>
1210 <option value="refund_unpaid">Refund lost item processing charge (only if unpaid)</option>
1211 <option value="0">Leave lost item processing charge</option>
1214 [%# Branch-specific %]
1215 [% IF ( not refundProcessingFeeRule ) %]
1216 <option value="*" selected="selected">
1220 [% IF defaultProcessingRefundRule == 'refund' %]
1221 <span>Use default (Refund lost item processing charge)</span>
1222 [% ELSIF defaultProcessingRefundRule == 'refund_unpaid' %]
1223 Use default (Refund lost item processing charge (only if unpaid))
1225 <span>Use default (Leave lost item processing charge)</span>
1228 [% IF ( not refundProcessingFeeRule ) %]
1229 <option value="refund">Refund lost item processing charge</option>
1230 <option value="refund_unpaid">Refund lost item processing charge (only if unpaid)</option>
1231 <option value="0">Leave lost item processing charge</option>
1233 [% IF ( refundProcessingFeeRule.rule_value == 'refund' ) %]
1234 <option value="refund" selected="selected">Refund lost item processing charge</option>
1235 <option value="refund_unpaid">Refund lost item processing charge (only if unpaid)</option>
1236 <option value="0">Leave lost item processing charge</option>
1237 [% ELSIF ( refundProcessingFeeRule.rule_value == 'refund_unpaid' ) %]
1238 <option value="refund">Refund lost item processing charge</option>
1239 <option value="refund_unpaid" selected="selected">Refund lost item processing charge (only if unpaid)</option>
1240 <option value="0">Leave lost item processing charge</option>
1241 [% ELSIF ( refundProcessingFeeRule.rule_value == 0 ) %]
1242 <option value="refund">Refund lost item processing charge</option>
1243 <option value="refund_unpaid">Refund lost item processing charge (only if unpaid)</option>
1244 <option value="0" selected="selected">Leave lost item processing charge</option>
1250 <td class="actions">
1251 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
1258 <div id="holds-policy-by-item-type" class="page-section">
1259 <h2>[% IF humanbranch %]Holds policy by item type for [% Branches.GetName( humanbranch ) | html %][% ELSE %]Default holds policy by item type[% END %]</h2>
1261 For this library, you can edit rules for given itemtypes, regardless of the patron's category.
1264 Currently, this means hold policies. The various policies have the following effects:
1267 <li><strong>From any library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li>
1268 <li><strong>From local hold group:</strong> Only patrons from libraries in the same item's home library hold groups may put this book on hold.</li>
1269 <li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li>
1270 <li><strong>No holds allowed:</strong> No patron may put this book on hold.</li>
1273 <p><strong>Note: </strong>If the system preference 'AllowHoldPolicyOverride' is enabled, these policies can be overridden by your circulation staff.</p>
1274 <p><strong>Important:</strong></p>
1277 <li>The hold policies are applied based on the ReservesControlBranch system preference which is set to <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReservesControlBranch">[% Koha.Preference('ReservesControlBranch') | html %]</a>.</li>
1278 <li>The return policy is applied based on the CircControlReturnsBranch system preference which is set to <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=CircControlReturnsBranch">[% Koha.Preference('CircControlReturnsBranch') | html %]</a>.</li>
1279 <li>When return policy is set to 'item floats by library group' the item's homebranch will be used to find groups.</li>
1282 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
1283 <input type="hidden" name="op" value="add-branch-item" />
1284 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
1288 <th>Hold policy</th>
1289 <th>Hold pickup library match</th>
1290 <th>Return policy</th>
1293 [% FOREACH i IN itemtypeloop %]
1294 [% SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, 'holdallowed' ) %]
1295 [% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, 'hold_fulfillment_policy' ) %]
1296 [% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, 'returnbranch' ) %]
1298 [% IF holdallowed || hold_fulfillment_policy || returnbranch %]
1301 [% i.translated_description | html %]
1304 [% IF holdallowed == 'from_any_library' %]
1305 <span>From any library</span>
1306 [% ELSIF holdallowed == 'from_local_hold_group' %]
1307 <span>From local hold group</span>
1308 [% ELSIF holdallowed == 'from_home_library' %]
1309 <span>From home library</span>
1311 <span>No holds allowed</span>
1315 [% IF hold_fulfillment_policy == 'any' %]
1316 <span>any library</span>
1317 [% ELSIF hold_fulfillment_policy == 'homebranch' %]
1318 <span>item's home library</span>
1319 [% ELSIF hold_fulfillment_policy == 'holdgroup' %]
1320 <span>item's hold group</span>
1321 [% ELSIF hold_fulfillment_policy == 'patrongroup' %]
1322 <span>patron's hold group</span>
1323 [% ELSIF hold_fulfillment_policy == 'holdingbranch' %]
1324 <span>item's holding library</span>
1328 [% IF returnbranch == 'homebranch' %]
1329 <span>Item returns home</span>
1330 [% ELSIF returnbranch == 'holdingbranch' %]
1331 <span>Item returns to issuing branch</span>
1332 [% ELSIF returnbranch == 'noreturn' %]
1333 <span>Item floats</span>
1334 [% ELSIF returnbranch == 'returnbylibrarygroup'%]
1335 <span>Item floats by library group</span>
1338 <td class="actions">
1339 <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&itemtype=[% i.itemtype | uri %]&branch=[% current_branch | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
1346 <select name="itemtype">
1347 [% FOREACH itemtypeloo IN itemtypeloop %]
1348 <option value="[% itemtypeloo.itemtype | html %]">[% itemtypeloo.translated_description | html %]</option>
1353 <select name="holdallowed">
1354 <option value="from_any_library">From any library</option>
1355 <option value="from_local_hold_group">From local hold group</option>
1356 <option value="from_home_library">From home library</option>
1357 <option value="not_allowed">No holds allowed</option>
1361 <select name="hold_fulfillment_policy">
1362 <option value="any">
1366 <option value="holdgroup">
1370 <option value="patrongroup">
1374 <option value="homebranch">
1378 <option value="holdingbranch">
1379 item's holding library
1384 <select name="returnbranch">
1385 <option value="homebranch">Item returns home</option>
1386 <option value="holdingbranch">Item returns to issuing library</option>
1387 <option value="noreturn">Item floats</option>
1388 <option value="returnbylibrarygroup">Item floats by library group</option>
1391 <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td>
1397 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1399 <div class="col-sm-2 col-sm-pull-10">
1401 [% INCLUDE 'admin-menu.inc' %]
1403 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1404 </div> <!-- /.row -->
1406 [% MACRO jsinclude BLOCK %]
1407 [% Asset.js("js/admin-menu.js") | $raw %]
1408 [% INCLUDE 'datatables.inc' %]
1409 [% INCLUDE 'calendar.inc' %]
1410 [% INCLUDE 'columns_settings.inc' %]
1411 [% INCLUDE 'format_price.inc' %]
1413 $(document).ready(function() {
1414 KohaTable("default-circulation-rules", {
1416 { "bVisible": false, "aTargets": [ 0,2 ] },
1417 { "bSortable": false, "aTargets": ["_all"] }
1419 "aaSortingFixed": [ [0,'asc'], [1,'asc'], [2,'asc'], [3,'asc'] ],
1425 function clear_edit(){
1426 var cancel = confirm(_("Are you sure you want to cancel your changes?"));
1427 if ( !cancel ) return;
1428 $('#default-circulation-rules td').removeClass('highlighted-row');
1429 var edit_row = $("#edit_row");
1430 $(edit_row).find("input").each(function(){
1431 var type = $(this).attr("type");
1432 if (type != "button" && type != "submit" ) {
1434 $(this).prop('disabled', false);
1436 if ( type == "checkbox" ) {
1437 $(this).prop('checked', false);
1440 $(edit_row).find("select").prop('disabled', false);
1441 $(edit_row).find("select option:first-child").attr("selected", "selected");
1442 $(edit_row).find("td:last input[name='clear']").remove();
1445 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone.");
1447 $(document).ready(function() {
1448 $('[data-toggle="popover"]').popover();
1450 $(".delete").on("click",function(){
1451 return confirmDelete(MSG_CONFIRM_DELETE);
1454 $("#clone_rules").on("click",function(){
1455 var library_dropdown = document.getElementById("branch");
1456 var selected_library = library_dropdown.options[library_dropdown.selectedIndex].value;
1457 var selected_library_text = $("#branch option:selected").text();
1458 var to_library = $("#tobranch option:selected").text();
1459 var MSG_CONFIRM_CLONE;
1460 if (selected_library === "*") {
1461 MSG_CONFIRM_CLONE = _("Are you sure you want to clone this standard rule to %s library? This will override the existing rules in this library.").format(to_library);
1462 return confirmClone(MSG_CONFIRM_CLONE);
1464 MSG_CONFIRM_CLONE = _("Are you sure you want to clone this circulation and fine rule from %s to %s library? This will override the existing rules in this library.").format(selected_library_text, to_library);
1465 return confirmClone(MSG_CONFIRM_CLONE);
1469 $('#selectlibrary').find("input:submit").hide();
1470 $('#branch').change(function() {
1471 $('#selectlibrary').submit();
1473 $(".editrule").click(function(){
1474 if ( $("#edit_row").find("input[type='text']").filter(function(){return this.value.length > 0 }).length > 0 ) {
1475 var edit = confirm(_("Are you sure you want to edit another rule?"));
1476 if (!edit) return false;
1478 $('#default-circulation-rules td').removeClass('highlighted-row');
1479 $(this).parent().parent().find("td").each(function (i) {
1480 $(this).addClass('highlighted-row');
1481 itm_code = $(this).data('code');
1482 itm_text = $(this).text();
1483 itm_text = itm_text.replace(/^\s*|\s*$/g,'');
1484 var current_column = $("#edit_row td:eq("+i+")");
1486 // specific processing for the Note column
1487 var note = $(this).find("a[name='viewnote']").data("content");
1488 $(current_column).find("input[type='text']").val(note);
1489 } else if ( i == 9 ) {
1490 // specific processing for the Hard due date column
1491 var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
1492 var input_value = '';
1493 if (typeof select_value === 'undefined'){
1494 select_value = '-1';
1496 input_value = itm_text.split(' ')[1];
1498 $(current_column).find("input[type='text']").val(input_value);
1499 $(current_column).find("select").val(select_value);
1500 } else if ( i == 16 ) {
1501 // specific processing for cap_fine_to_replacement_price
1502 var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
1503 $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
1504 $('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') );
1506 $(current_column).find("input[type='text']").val(itm_text);
1508 $(current_column).find("input[inputmode='decimal']").each(function() {
1509 $(this).val(itm_text.unformat_price());
1511 // select the corresponding option
1512 $(current_column).find("select option").each(function(){
1513 opt = $(this).attr('value');
1514 if ( opt == itm_code ) {
1515 $(this).attr('selected', 'selected');
1518 if ( i == 0 || i == 1 ) {
1519 // Disable the 2 first columns, we cannot update them.
1520 var val = $(current_column).find("select option:selected").val();
1521 var name = "categorycode";
1525 // Remove potential previous input added
1526 $(current_column).find("input").remove();
1527 $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
1528 } else if ( i == 5 || i == 6 || i == 26 || i == 27 || i == 28 ) {
1529 // If the value is not an integer for
1530 // - "Current checkouts allowed"
1531 // - "Current on-site checkouts allowed"
1532 // - "Holds allowed (total)"
1533 // - "Holds allowed (daily)"
1534 // - "Holds per record (count)"
1535 // The value is "Unlimited" (or an equivalent translated string)
1536 // an it should be set to an empty string
1537 if( !((parseFloat(itm_text) == parseInt(itm_text)) && !isNaN(itm_text)) ) {
1538 $(current_column).find("input[type='text']").val("");
1543 $("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true);
1544 $("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true);
1547 $(".clear_edit").on("click",function(e){
1552 $("#set-article-requests-daily-limit").on("submit", function(){
1553 if (! $("input[name='open_article_requests_limit'").val().length){
1554 alert("Please set a daily limit for this patron's category");
1560 $("#set-article-request-fee").on("submit", function(){
1561 if (! $("input[name='article_request_fee'").val().length){
1562 alert("Please set a valid value for the fee");
1570 [% INCLUDE 'intranet-bottom.inc' %]