8 [% USE CirculationRules %]
10 [% SET footerjs = 1 %]
12 [% SET branchcode = humanbranch || undef %]
14 [% SET categorycodes = [] %]
15 [% FOREACH pc IN patron_categories %]
16 [% categorycodes.push( pc.id ) %]
18 [% categorycodes.push(undef) %]
20 [% SET itemtypes = [] %]
21 [% FOREACH i IN itemtypeloop %]
22 [% itemtypes.push( i.itemtype ) %]
24 [% itemtypes.push(undef) %]
26 [% INCLUDE 'doc-head-open.inc' %]
27 <title>Circulation and fine rules › Administration › Koha</title>
28 [% INCLUDE 'doc-head-close.inc' %]
31 <body id="admin_smart-rules" class="admin">
32 [% WRAPPER 'header.inc' %]
33 [% INCLUDE 'prefs-admin-search.inc' %]
36 [% WRAPPER 'sub-header.inc' %]
37 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
40 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
43 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
46 <a href="#" aria-current="page">
47 Circulation and fine rules
54 <div class="main container-fluid">
56 <div class="col-sm-10 col-sm-push-2">
58 <h1 class="parameters">
60 Defining circulation and fine rules for "[% Branches.GetName( humanbranch ) | html %]"
62 Defining circulation and fine rules for all libraries
66 <div class="page-section bg-info">
67 <p>The rules are applied from most specific to less specific, using the first found in this order:</p>
69 <li>same library, same patron category, same item type</li>
70 <li>same library, same patron category, all item types</li>
71 <li>same library, all patron categories, same item type</li>
72 <li>same library, all patron categories, all item types</li>
73 <li>default (all libraries), same patron category, same item type</li>
74 <li>default (all libraries), same patron category, all item types</li>
75 <li>default (all libraries), all patron categories, same item type</li>
76 <li>default (all libraries), all patron categories, all item types</li>
79 <p>Where an itemtype has a parent, the rule will display as "Parent->Child" and the number of
80 current checkouts allowed will be limited to either the maximum for the parent (counting sibling types)
81 or the specific rule's type, whichever is less.</p>
82 <p>To modify a rule, create a new one with the same patron category and item type.</p>
85 <div class="page-section">
86 [% UNLESS restricted_to_own_library %]
87 <form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary">
89 <select name="branch" id="branch" style="width:20em;">
90 <option value="*">Standard rules for all libraries</option>
91 [% PROCESS options_for_libraries libraries => Branches.all( selected => current_branch, unfiltered => 1 ) %]
94 [% IF ( definedbranch ) %]
95 <form action="/cgi-bin/koha/admin/clone-rules.pl" method="post">
96 <label for="tobranch"><strong>Clone these rules to:</strong></label>
97 <input type="hidden" name="frombranch" value="[% current_branch | html %]" />
98 <select name="tobranch" id="tobranch">
99 [% PROCESS options_for_libraries libraries => Branches.all( unfiltered => 1 ) %]
101 <input type="submit" id="clone_rules" class="btn btn-primary" value="Clone" />
107 <div class="page-section">
108 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
109 <input type="hidden" name="op" value="add" />
110 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
111 <table id="default-circulation-rules">
115 <th class="fixed_sort">Patron category</th>
117 <th class="fixed_sort">Item type</th>
118 <th class="noExport">Actions</th>
120 <th>Current checkouts allowed</th>
121 <th>Current on-site checkouts allowed</th>
125 <th>Hard due date</th>
126 <th>Decreased loan period for high holds (day)</th>
128 <th>Fine charging interval</th>
129 <th>When to charge</th>
130 <th>Fine grace period</th>
131 <th>Overdue fines cap (amount)</th>
132 <th>Cap fine at replacement price</th>
133 <th>Suspension in days (day)</th>
134 <th>Max. suspension duration (day)</th>
135 <th>Suspension charging interval</th>
136 <th>Renewals allowed (count)</th>
137 [% IF Koha.Preference('UnseenRenewals') %]
138 <th>Unseen renewals allowed (count)</th>
140 <th>Renewal period</th>
141 <th>No renewal before</th>
142 <th>Automatic renewal</th>
143 <th>No automatic renewal after</th>
144 <th>No automatic renewal after (hard limit)</th>
145 <th>Holds allowed (total)</th>
146 <th>Holds allowed (daily)</th>
147 <th>Holds per record (count)</th>
148 <th>On shelf holds allowed</th>
149 <th>OPAC item level holds</th>
150 [% IF Koha.Preference('ArticleRequests') %]
151 <th>Article requests</th>
153 <th>Rental discount (%)</th>
154 [% IF Koha.Preference('UseRecalls') %]
155 <th>Recalls allowed (total)</th>
156 <th>Recalls per record (count)</th>
157 <th>On shelf recalls allowed</th>
158 <th>Recall due date interval (day)</th>
159 <th>Recall overdue fine amount</th>
160 <th>Recall pickup period (day)</th>
162 <th class="noExport">Actions</th>
166 [% SET row_count = 0 %]
167 [% FOREACH c IN categorycodes %]
168 [% SET c = '' UNLESS c.defined %]
169 [% FOREACH i IN itemtypes %]
170 [% SET i = '' UNLESS i.defined %]
171 [% SET note = all_rules.$c.$i.note %]
172 [% SET maxissueqty = all_rules.$c.$i.maxissueqty %]
173 [% SET maxonsiteissueqty = all_rules.$c.$i.maxonsiteissueqty %]
174 [% SET issuelength = all_rules.$c.$i.issuelength %]
175 [% SET daysmode = all_rules.$c.$i.daysmode %]
176 [% SET lengthunit = all_rules.$c.$i.lengthunit %]
177 [% SET hardduedate = all_rules.$c.$i.hardduedate %]
178 [% SET hardduedatecompare = all_rules.$c.$i.hardduedatecompare %]
179 [% SET fine = all_rules.$c.$i.fine %]
180 [% SET chargeperiod = all_rules.$c.$i.chargeperiod %]
181 [% SET chargeperiod_charge_at = all_rules.$c.$i.chargeperiod_charge_at %]
182 [% SET firstremind = all_rules.$c.$i.firstremind %]
183 [% SET overduefinescap = all_rules.$c.$i.overduefinescap %]
184 [% SET cap_fine_to_replacement_price = all_rules.$c.$i.cap_fine_to_replacement_price %]
185 [% SET finedays = all_rules.$c.$i.finedays %]
186 [% SET maxsuspensiondays = all_rules.$c.$i.maxsuspensiondays %]
187 [% SET suspension_chargeperiod = all_rules.$c.$i.suspension_chargeperiod %]
188 [% SET renewalsallowed = all_rules.$c.$i.renewalsallowed %]
189 [% SET unseenrenewalsallowed = all_rules.$c.$i.unseen_renewals_allowed %]
190 [% SET renewalperiod = all_rules.$c.$i.renewalperiod %]
191 [% SET norenewalbefore = all_rules.$c.$i.norenewalbefore %]
192 [% SET auto_renew = all_rules.$c.$i.auto_renew %]
193 [% SET no_auto_renewal_after = all_rules.$c.$i.no_auto_renewal_after %]
194 [% SET no_auto_renewal_after_hard_limit = all_rules.$c.$i.no_auto_renewal_after_hard_limit %]
195 [% SET reservesallowed = all_rules.$c.$i.reservesallowed %]
196 [% SET holds_per_day = all_rules.$c.$i.holds_per_day %]
197 [% SET holds_per_record = all_rules.$c.$i.holds_per_record %]
198 [% SET onshelfholds = all_rules.$c.$i.onshelfholds %]
199 [% SET opacitemholds = all_rules.$c.$i.opacitemholds %]
200 [% SET article_requests = all_rules.$c.$i.article_requests %]
201 [% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %]
202 [% SET decreaseloanholds = all_rules.$c.$i.decreaseloanholds %]
203 [% SET recalls_allowed = all_rules.$c.$i.recalls_allowed %]
204 [% SET recalls_per_record = all_rules.$c.$i.recalls_per_record %]
205 [% SET on_shelf_recalls = all_rules.$c.$i.on_shelf_recalls %]
206 [% SET recall_due_date_interval = all_rules.$c.$i.recall_due_date_interval %]
207 [% SET recall_overdue_fine = all_rules.$c.$i.recall_overdue_fine %]
208 [% SET recall_shelf_time = all_rules.$c.$i.recall_shelf_time %]
210 [% 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 %]
212 [% SET row_count = row_count + 1 %]
213 <tr row_countd="row_[% row_count | html %]">
214 <td>[% IF ( c == undef ) %]
223 [% Categories.GetName(c) | html %]
226 <td>[% IF ( i == undef ) %]
235 [% ItemTypes.GetDescription(i,1) | html %]
239 <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
240 <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"></i> Delete</a>
243 [% IF note.defined && note != '' %]
244 <a name="viewnote" data-toggle="popover" title="Note" data-content="[% note | html %]" data-placement="top" data-trigger="hover">View note</a>
245 [% ELSE %]<span> </span>[% END %]
248 [% IF maxissueqty.defined && maxissueqty != '' %]
249 [% maxissueqty | html %]
251 <span>Unlimited</span>
255 [% IF maxonsiteissueqty.defined && maxonsiteissueqty != '' %]
256 [% maxonsiteissueqty | html %]
258 <span>Unlimited</span>
261 <td>[% issuelength | html %]</td>
263 [% SWITCH daysmode %]
264 [% CASE 'Calendar' %]<span title="Use the calendar to skip days the library is closed">Skip closed days</span>
265 [% CASE 'Datedue' %]<span title="Use the calendar to push the due date to the next open day">Next open day</span>
266 [% CASE 'Days' %]<span title="Ignore the calendar">Ignore the calendar</span>
267 [% 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>
268 [% CASE %]<span title="Use the system preference 'useDaysMode' as a default value">Default</span>
272 [% IF ( lengthunit == 'days' ) %]
274 [% ELSIF ( lengthunit == 'hours') %]
277 <span>Undefined</span>
281 [% IF ( hardduedate ) %]
282 [% IF ( hardduedatecompare == '-1' ) %]
283 before [% hardduedate | $KohaDates %]
284 <input type="hidden" name="hardduedatecomparebackup" value="-1" />
285 [% ELSIF ( hardduedatecompare == '0' ) %]
286 on [% hardduedate | $KohaDates %]
287 <input type="hidden" name="hardduedatecomparebackup" value="0" />
288 [% ELSIF ( hardduedatecompare == '1' ) %]
289 after [% hardduedate | $KohaDates %]
290 <input type="hidden" name="hardduedatecomparebackup" value="1" />
293 <span>None defined</span>
296 <td>[% decreaseloanholds | html %]</td>
297 <td>[% fine | html %]</td>
298 <td>[% chargeperiod | html %]</td>
299 <td>[% IF chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]</td>
300 <td>[% firstremind | html %]</td>
301 <td>[% overduefinescap | $Price %]</td>
303 [% IF cap_fine_to_replacement_price %]
304 <input type="checkbox" checked="checked" disabled="disabled" />
306 <input type="checkbox" disabled="disabled" />
309 <td>[% finedays | html %]</td>
310 <td>[% maxsuspensiondays | html %]</td>
311 <td>[% suspension_chargeperiod | html %]</td>
312 <td>[% renewalsallowed | html %]</td>
313 [% IF Koha.Preference('UnseenRenewals') %]
315 [% IF unseenrenewalsallowed.defined && unseenrenewalsallowed != '' %]
316 [% unseenrenewalsallowed | html %]
318 <span>Unlimited</span>
322 <td>[% renewalperiod | html %]</td>
323 <td>[% norenewalbefore | html %]</td>
331 <td>[% no_auto_renewal_after | html %]</td>
332 <td>[% no_auto_renewal_after_hard_limit | $KohaDates %]</td>
334 [% IF reservesallowed.defined && reservesallowed != '' %]
335 [% reservesallowed | html %]
337 <span>Unlimited</span>
341 [% IF holds_per_day.defined && holds_per_day != '' %]
342 [% holds_per_day | html %]
344 <span>Unlimited</span>
348 [% IF holds_per_record.defined && holds_per_record != '' %]
349 [% holds_per_record | html %]
351 <span>Unlimited</span>
355 [% IF onshelfholds == 1 %]
357 [% ELSIF onshelfholds == 2 %]
358 <span>If all unavailable</span>
360 <span>If any unavailable</span>
364 [% IF opacitemholds == 'F'%]
366 [% ELSIF opacitemholds == 'Y'%]
369 <span>Don't allow</span>
372 [% IF Koha.Preference('ArticleRequests') %]
374 [% IF article_requests == 'no' %]
376 [% ELSIF article_requests == 'yes' %]
378 [% ELSIF article_requests == 'bib_only' %]
379 <span>Record only</span>
380 [% ELSIF article_requests == 'item_only' %]
381 <span>Item only</span>
385 <td>[% rentaldiscount | html %]</td>
386 [% IF Koha.Preference('UseRecalls') %]
387 <td>[% recalls_allowed | html %]</td>
388 <td>[% recalls_per_record | html %]</td>
390 [% IF on_shelf_recalls == 'all' %]
391 <span>If all unavailable</span>
393 <span>If any unavailable</span>
396 <td>[% recall_due_date_interval | html %]</td>
397 <td>[% recall_overdue_fine | $Price %]</td>
398 <td>[% recall_shelf_time | html %]</td>
401 <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
402 <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"></i> Delete</a>
408 <tr class="noExport" id="edit_row">
411 <select name="categorycode" id="categorycode">
412 <option value="*">All</option>
413 [% FOREACH patron_category IN patron_categories%]
414 <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
420 <select name="itemtype" id="matrixitemtype" style="width:13em;">
421 <option value="*">All</option>
422 [% FOREACH itemtypeloo IN itemtypeloop %]
423 [% NEXT IF itemtypeloo.parent_type %]
424 [% SET children = itemtypeloo.children_with_localization %]
425 [% IF children.count %]
426 <optgroup label="[% itemtypeloo.translated_description | html %]">
427 <option value="[% itemtypeloo.itemtype | html %]">[% itemtypeloo.translated_description | html %] (All)</option>
428 [% FOREACH child IN children %]
429 <option value="[% child.itemtype | html %]">[% child.translated_description | html %]</option>
433 <option value="[% itemtypeloo.itemtype | html %]">[% itemtypeloo.translated_description | html %]</option>
439 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
440 <button type="submit" class="btn btn-primary btn-xs"><i class="fa fa-save"></i> Save</button>
441 <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button>
443 <td><input type="text" name="note" id="note" size="15" value="" maxlength="100"></td>
444 <td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td>
445 <td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td>
446 <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
448 <select name="daysmode" id="daysmode">
449 <option value="" title="Use the system preference 'useDaysMode' as a default value">Default</option>
450 <option value="Calendar" title="Use the calendar to skip days the library is closed">Skip closed days</option>
451 <option value="Datedue" title="Use the calendar to push the due date to the next open day">Next open day</option>
452 <option value="Days" title="Ignore the calendar">Ignore the calendar</option>
453 <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>
457 <select name="lengthunit" id="lengthunit">
458 <option value="days" selected="selected">Days</option>
459 <option value="hours">Hours</option>
463 <select name="hardduedatecompare" id="hardduedatecompare">
464 <option value="-1">Before</option>
465 <option value="0">Exactly on</option>
466 <option value="1">After</option>
468 <input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate | html %]" class="flatpickr" />
469 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
471 <td><input type="text" name="decreaseloanholds" id="decreaseloanholds" size="2" /></td>
472 <td><input type="text" name="fine" id="fine" size="4" /></td>
473 <td><input type="text" name="chargeperiod" id="chargeperiod" size="2" /></td>
475 <select name="chargeperiod_charge_at" id="chargeperiod_charge_at">
476 <option value="0">End of interval</option>
477 <option value="1">Start of interval</option>
480 <td><input type="text" name="firstremind" id="firstremind" size="2" /> </td>
481 <td><input type="text" name="overduefinescap" id="overduefinescap" size="6" /> </td>
482 <td><input type="checkbox" name="cap_fine_to_replacement_price" id="cap_fine_to_replacement_price" /></td>
483 <td><input type="text" name="finedays" id="fined" size="3" /> </td>
484 <td><input type="text" name="maxsuspensiondays" id="maxsuspensiondays" size="3" /> </td>
485 <td><input type="text" name="suspension_chargeperiod" id="suspension_chargeperiod" size="3" /> </td>
486 <td><input type="text" name="renewalsallowed" id="renewalsallowed" size="2" /></td>
487 [% IF Koha.Preference('UnseenRenewals') %]
488 <td><input type="text" name="unseen_renewals_allowed" id="unseen_renewals_allowed" size="2" /></td>
490 <td><input type="text" name="renewalperiod" id="renewalperiod" size="3" /></td>
491 <td><input type="text" name="norenewalbefore" id="norenewalbefore" size="3" /></td>
493 <select name="auto_renew" id="auto_renew">
494 <option value="no" selected>No</option>
495 <option value="yes">Yes</option>
498 <td><input type="text" name="no_auto_renewal_after" id="no_auto_renewal_after" size="3" /></td>
500 <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"/>
501 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
503 <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
504 <td><input type="text" name="holds_per_day" id="holds_per_day" size="2" /></td>
505 <td><input type="text" name="holds_per_record" id="holds_per_record" size="2" /></td>
507 <select name="onshelfholds" id="onshelfholds">
508 <option value="1">Yes</option>
509 <option value="0">If any unavailable</option>
510 <option value="2">If all unavailable</option>
514 <select id="opacitemholds" name="opacitemholds">
515 <option value="N">Don't allow</option>
516 <option value="Y">Allow</option>
517 <option value="F">Force</option>
520 [% IF Koha.Preference('ArticleRequests') %]
522 <select id="article_requests" name="article_requests">
523 <option value="no">No</option>
524 <option value="yes">Yes</option>
525 <option value="bib_only">Record only</option>
526 <option value="item_only">Item only</option>
530 <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
531 [% IF Koha.Preference('UseRecalls') %]
532 <td><input type="text" name="recalls_allowed" id="recalls_allowed" size="3"></td>
533 <td><input type="text" name="recalls_per_record" id="recalls_per_record" size="3"></td>
535 <select name="on_shelf_recalls" id="on_shelf_recalls">
536 <option value="any">If any unavailable</option>
537 <option value="all">If all unavailable</option>
540 <td><input type="text" name="recall_due_date_interval" id="recall_due_date_interval" size="3"></td>
541 <td><input type="text" name="recall_overdue_fine" id="recall_overdue_fine" size="6"></td>
542 <td><input type="text" name="recall_shelf_time" id="recall_shelf_time" size="3"></td>
545 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
546 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
547 <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button>
554 <th>Patron category</th>
559 <th>Current checkouts allowed</th>
560 <th>Current on-site checkouts allowed</th>
564 <th>Hard due date</th>
565 <th>Decreased loan period for high holds (day)</th>
567 <th>Fine charging interval</th>
568 <th>Charge when?</th>
569 <th>Fine grace period</th>
570 <th>Overdue fines cap (amount)</th>
571 <th>Cap fine at replacement price</th>
572 <th>Suspension in days (day)</th>
573 <th>Max. suspension duration (day)</th>
574 <th>Suspension charging interval</th>
575 <th>Renewals allowed (count)</th>
576 [% IF Koha.Preference('UnseenRenewals') %]
577 <th>Unseen renewals allowed (count)</th>
579 <th>Renewal period</th>
580 <th>No renewal before</th>
581 <th>Automatic renewal</th>
582 <th>No automatic renewal after</th>
583 <th>No automatic renewal after (hard limit)</th>
584 <th>Holds allowed (total)</th>
585 <th>Holds allowed (daily)</th>
586 <th>Holds per record (count)</th>
587 <th>On shelf holds allowed</th>
588 <th>OPAC item level holds</th>
589 [% IF Koha.Preference('ArticleRequests') %]
590 <th>Article requests</th>
592 <th>Rental discount (%)</th>
593 [% IF Koha.Preference('UseRecalls') %]
594 <th>Recalls allowed (total)</th>
595 <th>Recalls per record (count)</th>
596 <th>On shelf recalls allowed</th>
597 <th>Recall due date interval (day)</th>
598 <th>Recall overdue fine amount</th>
599 <th>Recall pickup period (day)</th>
606 </div><!-- ./page-section -->
608 <div id="defaults-for-this-library" class="page-section">
609 <h2>Default checkout, hold and return policy[% IF humanbranch %] for [% Branches.GetName( humanbranch ) | html %][% END %]</h2>
610 <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>
611 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
612 <input type="hidden" name="op" value="set-branch-defaults" />
613 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
617 <th>Total current checkouts allowed</th>
618 <th>Total current on-site checkouts allowed</th>
619 <th>Maximum total holds allowed (count)</th>
621 <th>Hold pickup library match</th>
622 <th>Return policy</th>
623 <th class="noExport">Actions</th>
625 [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty', { want_rule => 1 } ) %]
626 [% SET patron_maxonsiteissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxonsiteissueqty', { want_rule => 1 } ) %]
627 [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds', { want_rule => 1 } ) %]
628 [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed', { want_rule => 1 } ) %]
629 [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy', { want_rule => 1 }) %]
630 [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch', { want_rule => 1 }) %]
631 [% SET default_checkout_hold_and_return_policy = ( patron_maxissueqty || patron_maxonsiteissueqty || rule_value || holdallowed || hold_fulfillment_policy || returnbranch ) %]
634 [% IF ( default_checkout_hold_and_return_policy ) %]
643 <input type="text" name="patron_maxissueqty" size="9" value="[% patron_maxissueqty.rule_value | html %]" placeholder="Unlimited"/>
646 <input type="text" name="patron_maxonsiteissueqty" size="9" value="[% patron_maxonsiteissueqty.rule_value | html %]" placeholder="Unlimited"/>
649 <input name="max_holds" size="9" value="[% rule_value.rule_value | html %]" placeholder="Unlimited"/>
652 <select name="holdallowed">
657 [% IF holdallowed.rule_value == 'from_any_library' %]
658 <option value="from_any_library" selected="selected">
660 <option value="from_any_library">
665 [% IF holdallowed.rule_value == 'from_local_hold_group' %]
666 <option value="from_local_hold_group" selected="selected">
668 <option value="from_local_hold_group">
670 From local hold group
673 [% IF holdallowed.rule_value == 'from_home_library' %]
674 <option value="from_home_library" selected="selected">
676 <option value="from_home_library">
681 [% IF holdallowed.rule_value == 'not_allowed' %]
682 <option value="not_allowed" selected="selected">
684 <option value="not_allowed">
691 <select name="hold_fulfillment_policy">
697 [% IF hold_fulfillment_policy.rule_value == 'any' %]
698 <option value="any" selected="selected">
707 [% IF hold_fulfillment_policy.rule_value == 'holdgroup' %]
708 <option value="holdgroup" selected="selected">
712 <option value="holdgroup">
717 [% IF hold_fulfillment_policy.rule_value == 'patrongroup' %]
718 <option value="patrongroup" selected="selected">
722 <option value="patrongroup">
727 [% IF hold_fulfillment_policy.rule_value == 'homebranch' %]
728 <option value="homebranch" selected="selected">
732 <option value="homebranch">
737 [% IF hold_fulfillment_policy.rule_value == 'holdingbranch' %]
738 <option value="holdingbranch" selected="selected">
739 item's holding library
742 <option value="holdingbranch">
743 item's holding library
749 <select name="returnbranch">
755 [% IF returnbranch.rule_value == 'homebranch' %]
756 <option value="homebranch" selected="selected">
758 <option value="homebranch">
762 [% IF returnbranch.rule_value == 'holdingbranch' %]
763 <option value="holdingbranch" selected="selected">
765 <option value="holdingbranch">
767 Item returns to issuing library
769 [% IF returnbranch.rule_value == 'noreturn' %]
770 <option value="noreturn" selected="selected">
772 <option value="noreturn">
779 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
780 [% IF ( default_checkout_hold_and_return_policy ) %]
781 <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>
789 [% IF ( show_branch_cat_rule_form ) %]
790 <div id="holds-policy-by-patron-category" class="page-section">
791 <h2>[% IF humanbranch %]Checkout, hold policy by patron category for [% Branches.GetName( humanbranch ) | html %][% ELSE %]Default checkout, hold policy by patron category[% END %]</h2>
792 <p>For this library, you can specify the maximum number of loans that
793 a patron of a given category can make, regardless of the item type.
795 <p>If the total amount loanable for a given patron category is left blank,
796 no limit applies, except possibly for a limit you define for a specific item type.
798 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
799 <input type="hidden" name="op" value="add-branch-cat" />
800 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
803 <th>Patron category</th>
804 <th>Total current checkouts allowed</th>
805 <th>Total current on-site checkouts allowed</th>
806 <th>Total holds allowed</th>
809 [% FOREACH c IN categorycodes %]
811 [% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxissueqty' ) %]
812 [% SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxonsiteissueqty' ) %]
813 [% SET max_holds = CirculationRules.Search( branchcode, c, undef, 'max_holds' ) %]
815 [% IF ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %]
821 [% Categories.GetName(c) | html %]
825 [% IF patron_maxissueqty.defined && patron_maxissueqty != '' %]
826 [% patron_maxissueqty | html %]
828 <span>Unlimited</span>
832 [% IF patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' %]
833 [% patron_maxonsiteissueqty | html %]
835 <span>Unlimited</span>
839 [% IF max_holds.defined && max_holds != '' %]
840 [% max_holds | html %]
842 <span>Unlimited</span>
847 <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"></i> Delete</a>
854 <select name="categorycode">
855 [% FOREACH patron_category IN patron_categories%]
856 <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
860 <td><input name="patron_maxissueqty" size="3" type="text" /></td>
861 <td><input name="patron_maxonsiteissueqty" size="3" type="text" /></td>
862 <td><input name="max_holds" size="3" type="text" /></td>
863 <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td>
870 <div id="waiting-hold-cancel-category" class="page-section">
872 <h2>Waiting hold cancellation policy for [% Branches.GetName( humanbranch ) | html %]</h2>
874 <h2>Default waiting hold cancellation policy</h2>
876 <p>Specify if waiting holds can be cancelled for a given patron category.</p>
877 <form id="set-waiting-hold-cancellation" method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
878 <input type="hidden" name="op" value="set-waiting-hold-cancellation" />
879 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
882 <th>Patron category</th>
884 <th>Cancellation allowed</th>
887 [% FOREACH c IN categorycodes %]
888 [% SET c = '*' UNLESS c.defined AND c != '' %]
889 [% FOREACH i IN itemtypes %]
890 [% SET i = '*' UNLESS i.defined AND i != '' %]
892 [% SET waiting_hold_cancellation = CirculationRules.Search( current_branch, c, i, 'waiting_hold_cancellation' ) %]
894 [% IF ( waiting_hold_cancellation.defined && waiting_hold_cancellation != '' ) %]
900 [% Categories.GetName(c) | html %]
907 [% ItemTypes.GetDescription(i,1) | html %]
911 [% IF waiting_hold_cancellation %]
918 <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"></i> Delete</a>
926 <select name="waiting_hold_cancellation_category" id="waiting_hold_cancellation_category">
927 <option value="*">All</option>
928 [% FOREACH patron_category IN patron_categories %]
929 <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
934 <select name="waiting_hold_cancellation_itemtype" id="waiting_hold_cancellation_itemtype">
935 <option value="*">All</option>
936 [% FOREACH itemtype IN itemtypeloop %]
937 <option value="[% itemtype.itemtype | html %]">[% ItemTypes.GetDescription(itemtype.itemtype) | html %]</option>
942 <select name="waiting_hold_cancellation_policy" id="waiting_hold_cancellation_policy">
943 <option value="0" selected>No</option>
944 <option value="1">Yes</option>
947 <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td>
953 [% IF Koha.Preference('ArticleRequests') %]
954 <div id="open-article-requests-limit-patron-category" class="page-section">
956 <h2>Daily open article requests limit for [% Branches.GetName( humanbranch ) | html %]</h2>
958 <h2>Default open article requests limit</h2>
960 <p>Specify the maximum number simultaneous current article requests a patron of a given category can have.</p>
961 <form id="set-article-requests-daily-limit" method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
962 <input type="hidden" name="op" value="add-open-article-requests-limit" />
963 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
966 <th>Patron category</th>
967 <th>Total article requests</th>
970 [% FOREACH c IN categorycodes %]
972 [% SET open_article_requests_limit = CirculationRules.Search( branchcode, c, undef, 'open_article_requests_limit' ) %]
974 [% IF ( open_article_requests_limit.defined && open_article_requests_limit != '' ) %]
977 [% Categories.GetName(c) | html %]
980 [% IF open_article_requests_limit.defined && open_article_requests_limit != '' %]
981 [% open_article_requests_limit | html %]
983 <span>Unlimited</span>
988 <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"></i> Delete</a>
995 <select name="categorycode">
996 [% FOREACH patron_category IN patron_categories %]
997 <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
1001 <td><input name="open_article_requests_limit" size="3" type="text" /></td>
1002 <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td>
1008 <div id="article-request-fee-category" class="page-section">
1009 [% IF humanbranch %]
1010 <h2>Article request fees for [% Branches.GetName( humanbranch ) | html %]</h2>
1012 <h2>Default article request fees</h2>
1014 <p>Specify the article request fee for a given patron category.</p>
1015 <form id="set-article-request-fee" method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
1016 <input type="hidden" name="op" value="set-article-request-fee" />
1017 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
1020 <th>Patron category</th>
1024 [% FOREACH c IN categorycodes %]
1025 [% SET c = '*' UNLESS c.defined AND c != '' %]
1027 [% SET article_request_fee = CirculationRules.Search( current_branch, c, undef, 'article_request_fee' ) %]
1029 [% IF ( article_request_fee.defined && article_request_fee != '' ) %]
1035 [% Categories.GetName(c) | html %]
1039 [% IF article_request_fee.defined && article_request_fee != '' %]
1040 [% article_request_fee | html %]
1045 <td class="actions">
1046 <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"></i> Delete</a>
1053 <select name="article_request_fee_category" id="article_request_fee_category">
1054 <option value="*">All</option>
1055 [% FOREACH patron_category IN patron_categories%]
1056 <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
1060 <td><input name="article_request_fee" size="3" type="text" /></td>
1061 <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td>
1068 <div id="refund-lost-item-fee-on-return" class="page-section">
1069 [% IF current_branch == '*' %]
1070 <h2>Default lost item fee refund on return policy</h2>
1072 <h2>Lost item fee refund on return policy for [% Branches.GetName(current_branch) | html %]</h2>
1074 <p>Specify the default policy for lost item fees on return.</p>
1075 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
1076 <input type="hidden" name="op" value="mod-refund-lost-item-fee-rule" />
1077 <input type="hidden" name="branch" value="[% current_branch | html %]" />
1080 <th>Refund lost item replacement fee</th>
1081 <th>Refund lost item processing fee</th>
1086 <select name="lostreturn">
1087 [%# Default branch %]
1088 [% IF ( current_branch == '*' ) %]
1089 [% IF ( defaultRefundRule == 'refund' ) %]
1090 <option value="refund" selected="selected">Refund lost item charge</option>
1091 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1092 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1093 <option value="restore">Refund lost item charge and restore overdue fine</option>
1094 <option value="0">Leave lost item charge</option>
1095 [% ELSIF ( defaultRefundRule == 'refund_unpaid' ) %]
1096 <option value="refund">Refund lost item charge</option>
1097 <option value="refund_unpaid" selected="selected">Refund lost item charge (only if unpaid)</option>
1098 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1099 <option value="restore">Refund lost item charge and restore overdue fine</option>
1100 <option value="0">Leave lost item charge</option>
1101 [% ELSIF ( defaultRefundRule == 'charge' ) %]
1102 <option value="refund">Refund lost item charge</option>
1103 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1104 <option value="charge" selected="selected">Refund lost item charge and charge new overdue fine</option>
1105 <option value="restore">Refund lost item charge and restore overdue fine</option>
1106 <option value="0">Leave lost item charge</option>
1107 [% ELSIF ( defaultRefundRule == 'restore' ) %]
1108 <option value="refund">Refund lost item charge</option>
1109 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1110 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1111 <option value="restore" selected="selected">Refund lost item charge and restore overdue fine</option>
1112 <option value="0">Leave lost item charge</option>
1113 [% ELSIF ( defaultRefundRule == 0 ) %]
1114 <option value="refund">Refund lost item charge</option>
1115 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1116 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1117 <option value="restore">Refund lost item charge and restore overdue fine</option>
1118 <option value="0" selected="selected">Leave lost item charge</option>
1120 <option value="refund">Refund lost item charge</option>
1121 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1122 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1123 <option value="restore">Refund lost item charge and restore overdue fine</option>
1124 <option value="0">Leave lost item charge</option>
1127 [%# Branch-specific %]
1128 [% IF ( not refundLostItemFeeRule ) %]
1129 <option value="*" selected="selected">
1133 [% IF defaultRefundRule == 'refund' %]
1134 <span>Use default (Refund lost item charge)</span>
1135 [% ELSIF defaultRefundRule == 'refund_unpaid' %]
1136 Use default (Refund lost item charge (only if unpaid))
1137 [% ELSIF defaultRefundRule == 'charge' %]
1138 <span>Use default (Refund lost item charge and charge new overdue fine)</span>
1139 [% ELSIF defaultRefundRule == 'restore' %]
1140 <span>Use default (Refund lost item charge and restore overdue fine)</span>
1142 <span>Use default (Leave lost item charge)</span>
1145 [% IF ( not refundLostItemFeeRule ) %]
1146 <option value="refund">Refund lost item charge</option>
1147 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1148 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1149 <option value="restore">Refund lost item charge and restore overdue fine</option>
1150 <option value="0">Leave lost item charge</option>
1152 [% IF ( refundLostItemFeeRule.rule_value == 'refund' ) %]
1153 <option value="refund" selected="selected">Refund lost item charge</option>
1154 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1155 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1156 <option value="restore">Refund lost item charge and restore overdue fine</option>
1157 <option value="0">Leave lost item charge</option>
1158 [% ELSIF ( refundLostItemFeeRule.rule_value == 'refund_unpaid' ) %]
1159 <option value="refund">Refund lost item charge</option>
1160 <option value="refund_unpaid" selected="selected">Refund lost item charge (only if unpaid)</option>
1161 <option value="charge" selected="selected">Refund lost item charge and charge new overdue fine</option>
1162 <option value="restore">Refund lost item charge and restore overdue fine</option>
1163 <option value="0">Leave lost item charge</option>
1164 [% ELSIF ( refundLostItemFeeRule.rule_value == 'charge' ) %]
1165 <option value="refund">Refund lost item charge</option>
1166 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1167 <option value="charge" selected="selected">Refund lost item charge and charge new overdue fine</option>
1168 <option value="restore">Refund lost item charge and restore overdue fine</option>
1169 <option value="0">Leave lost item charge</option>
1170 [% ELSIF ( refundLostItemFeeRule.rule_value == 'restore' ) %]
1171 <option value="refund">Refund lost item charge</option>
1172 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1173 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1174 <option value="restore" selected="selected">Refund lost item charge and restore overdue fine</option>
1175 <option value="0">Leave lost item charge</option>
1176 [% ELSIF ( refundLostItemFeeRule.rule_value == 0 ) %]
1177 <option value="refund">Refund lost item charge</option>
1178 <option value="refund_unpaid">Refund lost item charge (only if unpaid)</option>
1179 <option value="charge">Refund lost item charge and charge new overdue fine</option>
1180 <option value="restore">Refund lost item charge and restore overdue fine</option>
1181 <option value="0" selected="selected">Leave lost item charge</option>
1188 <select name="processingreturn">
1189 [%# Default branch %]
1190 [% IF ( current_branch == '*' ) %]
1191 [% IF ( defaultProcessingRefundRule == 'refund' ) %]
1192 <option value="refund" selected="selected">Refund lost item processing charge</option>
1193 <option value="refund_unpaid">Refund lost item processing charge (only if unpaid)</option>
1194 <option value="0">Leave lost item processing charge</option>
1195 [% ELSIF ( defaultProcessingRefundRule == 'refund_unpaid' ) %]
1196 <option value="refund">Refund lost item charge</option>
1197 <option value="refund_unpaid" selected="selected">Refund lost item processing charge (only if unpaid)</option>
1198 <option value="0">Leave lost item processing charge</option>
1199 [% ELSIF ( defaultProcessingRefundRule == 0 ) %]
1200 <option value="refund">Refund lost item processing charge</option>
1201 <option value="refund_unpaid">Refund lost item processing charge (only if unpaid)</option>
1202 <option value="0" selected="selected">Leave lost item processing charge</option>
1204 <option value="refund">Refund lost item processing charge</option>
1205 <option value="refund_unpaid">Refund lost item processing charge (only if unpaid)</option>
1206 <option value="0">Leave lost item processing charge</option>
1209 [%# Branch-specific %]
1210 [% IF ( not refundProcessingFeeRule ) %]
1211 <option value="*" selected="selected">
1215 [% IF defaultProcessingRefundRule == 'refund' %]
1216 <span>Use default (Refund lost item processing charge)</span>
1217 [% ELSIF defaultProcessingRefundRule == 'refund_unpaid' %]
1218 Use default (Refund lost item processing charge (only if unpaid))
1220 <span>Use default (Leave lost item processing charge)</span>
1223 [% IF ( not refundProcessingFeeRule ) %]
1224 <option value="refund">Refund lost item processing charge</option>
1225 <option value="refund_unpaid">Refund lost item processing charge (only if unpaid)</option>
1226 <option value="0">Leave lost item processing charge</option>
1228 [% IF ( refundProcessingFeeRule.rule_value == 'refund' ) %]
1229 <option value="refund" selected="selected">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>
1232 [% ELSIF ( refundProcessingFeeRule.rule_value == 'refund_unpaid' ) %]
1233 <option value="refund">Refund lost item processing charge</option>
1234 <option value="refund_unpaid" selected="selected">Refund lost item processing charge (only if unpaid)</option>
1235 <option value="0">Leave lost item processing charge</option>
1236 [% ELSIF ( refundProcessingFeeRule.rule_value == 0 ) %]
1237 <option value="refund">Refund lost item processing charge</option>
1238 <option value="refund_unpaid">Refund lost item processing charge (only if unpaid)</option>
1239 <option value="0" selected="selected">Leave lost item processing charge</option>
1245 <td class="actions">
1246 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
1253 <div id="holds-policy-by-item-type" class="page-section">
1254 <h2>[% IF humanbranch %]Holds policy by item type for [% Branches.GetName( humanbranch ) | html %][% ELSE %]Default holds policy by item type[% END %]</h2>
1256 For this library, you can edit rules for given itemtypes, regardless of the patron's category.
1259 Currently, this means hold policies. The various policies have the following effects:
1262 <li><strong>From any library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li>
1263 <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>
1264 <li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li>
1265 <li><strong>No holds allowed:</strong> No patron may put this book on hold.</li>
1268 <p><strong>Note: </strong>If the system preference 'AllowHoldPolicyOverride' is enabled, these policies can be overridden by your circulation staff.</p>
1269 <p><strong>Important:</strong></p>
1272 <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>
1273 <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>
1276 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
1277 <input type="hidden" name="op" value="add-branch-item" />
1278 <input type="hidden" name="branch" value="[% current_branch | html %]"/>
1282 <th>Hold policy</th>
1283 <th>Hold pickup library match</th>
1284 <th>Return policy</th>
1287 [% FOREACH i IN itemtypeloop %]
1288 [% SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, 'holdallowed' ) %]
1289 [% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, 'hold_fulfillment_policy' ) %]
1290 [% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, 'returnbranch' ) %]
1292 [% IF holdallowed || hold_fulfillment_policy || returnbranch %]
1295 [% i.translated_description | html %]
1298 [% IF holdallowed == 'from_any_library' %]
1299 <span>From any library</span>
1300 [% ELSIF holdallowed == 'from_local_hold_group' %]
1301 <span>From local hold group</span>
1302 [% ELSIF holdallowed == 'from_home_library' %]
1303 <span>From home library</span>
1305 <span>No holds allowed</span>
1309 [% IF hold_fulfillment_policy == 'any' %]
1310 <span>any library</span>
1311 [% ELSIF hold_fulfillment_policy == 'homebranch' %]
1312 <span>item's home library</span>
1313 [% ELSIF hold_fulfillment_policy == 'holdgroup' %]
1314 <span>item's hold group</span>
1315 [% ELSIF hold_fulfillment_policy == 'patrongroup' %]
1316 <span>patron's hold group</span>
1317 [% ELSIF hold_fulfillment_policy == 'holdingbranch' %]
1318 <span>item's holding library</span>
1322 [% IF returnbranch == 'homebranch' %]
1323 <span>Item returns home</span>
1324 [% ELSIF returnbranch == 'holdingbranch' %]
1325 <span>Item returns to issuing branch</span>
1326 [% ELSIF returnbranch == 'noreturn' %]
1327 <span>Item floats</span>
1330 <td class="actions">
1331 <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"></i> Delete</a>
1338 <select name="itemtype">
1339 [% FOREACH itemtypeloo IN itemtypeloop %]
1340 <option value="[% itemtypeloo.itemtype | html %]">[% itemtypeloo.translated_description | html %]</option>
1345 <select name="holdallowed">
1346 <option value="from_any_library">From any library</option>
1347 <option value="from_local_hold_group">From local hold group</option>
1348 <option value="from_home_library">From home library</option>
1349 <option value="not_allowed">No holds allowed</option>
1353 <select name="hold_fulfillment_policy">
1354 <option value="any">
1358 <option value="holdgroup">
1362 <option value="patrongroup">
1366 <option value="homebranch">
1370 <option value="holdingbranch">
1371 item's holding library
1376 <select name="returnbranch">
1377 <option value="homebranch">Item returns home</option>
1378 <option value="holdingbranch">Item returns to issuing library</option>
1379 <option value="noreturn">Item floats</option>
1382 <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td>
1388 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1390 <div class="col-sm-2 col-sm-pull-10">
1392 [% INCLUDE 'admin-menu.inc' %]
1394 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1395 </div> <!-- /.row -->
1397 [% MACRO jsinclude BLOCK %]
1398 [% Asset.js("js/admin-menu.js") | $raw %]
1399 [% INCLUDE 'datatables.inc' %]
1400 [% INCLUDE 'calendar.inc' %]
1401 [% INCLUDE 'columns_settings.inc' %]
1403 $(document).ready(function() {
1404 KohaTable("default-circulation-rules", {
1406 { "bVisible": false, "aTargets": [ 0,2 ] },
1407 { "bSortable": false, "aTargets": ["_all"] }
1409 "aaSortingFixed": [ [0,'asc'], [1,'asc'], [2,'asc'], [3,'asc'] ],
1415 function clear_edit(){
1416 var cancel = confirm(_("Are you sure you want to cancel your changes?"));
1417 if ( !cancel ) return;
1418 $('#default-circulation-rules td').removeClass('highlighted-row');
1419 var edit_row = $("#edit_row");
1420 $(edit_row).find("input").each(function(){
1421 var type = $(this).attr("type");
1422 if (type != "button" && type != "submit" ) {
1424 $(this).prop('disabled', false);
1426 if ( type == "checkbox" ) {
1427 $(this).prop('checked', false);
1430 $(edit_row).find("select").prop('disabled', false);
1431 $(edit_row).find("select option:first-child").attr("selected", "selected");
1432 $(edit_row).find("td:last input[name='clear']").remove();
1435 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone.");
1437 $(document).ready(function() {
1438 $('[data-toggle="popover"]').popover();
1440 $(".delete").on("click",function(){
1441 return confirmDelete(MSG_CONFIRM_DELETE);
1444 $("#clone_rules").on("click",function(){
1445 var library_dropdown = document.getElementById("branch");
1446 var selected_library = library_dropdown.options[library_dropdown.selectedIndex].value;
1447 var selected_library_text = $("#branch option:selected").text();
1448 var to_library = $("#tobranch option:selected").text();
1449 var MSG_CONFIRM_CLONE;
1450 if (selected_library === "*") {
1451 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);
1452 return confirmClone(MSG_CONFIRM_CLONE);
1454 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);
1455 return confirmClone(MSG_CONFIRM_CLONE);
1459 $('#selectlibrary').find("input:submit").hide();
1460 $('#branch').change(function() {
1461 $('#selectlibrary').submit();
1463 $(".editrule").click(function(){
1464 if ( $("#edit_row").find("input[type='text']").filter(function(){return this.value.length > 0 }).length > 0 ) {
1465 var edit = confirm(_("Are you sure you want to edit another rule?"));
1466 if (!edit) return false;
1468 $('#default-circulation-rules td').removeClass('highlighted-row');
1469 $(this).parent().parent().find("td").each(function (i) {
1470 $(this).addClass('highlighted-row');
1471 itm = $(this).text();
1472 itm = itm.replace(/^\s*|\s*$/g,'');
1473 var current_column = $("#edit_row td:eq("+i+")");
1475 // specific processing for the Note column
1476 var note = $(this).find("a[name='viewnote']").data("content");
1477 $(current_column).find("input[type='text']").val(note);
1478 } else if ( i == 9 ) {
1479 // specific processing for the Hard due date column
1480 var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
1481 var input_value = '';
1482 if (typeof select_value === 'undefined'){
1483 select_value = '-1';
1485 input_value = itm.split(' ')[1];
1487 $(current_column).find("input[type='text']").val(input_value);
1488 $(current_column).find("select").val(select_value);
1489 } else if ( i == 16 ) {
1490 // specific processing for cap_fine_to_replacement_price
1491 var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
1492 $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
1493 $('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') );
1495 $(current_column).find("input[type='text']").val(itm);
1496 // select the corresponding option
1497 $(current_column).find("select option").each(function(){
1498 opt = $(this).text().toLowerCase();
1499 opt = opt.replace(/ \(\w*?\)$/,""); //If option is a parent, compare without (All) or the equivalent in other languages
1500 itm = itm.replace(/.*->(.*)/,"$1"); //If item type is part of a group we need to clear the parent description
1501 opt = opt.replace(/^\s*|\s*$/g,'');
1502 if ( opt == itm.toLowerCase() ) {
1503 $(this).attr('selected', 'selected');
1506 if ( i == 0 || i == 1 ) {
1507 // Disable the 2 first columns, we cannot update them.
1508 var val = $(current_column).find("select option:selected").val();
1509 var name = "categorycode";
1513 // Remove potential previous input added
1514 $(current_column).find("input").remove();
1515 $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
1516 } else if ( i == 5 || i == 6 || i == 26 || i == 27 || i == 28 ) {
1517 // If the value is not an integer for
1518 // - "Current checkouts allowed"
1519 // - "Current on-site checkouts allowed"
1520 // - "Holds allowed (total)"
1521 // - "Holds allowed (daily)"
1522 // - "Holds per record (count)"
1523 // The value is "Unlimited" (or an equivalent translated string)
1524 // an it should be set to an empty string
1525 if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
1526 $(current_column).find("input[type='text']").val("");
1531 $("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true);
1532 $("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true);
1535 $(".clear_edit").on("click",function(e){
1540 $("#set-article-requests-daily-limit").on("submit", function(){
1541 if (! $("input[name='open_article_requests_limit'").val().length){
1542 alert("Please set a daily limit for this patron's category");
1548 $("#set-article-request-fee").on("submit", function(){
1549 if (! $("input[name='article_request_fee'").val().length){
1550 alert("Please set a valid value for the fee");
1558 [% INCLUDE 'intranet-bottom.inc' %]