From 2574a30c08db72b56440b2a787f5a488580e757b Mon Sep 17 00:00:00 2001 From: Josh Stompro Date: Mon, 30 Jan 2017 08:21:40 -0600 Subject: [PATCH] LP#1312837 - Item Status - Alternate View - Holds/Transit tab: Transit and Hold information does not refresh When switching between copies that have different transit and hold information, the data in the hold/transit tab doesn't get cleared when there isn't a new hold or transit to clear it. Test Plan: Acquire the barcodes for 3 copies, one that is available, on that is in transit and one that is captured for a hold. Before Change: 1. Open item status alternate view and switch to hold/copy tab. Note that the labels default to saying that the item is in transit and captured for a hold before any barcodes are scanned. 2. Enter the available item and note that the labels changed to not in transit , not captured. 3. Scan in the In Transit for Captured item and note that the labels don't change when they should. 4. Scan in the available item and note that the hold or transit data isn't cleared. After Change: 1. Enter the barcodes for the 3 copies with different statuses and note that the Holds/Transit information now updates correctly. Signed-off-by: Josh Stompro Signed-off-by: Kathy Lussier --- .../server/circ/alternate_copy_summary.js | 12 +++++++++++- .../staff_client/server/locale/en-US/circ.properties | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js index 17abb99d82..e8eb102589 100644 --- a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js +++ b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js @@ -346,6 +346,9 @@ function load_item() { transit_list.clear(); transit_list.append( { 'row' : { 'my' : { 'atc' : details.transit, } } }); + //Set transit caption back to default of "In Transit" + $('transit_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.transit_caption')); + var transit_copy_status = typeof details.transit.copy_status() == 'object' ? details.transit.copy_status() : data.hash.ccs[ details.transit.copy_status() ]; set("transit_copy_status", transit_copy_status.name() ); set_tooltip("transit_copy_status", document.getElementById('circStrings').getFormattedString( @@ -365,6 +368,7 @@ function load_item() { set("target_copy", details.transit.target_copy()); set("hold_transit_copy", details.transit.hold_transit_copy()); } else { + transit_list.clear(); $('transit_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.not_transit')); } @@ -650,7 +654,10 @@ function load_item() { hold_list.clear(); hold_list.append( { 'row' : { 'my' : { 'ahr' : better_fleshed_hold_blob.hold, 'acp' : details.copy, 'status' : status_robj, } } }); - + + //Set hold_caption back to default of "Captured for Hold" + $('hold_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.hold_caption')); + JSAN.use('patron.util'); var au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), details.hold.usr() ); $('hold_patron_name').setAttribute('value', $('circStrings').getFormattedString('staff.circ.copy_details.user_details', [au_obj.family_name(), au_obj.first_given_name(), au_obj.card().barcode()]) ); @@ -701,6 +708,9 @@ function load_item() { set("cancel_note", details.hold.cancel_note()); set("notes", details.hold.notes()); } else { + // Clear the hold list and remove patron name from hold screen + hold_list.clear(); + $('hold_patron_name').removeAttribute('value'); if (details.copy.status() == 8 /* ON HOLDS SHELF */) { $('hold_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.bad_hold_status')); } else { diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties b/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties index 0f1d0c965c..0ae743ed8b 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties @@ -86,11 +86,13 @@ staff.circ.copy_details.last_circ=Last Circulation staff.circ.copy_details.current_circ=Current Circulation staff.circ.copy_details.no_circ=This item has yet to circulate. staff.circ.copy_details.not_transit=This item is not in transit. +staff.circ.copy_details.transit_caption=In Transit staff.circ.copy_details.desk_renewal=Desk staff.circ.copy_details.opac_renewal=OPAC staff.circ.copy_details.phone_renewal=Phone # Displays user info: "Family name, First name : Barcode" staff.circ.copy_details.user_details=%1$s, %2$s : %3$s +staff.circ.copy_details.hold_caption=Captured for Hold staff.circ.copy_details.bad_hold_status=This item is not captured for a hold, however its status is incorrectly set to "On Holds Shelf". Please check this item in to correct the status. staff.circ.copy_details.no_hold=This item is not captured for a hold. staff.circ.copy_details.circ_count_by_year=%1$s : %2$s -- 2.43.2