<span i18n>Finalize Blanket Order</span>
</a>
</ng-container>
+ <ng-container *ngIf="showLegacyLinks">
+ <span class="pl-2 pr-2" i18n> | </span>
+ <a href="/eg/staff/acq/legacy/po/view/{{poId}}" target="_blank">
+ Show PO in Legacy Interface
+ </a>
+ </ng-container>
</div>
</div>
zeroCopyActivate = false;
canActivate: boolean = null;
canFinalize = false;
+ showLegacyLinks = false;
activationBlocks: EgEvent[] = [];
activationEvent: EgEvent;
})
.then(_ => this.setCanActivate())
- .then(_ => this.setCanFinalize());
+ .then(_ => this.setCanFinalize())
+ .then(_ => this.loadUiPrefs());
}
// Can run via Enter or blur. If it just ran via Enter, avoid
.subscribe(_ => this.canFinalize = true);
}
+ loadUiPrefs() {
+ return this.store.getItemBatch(['ui.staff.acq.show_deprecated_links'])
+ .then(settings => {
+ this.showLegacyLinks = settings['ui.staff.acq.show_deprecated_links'];
+ });
+ }
+
finalizePo() {
this.confirmFinalize.open().subscribe(confirmed => {
[ngModelOptions]="{standalone: true}" [(ngModel)]="runImmediately"/>
<label for="retrieve-immediately" class="form-check-label" i18n>Retrieve Results Immediately</label>
</div>
- <div class="col-xs-3 pl-2" *ngIf="showExpAngOptions()">
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox"
- name="show-exp-ang-links" id="show-exp-ang-links"
- (change)="toggleExpSearchLinks()" [ngModel]="showExpAngLinks()"/>
- <label class="form-check-label" for="show-exp-ang-links" i18n>
- Activate Experimental Links
- </label>
- </div>
- </div>
</div>
</form>
</div>
import {PcrudService} from '@eg/core/pcrud.service';
import {StringComponent} from '@eg/share/string/string.component';
import {ToastService} from '@eg/share/toast/toast.service';
-import {AcqSearchService, AcqSearchTerm, AcqSearch} from './acq-search.service';
+import {AcqSearchTerm, AcqSearch} from './acq-search.service';
import {ServerStoreService} from '@eg/core/server-store.service';
@Component({
private pcrud: PcrudService,
private store: ServerStoreService,
private idl: IdlService,
- private toast: ToastService,
- private acqSearch: AcqSearchService
+ private toast: ToastService
) {}
ngOnInit() {
saveRunImmediately() {
return this.store.setItem(this.runImmediatelySetting, this.runImmediately);
}
-
- showExpAngOptions(): boolean {
- return this.acqSearch.angSelectionEnabled;
- }
-
- showExpAngLinks(): boolean {
- return this.acqSearch.angSearchLinksEnabled;
- }
-
- toggleExpSearchLinks() {
- this.acqSearch.angSearchLinksEnabled = !this.acqSearch.angSearchLinksEnabled;
- this.store.setItem('ui.staff.angular_acq_search.enabled',
- this.acqSearch.angSearchLinksEnabled);
- }
}
import {IdlObject} from '@eg/core/idl.service';
import {EventService} from '@eg/core/event.service';
import {AttrDefsService} from './attr-defs.service';
-import {ServerStoreService} from '@eg/core/server-store.service';
const baseIdlClass = {
lineitem: 'jub',
_conjunction = 'all';
firstRun = true;
- angSelectionEnabled = false;
- angSearchLinksEnabled = false;
-
constructor(
private net: NetService,
private evt: EventService,
private auth: AuthService,
private pcrud: PcrudService,
- private serverStore: ServerStoreService,
private attrDefs: AttrDefsService
) {
this.firstRun = true;
return gridSource;
}
- loadUiPrefs(): Promise<any> {
- return this.serverStore.getItemBatch([
- 'ui.staff.angular_acq_selection.enabled',
- 'ui.staff.angular_acq_search.enabled'
- ]).then(sets => {
- this.angSelectionEnabled = sets['ui.staff.angular_acq_selection.enabled'];
- this.angSearchLinksEnabled =
- sets['ui.staff.angular_acq_search.enabled'] && this.angSelectionEnabled;
- });
- }
}
<ng-template #idTmpl let-lineitem="row">
- <ng-container *ngIf="showExpAngLinks(); else legacyId">
+ <ng-container>
<a *ngIf="lineitem.purchase_order()"
routerLink="/staff/acq/po/{{lineitem.purchase_order().id()}}"
fragment="{{lineitem.id()}}" target="_blank">
</a>
</ng-container>
- <ng-template #legacyId>
-
- <a *ngIf="lineitem.purchase_order()"
- routerLink="/staff/acq/po/{{lineitem.purchase_order().id()}}" fragment="{{lineitem.id()}}"
- target="_blank">
- {{lineitem.id()}}
- </a>
- <a *ngIf="lineitem.picklist() && !lineitem.purchase_order()"
- href="/eg/staff/acq/legacy/picklist/view/{{lineitem.picklist().id()}}?focus_li={{lineitem.id()}}"
- target="_blank">
- {{lineitem.id()}}
- </a>
- </ng-template>
</ng-template>
<ng-template #poTmpl let-lineitem="row">
- <ng-container *ngIf="showExpAngLinks(); else legacyPo">
+ <ng-container>
<a *ngIf="lineitem.purchase_order()"
routerLink="/staff/acq/po/{{lineitem.purchase_order().id()}}"
fragment="{{lineitem.id()}}" target="_blank">
{{lineitem.purchase_order().name()}}
</a>
</ng-container>
- <ng-template #legacyPo>
- <a *ngIf="lineitem.purchase_order()"
- routerLink="/staff/acq/po/{{lineitem.purchase_order().id()}}" fragment="{{lineitem.id()}}"
- target="_blank">
- {{lineitem.purchase_order().name()}}
- </a>
- </ng-template>
</ng-template>
<ng-template #plTmpl let-lineitem="row">
- <ng-container *ngIf="showExpAngLinks(); else legacyPl">
+ <ng-container>
<a *ngIf="lineitem.picklist()"
routerLink="/staff/acq/picklist/{{lineitem.picklist().id()}}"
fragment="{{lineitem.id()}}" target="_blank">
{{lineitem.picklist().name()}}
</a>
</ng-container>
-
- <ng-template #legacyPl>
- <a *ngIf="lineitem.picklist()"
- href="/eg/staff/acq/legacy/picklist/view/{{lineitem.picklist().id()}}?focus_li={{lineitem.id()}}"
- target="_blank">
- {{lineitem.picklist().name()}}
- </a>
- </ng-template>
</ng-template>
<ng-template #liAttrTmpl let-lineitem="row" let-col="col">
<a routerLink="/staff/catalog/record/{{lineitem.eg_bib_id()}}"
target="_blank" i18n>Catalog</a></li>
<li>
- <ng-container *ngIf="showExpAngLinks(); else legacyWs">
- <a routerLink="/staff/acq/lineitem/{{lineitem.id()}}/worksheet"
+ <ng-container>
+ <a routerLink="/staff/acq/po/{{lineitem.purchase_order().id()}}/lineitem/{{lineitem.id()}}/worksheet"
target="_blank" i18n>Worksheet</a>
</ng-container>
- <ng-template #legacyWs>
- <a href="/eg/staff/acq/legacy/lineitem/worksheet/{{lineitem.id()}}"
- target="_blank" i18n>Worksheet</a>
- </ng-template>
</li>
<li *ngIf="lineitem.purchase_order()">
- <ng-container *ngIf="showExpAngLinks(); else legacyPo2">
+ <ng-container>
<a routerLink="/staff/acq/po/{{lineitem.purchase_order().id()}}"
target="_blank" i18n>Purchase Order</a>
</ng-container>
- <ng-template #legacyPo2>
- <a routerLink="/staff/acq/po/{{lineitem.purchase_order().id()}}"
- target="_blank" i18n>Purchase Order</a>
- </ng-template>
</li>
<li><a href="/eg/staff/acq/requests/lineitem/{{lineitem.id()}}"
target="_blank" i18n>Requests</a></li>
<a routerLink="/staff/cat/vandelay/queue/bib/{{lineitem.queued_record().queue()}}"
target="_blank" i18n>Queue</a></li>
<li *ngIf="lineitem.picklist()">
- <ng-container *ngIf="showExpAngLinks(); else legacyPl2">
+ <ng-container>
<a routerLink="/staff/acq/picklist/{{lineitem.picklist().id()}}"
target="_blank" i18n>Selection List</a>
</ng-container>
- <ng-template #legacyPl2>
- <a href="/eg/staff/acq/legacy/picklist/view/{{lineitem.picklist().id()}}"
- target="_blank" i18n>Selection List</a>
- </ng-template>
</li>
</ul>
</ng-template>
}
showRow(row: any) {
- window.open('/eg/staff/acq/legacy/lineitem/worksheet/' + row.id(), '_blank');
- }
-
- showExpAngLinks(): boolean {
- return this.acqSearch.angSearchLinksEnabled;
+ window.open('/eg2/staff/acq/po/' + row.purchase_order().id() +
+ '/lineitem/' + row.id() + '/worksheet', '_blank');
}
}
</eg-string>
<ng-template #nameTmpl let-selectionlist="row">
- <ng-container *ngIf="showExpAngLinks(); else legacyLinks">
+ <ng-container>
<a routerLink="/staff/acq/picklist/{{selectionlist.id()}}" target="_blank">
{{selectionlist.name()}}
</a>
</ng-container>
- <ng-template #legacyLinks>
- <a href="/eg/staff/acq/legacy/picklist/view/{{selectionlist.id()}}"
- target="_blank">
- {{selectionlist.name()}}
- </a>
- </ng-template>
</ng-template>
<eg-picklist-create-dialog #picklistCreateDialog>
};
}
- showExpAngOptions(): boolean {
- return this.acqSearch.angSelectionEnabled;
- }
-
- showExpAngLinks(): boolean {
- return this.acqSearch.angSearchLinksEnabled;
- }
-
openCreateDialog() {
this.picklistCreateDialog.open().subscribe(
modified => {
}
showRow(row: any) {
- window.open('/eg/staff/acq/legacy/picklist/view/' + row.id(), '_blank');
+ window.open('/eg2/staff/acq/picklist/' + row.id(), '_blank');
}
doSearch(search: AcqSearch) {
defaultSearchSetting="eg.acq.search.default.purchaseorders"></eg-acq-search-form>
<ng-template #nameTmpl let-purchaseorder="row">
- <ng-container *ngIf="showExpAngLinks(); else legacyPo">
+ <ng-container>
<a routerLink="/staff/acq/po/{{purchaseorder.id()}}" target="_blank">
{{purchaseorder.name()}}
</a>
</ng-container>
- <ng-template #legacyPo>
- <a routerLink="/staff/acq/po/{{purchaseorder.id()}}" target="_blank">
- {{purchaseorder.name()}}
- </a>
- </ng-template>
</ng-template>
<ng-template #providerTmpl let-purchaseorder="row">
this.purchaseOrderResultsGrid.reload();
});
}
-
- showExpAngLinks(): boolean {
- return this.acqSearch.angSearchLinksEnabled;
- }
-
}
import {Router, Resolve, RouterStateSnapshot,
ActivatedRouteSnapshot} from '@angular/router';
import {AttrDefsService} from './attr-defs.service';
-import {AcqSearchService} from './acq-search.service';
@Injectable()
export class AttrDefsResolver implements Resolve<Promise<any[]>> {
constructor(
private router: Router,
- private attrDefs: AttrDefsService,
- private acqSearch: AcqSearchService
+ private attrDefs: AttrDefsService
) {}
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Promise<any[]> {
- return this.attrDefs.fetchAttrDefs()
- .then(_ => this.acqSearch.loadUiPrefs());
+ return Promise.all([
+ this.attrDefs.fetchAttrDefs()
+ ]);
}
}
'webstaff.format.date_and_time',
'ui.staff.max_recent_patrons',
'circ.curbside', // navbar
- 'ui.staff.angular_acq_selection.enabled', // navbar
'ui.staff.angular_catalog.enabled' // navbar
]).then(settings => {
// Avoid clobbering defaults
INSERT INTO config.org_unit_setting_type (name, grp, datatype, label)
VALUES (
- 'ui.staff.angular_acq_selection.enabled', 'gui', 'bool',
+ 'ui.staff.acq.show_deprecated_links', 'gui', 'bool',
oils_i18n_gettext(
- 'ui.staff.angular_acq_selection.enabled',
- 'Enable Experimental ACQ Selection/Purchase Interfaces',
+ 'ui.staff.acq.show_deprecated_links',
+ 'Display Links to Deprecated Acquisitions Interfaces',
'cwst', 'label'
)
);
)
);
-INSERT INTO config.org_unit_setting_type (name, grp, datatype, label)
-VALUES (
- 'ui.staff.angular_acq_selection.enabled', 'gui', 'bool',
- oils_i18n_gettext(
- 'ui.staff.angular_acq_selection.enabled',
- 'Enable Experimental ACQ Selection/Purchase Interfaces',
- 'cwst', 'label'
- )
-);
-
-
INSERT INTO config.print_template
(id, name, label, owner, active, locale, template)
VALUES (
)
);
+INSERT INTO config.org_unit_setting_type (name, grp, datatype, label)
+VALUES (
+ 'ui.staff.acq.show_deprecated_links', 'gui', 'bool',
+ oils_i18n_gettext(
+ 'ui.staff.acq.show_deprecated_links',
+ 'Display Links to Deprecated Acquisitions Interfaces',
+ 'cwst', 'label'
+ )
+);
+
COMMIT;
</ul>
</li>
- <!-- acquisitions experimental -->
- <li class="dropdown" uib-dropdown>
- <a href uib-dropdown-toggle>[% l('Acquisitions (Experimental)') %]<b class="caret"
- aria-hidden="true"></b>
- </a>
- <ul uib-dropdown-menu>
- <li>
- <a href="/eg2/staff/acq/po/create">
- <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
- [% l('Create Purchase Order') %]
- </a>
- </li>
- </ul>
- </li>
-
-
<!-- booking -->
<li class="dropdown" uib-dropdown>
<a href uib-dropdown-toggle>[% l('Booking') %]<b class="caret"
egCore.org.settings([
'ui.staff.max_recent_patrons',
'ui.staff.angular_catalog.enabled',
- 'ui.staff.angular_acq_selection.enabled',
'circ.curbside'
]).then(function(s) {
var val = s['ui.staff.max_recent_patrons'];
$scope.showAngularCatalog =
s['ui.staff.angular_catalog.enabled'];
- $scope.showAngularAcq =
- s['ui.staff.angular_acq_selection.enabled'];
$scope.enableCurbside =
s['circ.curbside'];
}).then(function() {