From 4b0c2e0142376e8655e8fe5a2d7dc138b511a2f4 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 16 Jan 2019 13:57:10 -0500 Subject: [PATCH] Patron reg button hide sanity checks Avoid referencing $scope.patron until the object exists when loading the patron create interface in the staff client. This avoids unnecessary (and potentially misleading) JS errors on page load. Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index 4e2e9a2586..95345d7050 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -2023,9 +2023,11 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , // Returns true if the Save and Save & Clone buttons should be disabled. $scope.edit_passthru.hide_save_actions = function() { - return $scope.patron.isnew ? + return !$scope.patron || ( + $scope.patron.isnew ? !$scope.perms.CREATE_USER : - !$scope.perms.UPDATE_USER; + !$scope.perms.UPDATE_USER + ); } // Returns true if any input elements are tagged as invalid -- 2.11.0