Merge remote branch 'kc/master' into new/enh/bug_5917
[koha.git] / koha-tt / 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
16 </head>
17 <body>
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'cat-search.inc' %]
20
21 <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>
22
23 <div id="doc3" class="yui-t1">
24
25 <div id="bd">
26     <div id="yui-main">
27     <div class="yui-b">
28     <h1 class="parameters">
29         [% IF ( humanbranch ) %]
30             Defining circulation and fine rules for "[% humanbranch %]"
31         [% ELSE %]
32             Defining circulation and fine rules for all libraries
33         [% END %]
34     </h1>
35     <div class="help">
36         <p>The rules are applied from most specific to less specific, using the first found in this order:</p>
37         <ul>
38             <li>same library, same patron type, same item type</li>
39             <li>same library, same patron type, all item types</li>
40             <li>same library, all patron types, same item type</li>
41             <li>same library, all patron types, all item types</li>
42             <li>all libraries, same patron type, same item type</li>
43             <li>all libraries, same patron type, all item types</li>
44             <li>all libraries, all patron types, same item type</li>
45             <li>all libraries, all patron types, all item types</li>
46         </ul>
47         <p>To modify a rule, create a new one with the same patron type and item type.</p>
48     </div>
49     <div>
50         <form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary">
51         Select a library :
52             <select name="branch" id="branch" style="width:20em;">
53                 <option value="*">All libraries</option>
54             [% FOREACH branchloo IN branchloop %]
55                                 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
56             [% END %]
57             </select>
58         </form>
59 [% IF ( definedbranch ) %]<form action="/cgi-bin/koha/admin/clone-rules.pl" method="post"><label 
60 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidden" name="frombranch" value="[% current_branch %]" />
61             <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>
62
63         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
64             <input type="hidden" name="op" value="add" />
65             <table>
66             <tr>
67                 <th>Patron Category</th>
68                 <th>Item Type</th>
69                 <th>Current Checkouts Allowed</th>
70                 <th>Loan Period (day)</th>
71                 <th>Fine Amount</th>
72                 <th>Fine Charging Interval</th>
73                 <th>Fine Grace period (day)</th>
74                 <th>Suspension in Days (day)</th>
75                 <th>Renewals Allowed (count)</th>
76                 <th>Holds Allowed (count)</th>
77                         <th>Rental Discount (%)</th>
78                                 <th>&nbsp;</th>
79             </tr>
80                                 [% FOREACH rule IN rules %]
81                                         [% UNLESS ( loop.odd ) %]
82                                         <tr class="highlight">
83                                         [% ELSE %]
84                                         <tr>
85                                         [% END %]
86                                                         <td>[% IF ( rule.default_humancategorycode ) %]
87                                                                         <em>All</em>
88                                                                 [% ELSE %]
89                                                                         [% rule.humancategorycode %]
90                                                                 [% END %]
91                                                         </td>
92                                                         <td>[% IF ( rule.default_humanitemtype ) %]
93                                                                         <em>All</em>
94                                                                 [% ELSE %]
95                                                                         [% rule.humanitemtype %]
96                                                                 [% END %]
97                                                         </td>
98                                                         <td>[% IF ( rule.unlimited_maxissueqty ) %]
99                                                                         Unlimited
100                                                                 [% ELSE %]
101                                                                         [% rule.maxissueqty %]
102                                                                 [% END %]
103                                                         </td>
104                                                         <td>[% rule.issuelength %]</td>
105                                                         <td>[% rule.fine %]</td>
106                                                         <td>[% rule.chargeperiod %]</td>
107                                                         <td>[% rule.firstremind %]</td>
108                                                         <td>[% rule.finedays %]</td>
109                                                         <td>[% rule.renewalsallowed %]</td>
110                                                         <td>[% rule.reservesallowed %]</td>
111                                                         <td>[% rule.rentaldiscount %]</td>
112                                                         <td>
113                                                                 <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>
114                                                         </td>
115                         </tr>
116                 [% END %]
117                 <tr>
118                     <td>
119                         <select name="categorycode">
120                             <option value="*">All</option>
121                         [% FOREACH categoryloo IN categoryloop %]
122                             <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
123                         [% END %]
124                         </select>
125                     </td>
126                     <td>
127                         <select name="itemtype" style="width:13em;">
128                             <option value="*">All</option>
129                         [% FOREACH itemtypeloo IN itemtypeloop %]
130                             <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.description %]</option>
131                         [% END %]
132                         </select>
133                     </td>
134                     <td><input name="maxissueqty" size="3" /></td>
135                     <td><input name="issuelength" size="3" /> </td>
136                     <td><input name="fine" size="4" /></td>
137                     <td><input name="chargeperiod" size="2" /></td>
138                     <td><input name="firstremind" size="2" /> </td>
139                     <td><input name="finedays" size="3" /> </td>
140                     <td><input name="renewalsallowed" size="2" /></td>
141                     <td><input name="reservesallowed" size="2" /></td>
142                     <td><input name="rentaldiscount" size="2" /></td>
143                     <td><input type="hidden" name="branch" value="[% current_branch %]"/><input type="submit" value="Add" class="submit" /></td>
144                 </tr>
145             </table>
146         </form>
147     </div>
148     <div id="defaults-for-this-library" class="container">
149     <h3>Default checkout and hold policy for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
150         <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>
151         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
152             <input type="hidden" name="op" value="set-branch-defaults" />
153             <input type="hidden" name="branch" value="[% current_branch %]"/>
154             <table>
155                 <tr>
156                     <th>&nbsp;</th>
157                     <th>Total Current Checkouts Allowed</th>
158                     <th>Hold Policy</th>
159                     <th>&nbsp;</th>
160                     <th>&nbsp;</th>
161                 </tr>
162                 <tr>
163                     <td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td>
164                     <td><input type="text" name="maxissueqty" size="3" value="[% default_maxissueqty %]"/></td>
165                     <td>
166                         <select name="holdallowed">
167                             [% IF ( default_holdallowed_any ) %]
168                             <option value="2" selected="selected">
169                             [% ELSE %]
170                             <option value="2">
171                             [% END %]
172                                 From Any Library
173                             </option>
174                             [% IF ( default_holdallowed_same ) %]
175                             <option value="1" selected="selected">
176                             [% ELSE %]
177                             <option value="1">
178                             [% END %]
179                                 From Home Library
180                             </option>
181                             [% IF ( default_holdallowed_none ) %]
182                             <option value="0" selected="selected">
183                             [% ELSE %]
184                             <option value="0">
185                             [% END %]
186                                 No Holds Allowed
187                             </option>
188                         </select>
189                     </td>
190                     <td><input type="submit" value="Save" class="submit" /></td>
191                     <td>
192                         <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=*&amp;branch=[% current_branch %]">Unset</a>
193                     </td>
194                 </tr>
195             </table>
196         </form>
197     </div>
198     [% IF ( show_branch_cat_rule_form ) %]
199     <div id="holds-policy-by-patron-category" class="container">
200     <h3>Checkout limit by patron category for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
201         <p>For this library, you can specify the maximum number of loans that
202             a patron of a given category can make, regardless of the item type.
203         </p>
204         <p>If the total amount loanable for a given patron category is left blank,
205            no limit applies, except possibly for a limit you define for a specific item type.
206         </p>
207         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
208             <input type="hidden" name="op" value="add-branch-cat" />
209             <input type="hidden" name="branch" value="[% current_branch %]"/>
210             <table>
211                 <tr>
212                     <th>Patron Category</th>
213                     <th>Total Current Checkouts Allowed</th>
214                     <th>&nbsp;</th>
215                 </tr>
216                 [% FOREACH branch_cat_rule_loo IN branch_cat_rule_loop %]
217                     [% UNLESS ( loop.odd ) %]
218                     <tr class="highlight">
219                     [% ELSE %]
220                     <tr>
221                     [% END %]
222                         <td>[% IF ( branch_cat_rule_loo.default_humancategorycode ) %]
223                                 <em>Default</em>
224                             [% ELSE %]
225                                 [% branch_cat_rule_loo.humancategorycode %]
226                             [% END %]
227                         </td>
228                         <td>[% IF ( branch_cat_rule_loo.unlimited_maxissueqty ) %]
229                                 Unlimited
230                             [% ELSE %]
231                                 [% branch_cat_rule_loo.maxissueqty %]
232                             [% END %]
233                         </td>
234                         <td>
235                             <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>
236                         </td>
237                     </tr>
238                 [% END %]
239                 <tr>
240                     <td>
241                         <select name="categorycode">
242                         [% FOREACH categoryloo IN categoryloop %]
243                             <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
244                         [% END %]
245                         </select>
246                     </td>
247                     <td><input name="maxissueqty" size="3" /></td>
248                     <td><input type="submit" value="Add" class="submit" /></td>
249                 </tr>
250             </table>
251         </form>
252     </div>
253     [% END %]
254     <div id="holds-policy-by-item-type" class="container">
255     <h3>Holds policy by item type for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
256         <p>
257             For this library, you can edit rules for given itemtypes, regardless
258             of the patron's category.
259         </p>
260         <p>
261             Currently, this means hold policies.
262             The various policies have the following effects:
263         </p>
264         <ul>
265             <li><strong>From Any Library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li>
266             <li><strong>From Home Library:</strong> Only patrons from the item's home library may put this book on hold.</li>
267             <li><strong>No Holds Allowed:</strong> No patron may put this book on hold.</li>
268         </ul>
269         <p>
270             Note that if the system preference
271             <code>AllowHoldPolicyOverride</code> is enabled, these policies can
272             be overridden by your circulation staff. Also, these policies are
273             based on the patron's home library, <em>not</em> the library where the hold is being placed..
274         </p>
275
276         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
277             <input type="hidden" name="op" value="add-branch-item" />
278             <input type="hidden" name="branch" value="[% current_branch %]"/>
279             <table>
280                 <tr>
281                     <th>Item Type</th>
282                     <th>Hold Policy</th>
283                     <th>&nbsp;</th>
284                 </tr>
285                 [% FOREACH branch_item_rule_loo IN branch_item_rule_loop %]
286                     [% UNLESS ( loop.odd ) %]
287                     <tr class="highlight">
288                     [% ELSE %]
289                     <tr>
290                     [% END %]
291                         <td>[% IF ( branch_item_rule_loo.default_humanitemtype ) %]
292                                 <em>Default</em>
293                             [% ELSE %]
294                                 [% branch_item_rule_loo.humanitemtype %]
295                             [% END %]
296                         </td>
297                         <td>[% IF ( branch_item_rule_loo.holdallowed_any ) %]
298                                 From Any Library
299                             [% ELSIF ( branch_item_rule_loo.holdallowed_same ) %]
300                                 From Home Library
301                             [% ELSE %]
302                                 No Holds Allowed
303                             [% END %]
304                         </td>
305                         <td>
306                             <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>
307                         </td>
308                     </tr>
309                 [% END %]
310                 <tr>
311                     <td>
312                         <select name="itemtype">
313                         [% FOREACH itemtypeloo IN itemtypeloop %]
314                             <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.description %]</option>
315                         [% END %]
316                         </select>
317                     </td>
318                     <td>
319                         <select name="holdallowed">
320                             <option value="2">From Any Library</option>
321                             <option value="1">From Home Library</option>
322                             <option value="0">No Holds Allowed</option>
323                         </select>
324                     </td>
325                     <td><input type="submit" value="Add" class="submit" /></td>
326                 </tr>
327             </table>
328         </form>
329     </div>
330 </div>
331
332 </div>
333 <div class="yui-b">
334 [% INCLUDE 'admin-menu.inc' %]
335 </div>
336 </div>
337 [% INCLUDE 'intranet-bottom.inc' %]