PINES Customization: Require Parent/Guardian Field
authorTerran McCanna <tmccanna@georgialibraries.org>
Thu, 21 Dec 2017 22:43:10 +0000 (17:43 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 16 Nov 2018 01:04:09 +0000 (20:04 -0500)
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 37c2c1d..60c8539 100644 (file)
@@ -446,6 +446,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 7599020..d5fcd25 100644 (file)
@@ -1984,6 +1984,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.