place holds continued
authorBill Erickson <berickxx@gmail.com>
Fri, 16 Nov 2018 21:21:18 +0000 (16:21 -0500)
committerBill Erickson <berickxx@gmail.com>
Fri, 30 Nov 2018 16:34:20 +0000 (11:34 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html
Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts

index 7f403ff..275686c 100644 (file)
@@ -1,4 +1,9 @@
-<h3 i18n>Place Hold</h3>
+
+<h3 i18n>Place Hold 
+    <ng-container *ngIf="user"> 
+       ({{user.family_name()}}, {{user.first_given_name()}} {{user.second_given_name()}})
+    </ng-container>
+</h3>
 
 <form class="form form-validated common-form striped-odd" 
   autocomplete="off" (keydown.enter)="$event.preventDefault()">
       </eg-date-select>
     </div>
   </div>
+  <div class="row mt-2">
+    <div class="col-lg-3">
+      <button class="btn btn-success" (click)="placeHolds()" 
+        [disabled]="!user" i18n>Submit</button>
+    </div>
+  </div>
 </form>
 
-<div class="row font-weight-bold mt-2 ml-1 mr-1">
+<div class="row"><div class="col-lg-12"><hr/></div></div>
+
+<div class="row font-weight-bold pt-3 ml-1 mr-1">
   <div class="col-lg-10" i18n>Placing hold(s) on record(s)</div>
   <div class="col-lg-2" i18n>Holds Status</div>
 </div>
index f31dd35..b499b06 100644 (file)
@@ -77,7 +77,8 @@ export class HoldComponent implements OnInit {
                 this.userBarcodeChanged();
             }
         } else {
-            this.currentUserBarcode = '_'; // just for preventing dupes
+            // To bypass the dupe check.
+            this.currentUserBarcode = '_' + this.requestor.id();
             this.getUser(this.requestor.id());
         }
     }
@@ -94,7 +95,11 @@ export class HoldComponent implements OnInit {
         }
 
         this.resetForm();
-        if (!this.userBarcode) { return; }
+
+        if (!this.userBarcode) { 
+            this.user = null;
+            return; 
+        }
 
         this.user = null;
         this.currentUserBarcode = this.userBarcode;
@@ -164,6 +169,17 @@ export class HoldComponent implements OnInit {
                     break;
             }
         });
+
+        if (!this.user.email()) {
+            this.notifyEmail = false;
+        }
+
+        if (!this.phoneValue) {
+            this.notifyPhone = false;
+        }
+    }
+
+    placeHolds() {
     }
 }