PINES Customization: Require Parent/Guardian Field
authorTerran McCanna <tmccanna@georgialibraries.org>
Thu, 21 Dec 2017 22:43:10 +0000 (17:43 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 4 Jun 2019 21:32:45 +0000 (17:32 -0400)
This shows a warning on screen if a juvenile patron doesn't have
the parent/guardian field filled in (although it doesn't actually
require it).

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js

index 25ad2fb..092848b 100644 (file)
@@ -458,6 +458,9 @@ within the "form" by name for validation.
   [% draw_form_input('au', 'ident_value2') %]
   <div class="col-md-6 patron-reg-example">
     [% draw_example_text('au', 'ident_value2') %]
+    <div ng-show="parent_alert" class="patron-reg-validation-alert">
+        <span>Parent/Guardian is Required (Ex: Jane Smith - Mom)</span>
+    </div>
   </div>
 </div>
 
index b987d0b..5e24e7c 100644 (file)
@@ -2043,6 +2043,13 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
             Number(egCore.date.intervalToSeconds(juv_interval) + '000'));
 
         $scope.patron.juvenile = ($scope.patron.dob > base);
+        
+        // PINES Customization: Require parent/guardian field if juvenile
+        if ($scope.patron.dob > base && (!$scope.patron.ident_value2 || $scope.patron.ident_value2 == '')) {
+            $scope.parent_alert = true;
+        } else {
+            $scope.parent_alert = false;
+        }
     }
 
     // returns true (disable) for orgs that cannot have users.