From: Bill Erickson Date: Tue, 20 Jul 2021 18:25:37 +0000 (-0400) Subject: LP1936233 Item status actions menu X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a3b9e806aa78d88f8092287fce82914517dced81;p=working%2FEvergreen.git LP1936233 Item status actions menu Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html b/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html index b5f917af68..944e3e794e 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html @@ -21,6 +21,10 @@ dialogTitle="No Target Selected" dialogBody="Please select a suitable transfer target"> + + +
@@ -51,8 +55,13 @@ label="Link as Conjoined to Marked Bib Record" (entryClicked)="openConjoinedDialog([item])"> - + + + + + @@ -63,6 +72,11 @@ i18n-group group="Add" (entryClicked)="addRecordToBucket([item])"> + + + + + + + + diff --git a/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.ts index 8d204ef516..c7afeb620d 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.ts @@ -39,6 +39,9 @@ import {MarkDamagedDialogComponent } from '@eg/staff/share/holdings/mark-damaged-dialog.component'; import {MarkMissingDialogComponent } from '@eg/staff/share/holdings/mark-missing-dialog.component'; +import {AnonCacheService} from '@eg/share/util/anon-cache.service'; +import {ToastService} from '@eg/share/toast/toast.service'; +import {StringService} from '@eg/share/string/string.service'; @Component({ templateUrl: 'status.component.html' @@ -93,7 +96,10 @@ export class ItemStatusComponent implements OnInit, AfterViewInit { private evt: EventService, private cat: CatalogService, private worklog: WorkLogService, - private holdings: HoldingsService + private holdings: HoldingsService, + private toast: ToastService, + private strings: StringService, + private anonCache: AnonCacheService ) {} ngOnInit() { @@ -360,6 +366,41 @@ export class ItemStatusComponent implements OnInit, AfterViewInit { })).subscribe(); } + + updateInventory(copies: IdlObject[]) { + if (copies.length === 0) { return; } + + this.net.request( + 'open-ils.circ', + 'open-ils.circ.circulation.update_latest_inventory', + this.auth.token(), {copy_list: copies.map(c => c.id())} + ).toPromise().then(_ => this.load()); + } + + printLabels(copies: IdlObject[]) { + if (copies.length === 0) { return; } + + this.anonCache.setItem(null, + 'print-labels-these-copies', {copies: copies.map(c => c.id())}) + .then(key => window.open(`/eg/staff/cat/printlabels/${key}`)); + } + + showAcq(copies: IdlObject[]) { + if (copies.length === 0) { return; } + + this.net.request('open-ils.acq', + 'open-ils.acq.lineitem.retrieve.by_copy_id', + this.auth.token(), copies[0].id() + ).subscribe(resp => { + + if (this.evt.parse(resp)) { + return this.strings.interpolate('staff.cat.item.no-acq') + .then(str => this.toast.info(str)); + } + + window.open(`/eg/staff/acq/legacy/po/view/${resp.purchase_order()}`); + }); + } }