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