<input [(ngModel)]="t.value1" type="number" *ngIf="searchTermDatatypes[t.field] == 'int'" class="form-control" />
<input [(ngModel)]="t.value1" type="number" *ngIf="searchTermDatatypes[t.field] == 'money'" class="form-control" />
<eg-org-select *ngIf="searchTermDatatypes[t.field] == 'org_unit'"
+ [initialOrgId]="t.value1"
(onChange)="setOrgUnitSearchValue($event, t)">
</eg-org-select>
<eg-combobox *ngIf="searchTermDatatypes[t.field] == 'link'"
import {Component, OnInit, AfterViewInit, ViewChild, ViewChildren, QueryList} from '@angular/core';
import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
-import {Router, ActivatedRoute, ParamMap} from '@angular/router';
+import {Router, ActivatedRoute, ParamMap, NavigationEnd} from '@angular/router';
import {StaffCommonModule} from '@eg/staff/common.module';
import {IdlService, IdlObject} from '@eg/core/idl.service';
import {PcrudService} from '@eg/core/pcrud.service';
private idl: IdlService,
) {
this.route.queryParamMap.subscribe((params: ParamMap) => {
+ this.urlSearchTerms = [];
const fields = params.getAll('f');
const ops = params.getAll('op');
const values1 = params.getAll('val1');
}
if (idx < values1.length) {
term.value1 = values1[idx];
+ if (term.value1 === 'null') {
+ // convert the string 'null' to a true
+ // null value, mostly for the benefit of the
+ // open invoices navigation link
+ term.value1 = null;
+ }
}
if (idx < values2.length) {
term.value2 = values2[idx];
}
this.urlSearchTerms.push(term);
+ this.ngOnInit(); // TODO: probably overkill
});
});
+ this.router.events.subscribe(routeEvent => {
+ if (routeEvent instanceof NavigationEnd) {
+ this.ngOnInit(); // TODO: probably overkill
+ }
+ });
}
ngOnInit() {
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item"
- href="/eg/staff/acq/legacy/search/unified?ca=pl">
+ routerLink="/staff/acq/search/selectionlists"
+ [queryParams]="{f: 'acqpl:owner', val1: user_id()}">
<span class="material-icons">view_list</span>
<span i18n>My Selection Lists</span>
</a>
<span i18n>Load MARC Order Records</span>
</a>
<a class="dropdown-item"
- href="/eg/staff/acq/legacy/search/unified?ca=po">
+ routerLink="/staff/acq/search/purchaseorders"
+ [queryParams]="{f: ['acqpo:ordering_agency','acqpo:state'], val1: [ws_ou(), 'on-order']}">
<span class="material-icons">shopping_cart</span>
<span i18n>Purchase Orders</span>
</a>
<span i18n>Claim-Ready Items</span>
</a>
<a class="dropdown-item"
- href="/eg/staff/acq/legacy/search/unified?ca=inv">
+ routerLink="/staff/acq/search/invoices"
+ [queryParams]="{f: ['acqinv:receiver', 'acqinv:close_date'], val1: [ws_ou(), null]}">
<span class="material-icons">attach_money</span>
<span i18n>Open Invoices</span>
</a>
return this.auth.user() ? this.auth.user().usrname() : '';
}
+ user_id() {
+ return this.auth.user() ? this.auth.user().id() : '';
+ }
+
workstation() {
return this.auth.user() ? this.auth.workstation() : '';
}
+ ws_ou() {
+ return this.auth.user() ? this.auth.user().ws_ou() : '';
+ }
+
setLocale(locale: any) {
this.locale.setLocale(locale.code());
}
</li>
<li class="divider"></li>
<li>
- <a href="./acq/legacy/search/unified?ca=pl" target="_self">
+ <a href="/eg2/staff/acq/search/selectionlists?f=acqpl:owner&val1={{user_id}}" target="_self">
<span class="glyphicon glyphicon-list"></span>
[% l('My Selection Lists') %]
</a>
</a>
</li>
<li>
- <a href="./acq/legacy/search/unified?ca=po" target="_self">
+ <a href="/eg2/staff/acq/search/purchaseorders?f=acqpo:ordering_agency&f=acqpo:state&val1={{ws_ou}}&val1=on-order" target="_self">
<span class="glyphicon glyphicon-shopping-cart"></span>
[% l('Purchase Orders') %]
</a>
</a>
</li>
<li>
- <a href="./acq/legacy/search/unified?ca=inv" target="_self">
+ <a href="/eg2/staff/acq/search/invoices?f=acqinv:receiver&f=acqinv:close_date&val1={{ws_ou}}&val1=null" target="_self">
<span class="glyphicon glyphicon-usd"></span>
[% l('Open Invoices') %]
</a>
if (egCore.auth.user()) {
$scope.op_changed = egCore.auth.OCtoken() ? true : false;
$scope.username = egCore.auth.user().usrname();
+ $scope.user_id = egCore.auth.user().id();
+ $scope.ws_ou = egCore.auth.user().ws_ou();
$scope.workstation = egCore.auth.workstation();
egCore.org.settings([