From 8fd8794babcedc2ff2cafcebf57a68ac5438f874 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 31 Jul 2020 10:00:48 -0400 Subject: [PATCH] LP1889694 copy count batch mode UI (revert) Signed-off-by: Bill Erickson --- .../src/app/share/catalog/bib-record.service.ts | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts b/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts index d29c4bdef8..d15d2bc2fb 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts @@ -160,6 +160,8 @@ export class BibRecordService { return from([]); } + //return this.getCopyCountsBatch(ids) + return this.pcrud.search('bre', {id: ids}, { flesh: 1, flesh_fields: {bre: ['flat_display_entries', 'mattrs']}, @@ -178,6 +180,22 @@ export class BibRecordService { })); } + getCopyCountsBatch(recordIds: number[], + orgId: number, isStaff?: boolean, isMetarecord?: boolean): Promise { + + let method = 'open-ils.search.biblio.record.copy_count.batch'; + + if (isMetarecord) { + method = method.replace(/record/, 'metarecord/'); + } + + if (isStaff) { method += '.staff'; } + + return this.net.request( + 'open-ils.search', method, orgId, recordIds + ).toPromise(); + } + // A Metabib Summary is a BibRecordSummary with the lead record as // its core bib record plus attributes (e.g. formats) from related // records. @@ -297,6 +315,23 @@ export class BibRecordService { getHoldingsSummary(recordId: number, orgId: number, orgDepth: number, isMetarecord?: boolean): Promise { + let method = 'open-ils.search.biblio.record.copy_count'; + + if (isMetarecord) { + method = method.replace(/record/, 'metarecord/'); + } + + // TODO: isStaff param / replace depth + method += '.staff'; + + return this.net.request( + 'open-ils.search', method, orgId, recordId + ).toPromise(); + } + + getHoldingsSummaryUnapi(recordId: number, + orgId: number, orgDepth: number, isMetarecord?: boolean): Promise { + const holdingsSummary = []; return this.unapi.getAsXmlDocument({ -- 2.11.0