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 <berickxx@gmail.com>
// 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