Bug 15532: Add ability to allow only items whose home/holding branch matches the...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / smart-rules.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Circulation and fine rules</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <script type="text/javascript">
6 //<![CDATA[
7
8 function clear_edit(){
9     var cancel = confirm(_("Are you sure you want to cancel your changes?"));
10     if ( !cancel ) return;
11     $('#default-circulation-rules td').removeClass('highlighted-row');
12     var edit_row = $("#edit_row");
13     $(edit_row).find("input").each(function(){
14         var type = $(this).attr("type");
15         if (type != "button" && type != "submit" ) {
16             $(this).val("");
17             $(this).removeAttr("disabled");
18         }
19         if ( type == "checkbox" ) {
20             $(this).attr('checked', false);
21         }
22     });
23     $(edit_row).find("select").removeAttr("disabled");
24     $(edit_row).find("select option:first").attr("selected", "selected");
25     $(edit_row).find("td:last input[name='clear']").remove();
26 }
27
28 $(document).ready(function() {
29         $('#cap_fine_to_replacement_price').on('change', function(){
30             $('#overduefinescap').prop('disabled', $(this).is(':checked') );
31         });
32         $('#selectlibrary').find("input:submit").hide();
33         $('#branch').change(function() {
34                 $('#selectlibrary').submit();
35         });
36         $(".editrule").click(function(){
37             if ( $(edit_row).find("input[type='text'][value!='']").length > 0 ) {
38                 var edit = confirm(_("Are you sure you want to edit another rule?"));
39                 if (!edit) return false;
40             }
41             $('#default-circulation-rules td').removeClass('highlighted-row');
42             $(this).parent().parent().find("td").each(function (i) {
43                 $(this).addClass('highlighted-row');
44                 itm = $(this).text();
45                 itm = itm.replace(/^\s*|\s*$/g,'');
46                 var current_column = $("#edit_row td:eq("+i+")");
47                 if ( i == 6 ) {
48                     // specific processing for the Hard due date column
49                     var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
50                     var input_value = '';
51                     if (typeof select_value === 'undefined'){
52                         select_value = '-1';
53                     }else {
54                         input_value = itm.split(' ')[1];
55                     }
56                     $(current_column).find("input[type='text']").val(input_value);
57                     $(current_column).find("select").val(select_value);
58                 } else if ( i == 12 ) {
59                     // specific processing for cap_fine_to_replacement_price
60                     var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
61                     $('#cap_fine_to_replacement_price').attr('checked', cap_fine_to_replacement_price.is(':checked') );
62                     $('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') );
63                 } else {
64                     $(current_column).find("input[type='text']").val(itm);
65                     // select the corresponding option
66                     $(current_column).find("select option").each(function(){
67                         opt = $(this).text().toLowerCase();
68                         opt = opt.replace(/^\s*|\s*$/g,'');
69                         if ( opt == itm.toLowerCase() ) {
70                             $(this).attr('selected', 'selected');
71                         }
72                     });
73                     if ( i == 0 || i == 1 ) {
74                         // Disable the 2 first columns, we cannot update them.
75                         var val = $(current_column).find("select option:selected").val();
76                         var name = "categorycode";
77                         if ( i == 1 ) {
78                             name="itemtype";
79                         }
80                         // Remove potential previous input added
81                         $(current_column).find("input").remove();
82                         $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
83                     } else if ( i == 2 || i == 3 ) {
84                         // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed"
85                         // The value is "Unlimited" (or an equivalent translated string)
86                         // an it should be set to an empty string
87                         if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
88                             $(current_column).find("input[type='text']").val("");
89                         }
90                     }
91                 }
92             });
93             $("#default-circulation-rules tr:last td:eq(0) select").attr('disabled', 'disabled');
94             $("#default-circulation-rules tr:last td:eq(1) select").attr('disabled', 'disabled');
95             return false;
96         });
97 });
98 //]]>
99 </script>
100 </head>
101 <body id="admin_smart-rules" class="admin">
102 [% INCLUDE 'header.inc' %]
103 [% INCLUDE 'cat-search.inc' %]
104
105 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; Circulation and fine rules</div>
106
107 <div id="doc3" class="yui-t1">
108
109 <div id="bd">
110     <div id="yui-main">
111     <div class="yui-b">
112     <h1 class="parameters">
113         [% IF ( humanbranch ) %]
114             Defining circulation and fine rules for "[% humanbranch %]"
115         [% ELSE %]
116             Defining circulation and fine rules for all libraries
117         [% END %]
118     </h1>
119     <div class="help">
120         <p>The rules are applied from most specific to less specific, using the first found in this order:</p>
121         <ul>
122             <li>same library, same patron type, same item type</li>
123             <li>same library, same patron type, all item types</li>
124             <li>same library, all patron types, same item type</li>
125             <li>same library, all patron types, all item types</li>
126             <li>default (all libraries), same patron type, same item type</li>
127             <li>default (all libraries), same patron type, all item types</li>
128             <li>default (all libraries), all patron types, same item type</li>
129             <li>default (all libraries), all patron types, all item types</li>
130         </ul>
131         <p>To modify a rule, create a new one with the same patron type and item type.</p>
132     </div>
133     <div>
134         <form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary">
135         Select a library :
136             <select name="branch" id="branch" style="width:20em;">
137                 <option value="*">All libraries</option>
138             [% FOREACH branchloo IN branchloop %]
139                                 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
140             [% END %]
141             </select>
142         </form>
143 [% IF ( definedbranch ) %]<form action="/cgi-bin/koha/admin/clone-rules.pl" method="post"><label 
144 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidden" name="frombranch" value="[% current_branch %]" />
145             <select name="tobranch" id="tobranch">[% FOREACH branchloo IN branchloop %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]</select> <input type="submit" value="Clone" /></form>[% END %]
146
147         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
148             <input type="hidden" name="op" value="add" />
149             <input type="hidden" name="branch" value="[% current_branch %]"/>
150             <table id="default-circulation-rules">
151             <thead>
152             <tr>
153                 <th>Patron category</th>
154                 <th>Item type</th>
155                 <th>Current checkouts allowed</th>
156                 <th>Current on-site checkouts allowed</th>
157                 <th>Loan period</th>
158                 <th>Unit</th>
159                 <th>Hard due date</th>
160                 <th>Fine amount</th>
161                 <th>Fine charging interval</th>
162                 <th>When to charge</th>
163                 <th>Fine grace period</th>
164                 <th>Overdue fines cap (amount)</th>
165                 <th>Cap fine at replacement price</th>
166                 <th>Suspension in days (day)</th>
167                 <th>Max. suspension duration (day)</th>
168                 <th>Renewals allowed (count)</th>
169                 <th>Renewal period</th>
170                 <th>No renewal before</th>
171                 <th>Automatic renewal</th>
172                 <th>Holds allowed (count)</th>
173                 <th>On shelf holds allowed</th>
174                 <th>Item level holds</th>
175                 <th>Rental discount (%)</th>
176                 <th colspan="2">&nbsp;</th>
177             </tr>
178             </thead>
179             <tbody>
180                                 [% FOREACH rule IN rules %]
181                                         <tr id="row_[% loop.count %]">
182                                                         <td>[% IF ( rule.default_humancategorycode ) %]
183                                                                         <em>All</em>
184                                                                 [% ELSE %]
185                                                                         [% rule.humancategorycode %]
186                                                                 [% END %]
187                                                         </td>
188                             <td>[% IF rule.default_translated_description %]
189                                                                         <em>All</em>
190                                                                 [% ELSE %]
191                                                                         [% rule.translated_description %]
192                                                                 [% END %]
193                                                         </td>
194                                                         <td>[% IF ( rule.unlimited_maxissueqty ) %]
195                                                                         Unlimited
196                                                                 [% ELSE %]
197                                                                         [% rule.maxissueqty %]
198                                                                 [% END %]
199                                                         </td>
200                             <td>[% IF rule.unlimited_maxonsiteissueqty %]
201                                     Unlimited
202                                 [% ELSE %]
203                                     [% rule.maxonsiteissueqty %]
204                                 [% END %]
205                             </td>
206                                                         <td>[% rule.issuelength %]</td>
207                                                         <td>
208                                                             [% rule.lengthunit %]
209                                                         </td>
210                             <td>
211                               [% IF ( rule.hardduedate ) %]
212                                 [% IF ( rule.hardduedatebefore ) %]
213                                   before [% rule.hardduedate %]
214                                   <input type="hidden" name="hardduedatecomparebackup" value="-1" />
215                                 [% ELSIF ( rule.hardduedateexact ) %]
216                                   on [% rule.hardduedate %]
217                                   <input type="hidden" name="hardduedatecomparebackup" value="0" />
218                                 [% ELSIF ( rule.hardduedateafter ) %]
219                                   after [% rule.hardduedate %]
220                                   <input type="hidden" name="hardduedatecomparebackup" value="1" />
221                                 [% END %]
222                               [% ELSE %]
223                                 None defined
224                               [% END %]
225                             </td>
226                                                         <td>[% rule.fine %]</td>
227                                                         <td>[% rule.chargeperiod %]</td>
228                 <td>[% IF rule.chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]</td>
229                                                         <td>[% rule.firstremind %]</td>
230                             <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
231                             <td>
232                                 [% IF rule.cap_fine_to_replacement_price %]
233                                     <input type="checkbox" checked="checked" disabled="disabled" />
234                                 [% ELSE %]
235                                     <input type="checkbox" disabled="disabled" />
236                                 [% END %]
237                             </td>
238                                                         <td>[% rule.finedays %]</td>
239                             <td>[% rule.maxsuspensiondays %]</td>
240                                                         <td>[% rule.renewalsallowed %]</td>
241                             <td>[% rule.renewalperiod %]</td>
242                             <td>[% rule.norenewalbefore %]</td>
243                             <td>
244                                 [% IF ( rule.auto_renew ) %]
245                                 Yes
246                                 [% ELSE %]
247                                 No
248                                 [% END %]
249                             </td>
250                                                         <td>[% rule.reservesallowed %]</td>
251                                                         <td>[% IF rule.onshelfholds %]Yes[% ELSE %]No[% END %]</td>
252                                                         <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
253                                                         <td>[% rule.rentaldiscount %]</td>
254                             <td><a href="#" class="editrule">Edit</a></td>
255                                                         <td>
256                                                                 <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype %]&amp;categorycode=[% rule.categorycode %]&amp;branch=[% rule.current_branch %]">Delete</a>
257                                                         </td>
258                         </tr>
259                 [% END %]
260                 <tr id="edit_row">
261                     <td>
262                         <select name="categorycode" id="categorycode">
263                             <option value="*">All</option>
264                         [% FOREACH categoryloo IN categoryloop %]
265                             <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
266                         [% END %]
267                         </select>
268                     </td>
269                     <td>
270                         <select name="itemtype" id="matrixitemtype" style="width:13em;">
271                             <option value="*">All</option>
272                         [% FOREACH itemtypeloo IN itemtypeloop %]
273                             <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option>
274                         [% END %]
275                         </select>
276                     </td>
277                     <td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td>
278                     <td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td>
279                     <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
280                     <td>
281                       <select name="lengthunit" id="lengthunit">
282                         <option value="days" selected="selected">Days</option>
283                         <option value="hours">Hours</option>
284                       </select>
285                     </td>
286                     <td>
287                         <select name="hardduedatecompare" id="hardduedatecompare">
288                            <option value="-1">Before</option>
289                            <option value="0">Exactly on</option>
290                            <option value="1">After</option>
291                         </select>
292                         <input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate %]" class="datepicker" />
293                         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
294                     </td>
295                     <td><input type="text" name="fine" id="fine" size="4" /></td>
296                     <td><input type="text" name="chargeperiod" id="chargeperiod" size="2" /></td>
297                     <td>
298                         <select name="chargeperiod_charge_at" id="chargeperiod_charge_at">
299                            <option value="0">End of interval</option>
300                            <option value="1">Start of interval</option>
301                         </select>
302                     </td>
303                     <td><input type="text" name="firstremind" id="firstremind" size="2" /> </td>
304                     <td><input type="text" name="overduefinescap" id="overduefinescap" size="6" /> </td>
305                     <td><input type="checkbox" name="cap_fine_to_replacement_price" id="cap_fine_to_replacement_price" /></td>
306                     <td><input type="text" name="finedays" id="fined" size="3" /> </td>
307                     <td><input type="text" name="maxsuspensiondays" id="maxsuspensiondays" size="3" /> </td>
308                     <td><input type="text" name="renewalsallowed" id="renewalsallowed" size="2" /></td>
309                     <td><input type="text" name="renewalperiod" id="renewalperiod" size="3" /></td>
310                     <td><input type="text" name="norenewalbefore" id="norenewalbefore" size="3" /></td>
311                     <td>
312                         <select name="auto_renew" id="auto_renew">
313                             <option value="no" selected>No</option>
314                             <option value="yes">Yes</option>
315                         </select>
316                     </td>
317                     <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
318                     <td>
319                         <select name="onshelfholds" id="onshelfholds">
320                             <option value="0" selected>No</option>
321                             <option value="1">Yes</option>
322                         </select>
323                     </td>
324                     <td>
325                         <select id="opacitemholds" name="opacitemholds">
326                             <option value="N">Don't allow</option>
327                             <option value="Y">Allow</option>
328                             <option value="F">Force</option>
329                         </select>
330                     </td>
331                     <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
332                     <td colspan="2">
333                         <input type="hidden" name="branch" value="[% current_branch %]"/>
334                         <input type="submit" value="Save" class="submit" />
335                         <input type="button" name="cancel" value="Clear" onclick="clear_edit();return false;" />
336                     </td>
337                 </tr>
338                 <tfoot>
339                     <tr>
340                       <th>Patron category</th>
341                       <th>Item type</th>
342                       <th>Current checkouts allowed</th>
343                       <th>Current on-site checkouts allowed</th>
344                       <th>Loan period</th>
345                       <th>Unit</th>
346                       <th>Hard due date</th>
347                       <th>Fine amount</th>
348                       <th>Fine charging interval</th>
349                       <th>Charge when?</th>
350                       <th>Fine grace period</th>
351                       <th>Overdue fines cap (amount)</th>
352                       <th>Cap fine at replacement price</th>
353                       <th>Suspension in days (day)</th>
354                       <th>Max. suspension duration (day)</th>
355                       <th>Renewals allowed (count)</th>
356                       <th>Renewal period</th>
357                       <th>No renewal before</th>
358                       <th>Automatic renewal</th>
359                       <th>Holds allowed (count)</th>
360                       <th>On shelf holds allowed</th>
361                       <th>Item level holds</th>
362                       <th>Rental discount (%)</th>
363                       <th colspan="2">&nbsp;</th>
364                     </tr>
365                   </tfoot>
366                 </tbody>
367             </table>
368         </form>
369     </div>
370     <div id="defaults-for-this-library" class="container">
371     <h3>Default checkout, hold and return policy[% IF ( humanbranch ) %] for [% humanbranch %][% END %]</h3>
372         <p>You can set a default maximum number of checkouts, hold policy and return policy that will be used if none is defined below for a particular item type or category.</p>
373         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
374             <input type="hidden" name="op" value="set-branch-defaults" />
375             <input type="hidden" name="branch" value="[% current_branch %]"/>
376             <table>
377                 <tr>
378                     <th>&nbsp;</th>
379                     <th>Total current checkouts allowed</th>
380                     <th>Total current on-site checkouts allowed</th>
381                     <th>Hold policy</th>
382                     <th>Hold pickup library match</th>
383                     <th>Return policy</th>
384                     <th>&nbsp;</th>
385                     <th>&nbsp;</th>
386                 </tr>
387                 <tr>
388                     <td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td>
389                     <td><input type="text" name="maxissueqty" size="3" value="[% default_maxissueqty %]"/></td>
390                     <td><input type="text" name="maxonsiteissueqty" size="3" value="[% default_maxonsiteissueqty %]"/></td>
391                     <td>
392                         <select name="holdallowed">
393                             [% IF ( default_holdallowed_any ) %]
394                             <option value="2" selected="selected">
395                             [% ELSE %]
396                             <option value="2">
397                             [% END %]
398                                 From any library
399                             </option>
400                             [% IF ( default_holdallowed_same ) %]
401                             <option value="1" selected="selected">
402                             [% ELSE %]
403                             <option value="1">
404                             [% END %]
405                                 From home library
406                             </option>
407                             [% IF ( default_holdallowed_none ) %]
408                             <option value="0" selected="selected">
409                             [% ELSE %]
410                             <option value="0">
411                             [% END %]
412                                 No holds allowed
413                             </option>
414                         </select>
415                     </td>
416                     <td>
417                         <select name="hold_fulfillment_policy">
418                             [% IF default_hold_fulfillment_policy == 'any' %]
419                                 <option value="any" selected="selected">
420                                     any library
421                                 </option>
422                             [% ELSE %]
423                                 <option value="any">
424                                     any library
425                                 </option>
426                             [% END %]
427
428                             [% IF default_hold_fulfillment_policy == 'homebranch' %]
429                                 <option value="homebranch" selected="selected">
430                                     item's home library
431                                 </option>
432                             [% ELSE %]
433                                 <option value="homebranch">
434                                     item's home library
435                                 </option>
436                             [% END %]
437
438                             [% IF default_hold_fulfillment_policy == 'holdingbranch' %]
439                                 <option value="holdingbranch" selected="selected">
440                                     item's holding library
441                                 </option>
442                             [% ELSE %]
443                                 <option value="holdingbranch">
444                                     item's holding library
445                                 </option>
446                             [% END %]
447                         </select>
448                     </td>
449                     <td>
450                         <select name="returnbranch">
451                             [% IF ( default_returnbranch == 'homebranch' ) %]
452                             <option value="homebranch" selected="selected">
453                             [% ELSE %]
454                             <option value="homebranch">
455                             [% END %]
456                                 Item returns home
457                             </option>
458                             [% IF ( default_returnbranch == 'holdingbranch' ) %]
459                             <option value="holdingbranch" selected="selected">
460                             [% ELSE %]
461                             <option value="holdingbranch">
462                             [% END %]
463                                 Item returns to issuing library
464                             </option>
465                             [% IF ( default_returnbranch == 'noreturn' ) %]
466                             <option value="noreturn" selected="selected">
467                             [% ELSE %]
468                             <option value="noreturn">
469                             [% END %]
470                                 Item floats
471                             </option>
472                         </select>
473                     </td>
474                     <td><input type="submit" value="Save" class="submit" /></td>
475                     <td>
476                         <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=*&amp;branch=[% current_branch %]">Unset</a>
477                     </td>
478                 </tr>
479             </table>
480         </form>
481     </div>
482     [% IF ( show_branch_cat_rule_form ) %]
483     <div id="holds-policy-by-patron-category" class="container">
484     <h3>[% IF humanbranch %]Checkout limit by patron category for [% humanbranch %][% ELSE %]Default checkout limit by patron category[% END %]</h3>
485         <p>For this library, you can specify the maximum number of loans that
486             a patron of a given category can make, regardless of the item type.
487         </p>
488         <p>If the total amount loanable for a given patron category is left blank,
489            no limit applies, except possibly for a limit you define for a specific item type.
490         </p>
491         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
492             <input type="hidden" name="op" value="add-branch-cat" />
493             <input type="hidden" name="branch" value="[% current_branch %]"/>
494             <table>
495                 <tr>
496                     <th>Patron category</th>
497                     <th>Total current checkouts allowed</th>
498                     <th>Total current on-site checkouts allowed</th>
499                     <th>&nbsp;</th>
500                 </tr>
501                 [% FOREACH branch_cat_rule_loo IN branch_cat_rule_loop %]
502                     [% UNLESS ( loop.odd ) %]
503                     <tr class="highlight">
504                     [% ELSE %]
505                     <tr>
506                     [% END %]
507                         <td>[% IF ( branch_cat_rule_loo.default_humancategorycode ) %]
508                                 <em>Default</em>
509                             [% ELSE %]
510                                 [% branch_cat_rule_loo.humancategorycode %]
511                             [% END %]
512                         </td>
513                         <td>[% IF ( branch_cat_rule_loo.unlimited_maxissueqty ) %]
514                                 Unlimited
515                             [% ELSE %]
516                                 [% branch_cat_rule_loo.maxissueqty %]
517                             [% END %]
518                         </td>
519                         <td>[% IF ( branch_cat_rule_loo.unlimited_maxonsiteissueqty ) %]
520                                 Unlimited
521                             [% ELSE %]
522                                 [% branch_cat_rule_loo.maxonsiteissueqty %]
523                             [% END %]
524                         </td>
525
526                         <td>
527                             <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=[% branch_cat_rule_loo.categorycode %]&amp;branch=[% current_branch %]">Delete</a>
528                         </td>
529                     </tr>
530                 [% END %]
531                 <tr>
532                     <td>
533                         <select name="categorycode">
534                         [% FOREACH categoryloo IN categoryloop %]
535                             <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
536                         [% END %]
537                         </select>
538                     </td>
539                     <td><input name="maxissueqty" size="3" /></td>
540                     <td><input name="maxonsiteissueqty" size="3" /></td>
541                     <td><input type="submit" value="Add" class="submit" /></td>
542                 </tr>
543             </table>
544         </form>
545     </div>
546     [% END %]
547     <div id="holds-policy-by-item-type" class="container">
548     <h3>[% IF humanbranch %]Holds policy by item type for [% humanbranch %][% ELSE %]Default holds policy by item type[% END %]</h3>
549         <p>
550             For this library, you can edit rules for given itemtypes, regardless
551             of the patron's category.
552         </p>
553         <p>
554             Currently, this means hold policies.
555             The various policies have the following effects:
556         </p>
557         <ul>
558             <li><strong>From any library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li>
559             <li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li>
560             <li><strong>No holds allowed:</strong> No patron may put this book on hold.</li>
561         </ul>
562         <p><strong>Note: </strong>If the system preference 'AllowHoldPolicyOverride' is enabled, these policies can be overridden by your circulation staff.</br />
563             <strong>Important: </strong>The policies are based on the patron's home library, not the library where the hold is being placed.
564         </p>
565
566         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
567             <input type="hidden" name="op" value="add-branch-item" />
568             <input type="hidden" name="branch" value="[% current_branch %]"/>
569             <table>
570                 <tr>
571                     <th>Item type</th>
572                     <th>Hold policy</th>
573                     <th>Hold pickup library match</th>
574                     <th>Return policy</th>
575                     <th>&nbsp;</th>
576                 </tr>
577                 [% FOREACH branch_item_rule_loo IN branch_item_rule_loop %]
578                     [% UNLESS ( loop.odd ) %]
579                     <tr class="highlight">
580                     [% ELSE %]
581                     <tr>
582                     [% END %]
583                         <td>[% IF ( branch_item_rule_loo.default_translated_description ) %]
584                                 <em>Default</em>
585                             [% ELSE %]
586                                 [% branch_item_rule_loo.translated_description %]
587                             [% END %]
588                         </td>
589                         <td>[% IF ( branch_item_rule_loo.holdallowed_any ) %]
590                                 From any library
591                             [% ELSIF ( branch_item_rule_loo.holdallowed_same ) %]
592                                 From home library
593                             [% ELSE %]
594                                 No holds allowed
595                             [% END %]
596                         </td>
597                         <td>[% IF ( branch_item_rule_loo.hold_fulfillment_policy == 'any' ) %]
598                                 any library
599                             [% ELSIF ( branch_item_rule_loo.hold_fulfillment_policy == 'homebranch' ) %]
600                                 item's home library
601                             [% ELSIF ( branch_item_rule_loo.hold_fulfillment_policy == 'holdingbranch' ) %]
602                                 item's holding library
603                             [% END %]
604                         </td>
605                         <td>[% IF ( branch_item_rule_loo.returnbranch == 'homebranch' ) %]
606                                 Item returns home
607                             [% ELSIF ( branch_item_rule_loo.returnbranch == 'holdingbranch' ) %]
608                                 Item returns to issuing branch
609                             [% ELSIF ( branch_item_rule_loo.returnbranch == 'noreturn' ) %]
610                                 Item floats
611                             [% ELSE %]
612                                 Error - unknown option
613                             [% END %]
614                         </td>
615                         <td>
616                             <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&amp;itemtype=[% branch_item_rule_loo.itemtype %]&amp;branch=[% current_branch %]">Delete</a>
617                         </td>
618                     </tr>
619                 [% END %]
620                 <tr>
621                     <td>
622                         <select name="itemtype">
623                         [% FOREACH itemtypeloo IN itemtypeloop %]
624                             <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option>
625                         [% END %]
626                         </select>
627                     </td>
628                     <td>
629                         <select name="holdallowed">
630                             <option value="2">From any library</option>
631                             <option value="1">From home library</option>
632                             <option value="0">No holds allowed</option>
633                         </select>
634                     </td>
635                     <td>
636                         <select name="hold_fulfillment_policy">
637                             <option value="any">
638                                 any library
639                             </option>
640
641                             <option value="homebranch">
642                                 item's home library
643                             </option>
644
645                             <option value="holdingbranch">
646                                 item's holding library
647                             </option>
648                         </select>
649                     </td>
650                     <td>
651                         <select name="returnbranch">
652                             <option value="homebranch">Item returns home</option>
653                             <option value="holdingbranch">Item returns to issuing library</option>
654                             <option value="noreturn">Item floats</option>
655                         </select>
656                     </td>
657                     <td><input type="submit" value="Add" class="submit" /></td>
658                 </tr>
659             </table>
660         </form>
661     </div>
662 </div>
663
664 </div>
665 <div class="yui-b">
666 [% INCLUDE 'admin-menu.inc' %]
667 </div>
668 </div>
669 [% INCLUDE 'intranet-bottom.inc' %]