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