From: Tiffany Little Date: Wed, 11 Jan 2023 14:51:21 +0000 (-0500) Subject: LP2002425 Add an owners limiter to acqpro idlQueryAnd X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=70317d75c179fd6b0bb3c5f908fab26f3bb21837;p=evergreen%2Fpines.git LP2002425 Add an owners limiter to acqpro idlQueryAnd Signed-off-by: Tiffany Little --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/link-invoice-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/link-invoice-dialog.component.html index dc2646f60c..8190d300cd 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/link-invoice-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/link-invoice-dialog.component.html @@ -24,7 +24,7 @@ idlIncludeLibraryInLabel="owner" [required]="true" [asyncSupportsEmptyTermClick]="true" - [idlQueryAnd]="{active: 't'}" idlClass="acqpro"> + [idlQueryAnd]="{owner: owners, active: 't'}" idlClass="acqpro"> diff --git a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/link-invoice-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/link-invoice-dialog.component.ts index 83b238c3e9..ac250f7220 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/link-invoice-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/link-invoice-dialog.component.ts @@ -1,8 +1,11 @@ import {Component, Input, ViewChild, TemplateRef, OnInit} from '@angular/core'; -import {NgbModal} from '@ng-bootstrap/ng-bootstrap'; +import {Observable} from 'rxjs'; +import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap'; import {DialogComponent} from '@eg/share/dialog/dialog.component'; import {IdlService, IdlObject} from '@eg/core/idl.service'; import {ComboboxEntry} from '@eg/share/combobox/combobox.component'; +import {OrgService} from '@eg/core/org.service'; +import {AuthService} from '@eg/core/auth.service'; @Component({ selector: 'eg-acq-link-invoice-dialog', @@ -15,6 +18,21 @@ export class LinkInvoiceDialogComponent extends DialogComponent { provider: ComboboxEntry; invoice: ComboboxEntry; + owners: number[]; - constructor(private modal: NgbModal) { super(modal); } + + constructor( + private modal: NgbModal, + private org: OrgService, + private auth: AuthService + ) { super(modal); } + + open(args?: NgbModalOptions): Observable { + if (!args) { + args = {}; + } + this.owners = this.org.fullPath(this.auth.user().ws_ou(), true); + + return super.open(args); } +} \ No newline at end of file diff --git a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html index 44467a0371..8d8dd03cb0 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html @@ -57,7 +57,7 @@ [required]="true" [asyncSupportsEmptyTermClick]="true" idlIncludeLibraryInLabel="owner" - [idlQueryAnd]="{active: 't'}" idlClass="acqpro"> + [idlQueryAnd]="{owner: proOwners, active: 't'}" idlClass="acqpro"> diff --git a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts index 78c46ef341..6d603b3441 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts @@ -92,6 +92,8 @@ export class UploadComponent implements AfterViewInit, OnDestroy { selectedFile: File; newPO: number; + proOwners: number[]; + defaultMatchSet: string; createPurchaseOrder: boolean; @@ -189,6 +191,7 @@ export class UploadComponent implements AfterViewInit, OnDestroy { this.minQualityRatio = 0; this.recordType = 'bib'; this.formTemplates = {}; + this.proOwners = this.org.fullPath(this.auth.user().ws_ou(), true); if (this.vlagent.importSelection) { if (!this.vlagent.importSelection.queue) { diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/create.component.html b/Open-ILS/src/eg2/src/app/staff/acq/po/create.component.html index f65caa52be..9887987c49 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/po/create.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/po/create.component.html @@ -31,7 +31,7 @@ + [idlQueryAnd]="{owner: proOwners, active: 't'}" idlClass="acqpro">
diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/create.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/po/create.component.ts index 7655529608..73223c51aa 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/po/create.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/po/create.component.ts @@ -34,6 +34,7 @@ export class PoCreateComponent implements OnInit { origLiCount = 0; poName: string; orderAgency: number; + proOwners: number[]; provider: ComboboxEntry; prepaymentRequired = false; createAssets = false; @@ -59,6 +60,8 @@ export class PoCreateComponent implements OnInit { ngOnInit() { this.poService.currentPo = null; + this.proOwners = this.org.fullPath(this.auth.user().ws_ou(), true); + this.route.queryParamMap.subscribe((params: ParamMap) => { this.lineitems = params.getAll('li').map(id => Number(id)); this.origLiCount = this.lineitems.length;