Lines 715-720
$(document).ready(function () {
Link Here
|
715 |
}); |
715 |
}); |
716 |
|
716 |
|
717 |
var MSG_CANCEL_SELECTED = __("Cancel selected (%s)"); |
717 |
var MSG_CANCEL_SELECTED = __("Cancel selected (%s)"); |
|
|
718 |
var MSG_MOVE_SELECTED = __("Move selected (%s)"); |
718 |
var MSG_CANCEL_ALERT = __( |
719 |
var MSG_CANCEL_ALERT = __( |
719 |
"This action will cancel <span class='badge bg-danger'>%s</span> hold(s)." |
720 |
"This action will cancel <span class='badge bg-danger'>%s</span> hold(s)." |
720 |
); |
721 |
); |
Lines 780-785
$(document).ready(function () {
Link Here
|
780 |
$(".holds_table .select_hold:checked").length |
781 |
$(".holds_table .select_hold:checked").length |
781 |
) |
782 |
) |
782 |
); |
783 |
); |
|
|
784 |
$(".move_selected_holds").html( |
785 |
MSG_MOVE_SELECTED.format( |
786 |
$(".holds_table .select_hold:checked").length |
787 |
) |
788 |
); |
783 |
$(".suspend_selected_holds").html( |
789 |
$(".suspend_selected_holds").html( |
784 |
MSG_SUSPEND_SELECTED.format( |
790 |
MSG_SUSPEND_SELECTED.format( |
785 |
$(".holds_table .select_hold:checked").length |
791 |
$(".holds_table .select_hold:checked").length |
Lines 819-829
$(document).ready(function () {
Link Here
|
819 |
) |
825 |
) |
820 |
.join(",") + |
826 |
.join(",") + |
821 |
"]"; |
827 |
"]"; |
|
|
828 |
$(".move_selected_holds").prop("disabled", count); |
822 |
}); |
829 |
}); |
823 |
|
830 |
|
824 |
$(".holds_table").on("click", ".select_hold", function () { |
831 |
$(".holds_table").on("click", ".select_hold", function () { |
825 |
var table = $(this).parents(".holds_table"); |
832 |
var table = $(this).parents(".holds_table"); |
826 |
var count = $(".select_hold:not(:checked)", table).length; |
833 |
var count = $(".select_hold:not(:checked)", table).length; |
|
|
834 |
var checked_count = $(".select_hold:checked", table).length; |
827 |
$(".select_hold_all", table).prop("checked", !count); |
835 |
$(".select_hold_all", table).prop("checked", !count); |
828 |
updateSelectedHoldsButtonCounters(); |
836 |
updateSelectedHoldsButtonCounters(); |
829 |
$("#cancel_hold_alert").html( |
837 |
$("#cancel_hold_alert").html( |
Lines 845-850
$(document).ready(function () {
Link Here
|
845 |
) |
853 |
) |
846 |
.join(",") + |
854 |
.join(",") + |
847 |
"]"; |
855 |
"]"; |
|
|
856 |
$(".move_selected_holds").prop("disabled", !checked_count); |
848 |
}); |
857 |
}); |
849 |
|
858 |
|
850 |
$(".cancel_selected_holds").click(function (e) { |
859 |
$(".cancel_selected_holds").click(function (e) { |
Lines 897-902
$(document).ready(function () {
Link Here
|
897 |
return false; |
906 |
return false; |
898 |
}); |
907 |
}); |
899 |
|
908 |
|
|
|
909 |
$("#itemSearchForm").on("submit", function (event) { |
910 |
event.preventDefault(); |
911 |
$("#move_hold_item_confirm").prop("disabled", true); |
912 |
|
913 |
let externalID = $("#external_id").val(); |
914 |
let apiUrl = `/api/v1/items?external_id=${encodeURIComponent(externalID)}`; |
915 |
|
916 |
$.ajax({ |
917 |
url: apiUrl, |
918 |
method: "GET", |
919 |
dataType: "json", |
920 |
success: function (data) { |
921 |
// Filter for exact matches only |
922 |
let exactMatches = data.filter( |
923 |
item => item.external_id === externalID |
924 |
); |
925 |
if (exactMatches.length > 0) { |
926 |
let resultHtml = ""; |
927 |
$.each(exactMatches, function (index, item) { |
928 |
resultHtml += ` |
929 |
<div class="alert alert-success"> |
930 |
<strong>Biblionumber:</strong> ${item.biblio_id} <br> |
931 |
<strong>Item:</strong> ${item.external_id} <br> |
932 |
<input id="new_itemnumber_${item.item_id}" name="new_itemnumber" type="checkbox" value="${item.item_id}"> |
933 |
<label for="new_itemnumber_${item.item_id}">Move all selected item level holds to this item</label> |
934 |
<input id="new_biblionumber_${item.item_id}" name="new_biblionumber" type="hidden" value="${item.biblio_id}"> |
935 |
</div> |
936 |
<hr /> |
937 |
`; |
938 |
}); |
939 |
$("#itemResultMessage").html(resultHtml); |
940 |
} else { |
941 |
$("#itemResultMessage").html(` |
942 |
<div class="alert alert-warning">No item found with barcode: ${externalID}.</div> |
943 |
`); |
944 |
} |
945 |
}, |
946 |
}); |
947 |
}); |
948 |
|
949 |
$("#biblioSearchForm").on("submit", function (event) { |
950 |
event.preventDefault(); |
951 |
$("#move_hold_biblio_confirm").prop("disabled", true); |
952 |
|
953 |
let biblioID = parseInt($("#biblio_id").val()); |
954 |
let apiUrl = `/api/v1/biblios?q={"biblio_id":"${encodeURIComponent(biblioID)}"}`; |
955 |
$.ajax({ |
956 |
url: apiUrl, |
957 |
method: "GET", |
958 |
dataType: "json", |
959 |
headers: { |
960 |
Accept: "application/json", |
961 |
}, |
962 |
success: function (data) { |
963 |
// Filter for exact matches only |
964 |
let exactMatches = data.filter( |
965 |
item => item.biblio_id === biblioID |
966 |
); |
967 |
|
968 |
if (exactMatches.length > 0) { |
969 |
let resultHtml = ""; |
970 |
$.each(exactMatches, function (index, item) { |
971 |
resultHtml += ` |
972 |
<div class="alert alert-success"> |
973 |
<strong>Biblionumber:</strong> ${item.biblio_id} <br> |
974 |
<input id="new_biblionumber_${item.biblio_id}" name="new_biblionumber" type="checkbox" value="${item.biblio_id}"> |
975 |
<label for="new_biblionumber_${item.biblio_id}">Move all selected record level holds to this record</label> |
976 |
</div> |
977 |
<hr /> |
978 |
`; |
979 |
}); |
980 |
$("#biblioResultMessage").html(resultHtml); |
981 |
} else { |
982 |
$("#biblioResultMessage").html(` |
983 |
<div class="alert alert-warning">No record found with biblionumber: ${biblioID}.</div> |
984 |
`); |
985 |
} |
986 |
}, |
987 |
}); |
988 |
}); |
989 |
|
990 |
$(document).on("change", 'input[name="new_itemnumber"]', function () { |
991 |
$('input[name="new_itemnumber"]').not(this).prop("checked", false); |
992 |
if ($('input[name="new_itemnumber"]:checked').length) { |
993 |
$("#move_hold_item_confirm").prop("disabled", false); |
994 |
} else { |
995 |
$("#move_hold_item_confirm").prop("disabled", true); |
996 |
} |
997 |
}); |
998 |
|
999 |
$(document).on("change", 'input[name="new_biblionumber"]', function () { |
1000 |
$('input[name="new_biblionumber"]').not(this).prop("checked", false); |
1001 |
if ($('input[name="new_biblionumber"]:checked').length) { |
1002 |
$("#move_hold_biblio_confirm").prop("disabled", false); |
1003 |
} else { |
1004 |
$("#move_hold_biblio_confirm").prop("disabled", true); |
1005 |
} |
1006 |
}); |
1007 |
|
900 |
function _append_patron_page_cancel_hold_modal_data(hold) { |
1008 |
function _append_patron_page_cancel_hold_modal_data(hold) { |
901 |
$("#cancel_modal_form #inputs").append( |
1009 |
$("#cancel_modal_form #inputs").append( |
902 |
'<input type="hidden" name="rank-request" value="del">' |
1010 |
'<input type="hidden" name="rank-request" value="del">' |
903 |
- |
|
|