LP2002425 Add an owners limiter to acqpro idlQueryAnd
authorTiffany Little <tlittle@georgialibraries.org>
Wed, 11 Jan 2023 14:51:21 +0000 (09:51 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 11 Jan 2023 14:59:33 +0000 (09:59 -0500)
Signed-off-by: Tiffany Little <tlittle@georgialibraries.org>
Open-ILS/src/eg2/src/app/staff/acq/lineitem/link-invoice-dialog.component.html
Open-ILS/src/eg2/src/app/staff/acq/lineitem/link-invoice-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html
Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts
Open-ILS/src/eg2/src/app/staff/acq/po/create.component.html
Open-ILS/src/eg2/src/app/staff/acq/po/create.component.ts

index dc2646f..8190d30 100644 (file)
@@ -24,7 +24,7 @@
             idlIncludeLibraryInLabel="owner"
             [required]="true"
             [asyncSupportsEmptyTermClick]="true"
-            [idlQueryAnd]="{active: 't'}" idlClass="acqpro">
+            [idlQueryAnd]="{owner: owners, active: 't'}" idlClass="acqpro">
           </eg-combobox>
         </div>
       </div>
index 83b238c..ac250f7 100644 (file)
@@ -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<any> {
+        if (!args) {
+          args = {};
+        }
+        this.owners = this.org.fullPath(this.auth.user().ws_ou(), true);
+
+        return super.open(args);
 }
+}
\ No newline at end of file
index 44467a0..8d8dd03 100644 (file)
@@ -57,7 +57,7 @@
         [required]="true"
         [asyncSupportsEmptyTermClick]="true"
         idlIncludeLibraryInLabel="owner"
-        [idlQueryAnd]="{active: 't'}" idlClass="acqpro">
+        [idlQueryAnd]="{owner: proOwners, active: 't'}" idlClass="acqpro">
       </eg-combobox>
     </div>
 
index 78c46ef..6d603b3 100644 (file)
@@ -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) {
index f65caa5..9887987 100644 (file)
@@ -31,7 +31,7 @@
     <eg-combobox domId="provider-input" [(ngModel)]="provider"
       [asyncSupportsEmptyTermClick]="true"
       idlIncludeLibraryInLabel="owner"
-      [idlQueryAnd]="{active: 't'}" idlClass="acqpro">
+      [idlQueryAnd]="{owner: proOwners, active: 't'}" idlClass="acqpro">
     </eg-combobox>
   </div>
   <div class="form-group form-check">
index 7655529..73223c5 100644 (file)
@@ -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;