From: Galen Charlton <gmc@equinoxinitiative.org>
Date: Thu, 22 Mar 2018 16:14:17 +0000 (-0400)
Subject: LP#1728147: correct fleshing of staff hold column
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6e7ec4bef9fcdbece1c2ff4758af87765d2ee396;p=contrib%2FConifer.git

LP#1728147: correct fleshing of staff hold column

This patch fixes the test (ahr.usr is fleshed, but not ahr.requestor)
and ensures that the value is cached correctly.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
---

diff --git a/Open-ILS/web/js/ui/default/staff/circ/holds/app.js b/Open-ILS/web/js/ui/default/staff/circ/holds/app.js
index 33fc77aa7c..8028da5b71 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/holds/app.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/holds/app.js
@@ -307,6 +307,11 @@ function($scope , $q , $routeParams , $window , $location , egCore ,
 
         ).then(null, null, function(hold_info) {
             egProgressDialog.increment();
+
+            // check if this is a staff-created hold
+            // i.e., requestor is not the same as the user
+            hold_info['_is_staff_hold'] = hold_info.hold.requestor() != hold_info.hold.usr().id();
+
             var hold_id = hold_info.hold.id();
             cached_details[hold_id] = hold_info;
             var item = details_needed[hold_id];
@@ -316,11 +321,6 @@ function($scope , $q , $routeParams , $window , $location , egCore ,
             angular.forEach(hold_info, 
                 function(val, key) { item[key] = val });
 
-            // check if this is a staff-created hold
-            // i.e requestor's profile != 2 (patron)
-
-            item['_is_staff_hold'] = item.hold.requestor().id() != item.hold.usr().id();
-
         });
     }