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',
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
selectedFile: File;
newPO: number;
+ proOwners: number[];
+
defaultMatchSet: string;
createPurchaseOrder: boolean;
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) {
<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">
origLiCount = 0;
poName: string;
orderAgency: number;
+ proOwners: number[];
provider: ComboboxEntry;
prepaymentRequired = false;
createAssets = false;
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;