import {Component, EventEmitter, Input, Output, OnChanges, OnInit, ViewChild} from '@angular/core';
+import {Location} from '@angular/common';
import {Router} from '@angular/router';
import {Observable, from, of} from 'rxjs';
import {tap, switchMap, mergeMap} from 'rxjs/operators';
returnNotAppropriate: (rows: IdlObject[]) => boolean;
constructor(
+ private ngLocation: Location,
private auth: AuthService,
private format: FormatService,
private pcrud: PcrudService,
this.viewPatronRecord = (reservations: IdlObject[]) => {
const patronIds = reservations.map(reservation => reservation.usr().id());
- window.open('/eg/staff/circ/patron/' + patronIds[0] + '/checkout');
+ window.open(
+ this.ngLocation.prepareExternalUrl(
+ '/staff/circ/patron/' + patronIds[0] + '/checkout'
+ )
+ );
};
this.noSelectedRows = (rows: IdlObject[]) => (rows.length === 0);
<div class="col-lg-10 offset-lg-1 d-flex justify-content-center">
<span class="mt-2" i18n>
Placing hold for patron
- <a href="/eg/staff/circ/patron/{{holdForUser().id()}}/holds">
+ <a routerLink="/staff/circ/patron/{{holdForUser().id()}}/holds">
{{holdForUser().pref_family_name() || holdForUser().family_name()}},
{{holdForUser().pref_first_given_name() || holdForUser().first_given_name()}}
</a>.
Created {{summary.record.create_date() | date:'shortDate'}} by
<!-- creator if fleshed after the initial data set is loaded -->
<a *ngIf="summary.record.creator().usrname" target="_self"
- href="/eg/staff/circ/patron/{{summary.record.creator().id()}}/checkout">
+ routerLink="/staff/circ/patron/{{summary.record.creator().id()}}/checkout">
{{summary.record.creator().usrname()}}
</a>
<!-- add a spacer pending data to reduce page shuffle -->
<div class="float-right small-text-1" i18n>
Edited {{summary.record.edit_date() | date:'shortDate'}} by
<a *ngIf="summary.record.editor().usrname" target="_self"
- href="/eg/staff/circ/patron/{{summary.record.editor().id()}}/checkout">
+ routerLink="/staff/circ/patron/{{summary.record.editor().id()}}/checkout">
{{summary.record.editor().usrname()}}
</a>
<span *ngIf="!summary.record.editor().usrname"> ... </span>
<ul class="list-group list-group-flush">
<li class="list-group-item" i18n>
Item was last checked out by patron
- <a href="/eg/staff/circ/patron/{{chargeResponse.circ.usr().id()}}/checkout">
+ <a routerLink="/staff/circ/patron/{{chargeResponse.circ.usr().id()}}/checkout">
{{chargeResponse.circ.usr().family_name()}},
{{chargeResponse.circ.usr().first_given_name()}}
({{chargeResponse.circ.usr().usrname()}})
<div class="well-row">
<div class="well-label" i18n>Patron Name</div>
<div class="well-value">
- <a href="/eg/staff/circ/patron/{{hold.usr_id}}/checkout">
+ <a routerLink="/staff/circ/patron/{{hold.usr_id}}/checkout">
{{hold.usr_display_name}}
</a>
</div>
<!-- force consistent width -->
<div class="well-label" i18n>Patron Barcode</div>
<div class="well-value">
- <a href="/eg/staff/circ/patron/{{hold.usr_id}}/checkout">
+ <a routerLink="/staff/circ/patron/{{hold.usr_id}}/checkout">
{{hold.ucard_barcode}}
</a>
</div>
datatype="timestamp" [datePlusTime]="true"></eg-grid-column>
<ng-template #userBarcodeTmpl let-hold="row">
- <a href="/eg/staff/circ/patron/{{hold.usr_id}}/checkout" target="_blank">
+ <a routerLink="/staff/circ/patron/{{hold.usr_id}}/checkout" target="_blank">
{{hold.ucard_barcode}}
</a>
</ng-template>
showPatron(rows: any[]) {
const usrIds = Array.from(new Set( rows.map(r => r.usr_id).filter( usr_id => Boolean(usr_id)) ));
usrIds.forEach( usrId => {
- const url =
- '/eg/staff/circ/patron/' + usrId + '/checkout';
- window.open(url, '_blank');
+ window.open(
+ this.ngLocation.prepareExternalUrl(
+ '/staff/circ/patron/' + usrId + '/checkout'
+ )
+ );
});
}
label="[% l('Retrieve Patron') %]"></eg-grid-action>
<eg-grid-field label="[% l('Barred') %]" path='usr.barred'></eg-grid-field>
<eg-grid-field label="[% l('Barcode') %]" path="usr.card.barcode">
- <a href="./circ/patron/{{item.usr.id()}}/checkout/" target="_blank">
+ <a href="/eg2/staff/circ/patron/{{item.usr.id()}}/checkout/">
{{item.usr.card().barcode()}}
</a>
</eg-grid-field>
<eg-grid-field label="[% l('First Name') %]" path="first_given_name" visible></eg-grid-field>
<eg-grid-field label="[% l('Last Name') %]" path="family_name" visible></eg-grid-field>
<eg-grid-field label="[% l('Barcode') %]" path='card.barcode' visible>
- <a target="_self" href="[% ctx.base_path %]/staff/circ/patron/{{item['id']}}/holds">
+ <a href="/eg2/staff/circ/patron/{{item['id']}}/holds">
{{item['card.barcode']}}
</a>
</eg-grid-field>
<eg-grid-field label="[% l('First Name') %]" path="first_given_name" visible></eg-grid-field>
<eg-grid-field label="[% l('Last Name') %]" path="family_name" visible></eg-grid-field>
<eg-grid-field label="[% l('Barcode') %]" path='card.barcode' visible>
- <a target="_self" href="[% ctx.base_path %]/staff/circ/patron/{{item['id']}}/holds">
+ <a href="/eg2/staff/circ/patron/{{item['id']}}/holds">
{{item['card.barcode']}}
</a>
</eg-grid-field>
<span> / [% l('Created {{bucket().create_time() | date:egDateAndTimeFormat}}') %]</span>
<span ng-show="bucket()._owner_name"> /
{{bucket()._owner_name}}
- <a target="_self" href="./circ/patron/{{bucket().owner()}}/checkout">
+ <a href="/eg2/staff/circ/patron/{{bucket().owner()}}/checkout">
({{bucket()._owner_ident}})
</a>
@ {{bucket()._owner_ou}}
<div class="row" ng-show="!isMaxCircHistoryZero" ng-repeat="circ in circ_list">
<div class="flex-row">
<div class="flex-cell well">
- <a ng-if="circ.usr()" target="_self"
- href="./circ/patron/{{circ.usr().id()}}/checkout">
+ <a ng-if="circ.usr()"
+ href="/eg2/staff/circ/patron/{{circ.usr().id()}}/checkout">
[% l('[_1], [_2] [_3] : [_4]',
'{{circ.usr().family_name()}}'
'{{circ.usr().first_given_name()}}'
<div class="flex-cell">[% l('Check Out Staff') %]</div>
<div class="flex-cell well">
<a ng-if="circ.circ_staff()" target="_blank"
- href="./circ/patron/{{circ.circ_staff().id()}}/checkout">
+ href="/eg2/staff/circ/patron/{{circ.circ_staff().id()}}/checkout">
{{circ.circ_staff().usrname()}}
</a>
</div>
<div class="flex-row">
<div class="flex-cell">[% l('Patron') %]</div>
<div class="flex-cell well">
- <a href="./circ/patron/{{prev_circ_usr.id()}}/checkout"
- ng-if="prev_circ_usr" target="_self">
+ <a href="/eg2/staff/circ/patron/{{prev_circ_usr.id()}}/checkout"
+ ng-if="prev_circ_usr">
[% l('[_1], [_2] [_3] : [_4]',
'{{prev_circ_usr.family_name()}}'
'{{prev_circ_usr.first_given_name()}}'
<div class="flex-row">
<div class="flex-cell">[% l('Patron') %]</div>
<div class="flex-cell well">
- <a href="./circ/patron/{{circ.usr().id()}}/checkout"
- ng-if="circ.usr()" target="_self">
+ <a href="/eg2/staff/circ/patron/{{circ.usr().id()}}/checkout"
+ ng-if="circ.usr()">
[% l('[_1], [_2] [_3] : [_4]',
'{{circ.usr().family_name()}}'
'{{circ.usr().first_given_name()}}'
<div class="flex-row">
<div class="flex-cell">[% l('Patron') %]</div>
<div class="flex-cell well">
- <a href="./circ/patron/{{hold.usr().id()}}/checkout"
- ng-if="hold" target="_self">
+ <a href="/eg2/staff/circ/patron/{{hold.usr().id()}}/checkout"
+ ng-if="hold">
[% l('[_1], [_2] [_3] : [_4]',
'{{hold.usr().family_name()}}'
'{{hold.usr().first_given_name()}}'
<div class="flex-row">
<div class="flex-cell">[% l('Requestor') %]</div>
<div class="flex-cell well">
- <a href="./circ/patron/{{hold.requestor().id()}}/checkout"
- ng-if="hold" target="_self">
+ <a href="/eg2/staff/circ/patron/{{hold.requestor().id()}}/checkout"
+ ng-if="hold">
[% l('[_1], [_2] [_3] : [_4]',
'{{hold.requestor().family_name()}}'
'{{hold.requestor().first_given_name()}}'
<eg-grid-field label="[% l('Created By') %]"
path="creator" hidden>
- <a target="_blank" href="[% ctx.base_path %]/staff/circ/patron/{{item['creator.id']}}/checkout">
+ <a href="/eg2/staff/circ/patron/{{item['creator.id']}}/checkout">
{{item['creator.usrname']}} <span ng-show="item['creator.id']" class="glyphicon glyphicon-new-window"></span>
</a>
</eg-grid-field>
<span class="pad-horiz alert alert-danger">{{fine_total | currency}}</span>
<span ng-if="billable_barcode">
<!-- note: this forces a new tab -->
- <a href='./circ/patron/{{billable_user_id}}/bills' target='_blank'>
+ <a href='/eg2/staff/circ/patron/{{billable_user_id}}/bills'>
<span>[% l('Transaction for [_1] billed:', '{{billable_barcode}}') %]</span>
</a>
<span class="pad-horiz alert alert-danger">{{billable_amount | currency}}</span>
<eg-grid-field label="[% l('Pickup Date/Time') %]" path="slot.slot" datatype="timestamp"></eg-grid-field>
<eg-grid-field label="[% l('Patron') %]" path="slot.patron" compiled handlers="gridCellHandlers">
- <a href="./circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
+ <a href="/eg2/staff/circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
{{item.slot.patron().family_name()}} / {{item.slot.patron().card().barcode()}}
<span class="glyphicon glyphicon-new-window"></span>
</a>
<eg-grid-field label="[% l('Delivery Date/Time') %]" path="slot.delivered" datatype="timestamp"></eg-grid-field>
<eg-grid-field label="[% l('Patron') %]" path="slot.patron" compiled>
- <a href="./circ/patron/{{item.slot.patron().id()}}/items_out" target="_blank">
+ <a href="/eg2/staff/circ/patron/{{item.slot.patron().id()}}/items_out" target="_blank">
{{item.slot.patron().family_name()}} / {{item.slot.patron().card().barcode()}}
<span class="glyphicon glyphicon-new-window"></span>
</a>
<eg-grid-field label="[% l('Pickup Date/Time') %]" path="slot.slot" datatype="timestamp"></eg-grid-field>
<eg-grid-field label="[% l('Patron') %]" path="slot.patron" compiled handlers="gridCellHandlers">
- <a href="./circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
+ <a href="/eg2/staff/circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
{{item.slot.patron().family_name()}} / {{item.slot.patron().card().barcode()}}
<span class="glyphicon glyphicon-new-window"></span>
</a>
<eg-grid-field label="[% l('Pickup Date/Time') %]" path="slot.slot" datatype="timestamp"></eg-grid-field>
<eg-grid-field label="[% l('Patron') %]" path="slot.patron" compiled handlers="gridCellHandlers">
- <a href="./circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
+ <a href="/eg2/staff/circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
{{item.slot.patron().family_name()}} / {{item.slot.patron().card().barcode()}}
<span class="glyphicon glyphicon-new-window"></span>
</a>
<eg-grid-field name="patron_id" path="usr.id" hidden required></eg-grid-field>
<eg-grid-field name="patron_barcode" path="usr.card.barcode"
hidden label="[% l('Patron Barcode') %]">
- <a href="./circ/patron/{{item.patron_id}}/holds" target="_self">
+ <a href="/eg2/staff/circ/patron/{{item.patron_id}}/holds">
{{item.patron_barcode}}
</a>
</eg-grid-field>
<eg-grid-field label="[% l('Barcode') %]"
path="card.barcode" visible>
- <a target="_self" href="[% ctx.base_path %]/staff/circ/patron/{{item.id}}/edit">
+ <a href="/eg2/staff/circ/patron/{{item.id}}/edit">
{{item['card.barcode']}}
</a>
</eg-grid-field>
<eg-grid-field label="[% l('Barcode') %]"
path="card.barcode" visible>
- <a target="_self" href="[% ctx.base_path %]/staff/circ/patron/{{item.id}}/edit">
+ <a href="/eg2/staff/circ/patron/{{item.id}}/edit">
{{item['card.barcode']}}
</a>
</eg-grid-field>
<div ng-if="copy_barcode" class="strong-text-2">{{copy_barcode}}</div>
{{evt.desc}}
<div ng-if="evt.textcode == 'ITEM_ON_HOLDS_SHELF'">
- <a target="_blank" href="[% ctx.base_path %]/staff/circ/patron/{{patronID}}/checkout">{{patronName}}</a>.
+ <a target="_blank" href="/eg2/staff/circ/patron/{{patronID}}/checkout">{{patronName}}</a>.
<div>
<label><input type="checkbox" ng-model="formdata.clearHold"/>
[% l('Cancel this hold upon checkout?') %]</label>
</div>
<div class="panel-body">
<div>
- <a target="_self" href="./circ/patron/bcsearch">
+ <a href="/eg2/staff/circ/patron/bcsearch">
<img src="[% ctx.media_prefix %]/images/portal/forward.png" alt="" role="presentation"/>
[% l('Check Out Items') %]
</a>
</a>
</div>
<div>
- <a target="_self" href="./circ/patron/search">
+ <a href="/eg2/staff/circ/patron/search">
<img src="[% ctx.media_prefix %]/images/portal/retreivepatron.png" alt="" role="presentation"/>
[% l('Search For Patron By Name') %]
</a>