From e8c945b99dc5d8b3d4aa014b50e3474138af1be9 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 27 Feb 2017 16:53:52 -0500 Subject: [PATCH] LP#1642378 Webstaff Negative Balance org select repairs 1. Disable org units in the org unit selector that cannot have users. Additional code cleanup: 2. The org selector calls egStartup internally, so if the page controller has no need to wait on the startup to complete, then it does not need to manually invoke the startup. 3. No longer necessary to manually track the selected org unit from the org selector directive. Signed-off-by: Bill Erickson Signed-off-by: Terran McCanna Signed-off-by: Kathy Lussier --- .../staff/admin/local/circ/neg_balance_users.tt2 | 1 + .../default/staff/admin/local/circ/neg_balance_users.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates/staff/admin/local/circ/neg_balance_users.tt2 b/Open-ILS/src/templates/staff/admin/local/circ/neg_balance_users.tt2 index 73d7ec85da..9501f6a774 100644 --- a/Open-ILS/src/templates/staff/admin/local/circ/neg_balance_users.tt2 +++ b/Open-ILS/src/templates/staff/admin/local/circ/neg_balance_users.tt2 @@ -23,6 +23,7 @@
diff --git a/Open-ILS/web/js/ui/default/staff/admin/local/circ/neg_balance_users.js b/Open-ILS/web/js/ui/default/staff/admin/local/circ/neg_balance_users.js index 4169c9b396..1697aa7cfc 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/local/circ/neg_balance_users.js +++ b/Open-ILS/web/js/ui/default/staff/admin/local/circ/neg_balance_users.js @@ -6,8 +6,6 @@ angular.module('egAdminCirc', ['$scope','$q','$timeout','$location','$window','egCore','egGridDataProvider', function($scope , $q , $timeout , $location , $window , egCore , egGridDataProvider) { - egCore.startup.go(); // standalone mode requires manual startup - $scope.grid_provider = egGridDataProvider.instance({}); // API does not currenlty support paging, so it's all or none. @@ -30,10 +28,14 @@ function($scope , $q , $timeout , $location , $window , egCore , egGridDataProvi } $scope.org_changed = function(org) { - $scope.context_org = org; // hmm, why necessary. $scope.grid_provider.refresh(); } + $scope.disable_org = function(org_id) { + if (!org_id) return true; + return egCore.org.get(org_id).ou_type().can_have_users() != 't'; + } + // NOTE: Chrome only allows one tab/window to open per user // action. Only the first patron will be displayed. $scope.get_user = function(selected) { -- 2.43.2