From: Bill Erickson Date: Mon, 27 Feb 2017 21:53:52 +0000 (-0500) Subject: LP#1642378 Webstaff Negative Balance org select repairs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2c4994ffd8daa517b49e39e94935cfd8df1f84a0;p=working%2FEvergreen.git 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 --- 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) {