LP1904036 Patron edit require email if using
authorBill Erickson <berickxx@gmail.com>
Fri, 16 Apr 2021 14:15:51 +0000 (10:15 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:31 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts

index 617436a..37c9bf3 100644 (file)
@@ -1108,9 +1108,15 @@ export class EditComponent implements OnInit, AfterViewInit {
 
     fieldRequired(field: string): boolean {
 
-        // Password field is only required for new patrons.
-        if (field === 'au.passwd') {
-            return this.patronId === null;
+        switch (field) {
+            case 'au.passwd':
+                // Only required for new patrons
+                return this.patronId === null;
+
+            case 'au.email':
+                // If the user ops in for email notices, require
+                // an email address
+                return this.holdNotifyTypes.email;
         }
 
         return this.fieldVisibility[field] === 3;