LP1904036 checkin; hold dialg
authorBill Erickson <berickxx@gmail.com>
Fri, 9 Apr 2021 21:02:59 +0000 (17:02 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:30 +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/checkin/checkin.component.ts
Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts
Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.html
Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.ts

index 6ad1c8f..e3acc3c 100644 (file)
@@ -21,7 +21,8 @@ interface CheckinGridEntry extends CheckinResult {
 }
 
 @Component({
-  templateUrl: 'checkin.component.html'
+  templateUrl: 'checkin.component.html',
+  styleUrls: ['checkin.component.css']
 })
 export class CheckinComponent implements OnInit, AfterViewInit {
     checkins: CheckinGridEntry[] = [];
index c8a31c1..f667fc1 100644 (file)
@@ -553,7 +553,8 @@ export class CircService {
             copy: payload.copy,
             volume: payload.volume,
             record: payload.record,
-            transit: payload.transit
+            transit: payload.transit,
+            hold: payload.hold
         };
 
         const copy = result.copy;
@@ -683,7 +684,7 @@ export class CircService {
 
                 if (hold) {
 
-                    if (hold.pickup_lib() === this.auth.user().ws_ou()) {
+                    if (Number(hold.pickup_lib()) === Number(this.auth.user().ws_ou())) {
                         result.routeTo = 'Holds Shelf'; // TODO
                         this.components.routeDialog.checkin = result;
                         return this.components.routeDialog.open().toPromise()
@@ -697,6 +698,7 @@ export class CircService {
                 } else {
                     console.warn('API Returned insufficient info on holds');
                 }
+                break;
 
             case 11: /* CATALOGING */
                 this.audio.play('info.checkin.cataloging');
index a8d85eb..f2486a3 100644 (file)
+
+<!-- 
+  Two separate dialogs are defined within, one for the holds slip
+  and one for hold and non-hold transits.
+-->
+
+<ng-template #holdShelfTmpl>
+  <div *ngIf="checkin.hold.behind_desk() == 't'" i18n>
+    This item should be routed to the <strong>Private Holds Shelf</strong>
+  </div>
+  <div *ngIf="checkin.hold.behind_desk() == 'f'" i18n>
+    This item should be routed to the <strong>Public Holds Shelf</strong>
+  </div>
+
+  <br/>
+  <div>
+    <span class="mr-2" i18n>Item Barcode:</span>
+    <span>{{checkin.copy.barcode()}}</span>
+  </div>
+  <div>
+    <span class="mr-2" i18n>Title:</span>
+    <span>{{checkin.record.title()}}</span>
+  </div>
+  <div>
+    <span class="mr-2" i18n>Author:</span>
+    <span>{{checkin.record.author()}}</span>
+  </div>
+  <div>
+    <span class="mr-2" i18n>Call Number:</span>
+    <span>{{checkin.volume.prefix().label()}}&nbsp;{{checkin.volume.label()}}&nbsp;{{checkin.volume.suffix().label()}}</span>
+  </div>
+  <br/>
+
+  <div *ngIf="checkin.patron.alias()">
+    Hold for patron {{checkin.patron.alias()}}
+  </div>
+  <div *ngIf="!checkin.patron.alias()" i18n>
+    Hold for patron {{checkin.patron.family_name()}}, 
+    {{checkin.patron.first_given_name()}} {{checkin.patron.second_given_name()}}
+  </div>
+  <div *ngIf="!checkin.patron.alias()">
+    <div *ngIf="checkin.patron.pref_family_name() 
+      || checkin.patron.pref_first_given_name() 
+      || checkin.patron.pref_second_given_name()">
+      Preferred name: 
+        {{checkin.patron.pref_family_name || checkin.patron.family_name}},
+        {{checkin.patron.pref_first_given_name || checkin.patron.first_given_name}}
+        {{checkin.patron.pref_second_given_name}}
+    </div>
+  </div>
+  <div>
+    <span class="mr-2" i18n>Patron Barcode:</span>
+    <span>{{checkin.patron.card().barcode()}}</span>
+  </div>
+  <div *ngIf="checkin.hold.phone_notify()" i18n>Notify by phone: {{checkin.hold.phone_notify()}}</div>
+  <div *ngIf="checkin.hold.sms_notify()" i18n>Notify by text: {{checkin.hold.sms_notify()}}</div>
+  <div *ngIf="checkin.hold.email_notify() == 't'" i18n>Notify by email: {{checkin.patron.email()}}</div>
+  <br/>
+  <div>
+    <span class="mr-2" i18n>Request Date:</span>
+    <span>{{checkin.hold.request_time() | date:'short'}}</span>
+  </div>
+  <div>
+    <span class="mr-2" i18n>Request Notes:</span>
+    <ul>
+      <li *ngFor="let note of checkin.hold.notes()">
+        <strong>{{note.title()}}</strong>: {{note.body()}}
+        <span *ngIf="note.slip() =='t' || note.pub() == 't'" i18n>[Patron-visible]</span>
+      </li>
+    </ul>
+  </div>
+  <div>
+    <span class="mr-2" i18n>Slip Date:</span>
+    <span>{{today | date:'short'}}</span>
+  </div>
+</ng-template>
+
+<ng-template #transitTmpl>
+</ng-template>
+
 <ng-template #dialogContent>
   <div class="modal-header bg-info">
-    <h4 i18n>Route Item to Holds Shelf</h4>
+    <h4>
+      <ng-container *ngIf="slip == 'hold_shelf_slip'" i18n>Hold Slip</ng-container>
+      <ng-container *ngIf="slip != 'hold_shelf_slip'" i18n>Transit Slip</ng-container>
+    </h4>
     <button type="button" class="close"
       i18n-aria-label aria-label="Close" (click)="close()">
       <span aria-hidden="true">&times;</span>
     </button>
   </div>
   <div class="modal-body">
-
-    ROUTE DIALOG
+    <ng-container *ngIf="slip == 'hold_shelf_slip'">
+      <ng-container *ngTemplateOutlet="holdShelfTmpl"></ng-container>
+    </ng-container>
+    <ng-container *ngIf="slip != 'hold_shelf_slip'">
+      <ng-container *ngTemplateOutlet="transitTmpl"></ng-container>
+    </ng-container>
   </div>
   <div class="modal-footer">
-    <button type="button" class="btn btn-success" (click)="close()" i18n>Submit</button>
-    <button type="button" class="btn btn-warning" (click)="close()" i18n>Cancel</button>
+    <button type="button" class="btn btn-success" (click)="print()" i18n>Print</button>
+    <button type="button" class="btn btn-warning" (click)="close()" i18n>Do Not Print</button>
   </div>
 </ng-template>
+
+
index 7972bed..9204bfc 100644 (file)
@@ -28,6 +28,7 @@ export class RouteDialogComponent extends DialogComponent {
     orgAddress: IdlObject;
     destCourierCode: string;
     destOrg: IdlObject;
+    today = new Date();
 
     constructor(
         private modal: NgbModal,
@@ -45,9 +46,11 @@ export class RouteDialogComponent extends DialogComponent {
         // But in some cases we still have to collect the data
         // for printing.
 
+console.warn('ROUTE DIALOG OPEN');
         return from(this.applySettings())
 
         .pipe(concatMap(exit => {
+console.warn('ROUTE DIALOG 2');
             if (exit) {
                 return of(exit);
             } else {
@@ -56,9 +59,11 @@ export class RouteDialogComponent extends DialogComponent {
         }))
 
         .pipe(concatMap(exit => {
+console.warn('ROUTE DIALOG 3');
             if (exit) {
                 return of(exit);
             } else {
+console.warn('ROUTE DIALOG 4');
                 return super.open(ops);
             }
         }));
@@ -105,10 +110,10 @@ export class RouteDialogComponent extends DialogComponent {
         if (this.checkin.params.auto_print_hold_transits
             || this.circ.suppressCheckinPopups) {
             // Print and exit.
-            return this.printTransit().then(_ => false);
+            return this.printTransit().then(_ => true); // exit
         }
 
-        return promise;
+        return promise.then(_ => false); // keep going
     }
 
     applySettings(): Promise<boolean> {