Lines 455-461
Link Here
|
455 |
[% UNLESS ( multi_hold ) %] |
455 |
[% UNLESS ( multi_hold ) %] |
456 |
<li> |
456 |
<li> |
457 |
<label for="requestany">Hold next available item </label> |
457 |
<label for="requestany">Hold next available item </label> |
458 |
[% IF force_hold_level == 'item' %] |
458 |
[% IF force_hold_level == 'item' || force_hold_level == 'volume' %] |
459 |
<input type="checkbox" id="requestany" name="request" disabled="true" /> |
459 |
<input type="checkbox" id="requestany" name="request" disabled="true" /> |
460 |
[% ELSIF force_hold_level == 'record' %] |
460 |
[% ELSIF force_hold_level == 'record' %] |
461 |
<input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/> |
461 |
<input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/> |
Lines 475-480
Link Here
|
475 |
[% ELSE %] |
475 |
[% ELSE %] |
476 |
<input type="hidden" name="holds_to_place_count" value="1" /> |
476 |
<input type="hidden" name="holds_to_place_count" value="1" /> |
477 |
[% END %] |
477 |
[% END %] |
|
|
478 |
|
479 |
<!-- Volume level holds --> |
480 |
[% FOREACH bibitemloo IN bibitemloop %] |
481 |
[% IF Koha.Preference('EnableVolumeHolds') && bibitemloo.volumes.count %] |
482 |
<label> |
483 |
Hold next available item from a volume |
484 |
[% IF bibitemloo.force_hold_level == 'volume' %] |
485 |
<span class="error"><i>(Required)</i></span> |
486 |
[% END %] |
487 |
</label> |
488 |
|
489 |
[% IF bibitemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %] |
490 |
<span class="error"> |
491 |
<i class="fa fa-times fa-lg" title="Cannot be put on hold"></i> |
492 |
Hold must be record level |
493 |
</span> |
494 |
[% ELSIF bibitemloo.force_hold_level == 'item' # Patron has placed an item level hold previously for this record %] |
495 |
<span class="error"> |
496 |
<i class="fa fa-times fa-lg" title="Cannot be put on hold"></i> |
497 |
Hold must be item level |
498 |
</span> |
499 |
[% ELSE %] |
500 |
[% FOREACH v IN bibitemloo.volumes %] |
501 |
[% IF v.items %] |
502 |
<li> |
503 |
<label for="volume_id">[% v.description | html %]</label> |
504 |
<input type="radio" name="volume_id" value="[% v.id | html %]" /> |
505 |
</li> |
506 |
[% END %] |
507 |
[% END %] |
508 |
[% END %] |
509 |
[% END %] |
510 |
[% END %] |
511 |
<!-- /Volume level holds --> |
512 |
|
478 |
[% END # /UNLESS multi_hold %] |
513 |
[% END # /UNLESS multi_hold %] |
479 |
|
514 |
|
480 |
<li id="non_priority_list_item"> |
515 |
<li id="non_priority_list_item"> |
Lines 529-534
Link Here
|
529 |
<th>Item type</th> |
564 |
<th>Item type</th> |
530 |
[% END %] |
565 |
[% END %] |
531 |
<th>Barcode</th> |
566 |
<th>Barcode</th> |
|
|
567 |
[% IF Koha.Preference('EnableVolumeHolds') && bibitemloo.volumes.count %] |
568 |
<th>Volume</th> |
569 |
[% END %] |
532 |
<th>Home library</th> |
570 |
<th>Home library</th> |
533 |
<th>Last location</th> |
571 |
<th>Last location</th> |
534 |
[% IF itemdata_ccode %] |
572 |
[% IF itemdata_ccode %] |
Lines 554-559
Link Here
|
554 |
<i class="fa fa-times fa-lg" title="Cannot be put on hold"></i> |
592 |
<i class="fa fa-times fa-lg" title="Cannot be put on hold"></i> |
555 |
Hold must be record level |
593 |
Hold must be record level |
556 |
</span> |
594 |
</span> |
|
|
595 |
[% ELSIF itemloo.force_hold_level == 'volume' # Patron has placed a volume level hold previously for this record %] |
596 |
<span class="error"> |
597 |
<i class="fa fa-times fa-lg" title="Cannot be put on hold"></i> |
598 |
Hold must be volume level |
599 |
</span> |
557 |
[% ELSIF ( itemloo.available ) %] |
600 |
[% ELSIF ( itemloo.available ) %] |
558 |
<input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" /> |
601 |
<input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" /> |
559 |
[% ELSIF ( itemloo.override ) %] |
602 |
[% ELSIF ( itemloo.override ) %] |
Lines 601-606
Link Here
|
601 |
<td> |
644 |
<td> |
602 |
[% itemloo.barcode | html %] |
645 |
[% itemloo.barcode | html %] |
603 |
</td> |
646 |
</td> |
|
|
647 |
[% IF Koha.Preference('EnableVolumeHolds') && bibitemloo.volumes.count %] |
648 |
<td> |
649 |
[% itemloo.object.volume.description | html %] |
650 |
</td> |
651 |
[% END %] |
604 |
<td> |
652 |
<td> |
605 |
[% Branches.GetName( itemloo.homebranch ) | html %] |
653 |
[% Branches.GetName( itemloo.homebranch ) | html %] |
606 |
</td> |
654 |
</td> |
Lines 1089-1094
Link Here
|
1089 |
}; |
1137 |
}; |
1090 |
if($('input[name="checkitem"]:checked').length) |
1138 |
if($('input[name="checkitem"]:checked').length) |
1091 |
data.item_id = $('input[name="checkitem"]:checked').val(); |
1139 |
data.item_id = $('input[name="checkitem"]:checked').val(); |
|
|
1140 |
if($('input[name="volume_id"]:checked').length) |
1141 |
data.volume_id = $('input[name="volume_id"]:checked').val(); |
1092 |
if($('input[name="borrowernumber"]').length) |
1142 |
if($('input[name="borrowernumber"]').length) |
1093 |
data.patron_id = $('input[name="borrowernumber"]').val(); |
1143 |
data.patron_id = $('input[name="borrowernumber"]').val(); |
1094 |
if($('textarea[name="notes"]').length) |
1144 |
if($('textarea[name="notes"]').length) |
Lines 1111-1122
Link Here
|
1111 |
const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1; |
1161 |
const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1; |
1112 |
biblionumbers.forEach(function(biblionumber) { |
1162 |
biblionumbers.forEach(function(biblionumber) { |
1113 |
data.biblio_id = biblionumber; |
1163 |
data.biblio_id = biblionumber; |
|
|
1164 |
console.log(data); |
1114 |
let options = { |
1165 |
let options = { |
1115 |
url: $t.attr('action'), |
1166 |
url: $t.attr('action'), |
1116 |
method: $t.attr('method').toUpperCase(), |
1167 |
method: $t.attr('method').toUpperCase(), |
1117 |
contentType: 'application/json', |
1168 |
contentType: 'application/json', |
1118 |
data: JSON.stringify(data) |
1169 |
data: JSON.stringify(data) |
1119 |
}; |
1170 |
}; |
|
|
1171 |
console.log(options); |
1120 |
for(let i = 0; i < count; i++) { |
1172 |
for(let i = 0; i < count; i++) { |
1121 |
$.ajax(options) |
1173 |
$.ajax(options) |
1122 |
.then(function(result) { |
1174 |
.then(function(result) { |
Lines 1141-1148
Link Here
|
1141 |
}); |
1193 |
}); |
1142 |
|
1194 |
|
1143 |
[% UNLESS ( multi_hold ) %] |
1195 |
[% UNLESS ( multi_hold ) %] |
1144 |
$("#hold-request-form").on("submit", function(){ |
1196 |
$("#hold-request-form [type='submit']").on("click", function(e){ |
1145 |
return check(); |
1197 |
return check(e); |
1146 |
}); |
1198 |
}); |
1147 |
[% ELSE %] |
1199 |
[% ELSE %] |
1148 |
$("#hold-request-form").on("submit", function(){ |
1200 |
$("#hold-request-form").on("submit", function(){ |
Lines 1152-1158
Link Here
|
1152 |
|
1204 |
|
1153 |
}); |
1205 |
}); |
1154 |
|
1206 |
|
1155 |
function check() { |
1207 |
function check(e) { |
1156 |
var msg = ""; |
1208 |
var msg = ""; |
1157 |
var count_reserv = 0; |
1209 |
var count_reserv = 0; |
1158 |
|
1210 |
|
Lines 1171-1176
Link Here
|
1171 |
} |
1223 |
} |
1172 |
} |
1224 |
} |
1173 |
|
1225 |
|
|
|
1226 |
count_reserv += $("input[name='volume_id']:checked").length; |
1227 |
|
1174 |
if (document.form.requestany.checked == true){ |
1228 |
if (document.form.requestany.checked == true){ |
1175 |
count_reserv++ ; |
1229 |
count_reserv++ ; |
1176 |
} |
1230 |
} |
Lines 1183-1188
Link Here
|
1183 |
$('#hold-request-form').preventDoubleFormSubmit(); |
1237 |
$('#hold-request-form').preventDoubleFormSubmit(); |
1184 |
return(true); |
1238 |
return(true); |
1185 |
} else { |
1239 |
} else { |
|
|
1240 |
e.preventDefault(); |
1186 |
alert(msg); |
1241 |
alert(msg); |
1187 |
return(false); |
1242 |
return(false); |
1188 |
} |
1243 |
} |
Lines 1235-1248
Link Here
|
1235 |
}); |
1290 |
}); |
1236 |
$("#requestany").click(function() { |
1291 |
$("#requestany").click(function() { |
1237 |
if(this.checked){ |
1292 |
if(this.checked){ |
1238 |
$("input[name=checkitem]").each(function() { |
1293 |
$("input[name=checkitem], input[name='volume_id']").each(function() { |
1239 |
$(this).prop("checked", false); |
1294 |
$(this).prop("checked", false); |
1240 |
}); |
1295 |
}); |
1241 |
} |
1296 |
} |
1242 |
}); |
1297 |
}); |
1243 |
$("input[name=checkitem]").click(function() { |
1298 |
$("input[name=checkitem], input[name='volume_id']").click(function() { |
1244 |
onechecked = 0; |
1299 |
onechecked = 0; |
1245 |
$("input[name=checkitem]").each(function() { |
1300 |
$("input[name=checkitem], input[name='volume_id']").each(function() { |
1246 |
if(this.checked){ |
1301 |
if(this.checked){ |
1247 |
onechecked = 1; |
1302 |
onechecked = 1; |
1248 |
} |
1303 |
} |
Lines 1342-1352
Link Here
|
1342 |
}; |
1397 |
}; |
1343 |
[% END %] |
1398 |
[% END %] |
1344 |
[% END %] |
1399 |
[% END %] |
|
|
1400 |
|
1345 |
Sticky = $("#toolbar"); |
1401 |
Sticky = $("#toolbar"); |
1346 |
Sticky.hcSticky({ |
1402 |
Sticky.hcSticky({ |
1347 |
stickTo: "#existing_holds", |
1403 |
stickTo: "#existing_holds", |
1348 |
stickyClass: "floating" |
1404 |
stickyClass: "floating" |
1349 |
}); |
1405 |
}); |
|
|
1406 |
|
1407 |
[% IF Koha.Preference('EnableVolumeHolds') %] |
1408 |
$(':radio[name="volume_id"]').change(function(){ |
1409 |
$(':radio[name="checkitem"]').attr('checked', false); |
1410 |
}); |
1411 |
$(':radio[name="checkitem"]').change(function(){ |
1412 |
$(':radio[name="volume_id"]').attr('checked', false); |
1413 |
}); |
1414 |
[% END %] |
1415 |
|
1350 |
}); |
1416 |
}); |
1351 |
</script> |
1417 |
</script> |
1352 |
[% END %] |
1418 |
[% END %] |