From b4d60f062dcac4514444c0e73eadeea6d74db614 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 22 Jun 2018 14:59:11 -0400 Subject: [PATCH] 5-pick-up-library-not-defaulting-to-patrons-home-library when creating new requests, given a user, default to the user's pickup library preference setting, or absent a preference, default to their home library. Absent a user, default to the pickup library selector value from the request list, if it's of an org type that can have volumes. Otherwise, default to the workstation library. Technically, the without-a-user behavior is going to be mooted whenever a user is chosen. Signed-off-by: Jason Etheridge --- Open-ILS/web/js/ui/default/staff/acq/services/requests.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/staff/acq/services/requests.js b/Open-ILS/web/js/ui/default/staff/acq/services/requests.js index 453a8f5a95..d5bbc6094e 100644 --- a/Open-ILS/web/js/ui/default/staff/acq/services/requests.js +++ b/Open-ILS/web/js/ui/default/staff/acq/services/requests.js @@ -206,7 +206,10 @@ function($uibModal , $q , egCore , egOrg , ngToast) { $m_scope.request.pickup_lib = egCore.idl.fromHash('aou',request.pickup_lib); } else { - $m_scope.request.pickup_lib = context_ou; + $m_scope.request.pickup_lib = + egOrg.CanHaveVolumes(context_ou) + ? context_ou + : egOrg.get( egCore.auth.user().ws_ou() ); } if (request.cancel_reason) { $m_scope.request.cancel_reason = @@ -278,6 +281,7 @@ function($uibModal , $q , egCore , egOrg , ngToast) { var usr = egCore.idl.toHash(users[0]); $m_scope.extra.user_obj = usr; $m_scope.request.usr = usr.id; + $m_scope.request.pickup_lib = egOrg.get(usr.home_ou.id); angular.forEach(usr.settings, function(s) { if (s.name == 'opac.hold_notify') { if (s.value.match('phone')) { @@ -334,6 +338,7 @@ function($uibModal , $q , egCore , egOrg , ngToast) { ).then(function(users) { var usr = egCore.idl.toHash(users[0]); aur_obj.usr = usr.id; + aur_obj.pickup_lib = egOrg.get(usr.home_ou.id); angular.forEach(usr.settings, function(s) { if (s.name == 'opac.hold_notify') { if (s.value.match('email')) { -- 2.11.0