|
Lines 91-103
Link Here
|
| 91 |
<thead> |
91 |
<thead> |
| 92 |
<tr> |
92 |
<tr> |
| 93 |
<th> </th> |
93 |
<th> </th> |
|
|
94 |
<th class="fixed_sort">On-site checkout</th> |
| 94 |
<th class="fixed_sort">Patron category</th> |
95 |
<th class="fixed_sort">Patron category</th> |
| 95 |
<th> </th> |
96 |
<th> </th> |
| 96 |
<th class="fixed_sort">Item type</th> |
97 |
<th class="fixed_sort">Item type</th> |
| 97 |
<th>Actions</th> |
98 |
<th>Actions</th> |
| 98 |
<th>Note</th> |
99 |
<th>Note</th> |
| 99 |
<th>Current checkouts allowed</th> |
100 |
<th>Current checkouts allowed</th> |
| 100 |
<th>Current on-site checkouts allowed</th> |
|
|
| 101 |
<th>Loan period</th> |
101 |
<th>Loan period</th> |
| 102 |
<th>Days mode</th> |
102 |
<th>Days mode</th> |
| 103 |
<th>Unit</th> |
103 |
<th>Unit</th> |
|
Lines 129-141
Link Here
|
| 129 |
</thead> |
129 |
</thead> |
| 130 |
<tbody> |
130 |
<tbody> |
| 131 |
[% SET row_count = 0 %] |
131 |
[% SET row_count = 0 %] |
| 132 |
[% FOREACH c IN categorycodes %] |
132 |
[% FOREACH osc IN [ undef, 0, 1 ] %] |
| 133 |
[% SET c = '' UNLESS c.defined %] |
133 |
[% FOREACH c IN categorycodes %] |
| 134 |
[% FOREACH i IN itemtypes %] |
134 |
[% SET c = '' UNLESS c.defined %] |
|
|
135 |
[% FOREACH i IN itemtypes %] |
| 135 |
[% SET i = '' UNLESS i.defined %] |
136 |
[% SET i = '' UNLESS i.defined %] |
|
|
137 |
[% SET osc = '' UNLESS osc.defined %] |
| 136 |
[% SET note = all_rules.$c.$i.note %] |
138 |
[% SET note = all_rules.$c.$i.note %] |
| 137 |
[% SET maxissueqty = all_rules.$c.$i.maxissueqty %] |
139 |
[% SET maxissueqty = all_rules.$c.$i.maxissueqty %] |
| 138 |
[% SET maxonsiteissueqty = all_rules.$c.$i.maxonsiteissueqty %] |
|
|
| 139 |
[% SET issuelength = all_rules.$c.$i.issuelength %] |
140 |
[% SET issuelength = all_rules.$c.$i.issuelength %] |
| 140 |
[% SET daysmode = all_rules.$c.$i.daysmode %] |
141 |
[% SET daysmode = all_rules.$c.$i.daysmode %] |
| 141 |
[% SET lengthunit = all_rules.$c.$i.lengthunit %] |
142 |
[% SET lengthunit = all_rules.$c.$i.lengthunit %] |
|
Lines 164-174
Link Here
|
| 164 |
[% SET article_requests = all_rules.$c.$i.article_requests %] |
165 |
[% SET article_requests = all_rules.$c.$i.article_requests %] |
| 165 |
[% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %] |
166 |
[% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %] |
| 166 |
|
167 |
|
| 167 |
[% SET show_rule = note || maxissueqty || maxonsiteissueqty || issuelength || daysmode || lengthunit || hardduedate || hardduedatecompare || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalperiod || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || rentaldiscount %] |
168 |
[% SET show_rule = note || maxissueqty || issuelength || daysmode || lengthunit || hardduedate || hardduedatecompare || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalperiod || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || rentaldiscount %] |
| 168 |
[% IF show_rule %] |
169 |
[% IF show_rule %] |
| 169 |
[% SET row_count = row_count + 1 %] |
170 |
[% SET row_count = row_count + 1 %] |
| 170 |
<tr row_countd="row_[% row_count | html %]"> |
171 |
<tr row_countd="row_[% row_count | html %]"> |
| 171 |
<td>[% IF ( c == undef ) %]1[% ELSE %]0[% END %]</td> |
172 |
<td>[% IF ( c == undef ) %]1[% ELSE %]0[% END %]</td> |
|
|
173 |
<td> |
| 174 |
[% IF osc == undef %] |
| 175 |
<em>All</em> |
| 176 |
[% ELSE %] |
| 177 |
[% IF osc == 0 %] |
| 178 |
<em>No</em> |
| 179 |
[% ELSIF osc == 1 %] |
| 180 |
<em>On-site</em> |
| 181 |
[% END %] |
| 182 |
[% END %] |
| 183 |
</td> |
| 172 |
<td> |
184 |
<td> |
| 173 |
[% IF c == undef %] |
185 |
[% IF c == undef %] |
| 174 |
<em>All</em> |
186 |
<em>All</em> |
|
Lines 186-192
Link Here
|
| 186 |
</td> |
198 |
</td> |
| 187 |
<td class="actions"> |
199 |
<td class="actions"> |
| 188 |
<a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> |
200 |
<a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> |
| 189 |
<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> |
201 |
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&onsite_checkout=[% ct || '*' | html %]&itemtype=[% i || '*' | html %]&categorycode=[% c || '*' | html %]&branch=[% current_branch | html %]"><i class="fa fa-trash"></i> Delete</a> |
| 190 |
</td> |
202 |
</td> |
| 191 |
<td> |
203 |
<td> |
| 192 |
[% IF note.defined && note != '' %] |
204 |
[% IF note.defined && note != '' %] |
|
Lines 200-212
Link Here
|
| 200 |
<span>Unlimited</span> |
212 |
<span>Unlimited</span> |
| 201 |
[% END %] |
213 |
[% END %] |
| 202 |
</td> |
214 |
</td> |
| 203 |
<td> |
|
|
| 204 |
[% IF maxonsiteissueqty.defined && maxonsiteissueqty != '' %] |
| 205 |
[% maxonsiteissueqty | html %] |
| 206 |
[% ELSE %] |
| 207 |
<span>Unlimited</span> |
| 208 |
[% END %] |
| 209 |
</td> |
| 210 |
<td>[% issuelength | html %]</td> |
215 |
<td>[% issuelength | html %]</td> |
| 211 |
<td> |
216 |
<td> |
| 212 |
[% SWITCH daysmode %] |
217 |
[% SWITCH daysmode %] |
|
Lines 326-335
Link Here
|
| 326 |
</td> |
331 |
</td> |
| 327 |
</tr> |
332 |
</tr> |
| 328 |
[% END %] |
333 |
[% END %] |
|
|
334 |
[% END %] |
| 329 |
[% END %] |
335 |
[% END %] |
| 330 |
[% END %] |
336 |
[% END %] |
| 331 |
<tr id="edit_row"> |
337 |
<tr id="edit_row"> |
| 332 |
<td>2</td> |
338 |
<td>2</td> |
|
|
339 |
<td> |
| 340 |
<select name="onsite_checkout" id="matrixonsite_checkout" style="width:13em;"> |
| 341 |
<option value="*">All</option> |
| 342 |
<option value="0">No</option> |
| 343 |
<option value="1">On-site</option> |
| 344 |
</select> |
| 345 |
</td> |
| 333 |
<td> |
346 |
<td> |
| 334 |
<select name="categorycode" id="categorycode"> |
347 |
<select name="categorycode" id="categorycode"> |
| 335 |
<option value="*">All</option> |
348 |
<option value="*">All</option> |
|
Lines 365-371
Link Here
|
| 365 |
</td> |
378 |
</td> |
| 366 |
<td><input type="text" name="note" id="note" size="15" value="" maxlength="100"></td> |
379 |
<td><input type="text" name="note" id="note" size="15" value="" maxlength="100"></td> |
| 367 |
<td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td> |
380 |
<td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td> |
| 368 |
<td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td> |
|
|
| 369 |
<td><input type="text" name="issuelength" id="issuelength" size="3" /> </td> |
381 |
<td><input type="text" name="issuelength" id="issuelength" size="3" /> </td> |
| 370 |
<td> |
382 |
<td> |
| 371 |
<select name="daysmode" id="daysmode"> |
383 |
<select name="daysmode" id="daysmode"> |
|
Lines 454-466
Link Here
|
| 454 |
<tfoot> |
466 |
<tfoot> |
| 455 |
<tr> |
467 |
<tr> |
| 456 |
<th> </th> |
468 |
<th> </th> |
|
|
469 |
<th>On-site checkout</th> |
| 457 |
<th>Patron category</th> |
470 |
<th>Patron category</th> |
| 458 |
<th> </th> |
471 |
<th> </th> |
| 459 |
<th>Item type</th> |
472 |
<th>Item type</th> |
| 460 |
<th> </th> |
473 |
<th> </th> |
| 461 |
<th>Note</th> |
474 |
<th>Note</th> |
| 462 |
<th>Current checkouts allowed</th> |
475 |
<th>Current checkouts allowed</th> |
| 463 |
<th>Current on-site checkouts allowed</th> |
|
|
| 464 |
<th>Loan period</th> |
476 |
<th>Loan period</th> |
| 465 |
<th>Days mode</th> |
477 |
<th>Days mode</th> |
| 466 |
<th>Unit</th> |
478 |
<th>Unit</th> |
|
Lines 514-533
Link Here
|
| 514 |
<tr> |
526 |
<tr> |
| 515 |
<td><em>Defaults</em></td> |
527 |
<td><em>Defaults</em></td> |
| 516 |
<td> |
528 |
<td> |
| 517 |
[% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty' ) %] |
529 |
[% SET patron_maxissueqty = CirculationRules.Search( current_branch, 0, undef, undef, 'patron_maxissueqty' ) %] |
| 518 |
<input type="text" name="patron_maxissueqty" size="3" value="[% patron_maxissueqty | html %]"/> |
530 |
<input type="text" name="patron_maxissueqty" size="3" value="[% patron_maxissueqty | html %]"/> |
| 519 |
</td> |
531 |
</td> |
| 520 |
<td> |
532 |
<td> |
| 521 |
[% SET patron_maxonsiteissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxonsiteissueqty' ) %] |
533 |
[% SET patron_maxissueqty = CirculationRules.Search( current_branch, 1, undef, undef, 'patron_maxissueqty' ) %] |
| 522 |
<input type="text" name="patron_maxonsiteissueqty" size="3" value="[% patron_maxonsiteissueqty | html %]"/> |
534 |
<input type="text" name="patron_maxonsiteissueqty" size="3" value="[% patron_maxissueqty | html %]"/> |
| 523 |
</td> |
535 |
</td> |
| 524 |
<td> |
536 |
<td> |
| 525 |
[% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds' ) %] |
537 |
[% SET rule_value = CirculationRules.Search( current_branch, undef, undef, undef, 'max_holds' ) %] |
| 526 |
<input name="max_holds" size="3" value="[% rule_value | html %]" /> |
538 |
<input name="max_holds" size="3" value="[% rule_value | html %]" /> |
| 527 |
</td> |
539 |
</td> |
| 528 |
<td> |
540 |
<td> |
| 529 |
<select name="holdallowed"> |
541 |
<select name="holdallowed"> |
| 530 |
[% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed' ) %] |
542 |
[% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, undef, 'holdallowed' ) %] |
| 531 |
<option value=""> |
543 |
<option value=""> |
| 532 |
Not set |
544 |
Not set |
| 533 |
</option> |
545 |
</option> |
|
Lines 567-573
Link Here
|
| 567 |
</td> |
579 |
</td> |
| 568 |
<td> |
580 |
<td> |
| 569 |
<select name="hold_fulfillment_policy"> |
581 |
<select name="hold_fulfillment_policy"> |
| 570 |
[% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy' ) %] |
582 |
[% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, undef, 'hold_fulfillment_policy' ) %] |
| 571 |
|
583 |
|
| 572 |
<option value=""> |
584 |
<option value=""> |
| 573 |
Not set |
585 |
Not set |
|
Lines 626-632
Link Here
|
| 626 |
</td> |
638 |
</td> |
| 627 |
<td> |
639 |
<td> |
| 628 |
<select name="returnbranch"> |
640 |
<select name="returnbranch"> |
| 629 |
[% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch' ) %] |
641 |
[% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, undef, 'returnbranch' ) %] |
| 630 |
|
642 |
|
| 631 |
<option value=""> |
643 |
<option value=""> |
| 632 |
Not set |
644 |
Not set |
|
Lines 685-693
Link Here
|
| 685 |
</tr> |
697 |
</tr> |
| 686 |
[% FOREACH c IN categorycodes %] |
698 |
[% FOREACH c IN categorycodes %] |
| 687 |
[% NEXT UNLESS c %] |
699 |
[% NEXT UNLESS c %] |
| 688 |
[% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxissueqty' ) %] |
700 |
[% SET patron_maxissueqty = CirculationRules.Search( branchcode, 0, c, undef, 'patron_maxissueqty' ) %] |
| 689 |
[% SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxonsiteissueqty' ) %] |
701 |
[% SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, 1, c, undef, 'patron_maxissueqty' ) %] |
| 690 |
[% SET max_holds = CirculationRules.Search( branchcode, c, undef, 'max_holds' ) %] |
702 |
[% SET max_holds = CirculationRules.Search( branchcode, undef, c, undef, 'max_holds' ) %] |
| 691 |
|
703 |
|
| 692 |
[% IF ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %] |
704 |
[% IF ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %] |
| 693 |
<tr> |
705 |
<tr> |
|
Lines 855-863
Link Here
|
| 855 |
<th> </th> |
867 |
<th> </th> |
| 856 |
</tr> |
868 |
</tr> |
| 857 |
[% FOREACH i IN itemtypeloop %] |
869 |
[% FOREACH i IN itemtypeloop %] |
| 858 |
[% SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, 'holdallowed' ) %] |
870 |
[% SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'holdallowed' ) %] |
| 859 |
[% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, 'hold_fulfillment_policy' ) %] |
871 |
[% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'hold_fulfillment_policy' ) %] |
| 860 |
[% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, 'returnbranch' ) %] |
872 |
[% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'returnbranch' ) %] |
| 861 |
|
873 |
|
| 862 |
[% IF holdallowed || hold_fulfillment_policy || returnbranch %] |
874 |
[% IF holdallowed || hold_fulfillment_policy || returnbranch %] |
| 863 |
<tr> |
875 |
<tr> |
|
Lines 972-981
Link Here
|
| 972 |
$(document).ready(function() { |
984 |
$(document).ready(function() { |
| 973 |
$("#default-circulation-rules").dataTable($.extend(true,{},dataTablesDefaults, { |
985 |
$("#default-circulation-rules").dataTable($.extend(true,{},dataTablesDefaults, { |
| 974 |
"aoColumnDefs": [ |
986 |
"aoColumnDefs": [ |
| 975 |
{ "bVisible": false, "aTargets": [ 0,2 ] }, |
987 |
{ "bVisible": false, "aTargets": [ 0,3 ] }, |
| 976 |
{ "bSortable": false, "aTargets": ["_all"] } |
988 |
{ "bSortable": false, "aTargets": ["_all"] } |
| 977 |
], |
989 |
], |
| 978 |
"aaSortingFixed": [ [0,'asc'], [1,'asc'], [2,'asc'], [3,'asc'] ], |
990 |
"aaSortingFixed": [ [0,'asc'], [1,'asc'], [2,'asc'], [3,'asc'], [4,'asc'] ], |
| 979 |
"bPaginate": false, |
991 |
"bPaginate": false, |
| 980 |
"bAutoWidth": false |
992 |
"bAutoWidth": false |
| 981 |
})); |
993 |
})); |
|
Lines 1040-1046
Link Here
|
| 1040 |
itm = $(this).text(); |
1052 |
itm = $(this).text(); |
| 1041 |
itm = itm.replace(/^\s*|\s*$/g,''); |
1053 |
itm = itm.replace(/^\s*|\s*$/g,''); |
| 1042 |
var current_column = $("#edit_row td:eq("+i+")"); |
1054 |
var current_column = $("#edit_row td:eq("+i+")"); |
| 1043 |
if ( i == 3 ) { |
1055 |
if ( i == 4 ) { |
| 1044 |
// specific processing for the Note column |
1056 |
// specific processing for the Note column |
| 1045 |
var note = $(this).find("a[name='viewnote']").data("content"); |
1057 |
var note = $(this).find("a[name='viewnote']").data("content"); |
| 1046 |
$(current_column).find("input[type='text']").val(note); |
1058 |
$(current_column).find("input[type='text']").val(note); |
|
Lines 1071-1090
Link Here
|
| 1071 |
$(this).attr('selected', 'selected'); |
1083 |
$(this).attr('selected', 'selected'); |
| 1072 |
} |
1084 |
} |
| 1073 |
}); |
1085 |
}); |
| 1074 |
if ( i == 0 || i == 1 ) { |
1086 |
if ( i == 0 || i == 1 || i == 2 ) { |
| 1075 |
// Disable the 2 first columns, we cannot update them. |
1087 |
// Disable the 2 first columns, we cannot update them. |
| 1076 |
var val = $(current_column).find("select option:selected").val(); |
1088 |
var val = $(current_column).find("select option:selected").val(); |
| 1077 |
var name = "categorycode"; |
1089 |
var name = "categorycode"; |
| 1078 |
if ( i == 1 ) { |
1090 |
if ( i == 1 ) { |
| 1079 |
name="itemtype"; |
1091 |
name="itemtype"; |
| 1080 |
} |
1092 |
} |
|
|
1093 |
if ( i == 2 ) { |
| 1094 |
name="onsite_checkout"; |
| 1095 |
} |
| 1081 |
// Remove potential previous input added |
1096 |
// Remove potential previous input added |
| 1082 |
$(current_column).find("input").remove(); |
1097 |
$(current_column).find("input").remove(); |
| 1083 |
$(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />"); |
1098 |
$(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />"); |
| 1084 |
} else if ( i == 5 || i == 6 || i == 25 || i == 26 || i == 27 ) { |
1099 |
} else if ( i == 6 || i == 25 || i == 26 || i == 27 ) { |
| 1085 |
// If the value is not an integer for |
1100 |
// If the value is not an integer for |
| 1086 |
// - "Current checkouts allowed" |
1101 |
// - "Current checkouts allowed" |
| 1087 |
// - "Current on-site checkouts allowed" |
|
|
| 1088 |
// - "Holds allowed (total)" |
1102 |
// - "Holds allowed (total)" |
| 1089 |
// - "Holds allowed (daily)" |
1103 |
// - "Holds allowed (daily)" |
| 1090 |
// - "Holds per record (count)" |
1104 |
// - "Holds per record (count)" |
|
Lines 1098-1103
Link Here
|
| 1098 |
}); |
1112 |
}); |
| 1099 |
$("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true); |
1113 |
$("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true); |
| 1100 |
$("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true); |
1114 |
$("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true); |
|
|
1115 |
$("#default-circulation-rules tr:last td:eq(2) select").prop('disabled', true); |
| 1101 |
return false; |
1116 |
return false; |
| 1102 |
}); |
1117 |
}); |
| 1103 |
$(".clear_edit").on("click",function(e){ |
1118 |
$(".clear_edit").on("click",function(e){ |
| 1104 |
- |
|
|