Bug 7144 string follow-up: reordering text
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / smart-rules.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Circulation and Fine Rules</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4
5 <script type="text/javascript">
6 //<![CDATA[
7 $(document).ready(function() {
8         $('#selectlibrary').find("input:submit").hide();
9         $('#branch').change(function() {
10                 $('#selectlibrary').submit();
11         });
12 });
13 //]]>
14 </script>
15 <!-- Enable Calendar system -->
16 <link rel="stylesheet" type="text/css" href="[% themelang %]/lib/calendar/calendar-system.css" />
17 <script type="text/javascript" src="[% themelang %]/lib/calendar/calendar.js"></script>
18 <script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-en.js"></script>
19 <script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-setup.js"></script>
20 <!-- End Calendar system additions -->
21 </head>
22 <body>
23 [% INCLUDE 'header.inc' %]
24 [% INCLUDE 'cat-search.inc' %]
25
26 <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>
27
28 <div id="doc3" class="yui-t1">
29
30 <div id="bd">
31     <div id="yui-main">
32     <div class="yui-b">
33     <h1 class="parameters">
34         [% IF ( humanbranch ) %]
35             Defining circulation and fine rules for "[% humanbranch %]"
36         [% ELSE %]
37             Defining circulation and fine rules for all libraries
38         [% END %]
39     </h1>
40     <div class="help">
41         <p>The rules are applied from most specific to less specific, using the first found in this order:</p>
42         <ul>
43             <li>same library, same patron type, same item type</li>
44             <li>same library, same patron type, all item types</li>
45             <li>same library, all patron types, same item type</li>
46             <li>same library, all patron types, all item types</li>
47             <li>all libraries, same patron type, same item type</li>
48             <li>all libraries, same patron type, all item types</li>
49             <li>all libraries, all patron types, same item type</li>
50             <li>all libraries, all patron types, all item types</li>
51         </ul>
52         <p>To modify a rule, create a new one with the same patron type and item type.</p>
53     </div>
54     <div>
55         <form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary">
56         Select a library :
57             <select name="branch" id="branch" style="width:20em;">
58                 <option value="*">All libraries</option>
59             [% FOREACH branchloo IN branchloop %]
60                                 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
61             [% END %]
62             </select>
63         </form>
64 [% IF ( definedbranch ) %]<form action="/cgi-bin/koha/admin/clone-rules.pl" method="post"><label 
65 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidden" name="frombranch" value="[% current_branch %]" />
66             <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 %]</fieldset>
67
68         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
69             <input type="hidden" name="op" value="add" />
70             <table>
71             <tr>
72                 <th>Patron category</th>
73                 <th>Item type</th>
74                 <th>Current checkouts allowed</th>
75                 <th>Loan period (day)</th>
76                 <th>Hard due date</th>
77                 <th>Fine amount</th>
78                 <th>Fine charging interval</th>
79                 <th>Fine grace period (day)</th>
80                 <th>Suspension in days (day)</th>
81                 <th>Renewals allowed (count)</th>
82                 <th>Holds allowed (count)</th>
83                         <th>Rental discount (%)</th>
84                                 <th>&nbsp;</th>
85             </tr>
86                                 [% FOREACH rule IN rules %]
87                                         [% UNLESS ( loop.odd ) %]
88                                         <tr class="highlight">
89                                         [% ELSE %]
90                                         <tr>
91                                         [% END %]
92                                                         <td>[% IF ( rule.default_humancategorycode ) %]
93                                                                         <em>All</em>
94                                                                 [% ELSE %]
95                                                                         [% rule.humancategorycode %]
96                                                                 [% END %]
97                                                         </td>
98                                                         <td>[% IF ( rule.default_humanitemtype ) %]
99                                                                         <em>All</em>
100                                                                 [% ELSE %]
101                                                                         [% rule.humanitemtype %]
102                                                                 [% END %]
103                                                         </td>
104                                                         <td>[% IF ( rule.unlimited_maxissueqty ) %]
105                                                                         Unlimited
106                                                                 [% ELSE %]
107                                                                         [% rule.maxissueqty %]
108                                                                 [% END %]
109                                                         </td>
110                                                         <td>[% rule.issuelength %]</td>
111                                                         <td>[% IF ( rule.hardduedate ) %]
112                                                                [% IF ( rule.hardduedatebefore ) %]before [% rule.hardduedate %]</td>
113                                                                [% ELSE %][% IF ( rule.hardduedateexact ) %]on [% rule.hardduedate %]</td>
114                                                                                  [% ELSE %][% IF ( rule.hardduedateafter ) %]after [% rule.hardduedate %]</td>[% END %]
115                                                                                  [% END %]
116                                                                [% END %]
117                                                             [% ELSE %]None defined[% END %]   
118                                                         <td>[% rule.fine %]</td>
119                                                         <td>[% rule.chargeperiod %]</td>
120                                                         <td>[% rule.firstremind %]</td>
121                                                         <td>[% rule.finedays %]</td>
122                                                         <td>[% rule.renewalsallowed %]</td>
123                                                         <td>[% rule.reservesallowed %]</td>
124                                                         <td>[% rule.rentaldiscount %]</td>
125                                                         <td>
126                                                                 <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>
127                                                         </td>
128                         </tr>
129                 [% END %]
130                 <tr>
131                     <td>
132                         <select name="categorycode">
133                             <option value="*">All</option>
134                         [% FOREACH categoryloo IN categoryloop %]
135                             <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
136                         [% END %]
137                         </select>
138                     </td>
139                     <td>
140                         <select name="itemtype" style="width:13em;">
141                             <option value="*">All</option>
142                         [% FOREACH itemtypeloo IN itemtypeloop %]
143                             <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.description %]</option>
144                         [% END %]
145                         </select>
146                     </td>
147                     <td><input name="maxissueqty" size="3" /></td>
148                     <td><input name="issuelength" size="3" /> </td>
149                     <td><select name="hardduedatecompare">
150                            <option value="-1">Before</option>
151                            <option value="0">Exactly on</option>
152                            <option value="1">After</option>
153                         </select>
154                         <input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate %]" />
155                         [% INCLUDE 'date-format.inc' %]
156                         <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar"  border="0" id="CalendarDueDate" style="cursor: pointer;"/>
157                         <script language="JavaScript" type="text/javascript">
158                              function refocus(calendar) {
159                                  document.getElementById('hardduedate').focus();
160                                  calendar.hide();
161                              };
162                              Calendar.setup(
163                              {
164                              inputField : "hardduedate",
165                              ifFormat : "%m/%d/%Y",
166                              button : "CalendarDueDate",
167                              onClose: refocus
168                              }
169                              );
170                  </script>
171                     </td>
172                     <td><input name="fine" size="4" /></td>
173                     <td><input name="chargeperiod" size="2" /></td>
174                     <td><input name="firstremind" size="2" /> </td>
175                     <td><input name="finedays" size="3" /> </td>
176                     <td><input name="renewalsallowed" size="2" /></td>
177                     <td><input name="reservesallowed" size="2" /></td>
178                     <td><input name="rentaldiscount" size="2" /></td>
179                     <td><input type="hidden" name="branch" value="[% current_branch %]"/><input type="submit" value="Add" class="submit" /></td>
180                 </tr>
181             </table>
182         </form>
183     </div>
184     <div id="defaults-for-this-library" class="container">
185     <h3>Default checkout, hold and return policy for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
186         <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>
187         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
188             <input type="hidden" name="op" value="set-branch-defaults" />
189             <input type="hidden" name="branch" value="[% current_branch %]"/>
190             <table>
191                 <tr>
192                     <th>&nbsp;</th>
193                     <th>Total current checkouts allowed</th>
194                     <th>Hold policy</th>
195                     <th>Return policy</th>
196                     <th>&nbsp;</th>
197                     <th>&nbsp;</th>
198                 </tr>
199                 <tr>
200                     <td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td>
201                     <td><input type="text" name="maxissueqty" size="3" value="[% default_maxissueqty %]"/></td>
202                     <td>
203                         <select name="holdallowed">
204                             [% IF ( default_holdallowed_any ) %]
205                             <option value="2" selected="selected">
206                             [% ELSE %]
207                             <option value="2">
208                             [% END %]
209                                 From any library
210                             </option>
211                             [% IF ( default_holdallowed_same ) %]
212                             <option value="1" selected="selected">
213                             [% ELSE %]
214                             <option value="1">
215                             [% END %]
216                                 From home library
217                             </option>
218                             [% IF ( default_holdallowed_none ) %]
219                             <option value="0" selected="selected">
220                             [% ELSE %]
221                             <option value="0">
222                             [% END %]
223                                 No holds allowed
224                             </option>
225                         </select>
226                     </td>
227                     <td>
228                         <select name="returnbranch">
229                             [% IF ( default_returnbranch == 'homebranch' ) %]
230                             <option value="homebranch" selected="selected">
231                             [% ELSE %]
232                             <option value="homebranch">
233                             [% END %]
234                                 Item returns home
235                             </option>
236                             [% IF ( default_returnbranch == 'holdingbranch' ) %]
237                             <option value="holdingbranch" selected="selected">
238                             [% ELSE %]
239                             <option value="holdingbranch">
240                             [% END %]
241                                 Item returns to issuing branch
242                             </option>
243                             [% IF ( default_returnbranch == 'noreturn' ) %]
244                             <option value="noreturn" selected="selected">
245                             [% ELSE %]
246                             <option value="noreturn">
247                             [% END %]
248                                 Item floats
249                             </option>
250                         </select>
251                     </td>
252                     <td><input type="submit" value="Save" class="submit" /></td>
253                     <td>
254                         <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=*&amp;branch=[% current_branch %]">Unset</a>
255                     </td>
256                 </tr>
257             </table>
258         </form>
259     </div>
260     [% IF ( show_branch_cat_rule_form ) %]
261     <div id="holds-policy-by-patron-category" class="container">
262     <h3>Checkout limit by patron category for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
263         <p>For this library, you can specify the maximum number of loans that
264             a patron of a given category can make, regardless of the item type.
265         </p>
266         <p>If the total amount loanable for a given patron category is left blank,
267            no limit applies, except possibly for a limit you define for a specific item type.
268         </p>
269         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
270             <input type="hidden" name="op" value="add-branch-cat" />
271             <input type="hidden" name="branch" value="[% current_branch %]"/>
272             <table>
273                 <tr>
274                     <th>Patron category</th>
275                     <th>Total current checkouts allowed</th>
276                     <th>&nbsp;</th>
277                 </tr>
278                 [% FOREACH branch_cat_rule_loo IN branch_cat_rule_loop %]
279                     [% UNLESS ( loop.odd ) %]
280                     <tr class="highlight">
281                     [% ELSE %]
282                     <tr>
283                     [% END %]
284                         <td>[% IF ( branch_cat_rule_loo.default_humancategorycode ) %]
285                                 <em>Default</em>
286                             [% ELSE %]
287                                 [% branch_cat_rule_loo.humancategorycode %]
288                             [% END %]
289                         </td>
290                         <td>[% IF ( branch_cat_rule_loo.unlimited_maxissueqty ) %]
291                                 Unlimited
292                             [% ELSE %]
293                                 [% branch_cat_rule_loo.maxissueqty %]
294                             [% END %]
295                         </td>
296                         <td>
297                             <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>
298                         </td>
299                     </tr>
300                 [% END %]
301                 <tr>
302                     <td>
303                         <select name="categorycode">
304                         [% FOREACH categoryloo IN categoryloop %]
305                             <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
306                         [% END %]
307                         </select>
308                     </td>
309                     <td><input name="maxissueqty" size="3" /></td>
310                     <td><input type="submit" value="Add" class="submit" /></td>
311                 </tr>
312             </table>
313         </form>
314     </div>
315     [% END %]
316     <div id="holds-policy-by-item-type" class="container">
317     <h3>Holds policy by item type for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
318         <p>
319             For this library, you can edit rules for given itemtypes, regardless
320             of the patron's category.
321         </p>
322         <p>
323             Currently, this means hold policies.
324             The various policies have the following effects:
325         </p>
326         <ul>
327             <li><strong>From any library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li>
328             <li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li>
329             <li><strong>No holds allowed:</strong> No patron may put this book on hold.</li>
330         </ul>
331         <p>
332             Note that if the system preference
333             <code>AllowHoldPolicyOverride</code> is enabled, these policies can
334             be overridden by your circulation staff. Also, these policies are
335             based on the patron's home library, <em>not</em> the library where the hold is being placed..
336         </p>
337
338         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
339             <input type="hidden" name="op" value="add-branch-item" />
340             <input type="hidden" name="branch" value="[% current_branch %]"/>
341             <table>
342                 <tr>
343                     <th>Item type</th>
344                     <th>Hold policy</th>
345                     <th>Return policy</th>
346                     <th>&nbsp;</th>
347                 </tr>
348                 [% FOREACH branch_item_rule_loo IN branch_item_rule_loop %]
349                     [% UNLESS ( loop.odd ) %]
350                     <tr class="highlight">
351                     [% ELSE %]
352                     <tr>
353                     [% END %]
354                         <td>[% IF ( branch_item_rule_loo.default_humanitemtype ) %]
355                                 <em>Default</em>
356                             [% ELSE %]
357                                 [% branch_item_rule_loo.humanitemtype %]
358                             [% END %]
359                         </td>
360                         <td>[% IF ( branch_item_rule_loo.holdallowed_any ) %]
361                                 From any library
362                             [% ELSIF ( branch_item_rule_loo.holdallowed_same ) %]
363                                 From home library
364                             [% ELSE %]
365                                 No holds allowed
366                             [% END %]
367                         </td>
368                         <td>[% IF ( branch_item_rule_loo.returnbranch == 'homebranch' ) %]
369                                 Item returns home
370                             [% ELSIF ( branch_item_rule_loo.returnbranch == 'holdingbranch' ) %]
371                                 Item returns to issuing branch
372                             [% ELSIF ( branch_item_rule_loo.returnbranch == 'noreturn' ) %]
373                                 Item floats
374                             [% ELSE %]
375                                 Error - unknown option
376                             [% END %]
377                         </td>
378                         <td>
379                             <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>
380                         </td>
381                     </tr>
382                 [% END %]
383                 <tr>
384                     <td>
385                         <select name="itemtype">
386                         [% FOREACH itemtypeloo IN itemtypeloop %]
387                             <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.description %]</option>
388                         [% END %]
389                         </select>
390                     </td>
391                     <td>
392                         <select name="holdallowed">
393                             <option value="2">From any library</option>
394                             <option value="1">From home library</option>
395                             <option value="0">No holds allowed</option>
396                         </select>
397                     </td>
398                     <td>
399                         <select name="returnbranch">
400                             <option value="homebranch">Item returns home</option>
401                             <option value="holdingbranch">Item returns to issuing branch</option>
402                             <option value="noreturn">Item floats</option>
403                         </select>
404                     </td>
405                     <td><input type="submit" value="Add" class="submit" /></td>
406                 </tr>
407             </table>
408         </form>
409     </div>
410 </div>
411
412 </div>
413 <div class="yui-b">
414 [% INCLUDE 'admin-menu.inc' %]
415 </div>
416 </div>
417 [% INCLUDE 'intranet-bottom.inc' %]