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