From: Billy Horn Date: Mon, 7 Nov 2016 22:29:53 +0000 (-0800) Subject: LP#1618949 Patron edit forces required stat cats X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c1dd0a4189916be905fe9e5c8827504442638249;p=working%2FEvergreen.git LP#1618949 Patron edit forces required stat cats Display required stat cats as required form fields and prevent the patron editor form from submitting when required stat cats do not have values. Signed-off-by: Billy Horn Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 index 69da8b6464..229c94d644 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 @@ -852,16 +852,20 @@ within the "form" by name for validation. -
+
+ +
-
+
-
- +
+
+
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 f0a45cddb3..d6e1c47236 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 @@ -1216,6 +1216,9 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , if ($scope.patron.isnew) set_new_patron_defaults(prs); + $scope.hasRequiredStatCat = prs.stat_cats.filter( + function(cat) {return cat.required() == 1} ).length > 0; + $scope.page_data_loaded = true; prs.set_field_patterns(field_patterns); @@ -1271,7 +1274,7 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , 'stat_cats' : 1, 'surveys' : 1 }; - + // Returns true if the selected field should be visible // given the current required/suggested/all setting. // The visibility flag applied to each field as a result of calling