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