From 4f49fd2e1c67de49e1c54564d720864707087356 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 --- .../src/templates/staff/admin/local/circ/neg_balance_users.tt2 | 1 + .../web/js/ui/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 43fa8780b8..0428d09c85 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. @@ -26,10 +24,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.11.0