this.loading = true;
this.context.reset();
+ /*
return this.volcopy.load()
.then(_ => this.fetchHoldings(copyIds))
+ */
+ return this.fetchHoldings(copyIds)
+ .then(_ => this.volcopy.load())
+ .then(_ => {
+ console.log('ORG UNITS IS', this.context.orgNodes().map(n => n.target.id()));
+ })
.then(_ => this.volcopy.applyVolLabels(
this.context.volNodes().map(n => n.target)))
.then(_ => this.context.sortHoldings())
autoId = -1;
- localOrgs: number[];
defaults: VolCopyDefaults = null;
copyStatuses: {[id: number]: IdlObject} = {};
bibParts: {[bibId: number]: IdlObject[]} = {};
if (this.commonData.acp_item_type_map) { return Promise.resolve(); }
- this.localOrgs = this.org.fullPath(this.auth.user().ws_ou(), true);
-
this.hideVolOrgs = this.org.list()
.filter(o => !this.org.canHaveVolumes(o)).map(o => o.id());
+ const orgIds: number[] = this.currentContext.orgNodes().map(n => n.target.id());
+
return this.net.request(
- 'open-ils.cat', 'open-ils.cat.volcopy.data', this.auth.token()
+ 'open-ils.cat', 'open-ils.cat.volcopy.data', this.auth.token(), orgIds
).pipe(tap(dataset => {
const key = Object.keys(dataset)[0];
this.commonData[key] = dataset[key];
desc => q|Returns a batch of org-scoped data types needed by the
volume/copy editor|,
params => [
- {desc => 'Authtoken', type => 'string'}
+ {desc => 'Authtoken', type => 'string'},
+ {desc => 'Alt Org Units. This overrides using just the authtoken org unit',
+ type => 'array'}
]
},
return => {desc => 'Stream of various object type lists', type => 'array'}
);
sub volcopy_data {
- my ($self, $client, $auth) = @_;
+ my ($self, $client, $auth, $alt_orgs) = @_;
my $e = new_editor(authtoken => $auth);
$e->checkauth or return $e->event;
- my $org_ids = $U->get_org_ancestors($e->requestor->ws_ou);
+
+ my $org_ids = [];
+
+ if ($alt_orgs) {
+ for my $org_id (@$alt_orgs) {
+ push(@$org_ids, @{$U->get_org_ancestors($org_id)});
+ }
+ } else {
+ $org_ids = $U->get_org_ancestors($e->requestor->ws_ou);
+ }
$client->respond({
acp_location => $e->search_asset_copy_location([