From 93df451c82c12029f8205b4d6b01ee874947eb75 Mon Sep 17 00:00:00 2001 From: Emily Lamancusa Date: Wed, 27 Sep 2023 12:35:58 -0400 Subject: [PATCH] Bug 34901: Display transit status on patron holds tab only if hold found value is "T" Check the transit status of the *hold* in addition to the transit status of the *item*, to avoid displaying a misleading transit status on item-level holds when the item is actually in transit for a different hold To test: 1. Create a record-level hold for Patron A for pickup at a library other than the logged-in library 2. Check in an item to fill that hold 3. Put an item-level hold on that same item for Patron B at a different library other than the logged-in library 4. Open Patron A's and Patron B's account details pages in separate tabs --> Note that the Holds tab on Patron A's account detail page correctly shows that their hold is in-transit --> Note that the Holds tab on Patron B's account detail page incorrectly shows that their hold on the same item is also in-transit 4. Apply patch 5. Clear browser cache 6. Refresh both patrons' account details pages --> Confirm that the holds tab on Patron A's account still correctly says their hold is in-transit --> Confirm that the holds tab on Patron B's account now correctly shows a blank status for their hold 7. Cancel Patron A's hold 8. Check in the item again to put it in transit for Patron B's hold 9. Reload Patron B's account page --> Confirm that the holds tab on Patron B's account now correctly says their hold is in-transit Signed-off-by: Katariina Hanhisalo Signed-off-by: Tuomas Kunttu Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit fa1485639b6727061572c310731f9b5a3f79adcd) Signed-off-by: Fridolin Somers (cherry picked from commit 9411b66eaa35b415c670216ab8e695baa21f9e08) Signed-off-by: Matt Blenkinsop --- koha-tmpl/intranet-tmpl/prog/js/holds.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js index 0b223bf302..533847fa8d 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -300,9 +300,9 @@ $(document).ready(function() { } - } else if ( oObj.transferred ) { + } else if ( oObj.found == "T" && oObj.transferred ) { data += __("Item is in transit from %s since %s").format(oObj.from_branch, oObj.date_sent); - } else if ( oObj.not_transferred ) { + } else if ( oObj.found == "T" && oObj.not_transferred ) { data += __("Item hasn't been transferred yet from %s").format(oObj.not_transferred_by); } data += ""; -- 2.39.2