From be4b9539171d821f3d127a19d8681f9d7247a6e4 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 13 Jul 2020 16:01:38 -0400 Subject: [PATCH] LP1887429 Properly handle user settings in staffcat holds Treat user settings like the raw JSON values that they are when fetched via fleshing. Also be sure the value for the 'opac.default_pickup_location' user setting is read as a number in the staff catalog to ensure it can be linked to the org unit in question. Signed-off-by: Bill Erickson Signed-off-by: Michele Morgan --- Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts | 8 ++++++-- Open-ILS/src/eg2/src/app/staff/share/patron/patron.service.ts | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) 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 3ac30414eb..e305a46e08 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 @@ -395,10 +395,14 @@ export class HoldComponent implements OnInit { this.user.settings().forEach(setting => { const name = setting.name(); - const value = setting.value(); + let value = setting.value(); if (value === '' || value === null) { return; } + // When fleshing 'settings' on the actor.usr object, + // we're grabbing the raw JSON values. + value = JSON.parse(value); + switch (name) { case 'opac.hold_notify': this.notifyPhone = Boolean(value.match(/phone/)); @@ -407,7 +411,7 @@ export class HoldComponent implements OnInit { break; case 'opac.default_pickup_location': - this.pickupLib = value; + this.pickupLib = Number(value); break; case 'opac.default_phone': diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/patron.service.ts b/Open-ILS/src/eg2/src/app/staff/share/patron/patron.service.ts index e658a7962a..32aa678e20 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/patron.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/patron.service.ts @@ -24,6 +24,8 @@ export class PatronService { 'actor', barcode.trim()); } + // Note pcrudOps should be constructed from the perspective + // of a user ('au') retrieval, not a barcode ('ac') retrieval. getByBarcode(barcode: string, pcrudOps?: any): Promise { return this.bcSearch(barcode).toPromise() .then(barcodes => { @@ -36,7 +38,7 @@ export class PatronService { for (let i = 0; i < barcodes.length; i++) { const bc = barcodes[i]; if (!this.evt.parse(bc)) { - return this.getById(bc.id); + return this.getById(bc.id, pcrudOps); } } -- 2.11.0