Bug 5917 : Swapping templates over
[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 and hold policy for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
186         <p>You can set a default maximum number of checkouts and hold 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>&nbsp;</th>
196                     <th>&nbsp;</th>
197                 </tr>
198                 <tr>
199                     <td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td>
200                     <td><input type="text" name="maxissueqty" size="3" value="[% default_maxissueqty %]"/></td>
201                     <td>
202                         <select name="holdallowed">
203                             [% IF ( default_holdallowed_any ) %]
204                             <option value="2" selected="selected">
205                             [% ELSE %]
206                             <option value="2">
207                             [% END %]
208                                 From Any Library
209                             </option>
210                             [% IF ( default_holdallowed_same ) %]
211                             <option value="1" selected="selected">
212                             [% ELSE %]
213                             <option value="1">
214                             [% END %]
215                                 From Home Library
216                             </option>
217                             [% IF ( default_holdallowed_none ) %]
218                             <option value="0" selected="selected">
219                             [% ELSE %]
220                             <option value="0">
221                             [% END %]
222                                 No Holds Allowed
223                             </option>
224                         </select>
225                     </td>
226                     <td><input type="submit" value="Save" class="submit" /></td>
227                     <td>
228                         <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=*&amp;branch=[% current_branch %]">Unset</a>
229                     </td>
230                 </tr>
231             </table>
232         </form>
233     </div>
234     [% IF ( show_branch_cat_rule_form ) %]
235     <div id="holds-policy-by-patron-category" class="container">
236     <h3>Checkout limit by patron category for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
237         <p>For this library, you can specify the maximum number of loans that
238             a patron of a given category can make, regardless of the item type.
239         </p>
240         <p>If the total amount loanable for a given patron category is left blank,
241            no limit applies, except possibly for a limit you define for a specific item type.
242         </p>
243         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
244             <input type="hidden" name="op" value="add-branch-cat" />
245             <input type="hidden" name="branch" value="[% current_branch %]"/>
246             <table>
247                 <tr>
248                     <th>Patron Category</th>
249                     <th>Total Current Checkouts Allowed</th>
250                     <th>&nbsp;</th>
251                 </tr>
252                 [% FOREACH branch_cat_rule_loo IN branch_cat_rule_loop %]
253                     [% UNLESS ( loop.odd ) %]
254                     <tr class="highlight">
255                     [% ELSE %]
256                     <tr>
257                     [% END %]
258                         <td>[% IF ( branch_cat_rule_loo.default_humancategorycode ) %]
259                                 <em>Default</em>
260                             [% ELSE %]
261                                 [% branch_cat_rule_loo.humancategorycode %]
262                             [% END %]
263                         </td>
264                         <td>[% IF ( branch_cat_rule_loo.unlimited_maxissueqty ) %]
265                                 Unlimited
266                             [% ELSE %]
267                                 [% branch_cat_rule_loo.maxissueqty %]
268                             [% END %]
269                         </td>
270                         <td>
271                             <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=[% branch_cat_rule_loo.categorycode %]&amp;branch=[% branch_cat_rule_loo.current_branch %]">Delete</a>
272                         </td>
273                     </tr>
274                 [% END %]
275                 <tr>
276                     <td>
277                         <select name="categorycode">
278                         [% FOREACH categoryloo IN categoryloop %]
279                             <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
280                         [% END %]
281                         </select>
282                     </td>
283                     <td><input name="maxissueqty" size="3" /></td>
284                     <td><input type="submit" value="Add" class="submit" /></td>
285                 </tr>
286             </table>
287         </form>
288     </div>
289     [% END %]
290     <div id="holds-policy-by-item-type" class="container">
291     <h3>Holds policy by item type for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
292         <p>
293             For this library, you can edit rules for given itemtypes, regardless
294             of the patron's category.
295         </p>
296         <p>
297             Currently, this means hold policies.
298             The various policies have the following effects:
299         </p>
300         <ul>
301             <li><strong>From Any Library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li>
302             <li><strong>From Home Library:</strong> Only patrons from the item's home library may put this book on hold.</li>
303             <li><strong>No Holds Allowed:</strong> No patron may put this book on hold.</li>
304         </ul>
305         <p>
306             Note that if the system preference
307             <code>AllowHoldPolicyOverride</code> is enabled, these policies can
308             be overridden by your circulation staff. Also, these policies are
309             based on the patron's home library, <em>not</em> the library where the hold is being placed..
310         </p>
311
312         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
313             <input type="hidden" name="op" value="add-branch-item" />
314             <input type="hidden" name="branch" value="[% current_branch %]"/>
315             <table>
316                 <tr>
317                     <th>Item Type</th>
318                     <th>Hold Policy</th>
319                     <th>&nbsp;</th>
320                 </tr>
321                 [% FOREACH branch_item_rule_loo IN branch_item_rule_loop %]
322                     [% UNLESS ( loop.odd ) %]
323                     <tr class="highlight">
324                     [% ELSE %]
325                     <tr>
326                     [% END %]
327                         <td>[% IF ( branch_item_rule_loo.default_humanitemtype ) %]
328                                 <em>Default</em>
329                             [% ELSE %]
330                                 [% branch_item_rule_loo.humanitemtype %]
331                             [% END %]
332                         </td>
333                         <td>[% IF ( branch_item_rule_loo.holdallowed_any ) %]
334                                 From Any Library
335                             [% ELSIF ( branch_item_rule_loo.holdallowed_same ) %]
336                                 From Home Library
337                             [% ELSE %]
338                                 No Holds Allowed
339                             [% END %]
340                         </td>
341                         <td>
342                             <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&amp;itemtype=[% branch_item_rule_loo.itemtype %]&amp;branch=[% branch_item_rule_loo.current_branch %]">Delete</a>
343                         </td>
344                     </tr>
345                 [% END %]
346                 <tr>
347                     <td>
348                         <select name="itemtype">
349                         [% FOREACH itemtypeloo IN itemtypeloop %]
350                             <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.description %]</option>
351                         [% END %]
352                         </select>
353                     </td>
354                     <td>
355                         <select name="holdallowed">
356                             <option value="2">From Any Library</option>
357                             <option value="1">From Home Library</option>
358                             <option value="0">No Holds Allowed</option>
359                         </select>
360                     </td>
361                     <td><input type="submit" value="Add" class="submit" /></td>
362                 </tr>
363             </table>
364         </form>
365     </div>
366 </div>
367
368 </div>
369 <div class="yui-b">
370 [% INCLUDE 'admin-menu.inc' %]
371 </div>
372 </div>
373 [% INCLUDE 'intranet-bottom.inc' %]