Lines 1-946
Link Here
|
1 |
[% USE KohaDates %] |
|
|
2 |
[% USE Branches %] |
3 |
[% USE Categories %] |
4 |
[% USE ItemTypes %] |
5 |
[% USE CirculationRules %] |
6 |
[% SET footerjs = 1 %] |
7 |
|
8 |
[% SET branchcode = humanbranch || undef %] |
9 |
|
10 |
[% SET categorycodes = [] %] |
11 |
[% FOREACH pc IN patron_categories %] |
12 |
[% categorycodes.push( pc.id ) %] |
13 |
[% END %] |
14 |
[% categorycodes.push(undef) %] |
15 |
|
16 |
[% SET itemtypes = [] %] |
17 |
[% FOREACH i IN itemtypeloop %] |
18 |
[% itemtypes.push( i.itemtype ) %] |
19 |
[% END %] |
20 |
[% itemtypes.push(undef) %] |
21 |
|
22 |
[% INCLUDE 'doc-head-open.inc' %] |
23 |
<title>Koha › Administration › Circulation and fine rules</title> |
24 |
[% INCLUDE 'doc-head-close.inc' %] |
25 |
</head> |
26 |
|
27 |
<body id="admin_smart-rules" class="admin"> |
28 |
[% INCLUDE 'header.inc' %] |
29 |
[% INCLUDE 'prefs-admin-search.inc' %] |
30 |
|
31 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › Circulation and fine rules</div> |
32 |
|
33 |
<div id="doc3" class="yui-t1"> |
34 |
|
35 |
<div id="bd"> |
36 |
<div id="yui-main"> |
37 |
<div class="yui-b"> |
38 |
<h1 class="parameters"> |
39 |
[% IF humanbranch %] |
40 |
Defining circulation and fine rules for "[% Branches.GetName( humanbranch ) %]" |
41 |
[% ELSE %] |
42 |
Defining circulation and fine rules for all libraries |
43 |
[% END %] |
44 |
</h1> |
45 |
<div class="help"> |
46 |
<p>The rules are applied from most specific to less specific, using the first found in this order:</p> |
47 |
<ul> |
48 |
<li>same library, same patron category, same item type</li> |
49 |
<li>same library, same patron category, all item types</li> |
50 |
<li>same library, all patron categories, same item type</li> |
51 |
<li>same library, all patron categories, all item types</li> |
52 |
<li>default (all libraries), same patron category, same item type</li> |
53 |
<li>default (all libraries), same patron category, all item types</li> |
54 |
<li>default (all libraries), all patron categories, same item type</li> |
55 |
<li>default (all libraries), all patron categories, all item types</li> |
56 |
</ul> |
57 |
<p>To modify a rule, create a new one with the same patron category and item type.</p> |
58 |
</div> |
59 |
<div> |
60 |
[% UNLESS restricted_to_own_library %] |
61 |
<form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary"> |
62 |
Select a library : |
63 |
<select name="branch" id="branch" style="width:20em;"> |
64 |
<option value="*">Standard rules for all libraries</option> |
65 |
[% PROCESS options_for_libraries libraries => Branches.all( selected => current_branch, unfiltered => 1 ) %] |
66 |
</select> |
67 |
</form> |
68 |
[% IF ( definedbranch ) %] |
69 |
<form action="/cgi-bin/koha/admin/clone-rules.pl" method="post"> |
70 |
<label for="tobranch"><strong>Clone these rules to:</strong></label> |
71 |
<input type="hidden" name="frombranch" value="[% current_branch %]" /> |
72 |
<select name="tobranch" id="tobranch"> |
73 |
[% PROCESS options_for_libraries libraries => Branches.all( unfiltered => 1 ) %] |
74 |
</select> |
75 |
<input type="submit" id="clone_rules" value="Clone" /> |
76 |
</form> |
77 |
[% END %] |
78 |
[% END %] |
79 |
|
80 |
<form method="post" action="/cgi-bin/koha/admin/smart-rules.pl"> |
81 |
<input type="hidden" name="op" value="add" /> |
82 |
<input type="hidden" name="branch" value="[% current_branch %]"/> |
83 |
<table id="default-circulation-rules"> |
84 |
<thead> |
85 |
<tr> |
86 |
<th>Patron category</th> |
87 |
<th>Item type</th> |
88 |
<th>Actions</th> |
89 |
<th>Current checkouts allowed</th> |
90 |
<th>Current on-site checkouts allowed</th> |
91 |
<th>Loan period</th> |
92 |
<th>Unit</th> |
93 |
<th>Hard due date</th> |
94 |
<th>Fine amount</th> |
95 |
<th>Fine charging interval</th> |
96 |
<th>When to charge</th> |
97 |
<th>Fine grace period</th> |
98 |
<th>Overdue fines cap (amount)</th> |
99 |
<th>Cap fine at replacement price</th> |
100 |
<th>Suspension in days (day)</th> |
101 |
<th>Max. suspension duration (day)</th> |
102 |
<th>Renewals allowed (count)</th> |
103 |
<th>Renewal period</th> |
104 |
<th>No renewal before</th> |
105 |
<th>Automatic renewal</th> |
106 |
<th>No automatic renewal after</th> |
107 |
<th>No automatic renewal after (hard limit)</th> |
108 |
<th>Holds allowed (count)</th> |
109 |
<th>Holds per record (count)</th> |
110 |
<th>On shelf holds allowed</th> |
111 |
<th>Item level holds</th> |
112 |
<th>Article requests</th> |
113 |
<th>Rental discount (%)</th> |
114 |
<th>Actions</th> |
115 |
</tr> |
116 |
</thead> |
117 |
<tbody> |
118 |
[% SET row_count = 0 %] |
119 |
[% FOREACH c IN categorycodes %] |
120 |
[% FOREACH i IN itemtypes %] |
121 |
[% SET maxissueqty = CirculationRules.Get( branchcode, c, i, 'maxissueqty' ) %] |
122 |
[% SET maxonsiteissueqty = CirculationRules.Get( branchcode, c, i, 'maxonsiteissueqty' ) %] |
123 |
[% SET issuelength = CirculationRules.Get( branchcode, c, i, 'issuelength' ) %] |
124 |
[% SET lengthunit = CirculationRules.Get( branchcode, c, i, 'lengthunit' ) %] |
125 |
[% SET hardduedate = CirculationRules.Get( branchcode, c, i, 'hardduedate' ) %] |
126 |
[% SET hardduedatecompare = CirculationRules.Get( branchcode, c, i, 'hardduedatecompare' ) %] |
127 |
[% SET fine = CirculationRules.Get( branchcode, c, i, 'fine' ) %] |
128 |
[% SET chargeperiod = CirculationRules.Get( branchcode, c, i, 'chargeperiod' ) %] |
129 |
[% SET chargeperiod_charge_at = CirculationRules.Get( branchcode, c, i, 'chargeperiod_charge_at' ) %] |
130 |
[% SET firstremind = CirculationRules.Get( branchcode, c, i, 'firstremind' ) %] |
131 |
[% SET overduefinescap = CirculationRules.Get( branchcode, c, i, 'overduefinescap' ) %] |
132 |
[% SET cap_fine_to_replacement_price = CirculationRules.Get( branchcode, c, i, 'cap_fine_to_replacement_price' ) %] |
133 |
[% SET finedays = CirculationRules.Get( branchcode, c, i, 'finedays' ) %] |
134 |
[% SET maxsuspensiondays = CirculationRules.Get( branchcode, c, i, 'maxsuspensiondays' ) %] |
135 |
[% SET renewalsallowed = CirculationRules.Get( branchcode, c, i, 'renewalsallowed' ) %] |
136 |
[% SET renewalperiod = CirculationRules.Get( branchcode, c, i, 'renewalperiod' ) %] |
137 |
[% SET norenewalbefore = CirculationRules.Get( branchcode, c, i, 'norenewalbefore' ) %] |
138 |
[% SET auto_renew = CirculationRules.Get( branchcode, c, i, 'auto_renew' ) %] |
139 |
[% SET no_auto_renewal_after = CirculationRules.Get( branchcode, c, i, 'no_auto_renewal_after' ) %] |
140 |
[% SET no_auto_renewal_after_hard_limit = CirculationRules.Get( branchcode, c, i, 'no_auto_renewal_after_hard_limit' ) %] |
141 |
[% SET reservesallowed = CirculationRules.Get( branchcode, c, i, 'reservesallowed' ) %] |
142 |
[% SET holds_per_record = CirculationRules.Get( branchcode, c, i, 'holds_per_record' ) %] |
143 |
[% SET onshelfholds = CirculationRules.Get( branchcode, c, i, 'onshelfholds' ) %] |
144 |
[% SET opacitemholds = CirculationRules.Get( branchcode, c, i, 'opacitemholds' ) %] |
145 |
[% SET article_requests = CirculationRules.Get( branchcode, c, i, 'article_requests' ) %] |
146 |
[% SET rentaldiscount = CirculationRules.Get( branchcode, c, i, 'rentaldiscount' ) %] |
147 |
|
148 |
[% SET show_rule = maxissueqty || maxonsiteissueqty || issuelength || lengthunit || hardduedate || hardduedatebefore || hardduedateexact || fine || chargeperiod |
149 |
|| chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || renewalsallowed |
150 |
|| renewalsallowed || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed |
151 |
|| holds_per_record || onshelfholds || opacitemholds || article_requests || article_requests %] |
152 |
[% IF show_rule %] |
153 |
[% SET row_count = row_count + 1 %] |
154 |
<tr row_countd="row_[% row_count %]"> |
155 |
<td> |
156 |
[% IF c == undef %] |
157 |
<em>All</em> |
158 |
[% ELSE %] |
159 |
[% Categories.GetName(c) %] |
160 |
[% END %] |
161 |
</td> |
162 |
<td> |
163 |
[% IF i == undef %] |
164 |
<em>All</em> |
165 |
[% ELSE %] |
166 |
[% ItemTypes.GetDescription(i) %] |
167 |
[% END %] |
168 |
</td> |
169 |
<td class="actions"> |
170 |
<a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> |
171 |
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% rule.itemtype || '*' %]&categorycode=[% rule.categorycode || '*' %]&branch=[% current_branch %]"><i class="fa fa-trash"></i> Delete</a> |
172 |
</td> |
173 |
<td> |
174 |
[% IF maxissueqty.defined && maxissueqty != '' %] |
175 |
[% maxissueqty %] |
176 |
[% ELSE %] |
177 |
Unlimited |
178 |
[% END %] |
179 |
</td> |
180 |
<td> |
181 |
[% IF maxonsiteissueqty.defined && maxonsiteissueqty != '' %] |
182 |
[% maxonsiteissueqty %] |
183 |
[% ELSE %] |
184 |
Unlimited |
185 |
[% END %] |
186 |
</td> |
187 |
<td>[% issuelength %]</td> |
188 |
<td> |
189 |
[% lengthunit %] |
190 |
</td> |
191 |
<td> |
192 |
[% IF ( hardduedate ) %] |
193 |
[% IF ( hardduedatecompare == '-1' ) %] |
194 |
before [% hardduedate | $KohaDates %] |
195 |
<input type="hidden" name="hardduedatecomparebackup" value="-1" /> |
196 |
[% ELSIF ( hardduedatecompare == '0' ) %] |
197 |
on [% hardduedate | $KohaDates %] |
198 |
<input type="hidden" name="hardduedatecomparebackup" value="0" /> |
199 |
[% ELSIF ( hardduedatecompare == '1' ) %] |
200 |
after [% hardduedate | $KohaDates %] |
201 |
<input type="hidden" name="hardduedatecomparebackup" value="1" /> |
202 |
[% END %] |
203 |
[% ELSE %] |
204 |
None defined |
205 |
[% END %] |
206 |
</td> |
207 |
<td>[% fine %]</td> |
208 |
<td>[% chargeperiod %]</td> |
209 |
<td>[% IF chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]</td> |
210 |
<td>[% firstremind %]</td> |
211 |
<td>[% overduefinescap FILTER format("%.2f") %]</td> |
212 |
<td> |
213 |
[% IF cap_fine_to_replacement_price %] |
214 |
<input type="checkbox" checked="checked" disabled="disabled" /> |
215 |
[% ELSE %] |
216 |
<input type="checkbox" disabled="disabled" /> |
217 |
[% END %] |
218 |
</td> |
219 |
<td>[% finedays %]</td> |
220 |
<td>[% maxsuspensiondays %]</td> |
221 |
<td>[% renewalsallowed %]</td> |
222 |
<td>[% renewalperiod %]</td> |
223 |
<td>[% norenewalbefore %]</td> |
224 |
<td> |
225 |
[% IF auto_renew %] |
226 |
Yes |
227 |
[% ELSE %] |
228 |
No |
229 |
[% END %] |
230 |
</td> |
231 |
<td>[% no_auto_renewal_after %]</td> |
232 |
<td>[% no_auto_renewal_after_hard_limit %]</td> |
233 |
<td>[% reservesallowed %]</td> |
234 |
<td>[% holds_per_record %]</td> |
235 |
<td> |
236 |
[% IF onshelfholds == 1 %] |
237 |
Yes |
238 |
[% ELSIF onshelfholds == 2 %] |
239 |
If all unavailable |
240 |
[% ELSE %] |
241 |
If any unavailable |
242 |
[% END %] |
243 |
</td> |
244 |
<td>[% IF opacitemholds == 'F'%]Force[% ELSIF opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td> |
245 |
<td> |
246 |
[% IF article_requests == 'no' %] |
247 |
No |
248 |
[% ELSIF article_requests == 'yes' %] |
249 |
Yes |
250 |
[% ELSIF article_requests == 'bib_only' %] |
251 |
Record only |
252 |
[% ELSIF article_requests == 'item_only' %] |
253 |
Item only |
254 |
[% END %] |
255 |
</td> |
256 |
<td>[% rentaldiscount %]</td> |
257 |
<td class="actions"> |
258 |
<a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> |
259 |
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% rule.itemtype || '*' %]&categorycode=[% rule.categorycode || '*' %]&branch=[% current_branch %]"><i class="fa fa-trash"></i> Delete</a> |
260 |
</td> |
261 |
</tr> |
262 |
[% END %] |
263 |
[% END %] |
264 |
[% END %] |
265 |
<tr id="edit_row"> |
266 |
<td> |
267 |
<select name="categorycode" id="categorycode"> |
268 |
<option value="*">All</option> |
269 |
[% FOREACH patron_category IN patron_categories%] |
270 |
<option value="[% patron_category.categorycode %]">[% patron_category.description %]</option> |
271 |
[% END %] |
272 |
</select> |
273 |
</td> |
274 |
<td> |
275 |
<select name="itemtype" id="matrixitemtype" style="width:13em;"> |
276 |
<option value="*">All</option> |
277 |
[% FOREACH itemtypeloo IN itemtypeloop %] |
278 |
<option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option> |
279 |
[% END %] |
280 |
</select> |
281 |
</td> |
282 |
<td class="actions"> |
283 |
<input type="hidden" name="branch" value="[% current_branch %]"/> |
284 |
<button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button> |
285 |
<button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button> |
286 |
</td> |
287 |
<td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td> |
288 |
<td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td> |
289 |
<td><input type="text" name="issuelength" id="issuelength" size="3" /> </td> |
290 |
<td> |
291 |
<select name="lengthunit" id="lengthunit"> |
292 |
<option value="days" selected="selected">Days</option> |
293 |
<option value="hours">Hours</option> |
294 |
</select> |
295 |
</td> |
296 |
<td> |
297 |
<select name="hardduedatecompare" id="hardduedatecompare"> |
298 |
<option value="-1">Before</option> |
299 |
<option value="0">Exactly on</option> |
300 |
<option value="1">After</option> |
301 |
</select> |
302 |
<input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate %]" class="datepicker" /> |
303 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
304 |
</td> |
305 |
<td><input type="text" name="fine" id="fine" size="4" /></td> |
306 |
<td><input type="text" name="chargeperiod" id="chargeperiod" size="2" /></td> |
307 |
<td> |
308 |
<select name="chargeperiod_charge_at" id="chargeperiod_charge_at"> |
309 |
<option value="0">End of interval</option> |
310 |
<option value="1">Start of interval</option> |
311 |
</select> |
312 |
</td> |
313 |
<td><input type="text" name="firstremind" id="firstremind" size="2" /> </td> |
314 |
<td><input type="text" name="overduefinescap" id="overduefinescap" size="6" /> </td> |
315 |
<td><input type="checkbox" name="cap_fine_to_replacement_price" id="cap_fine_to_replacement_price" /></td> |
316 |
<td><input type="text" name="finedays" id="fined" size="3" /> </td> |
317 |
<td><input type="text" name="maxsuspensiondays" id="maxsuspensiondays" size="3" /> </td> |
318 |
<td><input type="text" name="renewalsallowed" id="renewalsallowed" size="2" /></td> |
319 |
<td><input type="text" name="renewalperiod" id="renewalperiod" size="3" /></td> |
320 |
<td><input type="text" name="norenewalbefore" id="norenewalbefore" size="3" /></td> |
321 |
<td> |
322 |
<select name="auto_renew" id="auto_renew"> |
323 |
<option value="no" selected>No</option> |
324 |
<option value="yes">Yes</option> |
325 |
</select> |
326 |
</td> |
327 |
<td><input type="text" name="no_auto_renewal_after" id="no_auto_renewal_after" size="3" /></td> |
328 |
<td> |
329 |
<input type="text" size="10" name="no_auto_renewal_after_hard_limit" id="no_auto_renewal_after_hard_limit" value="[% no_auto_renewal_after_hard_limit %]" class="datepicker"/> |
330 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
331 |
</td> |
332 |
<td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td> |
333 |
<td><input type="text" name="holds_per_record" id="holds_per_record" size="2" /></td> |
334 |
<td> |
335 |
<select name="onshelfholds" id="onshelfholds"> |
336 |
<option value="1">Yes</option> |
337 |
<option value="0">If any unavailable</option> |
338 |
<option value="2">If all unavailable</option> |
339 |
</select> |
340 |
</td> |
341 |
<td> |
342 |
<select id="opacitemholds" name="opacitemholds"> |
343 |
<option value="N">Don't allow</option> |
344 |
<option value="Y">Allow</option> |
345 |
<option value="F">Force</option> |
346 |
</select> |
347 |
</td> |
348 |
<td> |
349 |
<select id="article_requests" name="article_requests"> |
350 |
<option value="no">No</option> |
351 |
<option value="yes">Yes</option> |
352 |
<option value="bib_only">Record only</option> |
353 |
<option value="item_only">Item only</option> |
354 |
</select> |
355 |
</td> |
356 |
<td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td> |
357 |
<td class="actions"> |
358 |
<input type="hidden" name="branch" value="[% current_branch %]"/> |
359 |
<button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button> |
360 |
<button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button> |
361 |
</td> |
362 |
</tr> |
363 |
<tfoot> |
364 |
<tr> |
365 |
<th>Patron category</th> |
366 |
<th>Item type</th> |
367 |
<th> </th> |
368 |
<th>Current checkouts allowed</th> |
369 |
<th>Current on-site checkouts allowed</th> |
370 |
<th>Loan period</th> |
371 |
<th>Unit</th> |
372 |
<th>Hard due date</th> |
373 |
<th>Fine amount</th> |
374 |
<th>Fine charging interval</th> |
375 |
<th>Charge when?</th> |
376 |
<th>Fine grace period</th> |
377 |
<th>Overdue fines cap (amount)</th> |
378 |
<th>Cap fine at replacement price</th> |
379 |
<th>Suspension in days (day)</th> |
380 |
<th>Max. suspension duration (day)</th> |
381 |
<th>Renewals allowed (count)</th> |
382 |
<th>Renewal period</th> |
383 |
<th>No renewal before</th> |
384 |
<th>Automatic renewal</th> |
385 |
<th>No automatic renewal after</th> |
386 |
<th>No automatic renewal after (hard limit)</th> |
387 |
<th>Holds allowed (count)</th> |
388 |
<th>Holds per record (count)</th> |
389 |
<th>On shelf holds allowed</th> |
390 |
<th>Item level holds</th> |
391 |
<th>Article requests</th> |
392 |
<th>Rental discount (%)</th> |
393 |
<th> </th> |
394 |
</tr> |
395 |
</tfoot> |
396 |
</tbody> |
397 |
</table> |
398 |
</form> |
399 |
</div> |
400 |
<div id="defaults-for-this-library" class="container"> |
401 |
<h3>Default checkout, hold and return policy[% IF humanbranch %] for [% Branches.GetName( humanbranch ) %][% END %]</h3> |
402 |
<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> |
403 |
<form method="post" action="/cgi-bin/koha/admin/smart-rules.pl"> |
404 |
<input type="hidden" name="op" value="set-branch-defaults" /> |
405 |
<input type="hidden" name="branch" value="[% current_branch %]"/> |
406 |
<table> |
407 |
<tr> |
408 |
<th> </th> |
409 |
<th>Total current checkouts allowed</th> |
410 |
<th>Total current on-site checkouts allowed</th> |
411 |
<th>Maximum total holds allowed (count)</th> |
412 |
<th>Hold policy</th> |
413 |
<th>Hold pickup library match</th> |
414 |
<th>Return policy</th> |
415 |
<th>Actions</th> |
416 |
</tr> |
417 |
<tr> |
418 |
<td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td> |
419 |
<td> |
420 |
[% SET patron_maxissueqty = CirculationRules.Get( branchcode, undef, undef, 'patron_maxissueqty' ) %] |
421 |
<input type="text" name="patron_maxissueqty" size="3" value="[% patron_maxissueqty %]"/> |
422 |
</td> |
423 |
<td> |
424 |
[% SET patron_maxonsiteissueqty = CirculationRules.Get( branchcode, undef, undef, 'patron_maxonsiteissueqty' ) %] |
425 |
<input type="text" name="patron_maxonsiteissueqty" size="3" value="[% patron_maxonsiteissueqty %]"/> |
426 |
</td> |
427 |
<td> |
428 |
[% SET rule_value = CirculationRules.Get( current_branch, '*', undef, 'max_holds' ) %] |
429 |
<input name="max_holds" size="3" value="[% rule_value %]" /> |
430 |
</td> |
431 |
<td> |
432 |
<select name="holdallowed"> |
433 |
[% SET holdallowed = CirculationRules.Get( branchcode, undef, undef, 'holdallowed' ) %] |
434 |
<option value=""> |
435 |
Not set |
436 |
</option> |
437 |
|
438 |
[% IF holdallowed == 2 %] |
439 |
<option value="2" selected="selected"> |
440 |
[% ELSE %] |
441 |
<option value="2"> |
442 |
[% END %] |
443 |
From any library |
444 |
</option> |
445 |
|
446 |
[% IF holdallowed == 1 %] |
447 |
<option value="1" selected="selected"> |
448 |
[% ELSE %] |
449 |
<option value="1"> |
450 |
[% END %] |
451 |
From home library |
452 |
</option> |
453 |
|
454 |
[% IF holdallowed == 0 %] |
455 |
<option value="0" selected="selected"> |
456 |
[% ELSE %] |
457 |
<option value="0"> |
458 |
[% END %] |
459 |
No holds allowed |
460 |
</option> |
461 |
</select> |
462 |
</td> |
463 |
<td> |
464 |
<select name="hold_fulfillment_policy"> |
465 |
[% SET hold_fulfillment_policy = CirculationRules.Get( branchcode, undef, undef, 'hold_fulfillment_policy' ) %] |
466 |
|
467 |
<option value=""> |
468 |
Not set |
469 |
</option> |
470 |
|
471 |
[% IF hold_fulfillment_policy == 'any' %] |
472 |
<option value="any" selected="selected"> |
473 |
any library |
474 |
</option> |
475 |
[% ELSE %] |
476 |
<option value="any"> |
477 |
any library |
478 |
</option> |
479 |
[% END %] |
480 |
|
481 |
[% IF hold_fulfillment_policy == 'homebranch' %] |
482 |
<option value="homebranch" selected="selected"> |
483 |
item's home library |
484 |
</option> |
485 |
[% ELSE %] |
486 |
<option value="homebranch"> |
487 |
item's home library |
488 |
</option> |
489 |
[% END %] |
490 |
|
491 |
[% IF hold_fulfillment_policy == 'holdingbranch' %] |
492 |
<option value="holdingbranch" selected="selected"> |
493 |
item's holding library |
494 |
</option> |
495 |
[% ELSE %] |
496 |
<option value="holdingbranch"> |
497 |
item's holding library |
498 |
</option> |
499 |
[% END %] |
500 |
</select> |
501 |
</td> |
502 |
<td> |
503 |
<select name="returnbranch"> |
504 |
[% SET returnbranch = CirculationRules.Get( branchcode, undef, undef, 'returnbranch' ) %] |
505 |
|
506 |
<option value=""> |
507 |
Not set |
508 |
</option> |
509 |
|
510 |
[% IF returnbranch == 'homebranch' %] |
511 |
<option value="homebranch" selected="selected"> |
512 |
[% ELSE %] |
513 |
<option value="homebranch"> |
514 |
[% END %] |
515 |
Item returns home |
516 |
</option> |
517 |
[% IF returnbranch == 'holdingbranch' %] |
518 |
<option value="holdingbranch" selected="selected"> |
519 |
[% ELSE %] |
520 |
<option value="holdingbranch"> |
521 |
[% END %] |
522 |
Item returns to issuing library |
523 |
</option> |
524 |
[% IF returnbranch == 'noreturn' %] |
525 |
<option value="noreturn" selected="selected"> |
526 |
[% ELSE %] |
527 |
<option value="noreturn"> |
528 |
[% END %] |
529 |
Item floats |
530 |
</option> |
531 |
</select> |
532 |
</td> |
533 |
<td class="actions"> |
534 |
<button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button> |
535 |
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=*&branch=[% current_branch %]" id="unset"><i class="fa fa-undo"></i> Unset</a> |
536 |
</td> |
537 |
</tr> |
538 |
</table> |
539 |
</form> |
540 |
</div> |
541 |
[% IF ( show_branch_cat_rule_form ) %] |
542 |
<div id="holds-policy-by-patron-category" class="container"> |
543 |
<h3>[% IF humanbranch %]Checkout, hold policy by patron category for [% Branches.GetName( humanbranch ) %][% ELSE %]Default checkout, hold policy by patron category[% END %]</h3> |
544 |
<p>For this library, you can specify the maximum number of loans that |
545 |
a patron of a given category can make, regardless of the item type. |
546 |
</p> |
547 |
<p>If the total amount loanable for a given patron category is left blank, |
548 |
no limit applies, except possibly for a limit you define for a specific item type. |
549 |
</p> |
550 |
<form method="post" action="/cgi-bin/koha/admin/smart-rules.pl"> |
551 |
<input type="hidden" name="op" value="add-branch-cat" /> |
552 |
<input type="hidden" name="branch" value="[% current_branch %]"/> |
553 |
<table> |
554 |
<tr> |
555 |
<th>Patron category</th> |
556 |
<th>Total current checkouts allowed</th> |
557 |
<th>Total current on-site checkouts allowed</th> |
558 |
<th>Total holds allowed</th> |
559 |
<th> </th> |
560 |
</tr> |
561 |
[% FOREACH c IN categorycodes %] |
562 |
[% NEXT UNLESS c %] |
563 |
[% SET patron_maxissueqty = CirculationRules.Get( branchcode, c, undef, 'patron_maxissueqty' ) %] |
564 |
[% SET patron_maxonsiteissueqty = CirculationRules.Get( branchcode, c, undef, 'patron_maxonsiteissueqty' ) %] |
565 |
[% SET max_holds = CirculationRules.Get( branchcode, c, undef, 'max_holds' ) %] |
566 |
|
567 |
[% IF patron_maxissueqty || patron_maxonsiteissueqty || max_holds %] |
568 |
<tr> |
569 |
<td> |
570 |
[% IF c == undef %] |
571 |
<em>Default</em> |
572 |
[% ELSE %] |
573 |
[% Categories.GetName(c) %] |
574 |
[% END %] |
575 |
</td> |
576 |
<td> |
577 |
[% IF patron_maxissueqty.defined && patron_maxissueqty != '' %] |
578 |
[% patron_maxissueqty %] |
579 |
[% ELSE %] |
580 |
Unlimited |
581 |
[% END %] |
582 |
</td> |
583 |
<td> |
584 |
[% IF patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' %] |
585 |
[% patron_maxonsiteissueqty %] |
586 |
[% ELSE %] |
587 |
Unlimited |
588 |
[% END %] |
589 |
</td> |
590 |
<td> |
591 |
[% IF max_holds.defined && max_holds != '' %] |
592 |
[% max_holds %] |
593 |
[% ELSE %] |
594 |
Unlimited |
595 |
[% END %] |
596 |
</td> |
597 |
|
598 |
<td class="actions"> |
599 |
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=[% c %]&branch=[% current_branch %]"><i class="fa fa-trash"></i> Delete</a> |
600 |
</td> |
601 |
</tr> |
602 |
[% END %] |
603 |
[% END %] |
604 |
<tr> |
605 |
<td> |
606 |
<select name="categorycode"> |
607 |
[% FOREACH patron_category IN patron_categories%] |
608 |
<option value="[% patron_category.categorycode %]">[% patron_category.description %]</option> |
609 |
[% END %] |
610 |
</select> |
611 |
</td> |
612 |
<td><input name="patron_maxissueqty" size="3" /></td> |
613 |
<td><input name="patron_maxonsiteissueqty" size="3" /></td> |
614 |
<td><input name="max_holds" size="3" /></td> |
615 |
<td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</td> |
616 |
</tr> |
617 |
</table> |
618 |
</form> |
619 |
</div> |
620 |
[% END %] |
621 |
|
622 |
<div id="refund-lost-item-fee-on-return" class="container"> |
623 |
[% IF current_branch == '*' %] |
624 |
<h3>Default lost item fee refund on return policy</h3> |
625 |
[% ELSE %] |
626 |
<h3>Lost item fee refund on return policy for [% Branches.GetName(current_branch) %]</h3> |
627 |
[% END %] |
628 |
<p>Specify the default policy for lost item fees on return. |
629 |
</p> |
630 |
<form method="post" action="/cgi-bin/koha/admin/smart-rules.pl"> |
631 |
<input type="hidden" name="op" value="mod-refund-lost-item-fee-rule" /> |
632 |
<input type="hidden" name="branch" value="[% current_branch %]" /> |
633 |
<table> |
634 |
<tr> |
635 |
<th>Refund lost item fee</th> |
636 |
<th> </th> |
637 |
</tr> |
638 |
<tr> |
639 |
<td> |
640 |
<select name="refund"> |
641 |
[#% Default branch %#] |
642 |
[% IF ( current_branch == '*' ) %] |
643 |
[% IF ( refundLostItemFeeRule.rule_value ) %] |
644 |
<option value="1" selected="selected"> |
645 |
[% ELSE %] |
646 |
<option value="1"> |
647 |
[% END %] |
648 |
Yes |
649 |
</option> |
650 |
[% IF ( not refundLostItemFeeRule.rule_value ) %] |
651 |
<option value="0" selected="selected"> |
652 |
[% ELSE %] |
653 |
<option value="0"> |
654 |
[% END %] |
655 |
No |
656 |
</option> |
657 |
[% ELSE %] |
658 |
[#% Branch-specific %#] |
659 |
[% IF ( not refundLostItemFeeRule ) %] |
660 |
<option value="*" selected="selected"> |
661 |
[% ELSE %] |
662 |
<option value="*"> |
663 |
[% END %] |
664 |
[% IF defaultRefundRule %] |
665 |
Use default (Yes) |
666 |
[% ELSE %] |
667 |
Use default (No) |
668 |
[% END %] |
669 |
</option> |
670 |
[% IF ( not refundLostItemFeeRule ) %] |
671 |
<option value="1">Yes</option> |
672 |
<option value="0">No</option> |
673 |
[% ELSE %] |
674 |
[% IF ( refundLostItemFeeRule.rule_value ) %] |
675 |
<option value="1" selected="selected"> |
676 |
[% ELSE %] |
677 |
<option value="1"> |
678 |
[% END %] |
679 |
Yes |
680 |
</option> |
681 |
[% IF ( not refundLostItemFeeRule.rule_value ) %] |
682 |
<option value="0" selected="selected"> |
683 |
[% ELSE %] |
684 |
<option value="0"> |
685 |
[% END %] |
686 |
No |
687 |
</option> |
688 |
[% END %] |
689 |
[% END %] |
690 |
</select> |
691 |
</td> |
692 |
<td class="actions"> |
693 |
<button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button> |
694 |
</td> |
695 |
</td> |
696 |
</tr> |
697 |
</table> |
698 |
</form> |
699 |
</div> |
700 |
|
701 |
<div id="holds-policy-by-item-type" class="container"> |
702 |
<h3>[% IF humanbranch %]Holds policy by item type for [% Branches.GetName( humanbranch ) %][% ELSE %]Default holds policy by item type[% END %]</h3> |
703 |
<p> |
704 |
For this library, you can edit rules for given itemtypes, regardless |
705 |
of the patron's category. |
706 |
</p> |
707 |
<p> |
708 |
Currently, this means hold policies. |
709 |
The various policies have the following effects: |
710 |
</p> |
711 |
<ul> |
712 |
<li><strong>From any library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li> |
713 |
<li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li> |
714 |
<li><strong>No holds allowed:</strong> No patron may put this book on hold.</li> |
715 |
</ul> |
716 |
<p><strong>Note: </strong>If the system preference 'AllowHoldPolicyOverride' is enabled, these policies can be overridden by your circulation staff.</br /> |
717 |
<strong>Important: </strong>The policies are based on the patron's home library, not the library where the hold is being placed. |
718 |
</p> |
719 |
|
720 |
<form method="post" action="/cgi-bin/koha/admin/smart-rules.pl"> |
721 |
<input type="hidden" name="op" value="add-branch-item" /> |
722 |
<input type="hidden" name="branch" value="[% current_branch %]"/> |
723 |
<table> |
724 |
<tr> |
725 |
<th>Item type</th> |
726 |
<th>Hold policy</th> |
727 |
<th>Hold pickup library match</th> |
728 |
<th>Return policy</th> |
729 |
<th> </th> |
730 |
</tr> |
731 |
[% FOREACH i IN itemtypeloop %] |
732 |
[% SET holdallowed = CirculationRules.Get( branchcode, undef, i.itemtype, 'holdallowed' ) %] |
733 |
[% SET hold_fulfillment_policy = CirculationRules.Get( branchcode, undef, i.itemtype, 'hold_fulfillment_policy' ) %] |
734 |
[% SET returnbranch = CirculationRules.Get( branchcode, undef, i.itemtype, 'returnbranch' ) %] |
735 |
|
736 |
[% IF holdallowed || hold_fulfillment_policy || returnbranch %] |
737 |
<tr> |
738 |
<td> |
739 |
[% i.translated_description %] |
740 |
</td> |
741 |
<td> |
742 |
[% IF holdallowed == 2 %] |
743 |
From any library |
744 |
[% ELSIF holdallowed == 1 %] |
745 |
From home library |
746 |
[% ELSE %] |
747 |
No holds allowed |
748 |
[% END %] |
749 |
</td> |
750 |
<td> |
751 |
[% IF hold_fulfillment_policy == 'any' %] |
752 |
any library |
753 |
[% ELSIF hold_fulfillment_policy == 'homebranch' %] |
754 |
item's home library |
755 |
[% ELSIF hold_fulfillment_policy == 'holdingbranch' %] |
756 |
item's holding library |
757 |
[% END %] |
758 |
</td> |
759 |
<td> |
760 |
[% IF returnbranch == 'homebranch' %] |
761 |
Item returns home |
762 |
[% ELSIF returnbranch == 'holdingbranch' %] |
763 |
Item returns to issuing branch |
764 |
[% ELSIF returnbranch == 'noreturn' %] |
765 |
Item floats |
766 |
[% END %] |
767 |
</td> |
768 |
<td class="actions"> |
769 |
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&itemtype=[% i.itemtype %]&branch=[% current_branch %]"><i class="fa fa-trash"></i> Delete</a> |
770 |
</td> |
771 |
</tr> |
772 |
[% END %] |
773 |
[% END %] |
774 |
<tr> |
775 |
<td> |
776 |
<select name="itemtype"> |
777 |
[% FOREACH itemtypeloo IN itemtypeloop %] |
778 |
<option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option> |
779 |
[% END %] |
780 |
</select> |
781 |
</td> |
782 |
<td> |
783 |
<select name="holdallowed"> |
784 |
<option value="2">From any library</option> |
785 |
<option value="1">From home library</option> |
786 |
<option value="0">No holds allowed</option> |
787 |
</select> |
788 |
</td> |
789 |
<td> |
790 |
<select name="hold_fulfillment_policy"> |
791 |
<option value="any"> |
792 |
any library |
793 |
</option> |
794 |
|
795 |
<option value="homebranch"> |
796 |
item's home library |
797 |
</option> |
798 |
|
799 |
<option value="holdingbranch"> |
800 |
item's holding library |
801 |
</option> |
802 |
</select> |
803 |
</td> |
804 |
<td> |
805 |
<select name="returnbranch"> |
806 |
<option value="homebranch">Item returns home</option> |
807 |
<option value="holdingbranch">Item returns to issuing library</option> |
808 |
<option value="noreturn">Item floats</option> |
809 |
</select> |
810 |
</td> |
811 |
<td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td> |
812 |
</tr> |
813 |
</table> |
814 |
</form> |
815 |
</div> |
816 |
</div> |
817 |
|
818 |
</div> |
819 |
<div class="yui-b"> |
820 |
[% INCLUDE 'admin-menu.inc' %] |
821 |
</div> |
822 |
</div> |
823 |
|
824 |
[% MACRO jsinclude BLOCK %] |
825 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script> |
826 |
[% INCLUDE 'calendar.inc' %] |
827 |
<script type="text/javascript"> |
828 |
|
829 |
function clear_edit(){ |
830 |
var cancel = confirm(_("Are you sure you want to cancel your changes?")); |
831 |
if ( !cancel ) return; |
832 |
$('#default-circulation-rules td').removeClass('highlighted-row'); |
833 |
var edit_row = $("#edit_row"); |
834 |
$(edit_row).find("input").each(function(){ |
835 |
var type = $(this).attr("type"); |
836 |
if (type != "button" && type != "submit" ) { |
837 |
$(this).val(""); |
838 |
$(this).prop('disabled', false); |
839 |
} |
840 |
if ( type == "checkbox" ) { |
841 |
$(this).prop('checked', false); |
842 |
} |
843 |
}); |
844 |
$(edit_row).find("select").prop('disabled', false); |
845 |
$(edit_row).find("select option:first").attr("selected", "selected"); |
846 |
$(edit_row).find("td:last input[name='clear']").remove(); |
847 |
} |
848 |
|
849 |
var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone."); |
850 |
|
851 |
$(document).ready(function() { |
852 |
$(".delete").on("click",function(){ |
853 |
return confirmDelete(MSG_CONFIRM_DELETE); |
854 |
}); |
855 |
|
856 |
$("#clone_rules").on("click",function(){ |
857 |
var library_dropdown = document.getElementById("branch"); |
858 |
var selected_library = library_dropdown.options[library_dropdown.selectedIndex].value; |
859 |
var selected_library_text = $("#branch option:selected").text(); |
860 |
var to_library = $("#tobranch option:selected").text(); |
861 |
var MSG_CONFIRM_CLONE; |
862 |
if (selected_library === "*") { |
863 |
MSG_CONFIRM_CLONE = _("Are you sure you want to clone this standard rule to %s library? This will override the existing rules in this library.").format(to_library); |
864 |
return confirmClone(MSG_CONFIRM_CLONE); |
865 |
} else { |
866 |
MSG_CONFIRM_CLONE = _("Are you sure you want to clone this circulation and fine rule from %s to %s library? This will override the existing rules in this library.").format(selected_library_text, to_library); |
867 |
return confirmClone(MSG_CONFIRM_CLONE); |
868 |
} |
869 |
}); |
870 |
|
871 |
$('#cap_fine_to_replacement_price').on('change', function(){ |
872 |
$('#overduefinescap').prop('disabled', $(this).is(':checked') ); |
873 |
}); |
874 |
$('#selectlibrary').find("input:submit").hide(); |
875 |
$('#branch').change(function() { |
876 |
$('#selectlibrary').submit(); |
877 |
}); |
878 |
$(".editrule").click(function(){ |
879 |
if ( $("#edit_row").find("input[type='text']").filter(function(){return this.value.length > 0 }).length > 0 ) { |
880 |
var edit = confirm(_("Are you sure you want to edit another rule?")); |
881 |
if (!edit) return false; |
882 |
} |
883 |
$('#default-circulation-rules td').removeClass('highlighted-row'); |
884 |
$(this).parent().parent().find("td").each(function (i) { |
885 |
$(this).addClass('highlighted-row'); |
886 |
itm = $(this).text(); |
887 |
itm = itm.replace(/^\s*|\s*$/g,''); |
888 |
var current_column = $("#edit_row td:eq("+i+")"); |
889 |
if ( i == 7 ) { |
890 |
// specific processing for the Hard due date column |
891 |
var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val(); |
892 |
var input_value = ''; |
893 |
if (typeof select_value === 'undefined'){ |
894 |
select_value = '-1'; |
895 |
}else { |
896 |
input_value = itm.split(' ')[1]; |
897 |
} |
898 |
$(current_column).find("input[type='text']").val(input_value); |
899 |
$(current_column).find("select").val(select_value); |
900 |
} else if ( i == 13 ) { |
901 |
// specific processing for cap_fine_to_replacement_price |
902 |
var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']"); |
903 |
$('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') ); |
904 |
$('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') ); |
905 |
} else { |
906 |
$(current_column).find("input[type='text']").val(itm); |
907 |
// select the corresponding option |
908 |
$(current_column).find("select option").each(function(){ |
909 |
opt = $(this).text().toLowerCase(); |
910 |
opt = opt.replace(/^\s*|\s*$/g,''); |
911 |
if ( opt == itm.toLowerCase() ) { |
912 |
$(this).attr('selected', 'selected'); |
913 |
} |
914 |
}); |
915 |
if ( i == 0 || i == 1 ) { |
916 |
// Disable the 2 first columns, we cannot update them. |
917 |
var val = $(current_column).find("select option:selected").val(); |
918 |
var name = "categorycode"; |
919 |
if ( i == 1 ) { |
920 |
name="itemtype"; |
921 |
} |
922 |
// Remove potential previous input added |
923 |
$(current_column).find("input").remove(); |
924 |
$(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />"); |
925 |
} else if ( i == 3 || i == 4 ) { |
926 |
// If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed" |
927 |
// The value is "Unlimited" (or an equivalent translated string) |
928 |
// an it should be set to an empty string |
929 |
if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) { |
930 |
$(current_column).find("input[type='text']").val(""); |
931 |
} |
932 |
} |
933 |
} |
934 |
}); |
935 |
$("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true); |
936 |
$("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true); |
937 |
return false; |
938 |
}); |
939 |
$(".clear_edit").on("click",function(e){ |
940 |
e.preventDefault(); |
941 |
clear_edit(); |
942 |
}); |
943 |
}); |
944 |
</script> |
945 |
[% END %] |
946 |
[% INCLUDE 'intranet-bottom.inc' %] |