From c59c4483cd86f5b8767d130b90662ee18bf9c9cc Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 16 Sep 2021 11:02:45 -0400 Subject: [PATCH] LP1904036 SMS number / carrier required if SMS enabled Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html | 2 ++ Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html index c46961ea83..48dc650976 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html @@ -147,6 +147,7 @@ id="cust-{{args.settingName}}-input" [ngModel]="userSettings[args.settingName]" (ngModelChange)="userSettingChange(args.settingName, $event)" + [required]="settingFieldRequired(args.settingName)" [disabled]="args.disabled" /> @@ -570,6 +571,7 @@ name="cust-opac.default_sms_carrier-input" domId="cust-opac.default_sms_carrier-input" [selectedId]="userSettings['opac.default_sms_carrier']" + [required]="settingFieldRequired('opac.default_sms_carrier')" (onChange)="userSettingChange( 'opac.default_sms_carrier', $event ? $event.id : null)"> diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts index c95260d707..15d29b36ad 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts @@ -1145,6 +1145,16 @@ export class EditComponent implements OnInit, AfterViewInit { return this.fieldVisibility[field] === 3; } + settingFieldRequired(name: string): boolean { + + switch (name) { + case 'opac.default_sms_notify': + case 'opac.default_sms_carrier': + return this.holdNotifyTypes.sms; + } + + return false; + } fieldPattern(idlClass: string, field: string): RegExp { if (!this.fieldPatterns[idlClass][field]) { -- 2.11.0