From 8f47b6d7f4473e8edba641a6a9e136019f42d2e0 Mon Sep 17 00:00:00 2001 From: Billy Horn Date: Mon, 7 Nov 2016 14:29:53 -0800 Subject: [PATCH] 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 Signed-off-by: Kathy Lussier --- Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 | 17 +++++++++++------ Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js | 5 ++++- 2 files changed, 15 insertions(+), 7 deletions(-) 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 4acd97e52b..073ccd4237 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 @@ -853,16 +853,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 -- 2.11.0