LP#1728147: correct fleshing of staff hold column
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 22 Mar 2018 16:14:17 +0000 (12:14 -0400)
committerKathy Lussier <klussier@masslnc.org>
Thu, 22 Mar 2018 18:07:19 +0000 (14:07 -0400)
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>
Open-ILS/web/js/ui/default/staff/circ/holds/app.js

index 33fc77a..8028da5 100644 (file)
@@ -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();
-
         });
     }