From 112aeed8d96f57ed07f10c6fd3368f08160ee45d Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 26 Nov 2018 14:52:09 -0500 Subject: [PATCH] place holds continued Signed-off-by: Bill Erickson --- .../eg2/src/app/share/catalog/catalog.service.ts | 9 +++ .../src/app/staff/catalog/hold/hold.component.html | 66 ++++++++++++---------- .../src/app/staff/catalog/hold/hold.component.ts | 17 +++++- .../app/staff/catalog/result/record.component.ts | 8 +-- .../src/eg2/src/app/staff/share/hold.service.ts | 18 +++++- 5 files changed, 76 insertions(+), 42 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts b/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts index c51340709c..1035d35106 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts @@ -226,6 +226,15 @@ export class CatalogService { }); } + iconFormatLabel(code: string): string { + if (this.ccvmMap) { + const ccvm = this.ccvmMap.icon_format.filter( + format => format.code() === code)[0]; + if (ccvm) { + return ccvm.search_label(); + } + } + } fetchCmfs(): Promise { // At the moment, we only need facet CMFs. diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html index a161e226de..1ec9531d37 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html @@ -1,8 +1,8 @@

Place Hold - - ({{user.family_name()}}, {{user.first_given_name()}} {{user.second_given_name()}}) - + + ({{user.family_name()}}, {{user.first_given_name()}}) +

+ + +
+
+
+ + +
+ +
+
+
-
-
-
- -
-
- -
-
-
+
{{requestor.usrname()}}
+ +
+
+ +
+
@@ -87,20 +98,6 @@
-
- - -
-
-
- - -
-
-
-
@@ -125,7 +122,8 @@
-
Title
+
Format
+
Title
Author
TCN
Call Number
@@ -135,7 +133,15 @@
-
+
+ + {{iconFormatLabel(code)}} + +
+
{{ctx.bibSummary.display.title}} diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts index e813a94d46..b61d82df78 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts @@ -34,8 +34,10 @@ export class HoldComponent implements OnInit { pickupLib: number; notifyEmail: boolean; notifyPhone: boolean; - notifySms: boolean; phoneValue: string; + notifySms: boolean; + smsValue: string; + smsCarrier: string; suspend: boolean; activeDate: string; @@ -114,6 +116,7 @@ export class HoldComponent implements OnInit { } holdForChanged() { + this.user = null; if (this.holdFor === 'patron') { if (this.userBarcode) { @@ -238,7 +241,13 @@ export class HoldComponent implements OnInit { recipient: this.user.id(), requestor: this.requestor.id(), pickupLib: this.pickupLib, - override: override + override: override, + notifyEmail: this.notifyEmail, // bool + notifyPhone: this.notifyPhone ? this.phoneValue : null, + notifySms: this.notifySms ? this.smsValue : null, + smsCarrier: this.notifySms ? this.smsCarrier : null, + thawDate: this.suspend ? this.activeDate : null, + frozen: this.suspend }).toPromise().then(request => { console.log('hold returned: ', request); @@ -269,6 +278,10 @@ export class HoldComponent implements OnInit { return ctx.lastRequest && !ctx.lastRequest.result.success && ctx.canOverride; } + + iconFormatLabel(code: string): string { + return this.cat.iconFormatLabel(code); + } } diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts index b99a4a1b05..b05d6b436e 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts @@ -54,13 +54,7 @@ export class ResultRecordComponent implements OnInit, OnDestroy { } iconFormatLabel(code: string): string { - if (this.cat.ccvmMap) { - const ccvm = this.cat.ccvmMap.icon_format.filter( - format => format.code() === code)[0]; - if (ccvm) { - return ccvm.search_label(); - } - } + return this.cat.iconFormatLabel(code); } placeHold(): void { diff --git a/Open-ILS/src/eg2/src/app/staff/share/hold.service.ts b/Open-ILS/src/eg2/src/app/staff/share/hold.service.ts index 7004a461f7..5651d5941b 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/hold.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/hold.service.ts @@ -21,6 +21,12 @@ export interface HoldRequest { requestor: number; pickupLib: number; override?: boolean; + notifyEmail?: boolean; + notifyPhone?: string; + notifySms?: string; + smsCarrier?: string; + thawDate?: string; // ISO date + frozen?: boolean; //holdableFormats?: {[id: number]: string[]}; result?: HoldRequestResult // ... @@ -42,9 +48,15 @@ export class HoldService { return this.net.request( 'open-ils.circ', method, this.auth.token(), { - patronid: request.recipient, - pickup_lib: request.pickupLib, - hold_type: request.holdType, + patronid: request.recipient, + pickup_lib: request.pickupLib, + hold_type: request.holdType, + email_notify: request.notifyEmail, + phone_notify: request.notifyPhone, + thaw_date: request.thawDate, + frozen: request.frozen, + sms_notify: request.notifySms, + sms_carrier: request.smsCarrier //holdable_formats_map: request.holdableFormats }, [request.holdTarget] -- 2.11.0