--- /dev/null
+import {NgModule} from '@angular/core';
+import {FmRecordEditorModule} from '@eg/share/fm-editor/fm-editor.module';
+import {StaffCommonModule} from '@eg/staff/common.module';
+import {HoldsModule} from '@eg/staff/share/holds/holds.module';
+import {HoldingsModule} from '@eg/staff/share/holdings/holdings.module';
+import {BookingModule} from '@eg/staff/share/booking/booking.module';
+import {PatronModule} from '@eg/staff/share/patron/patron.module';
+import {HoldsUiRoutingModule} from './routing.module';
+import {HoldsPullListComponent} from './pull-list.component';
+
+@NgModule({
+ declarations: [
+ HoldsPullListComponent
+ ],
+ imports: [
+ StaffCommonModule,
+ FmRecordEditorModule,
+ HoldsModule,
+ HoldingsModule,
+ BookingModule,
+ PatronModule,
+ HoldsUiRoutingModule
+ ],
+ providers: [
+ ]
+})
+
+export class HoldsUiModule {}
--- /dev/null
+
+<eg-staff-banner i18n-bannerText bannerText="Holds Pull List"></eg-staff-banner>
+
+<eg-holds-grid
+ printTemplate="holds_pull_list"
+ persistKey="circ.holds.pull_list"
+ [hidePickupLibFilter]="true"
+ [pullListOrg]="targetOrg()">
+</eg-holds-grid>
+
--- /dev/null
+import {Component, OnInit, Input, ViewChild, HostListener} from '@angular/core';
+import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
+import {Router, ActivatedRoute, ParamMap} from '@angular/router';
+import {PcrudService} from '@eg/core/pcrud.service';
+import {IdlObject} from '@eg/core/idl.service';
+import {AuthService} from '@eg/core/auth.service';
+import {StoreService} from '@eg/core/store.service';
+
+@Component({
+ selector: 'eg-holds-pull-list',
+ templateUrl: 'pull-list.component.html'
+})
+export class HoldsPullListComponent implements OnInit {
+
+ constructor(
+ private router: Router,
+ private route: ActivatedRoute,
+ private pcrud: PcrudService,
+ private auth: AuthService,
+ private store: StoreService
+ ) {}
+
+ ngOnInit() {
+ }
+
+ targetOrg(): number {
+ // TODO: selector
+ return this.auth.user().ws_ou();
+ }
+}
+
--- /dev/null
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {HoldsPullListComponent} from './pull-list.component';
+
+const routes: Routes = [{
+ path: 'pull-list',
+ component: HoldsPullListComponent
+}];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+
+export class HoldsUiRoutingModule {}
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
-const routes: Routes = [
- { path: 'patron',
- loadChildren: () =>
- import('./patron/routing.module').then(m => m.CircPatronRoutingModule)
- }
-];
+const routes: Routes = [{
+ path: 'patron',
+ loadChildren: () =>
+ import('./patron/routing.module').then(m => m.CircPatronRoutingModule)
+}, {
+ path: 'holds',
+ loadChildren: () =>
+ import('./holds/holds.module').then(m => m.HoldsUiModule)
+}];
@NgModule({
imports: [RouterModule.forChild(routes)],
[multiSortable]="true" [persistKey]="persistKey"
(onRowActivate)="showDetail($event)">
- <eg-grid-toolbar-checkbox (onChange)="preFetchHolds($event)" *ngIf="!hopeless"
+ <eg-grid-toolbar-checkbox
+ (onChange)="preFetchHolds($event)" *ngIf="!hopeless && this.preFetchSetting"
[initialValue]="enablePreFetch" i18n-label label="Pre-Fetch All Holds">
</eg-grid-toolbar-checkbox>
@Input() initialPickupLib: number | IdlObject;
@Input() hidePickupLibFilter: boolean;
+ // Setting a value here puts us into "pull list" mode.
+ @Input() pullListOrg: number;
+
// If true, only retrieve holds with a Hopeless Date
// and enable related Actions
@Input() hopeless: boolean;
this.store.getItem(this.preFetchSetting).then(
applied => this.enablePreFetch = Boolean(applied)
);
+ } else {
+ this.enablePreFetch = false;
}
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,
- };
+ const filters: any = {};
+
+ if (this.pullListOrg) {
+ filters.cancel_time = null;
+ filters.capture_time = null;
+
+ // Oddly, there are aliases for these (cp_status, cp_circ_lib),
+ // but the API complains when I use them.
+ filters['cp.status'] = [0, 7];
+ filters['cp.circ_lib'] = this.pullListOrg;
+
+ return filters;
+ }
+
+ if (this._showFulfilledSince) {
+ filters.fulfillment_time = this._showFulfilledSince.toISOString();
+ }
+
+ if (this._showCanceledSince) {
+ filters.cancel_time = this._showCanceledSince.toISOString();
+ }
if (this.hopeless) {
filters['hopeless_holds'] = {
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._userId && !this.pullListOrg) {
return of([]);
}
subObj[obj.name] = {dir: obj.dir, nulls: 'last'};
orderBy.push(subObj);
});
+ } else if (this.pullListOrg) {
+ orderBy.push(
+ {copy_location_order_position: {dir: 'asc', nulls: 'last'}},
+ {cn_label_sortkey: {dir: 'asc'}}
+ );
}
const limit = this.enablePreFetch ? null : pager.limit;