import {Component, OnInit, Input, ViewChild, Renderer2} from '@angular/core';
import {Router, ActivatedRoute, ParamMap} from '@angular/router';
-import {Observable} from 'rxjs';
-import {tap} from 'rxjs/operators';
import {EventService} from '@eg/core/event.service';
import {NetService} from '@eg/core/net.service';
import {AuthService} from '@eg/core/auth.service';
import {IdlObject} from '@eg/core/idl.service';
import {OrgService} from '@eg/core/org.service';
import {BibRecordService, BibRecordSummary} from '@eg/share/catalog/bib-record.service';
-import {CatalogSearchContext, CatalogSearchState} from '@eg/share/catalog/search-context';
import {CatalogService} from '@eg/share/catalog/catalog.service';
import {StaffCatalogService} from '../catalog.service';
import {HoldsService, HoldRequest,
this.holdType = this.route.snapshot.params['type'];
this.holdTargets = this.route.snapshot.queryParams['target'];
+ this.holdFor = this.route.snapshot.queryParams['holdFor'] || 'patron';
if (!Array.isArray(this.holdTargets)) {
this.holdTargets = [this.holdTargets];
}
this.holdTargets = this.holdTargets.map(t => Number(t));
- this.holdFor = 'patron';
+
this.requestor = this.auth.user();
this.pickupLib = this.auth.user().ws_ou();
return ctx;
});
+ if (this.holdFor === 'staff') {
+ this.holdForChanged();
+ }
+
this.getTargetMeta();
this.org.settings('sms.enable').then(sets => {
import {Component, OnInit, Input, ViewChild} from '@angular/core';
+import {Router} from '@angular/router';
import {Observable, Observer, of} from 'rxjs';
import {map} from 'rxjs/operators';
import {Pager} from '@eg/share/util/pager';
contextOrg: IdlObject;
constructor(
+ private router: Router,
private org: OrgService,
private idl: IdlService,
private pcrud: PcrudService,
dismissed => {}
);
}
+
+ requestItems(rows: HoldingsEntry[]) {
+ const copyIds = this.selectedCopyIds(rows);
+ if (copyIds.length === 0) { return; }
+ const params = {target: copyIds, holdFor: 'staff'};
+ this.router.navigate(['/staff/catalog/hold/C'], {queryParams: params});
+ }
}