Lines 5-10
Link Here
|
5 |
[% USE Branches %] |
5 |
[% USE Branches %] |
6 |
[% USE Categories %] |
6 |
[% USE Categories %] |
7 |
[% USE ItemTypes %] |
7 |
[% USE ItemTypes %] |
|
|
8 |
[% USE Checkouts %] |
8 |
[% USE CirculationRules %] |
9 |
[% USE CirculationRules %] |
9 |
[% SET footerjs = 1 %] |
10 |
[% SET footerjs = 1 %] |
10 |
|
11 |
|
Lines 22-27
Link Here
|
22 |
[% END %] |
23 |
[% END %] |
23 |
[% itemtypes.push(undef) %] |
24 |
[% itemtypes.push(undef) %] |
24 |
|
25 |
|
|
|
26 |
[% SET checkout_types = [] %] |
27 |
[% FOREACH ct IN Checkouts.checkout_type %] |
28 |
[% checkout_types.push( ct.value ) %] |
29 |
[% END %] |
30 |
[% checkout_types.push(undef) %] |
31 |
|
25 |
[% INCLUDE 'doc-head-open.inc' %] |
32 |
[% INCLUDE 'doc-head-open.inc' %] |
26 |
<title>Koha › Administration › Circulation and fine rules</title> |
33 |
<title>Koha › Administration › Circulation and fine rules</title> |
27 |
[% INCLUDE 'doc-head-close.inc' %] |
34 |
[% INCLUDE 'doc-head-close.inc' %] |
Lines 86-91
Link Here
|
86 |
<table id="default-circulation-rules"> |
93 |
<table id="default-circulation-rules"> |
87 |
<thead> |
94 |
<thead> |
88 |
<tr> |
95 |
<tr> |
|
|
96 |
<th>Checkout type</th> |
89 |
<th>Patron category</th> |
97 |
<th>Patron category</th> |
90 |
<th>Item type</th> |
98 |
<th>Item type</th> |
91 |
<th>Actions</th> |
99 |
<th>Actions</th> |
Lines 122-131
Link Here
|
122 |
</thead> |
130 |
</thead> |
123 |
<tbody> |
131 |
<tbody> |
124 |
[% SET row_count = 0 %] |
132 |
[% SET row_count = 0 %] |
125 |
[% FOREACH c IN categorycodes %] |
133 |
[% FOREACH ct IN checkout_types %] |
126 |
[% SET c = '' UNLESS c.defined %] |
134 |
[% FOREACH c IN categorycodes %] |
127 |
[% FOREACH i IN itemtypes %] |
135 |
[% SET c = '' UNLESS c.defined %] |
|
|
136 |
[% FOREACH i IN itemtypes %] |
128 |
[% SET i = '' UNLESS i.defined %] |
137 |
[% SET i = '' UNLESS i.defined %] |
|
|
138 |
[% SET ct = '' UNLESS ct.defined %] |
129 |
[% SET note = all_rules.$c.$i.note %] |
139 |
[% SET note = all_rules.$c.$i.note %] |
130 |
[% SET maxissueqty = all_rules.$c.$i.maxissueqty %] |
140 |
[% SET maxissueqty = all_rules.$c.$i.maxissueqty %] |
131 |
[% SET issuelength = all_rules.$c.$i.issuelength %] |
141 |
[% SET issuelength = all_rules.$c.$i.issuelength %] |
Lines 160-165
Link Here
|
160 |
[% IF show_rule %] |
170 |
[% IF show_rule %] |
161 |
[% SET row_count = row_count + 1 %] |
171 |
[% SET row_count = row_count + 1 %] |
162 |
<tr row_countd="row_[% row_count | html %]"> |
172 |
<tr row_countd="row_[% row_count | html %]"> |
|
|
173 |
<td> |
174 |
[% IF ct == undef %] |
175 |
<em>All</em> |
176 |
[% ELSE %] |
177 |
[% IF ct == 'CHECKOUT' %] |
178 |
<em>Normal checkout</em> |
179 |
[% ELSIF ct == 'ONSITE' %] |
180 |
<em>On-site checkout</em> |
181 |
[% END %] |
182 |
[% END %] |
183 |
</td> |
163 |
<td> |
184 |
<td> |
164 |
[% IF c == undef %] |
185 |
[% IF c == undef %] |
165 |
<em>All</em> |
186 |
<em>All</em> |
Lines 176-182
Link Here
|
176 |
</td> |
197 |
</td> |
177 |
<td class="actions"> |
198 |
<td class="actions"> |
178 |
<a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> |
199 |
<a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> |
179 |
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% i || '*' | html %]&categorycode=[% c || '*' | html %]&branch=[% current_branch | html %]"><i class="fa fa-trash"></i> Delete</a> |
200 |
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&checkout_type=[% ct || '*' | html %]&itemtype=[% i || '*' | html %]&categorycode=[% c || '*' | html %]&branch=[% current_branch | html %]"><i class="fa fa-trash"></i> Delete</a> |
180 |
</td> |
201 |
</td> |
181 |
<td> |
202 |
<td> |
182 |
[% IF note.defined && note != '' %] |
203 |
[% IF note.defined && note != '' %] |
Lines 309-317
Link Here
|
309 |
</td> |
330 |
</td> |
310 |
</tr> |
331 |
</tr> |
311 |
[% END %] |
332 |
[% END %] |
|
|
333 |
[% END %] |
312 |
[% END %] |
334 |
[% END %] |
313 |
[% END %] |
335 |
[% END %] |
314 |
<tr id="edit_row"> |
336 |
<tr id="edit_row"> |
|
|
337 |
<td> |
338 |
<select name="checkout_type" id="matrixcheckout_type" style="width:13em;"> |
339 |
<option value="*">All</option> |
340 |
<option value="CHECKOUT">Normal checkout</option> |
341 |
<option value="ONSITE">On-site checkout</option> |
342 |
</select> |
343 |
</td> |
315 |
<td> |
344 |
<td> |
316 |
<select name="categorycode" id="categorycode"> |
345 |
<select name="categorycode" id="categorycode"> |
317 |
<option value="*">All</option> |
346 |
<option value="*">All</option> |
Lines 422-427
Link Here
|
422 |
</tr> |
451 |
</tr> |
423 |
<tfoot> |
452 |
<tfoot> |
424 |
<tr> |
453 |
<tr> |
|
|
454 |
<th>Checkout type</th> |
425 |
<th>Patron category</th> |
455 |
<th>Patron category</th> |
426 |
<th>Item type</th> |
456 |
<th>Item type</th> |
427 |
<th> </th> |
457 |
<th> </th> |
Lines 470-475
Link Here
|
470 |
<tr> |
500 |
<tr> |
471 |
<th> </th> |
501 |
<th> </th> |
472 |
<th>Total current checkouts allowed</th> |
502 |
<th>Total current checkouts allowed</th> |
|
|
503 |
<th>Total current on-site checkouts allowed</th> |
473 |
<th>Maximum total holds allowed (count)</th> |
504 |
<th>Maximum total holds allowed (count)</th> |
474 |
<th>Hold policy</th> |
505 |
<th>Hold policy</th> |
475 |
<th>Hold pickup library match</th> |
506 |
<th>Hold pickup library match</th> |
Lines 479-494
Link Here
|
479 |
<tr> |
510 |
<tr> |
480 |
<td><em>Defaults</em></td> |
511 |
<td><em>Defaults</em></td> |
481 |
<td> |
512 |
<td> |
482 |
[% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty' ) %] |
513 |
[% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, Checkouts.checkout_type.checkout, 'patron_maxissueqty' ) %] |
483 |
<input type="text" name="patron_maxissueqty" size="3" value="[% patron_maxissueqty | html %]"/> |
514 |
<input type="text" name="patron_maxissueqty" size="3" value="[% patron_maxissueqty | html %]"/> |
484 |
</td> |
515 |
</td> |
485 |
<td> |
516 |
<td> |
486 |
[% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds' ) %] |
517 |
[% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, Checkouts.checkout_type.onsite_checkout, 'patron_maxissueqty' ) %] |
|
|
518 |
<input type="text" name="patron_maxonsiteissueqty" size="3" value="[% patron_maxissueqty | html %]"/> |
519 |
</td> |
520 |
<td> |
521 |
[% SET rule_value = CirculationRules.Search( current_branch, undef , undef, undef, 'max_holds' ) %] |
487 |
<input name="max_holds" size="3" value="[% rule_value | html %]" /> |
522 |
<input name="max_holds" size="3" value="[% rule_value | html %]" /> |
488 |
</td> |
523 |
</td> |
489 |
<td> |
524 |
<td> |
490 |
<select name="holdallowed"> |
525 |
<select name="holdallowed"> |
491 |
[% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed' ) %] |
526 |
[% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, undef, 'holdallowed' ) %] |
492 |
<option value=""> |
527 |
<option value=""> |
493 |
Not set |
528 |
Not set |
494 |
</option> |
529 |
</option> |
Lines 528-534
Link Here
|
528 |
</td> |
563 |
</td> |
529 |
<td> |
564 |
<td> |
530 |
<select name="hold_fulfillment_policy"> |
565 |
<select name="hold_fulfillment_policy"> |
531 |
[% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy' ) %] |
566 |
[% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, undef, 'hold_fulfillment_policy' ) %] |
532 |
|
567 |
|
533 |
<option value=""> |
568 |
<option value=""> |
534 |
Not set |
569 |
Not set |
Lines 587-593
Link Here
|
587 |
</td> |
622 |
</td> |
588 |
<td> |
623 |
<td> |
589 |
<select name="returnbranch"> |
624 |
<select name="returnbranch"> |
590 |
[% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch' ) %] |
625 |
[% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, undef, 'returnbranch' ) %] |
591 |
|
626 |
|
592 |
<option value=""> |
627 |
<option value=""> |
593 |
Not set |
628 |
Not set |
Lines 640-652
Link Here
|
640 |
<tr> |
675 |
<tr> |
641 |
<th>Patron category</th> |
676 |
<th>Patron category</th> |
642 |
<th>Total current checkouts allowed</th> |
677 |
<th>Total current checkouts allowed</th> |
|
|
678 |
<th>Total current on-site checkouts allowed</th> |
643 |
<th>Total holds allowed</th> |
679 |
<th>Total holds allowed</th> |
644 |
<th> </th> |
680 |
<th> </th> |
645 |
</tr> |
681 |
</tr> |
646 |
[% FOREACH c IN categorycodes %] |
682 |
[% FOREACH c IN categorycodes %] |
647 |
[% NEXT UNLESS c %] |
683 |
[% NEXT UNLESS c %] |
648 |
[% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxissueqty' ) %] |
684 |
[% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, Checkouts.checkout_type.checkout, 'patron_maxissueqty' ) %] |
649 |
[% SET max_holds = CirculationRules.Search( branchcode, c, undef, 'max_holds' ) %] |
685 |
[% SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, c, undef, Checkouts.checkout_type.onsite_checkout, 'patron_maxissueqty' ) %] |
|
|
686 |
[% SET max_holds = CirculationRules.Search( branchcode, c, undef, undef, 'max_holds' ) %] |
650 |
|
687 |
|
651 |
[% IF ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %] |
688 |
[% IF ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %] |
652 |
<tr> |
689 |
<tr> |
Lines 664-669
Link Here
|
664 |
<span>Unlimited</span> |
701 |
<span>Unlimited</span> |
665 |
[% END %] |
702 |
[% END %] |
666 |
</td> |
703 |
</td> |
|
|
704 |
<td> |
705 |
[% IF patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' %] |
706 |
[% patron_maxonsiteissueqty | html %] |
707 |
[% ELSE %] |
708 |
<span>Unlimited</span> |
709 |
[% END %] |
710 |
</td> |
667 |
<td> |
711 |
<td> |
668 |
[% IF max_holds.defined && max_holds != '' %] |
712 |
[% IF max_holds.defined && max_holds != '' %] |
669 |
[% max_holds | html %] |
713 |
[% max_holds | html %] |
Lines 687-692
Link Here
|
687 |
</select> |
731 |
</select> |
688 |
</td> |
732 |
</td> |
689 |
<td><input name="patron_maxissueqty" size="3" type="text" /></td> |
733 |
<td><input name="patron_maxissueqty" size="3" type="text" /></td> |
|
|
734 |
<td><input name="patron_maxonsiteissueqty" size="3" type="text" /></td> |
690 |
<td><input name="max_holds" size="3" type="text" /></td> |
735 |
<td><input name="max_holds" size="3" type="text" /></td> |
691 |
<td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</td> |
736 |
<td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</td> |
692 |
</tr> |
737 |
</tr> |
Lines 806-814
Link Here
|
806 |
<th> </th> |
851 |
<th> </th> |
807 |
</tr> |
852 |
</tr> |
808 |
[% FOREACH i IN itemtypeloop %] |
853 |
[% FOREACH i IN itemtypeloop %] |
809 |
[% SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, 'holdallowed' ) %] |
854 |
[% SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'holdallowed' ) %] |
810 |
[% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, 'hold_fulfillment_policy' ) %] |
855 |
[% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'hold_fulfillment_policy' ) %] |
811 |
[% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, 'returnbranch' ) %] |
856 |
[% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'returnbranch' ) %] |
812 |
|
857 |
|
813 |
[% IF holdallowed || hold_fulfillment_policy || returnbranch %] |
858 |
[% IF holdallowed || hold_fulfillment_policy || returnbranch %] |
814 |
<tr> |
859 |
<tr> |
Lines 979-989
Link Here
|
979 |
itm = $(this).text(); |
1024 |
itm = $(this).text(); |
980 |
itm = itm.replace(/^\s*|\s*$/g,''); |
1025 |
itm = itm.replace(/^\s*|\s*$/g,''); |
981 |
var current_column = $("#edit_row td:eq("+i+")"); |
1026 |
var current_column = $("#edit_row td:eq("+i+")"); |
982 |
if ( i == 3 ) { |
1027 |
if ( i == 4 ) { |
983 |
// specific processing for the Note column |
1028 |
// specific processing for the Note column |
984 |
var note = $(this).find("a[name='viewnote']").data("content"); |
1029 |
var note = $(this).find("a[name='viewnote']").data("content"); |
985 |
$(current_column).find("input[type='text']").val(note); |
1030 |
$(current_column).find("input[type='text']").val(note); |
986 |
} else if ( i == 8 ) { |
1031 |
} else if ( i == 9 ) { |
987 |
// specific processing for the Hard due date column |
1032 |
// specific processing for the Hard due date column |
988 |
var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val(); |
1033 |
var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val(); |
989 |
var input_value = ''; |
1034 |
var input_value = ''; |
Lines 994-1000
Link Here
|
994 |
} |
1039 |
} |
995 |
$(current_column).find("input[type='text']").val(input_value); |
1040 |
$(current_column).find("input[type='text']").val(input_value); |
996 |
$(current_column).find("select").val(select_value); |
1041 |
$(current_column).find("select").val(select_value); |
997 |
} else if ( i == 14 ) { |
1042 |
} else if ( i == 15 ) { |
998 |
// specific processing for cap_fine_to_replacement_price |
1043 |
// specific processing for cap_fine_to_replacement_price |
999 |
var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']"); |
1044 |
var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']"); |
1000 |
$('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') ); |
1045 |
$('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') ); |
Lines 1009-1025
Link Here
|
1009 |
$(this).attr('selected', 'selected'); |
1054 |
$(this).attr('selected', 'selected'); |
1010 |
} |
1055 |
} |
1011 |
}); |
1056 |
}); |
1012 |
if ( i == 0 || i == 1 ) { |
1057 |
if ( i == 0 || i == 1 || i == 2 ) { |
1013 |
// Disable the 2 first columns, we cannot update them. |
1058 |
// Disable the 2 first columns, we cannot update them. |
1014 |
var val = $(current_column).find("select option:selected").val(); |
1059 |
var val = $(current_column).find("select option:selected").val(); |
1015 |
var name = "categorycode"; |
1060 |
var name = "categorycode"; |
1016 |
if ( i == 1 ) { |
1061 |
if ( i == 1 ) { |
1017 |
name="itemtype"; |
1062 |
name="itemtype"; |
1018 |
} |
1063 |
} |
|
|
1064 |
if ( i == 2 ) { |
1065 |
name="checkout_type"; |
1066 |
} |
1019 |
// Remove potential previous input added |
1067 |
// Remove potential previous input added |
1020 |
$(current_column).find("input").remove(); |
1068 |
$(current_column).find("input").remove(); |
1021 |
$(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />"); |
1069 |
$(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />"); |
1022 |
} else if ( i == 5 || i == 25 || i == 26 || i == 27 ) { |
1070 |
} else if ( i == 6 || i == 25 || i == 26 || i == 27 ) { |
1023 |
// If the value is not an integer for |
1071 |
// If the value is not an integer for |
1024 |
// - "Current checkouts allowed" |
1072 |
// - "Current checkouts allowed" |
1025 |
// - "Holds allowed (total)" |
1073 |
// - "Holds allowed (total)" |
Lines 1035-1040
Link Here
|
1035 |
}); |
1083 |
}); |
1036 |
$("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true); |
1084 |
$("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true); |
1037 |
$("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true); |
1085 |
$("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true); |
|
|
1086 |
$("#default-circulation-rules tr:last td:eq(2) select").prop('disabled', true); |
1038 |
return false; |
1087 |
return false; |
1039 |
}); |
1088 |
}); |
1040 |
$(".clear_edit").on("click",function(e){ |
1089 |
$(".clear_edit").on("click",function(e){ |
1041 |
- |
|
|