<!-- row actions -->
+ <!-- row actions : Ungrouped -->
+
+ <eg-grid-toolbar-action
+ i18n-label label="Print Labels" (onClick)="openItemPrintLabels($event)">
+ </eg-grid-toolbar-action>
+
+ <!-- row actions : Show group -->
+
+ <eg-grid-toolbar-action
+ i18n-group group="Show" i18n-label label="Show Item Status (list)"
+ (onClick)="openItemStatusList($event)"></eg-grid-toolbar-action>
+
+ <eg-grid-toolbar-action
+ i18n-group group="Show" i18n-label label="Show Item Status (detail)"
+ (onClick)="openItemStatus($event)"></eg-grid-toolbar-action>
+
+ <eg-grid-toolbar-action
+ i18n-group group="Show" i18n-label label="Show Item Holds"
+ (onClick)="openItemHolds($event)"></eg-grid-toolbar-action>
+
+ <eg-grid-toolbar-action
+ i18n-group group="Show" i18n-label label="Show Triggered Events"
+ (onClick)="openItemTriggeredEvents($event)"></eg-grid-toolbar-action>
+
+ <!-- row actions : Mark group -->
+
<eg-grid-toolbar-action
group="Mark" i18n-group i18n-label label="Mark Item Damaged"
(onClick)="showMarkDamagedDialog($event)"></eg-grid-toolbar-action>
} 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';
// The holdings grid models a single HoldingsTree, composed of HoldingsTreeNodes
private pcrud: PcrudService,
private staffCat: StaffCatalogService,
private store: ServerStoreService,
- private localStore: StoreService
+ private localStore: StoreService,
+ private anonCache: AnonCacheService
) {
// Set some sane defaults before settings are loaded.
this.gridDataSource = new GridDataSource();
this.localStore.setLocalItem('eg.cat.transfer_target_record', this.recordId);
this.localStore.setLocalItem('eg.cat.transfer_target_lib', orgId);
}
-}
+ openAngJsWindow(path: string) {
+ const url = `/eg/staff/${path}`;
+ window.open(url, '_blank');
+ }
+
+ openItemHolds(rows: HoldingsEntry[]) {
+ if (rows.length > 0 && rows[0].copy) {
+ this.openAngJsWindow(`cat/item/${rows[0].copy.id()}/holds`);
+ }
+ }
+ openItemStatusList(rows: HoldingsEntry[]) {
+ const ids = this.selectedCopyIds(rows);
+ if (ids.length > 0) {
+ return this.openAngJsWindow(`cat/item/search/${ids.join(',')}`);
+ }
+ }
+
+ openItemStatus(rows: HoldingsEntry[]) {
+ if (rows.length > 0 && rows[0].copy) {
+ return this.openAngJsWindow(`cat/item/${rows[0].copy.id()}`);
+ }
+ }
+
+ openItemTriggeredEvents(rows: HoldingsEntry[]) {
+ if (rows.length > 0 && rows[0].copy) {
+ return this.openAngJsWindow(
+ `cat/item/${rows[0].copy.id()}/triggered_events`);
+ }
+ }
+
+ openItemPrintLabels(rows: HoldingsEntry[]) {
+ const ids = this.selectedCopyIds(rows);
+ if (ids.length === 0) { return; }
+
+ this.anonCache.setItem(null, 'print-labels-these-copies', {copies: ids})
+ .then(key => this.openAngJsWindow(`cat/printlabels/${key}`));
+ }
+}