<ng-container *ngIf="mode == 'list' && initComplete()">
<div class="row" *ngIf="!hidePickupLibFilter">
- <div class="col-lg-4">
+ <div class="col-lg-5">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text" i18n>Pickup Library</div>
[multiSortable]="true" [persistKey]="persistKey"
(onRowActivate)="showDetail($event)">
- <eg-grid-toolbar-checkbox (onChange)="preFetchHolds($event)"
- [initialValue]="enablePreFetch" i18n-label label="Pre-Fetch All Holds">
- </eg-grid-toolbar-checkbox>
+ <ng-container *ngIf="preFetchSetting">
+ <eg-grid-toolbar-checkbox (onChange)="preFetchHolds($event)"
+ [initialValue]="enablePreFetch" i18n-label label="Pre-Fetch All Holds">
+ </eg-grid-toolbar-checkbox>
+ </ng-container>
<eg-grid-toolbar-action
i18n-label label="Show Hold Details" i18n-group group="Hold"
i18-group group="Hold" i18n-label label="Print Holds"
(onClick)="printHolds()"></eg-grid-toolbar-action>
+ <eg-grid-toolbar-action
+ i18n-label label="Show Hold Details" i18n-group group="Show"
+ (onClick)="showDetails($event)"></eg-grid-toolbar-action>
+
+ <eg-grid-toolbar-action
+ i18n-label label="Show Holds For Title" i18n-group group="Show"
+ (onClick)="showHoldsForTitle($event)"></eg-grid-toolbar-action>
+
<eg-grid-column i18n-label label="Hold ID" path='id' [index]="true" datatype="id">
</eg-grid-column>
import {Component, OnInit, Input, ViewChild} from '@angular/core';
+import {Location} from '@angular/common';
import {Observable, Observer, of} from 'rxjs';
import {IdlObject} from '@eg/core/idl.service';
import {NetService} from '@eg/core/net.service';
}
}
- _userId: number;
- @Input() set userId(id: number) {
- this._userId = id;
+ get recordId(): number {
+ return this._recordId;
+ }
+
+ _patronId: number;
+ @Input() set patronId(id: number) {
+ this._patronId = id;
if (this.initDone) {
this.holdsGrid.reload();
}
}
+ get patronId(): number {
+ return this._patronId;
+ }
// Include holds canceled on or after the provided date.
// If no value is passed, canceled holds are not displayed.
this.holdsGrid.reload();
}
}
+ get showCanceledSince(): Date {
+ return this._showCanceledSince;
+ }
// Include holds fulfilled on or after hte provided date.
// If no value is passed, fulfilled holds are not displayed.
this.holdsGrid.reload();
}
}
+ get showFulfilledSince(): Date {
+ return this._showFulfilledSince;
+ }
cellTextGenerator: GridCellTextGenerator;
constructor(
+ private ngLocation: Location,
private net: NetService,
private org: OrgService,
private store: ServerStoreService,
ngOnInit() {
this.initDone = true;
- this.pickupLib = this.org.get(this.initialPickupLib);
-
- if (this.preFetchSetting) {
- this.store.getItem(this.preFetchSetting).then(
- applied => this.enablePreFetch = Boolean(applied)
- );
+ if (this.initialPickupLib) {
+ this.pickupLib = this.org.get(this.initialPickupLib);
+ }
+ if (this.preFetchSetting) {
+ this.store.getItem(this.preFetchSetting).then(
+ applied => this.enablePreFetch = Boolean(applied)
+ );
}
if (!this.defaultSort) {
applyFilters(): any {
const filters: any = {
is_staff_request: true,
- fulfillment_time: this._showFulfilledSince ?
- this._showFulfilledSince.toISOString() : null,
- cancel_time: this._showCanceledSince ?
- this._showCanceledSince.toISOString() : null,
+ fulfillment_time: this.showFulfilledSince ?
+ this.showFulfilledSince.toISOString() : null,
+ cancel_time: this.showCanceledSince ?
+ this.showCanceledSince.toISOString() : null,
};
if (this.pickupLib) {
this.org.descendants(this.pickupLib, true);
}
- if (this._recordId) {
- filters.record_id = this._recordId;
+ if (this.recordId) {
+ filters.record_id = this.recordId;
}
- if (this._userId) {
- filters.usr_id = this._userId;
+ if (this.patronId) {
+ filters.usr_id = this.patronId;
}
return filters;
fetchHolds(pager: Pager, sort: any[]): Observable<any> {
// We need at least one filter.
- if (!this._recordId && !this.pickupLib && !this._userId) {
+ if (!this.recordId && !this.pickupLib && !this.patronId) {
return of([]);
}
this.showDetail(rows[0]);
}
+ showHoldsForTitle(rows: any[]) {
+ if (rows.length === 0) { return; }
+
+ const url = this.ngLocation.prepareExternalUrl(
+ `/staff/catalog/record/${rows[0].record_id}/holds`);
+
+ window.open(url, '_blank');
+ }
+
showDetail(row: any) {
if (row) {
this.mode = 'detail';
--- /dev/null
+
+BEGIN;
+
+-- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version);
+
+/*
+INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
+VALUES (
+ 'eg.catalog.results.count', 'gui', 'integer',
+ oils_i18n_gettext(
+ 'eg.catalog.results.count',
+ 'Catalog Results Page Size',
+ 'cwst', 'label'
+ )
+);
+*/
+
+eg.circ.patron.holds.prefetch
+
+eg.grid.circ.patron.holds
+
+holds_for_patron print template
+
+COMMIT;