|
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 |
</ol> |
514 |
</ol> |
| 480 |
|
515 |
|
|
Lines 523-528
Link Here
|
| 523 |
<th>Item type</th> |
558 |
<th>Item type</th> |
| 524 |
[% END %] |
559 |
[% END %] |
| 525 |
<th>Barcode</th> |
560 |
<th>Barcode</th> |
|
|
561 |
[% IF Koha.Preference('EnableVolumeHolds') && bibitemloo.volumes.count %] |
| 562 |
<th>Volume</th> |
| 563 |
[% END %] |
| 526 |
<th>Home library</th> |
564 |
<th>Home library</th> |
| 527 |
<th>Last location</th> |
565 |
<th>Last location</th> |
| 528 |
[% IF itemdata_ccode %] |
566 |
[% IF itemdata_ccode %] |
|
Lines 548-553
Link Here
|
| 548 |
<i class="fa fa-times fa-lg" title="Cannot be put on hold"></i> |
586 |
<i class="fa fa-times fa-lg" title="Cannot be put on hold"></i> |
| 549 |
Hold must be record level |
587 |
Hold must be record level |
| 550 |
</span> |
588 |
</span> |
|
|
589 |
[% ELSIF itemloo.force_hold_level == 'volume' # Patron has placed a volume level hold previously for this record %] |
| 590 |
<span class="error"> |
| 591 |
<i class="fa fa-times fa-lg" title="Cannot be put on hold"></i> |
| 592 |
Hold must be volume level |
| 593 |
</span> |
| 551 |
[% ELSIF ( itemloo.available ) %] |
594 |
[% ELSIF ( itemloo.available ) %] |
| 552 |
<input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" /> |
595 |
<input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" /> |
| 553 |
[% ELSIF ( itemloo.override ) %] |
596 |
[% ELSIF ( itemloo.override ) %] |
|
Lines 595-600
Link Here
|
| 595 |
<td> |
638 |
<td> |
| 596 |
[% itemloo.barcode | html %] |
639 |
[% itemloo.barcode | html %] |
| 597 |
</td> |
640 |
</td> |
|
|
641 |
[% IF Koha.Preference('EnableVolumeHolds') && bibitemloo.volumes.count %] |
| 642 |
<td> |
| 643 |
[% itemloo.object.volume.description | html %] |
| 644 |
</td> |
| 645 |
[% END %] |
| 598 |
<td> |
646 |
<td> |
| 599 |
[% Branches.GetName( itemloo.homebranch ) | html %] |
647 |
[% Branches.GetName( itemloo.homebranch ) | html %] |
| 600 |
</td> |
648 |
</td> |
|
Lines 1082-1087
Link Here
|
| 1082 |
}; |
1130 |
}; |
| 1083 |
if($('input[name="checkitem"]:checked').length) |
1131 |
if($('input[name="checkitem"]:checked').length) |
| 1084 |
data.item_id = $('input[name="checkitem"]:checked').val(); |
1132 |
data.item_id = $('input[name="checkitem"]:checked').val(); |
|
|
1133 |
if($('input[name="volume_id"]:checked').length) |
| 1134 |
data.volume_id = $('input[name="volume_id"]:checked').val(); |
| 1085 |
if($('input[name="borrowernumber"]').length) |
1135 |
if($('input[name="borrowernumber"]').length) |
| 1086 |
data.patron_id = $('input[name="borrowernumber"]').val(); |
1136 |
data.patron_id = $('input[name="borrowernumber"]').val(); |
| 1087 |
if($('textarea[name="notes"]').length) |
1137 |
if($('textarea[name="notes"]').length) |
|
Lines 1104-1115
Link Here
|
| 1104 |
const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1; |
1154 |
const count = $('input[name="holds_to_place_count"]').length?$('input[name="holds_to_place_count"]').val():1; |
| 1105 |
biblionumbers.forEach(function(biblionumber) { |
1155 |
biblionumbers.forEach(function(biblionumber) { |
| 1106 |
data.biblio_id = biblionumber; |
1156 |
data.biblio_id = biblionumber; |
|
|
1157 |
console.log(data); |
| 1107 |
let options = { |
1158 |
let options = { |
| 1108 |
url: $t.attr('action'), |
1159 |
url: $t.attr('action'), |
| 1109 |
method: $t.attr('method').toUpperCase(), |
1160 |
method: $t.attr('method').toUpperCase(), |
| 1110 |
contentType: 'application/json', |
1161 |
contentType: 'application/json', |
| 1111 |
data: JSON.stringify(data) |
1162 |
data: JSON.stringify(data) |
| 1112 |
}; |
1163 |
}; |
|
|
1164 |
console.log(options); |
| 1113 |
for(let i = 0; i < count; i++) { |
1165 |
for(let i = 0; i < count; i++) { |
| 1114 |
$.ajax(options) |
1166 |
$.ajax(options) |
| 1115 |
.then(function(result) { |
1167 |
.then(function(result) { |
|
Lines 1134-1141
Link Here
|
| 1134 |
}); |
1186 |
}); |
| 1135 |
|
1187 |
|
| 1136 |
[% UNLESS ( multi_hold ) %] |
1188 |
[% UNLESS ( multi_hold ) %] |
| 1137 |
$("#hold-request-form").on("submit", function(){ |
1189 |
$("#hold-request-form [type='submit']").on("click", function(e){ |
| 1138 |
return check(); |
1190 |
return check(e); |
| 1139 |
}); |
1191 |
}); |
| 1140 |
[% ELSE %] |
1192 |
[% ELSE %] |
| 1141 |
$("#hold-request-form").on("submit", function(){ |
1193 |
$("#hold-request-form").on("submit", function(){ |
|
Lines 1145-1151
Link Here
|
| 1145 |
|
1197 |
|
| 1146 |
}); |
1198 |
}); |
| 1147 |
|
1199 |
|
| 1148 |
function check() { |
1200 |
function check(e) { |
| 1149 |
var msg = ""; |
1201 |
var msg = ""; |
| 1150 |
var count_reserv = 0; |
1202 |
var count_reserv = 0; |
| 1151 |
|
1203 |
|
|
Lines 1164-1169
Link Here
|
| 1164 |
} |
1216 |
} |
| 1165 |
} |
1217 |
} |
| 1166 |
|
1218 |
|
|
|
1219 |
count_reserv += $("input[name='volume_id']:checked").length; |
| 1220 |
|
| 1167 |
if (document.form.requestany.checked == true){ |
1221 |
if (document.form.requestany.checked == true){ |
| 1168 |
count_reserv++ ; |
1222 |
count_reserv++ ; |
| 1169 |
} |
1223 |
} |
|
Lines 1176-1181
Link Here
|
| 1176 |
$('#hold-request-form').preventDoubleFormSubmit(); |
1230 |
$('#hold-request-form').preventDoubleFormSubmit(); |
| 1177 |
return(true); |
1231 |
return(true); |
| 1178 |
} else { |
1232 |
} else { |
|
|
1233 |
e.preventDefault(); |
| 1179 |
alert(msg); |
1234 |
alert(msg); |
| 1180 |
return(false); |
1235 |
return(false); |
| 1181 |
} |
1236 |
} |
|
Lines 1228-1241
Link Here
|
| 1228 |
}); |
1283 |
}); |
| 1229 |
$("#requestany").click(function() { |
1284 |
$("#requestany").click(function() { |
| 1230 |
if(this.checked){ |
1285 |
if(this.checked){ |
| 1231 |
$("input[name=checkitem]").each(function() { |
1286 |
$("input[name=checkitem], input[name='volume_id']").each(function() { |
| 1232 |
$(this).prop("checked", false); |
1287 |
$(this).prop("checked", false); |
| 1233 |
}); |
1288 |
}); |
| 1234 |
} |
1289 |
} |
| 1235 |
}); |
1290 |
}); |
| 1236 |
$("input[name=checkitem]").click(function() { |
1291 |
$("input[name=checkitem], input[name='volume_id']").click(function() { |
| 1237 |
onechecked = 0; |
1292 |
onechecked = 0; |
| 1238 |
$("input[name=checkitem]").each(function() { |
1293 |
$("input[name=checkitem], input[name='volume_id']").each(function() { |
| 1239 |
if(this.checked){ |
1294 |
if(this.checked){ |
| 1240 |
onechecked = 1; |
1295 |
onechecked = 1; |
| 1241 |
} |
1296 |
} |
|
Lines 1322-1332
Link Here
|
| 1322 |
}; |
1377 |
}; |
| 1323 |
[% END %] |
1378 |
[% END %] |
| 1324 |
[% END %] |
1379 |
[% END %] |
|
|
1380 |
|
| 1325 |
Sticky = $("#toolbar"); |
1381 |
Sticky = $("#toolbar"); |
| 1326 |
Sticky.hcSticky({ |
1382 |
Sticky.hcSticky({ |
| 1327 |
stickTo: "#existing_holds", |
1383 |
stickTo: "#existing_holds", |
| 1328 |
stickyClass: "floating" |
1384 |
stickyClass: "floating" |
| 1329 |
}); |
1385 |
}); |
|
|
1386 |
|
| 1387 |
[% IF Koha.Preference('EnableVolumeHolds') %] |
| 1388 |
$(':radio[name="volume_id"]').change(function(){ |
| 1389 |
$(':radio[name="checkitem"]').attr('checked', false); |
| 1390 |
}); |
| 1391 |
$(':radio[name="checkitem"]').change(function(){ |
| 1392 |
$(':radio[name="volume_id"]').attr('checked', false); |
| 1393 |
}); |
| 1394 |
[% END %] |
| 1395 |
|
| 1330 |
}); |
1396 |
}); |
| 1331 |
</script> |
1397 |
</script> |
| 1332 |
[% END %] |
1398 |
[% END %] |