KMAIN-1921 Item Status Reset
authorkhuckins <khuckins@catalystdevworks.com>
Wed, 18 Nov 2015 19:06:32 +0000 (14:06 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Move Clearing function call to a check for the
listbox, so box clears regardless of if holds
and transit status aren't valid.

Add caption change so captions are valid when going
from a non-captured/non-transit item to a captured/
in-transit item.

Signed-off-by: khuckins <khuckins@catalystdevworks.com>
modified:   Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js
modified:   Open-ILS/xul/staff_client/server/locale/en-US/circ.properties

Patch modified by Bill to reset hold patron name display and to
remove changes unrelated to this patch.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties

index e8eb102..ef06cfa 100644 (file)
@@ -341,9 +341,11 @@ function load_item() {
         set("target_copy", '');
         set("hold_transit_copy", '');
 
+        // KMAIN-1921 Clear the list even if item isn't applicable - avoid ghost data
+        transit_list.clear();
+
         if (details.transit) {
 
-            transit_list.clear();
             transit_list.append( { 'row' : { 'my' : { 'atc' : details.transit, } } });
 
             //Set transit caption back to default of "In Transit"
@@ -367,6 +369,8 @@ function load_item() {
             set("source_send_time", util.date.formatted_date( details.transit.source_send_time(), '%{localized}' )); 
             set("target_copy", details.transit.target_copy()); 
             set("hold_transit_copy", details.transit.hold_transit_copy()); 
+            $('transit_caption').setAttribute('label', // KMAIN-1921
+                $('circStrings').getString('staff.circ.in_transit_caption'));
         } else {
             transit_list.clear();
             $('transit_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.not_transit'));
@@ -633,7 +637,6 @@ function load_item() {
         set_tooltip("selection_ou", '');
         set("target", '');
         set("hold_usr", '');
-        set("hold_patron_name", '');
         set("cancel_time", '');
         set("notify_time", '');
         set("notify_count", '');
@@ -647,12 +650,16 @@ function load_item() {
         set("cancel_note", '');
         set("notes", '');
 
+
+        // KMAIN-1921 Clear the list even if the item isn't applicable - avoid ghost data
+        $('hold_patron_name').setAttribute('value', '');
+        hold_list.clear();
+
         if (details.hold) {
             var better_fleshed_hold_blob = network.simple_request('FM_AHR_BLOB_RETRIEVE.authoritative',[ ses(), details.hold.id() ]);
             var status_robj = better_fleshed_hold_blob.status;
             JSAN.use('circ.util');
 
-            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"
@@ -707,6 +714,8 @@ function load_item() {
             set("cancel_cause", details.hold.cancel_cause()); 
             set("cancel_note", details.hold.cancel_note()); 
             set("notes", details.hold.notes()); 
+            $('hold_caption').setAttribute('label', // KMAIN-1921
+                $('circStrings').getString('staff.circ.captured_hold_caption'));
         } else {
             // Clear the hold list and remove patron name from hold screen
             hold_list.clear();
index 338dc6b..a975602 100644 (file)
@@ -83,6 +83,8 @@ staff.circ.copy_details.hold=Hold ID = %1$s
 staff.circ.copy_details.transit=Transit ID = %1$s
 staff.circ.copy_details.circ=Circulation ID = %1$s
 staff.circ.copy_details.last_circ=Last Circulation
+staff.circ.in_transit_caption=In Transit
+staff.circ.captured_hold_caption=Captured for Hold
 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.