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