}
disablePurge(): boolean {
- return
+ return (
+ !this.context.patron ||
this.context.patron.super_user() === 't' ||
- this.patronId === this.auth.user().id();
+ this.patronId === this.auth.user().id()
+ );
}
purgeAccount() {
holds: {
ready: number;
total: number;
- }
+ };
}
@Injectable()
stats.checkouts[key] = Number(stats.checkouts[key]));
stats.checkouts.total_out = stats.checkouts.out +
- stats.checkouts.overdue + stats.checkouts.long_overdue
+ stats.checkouts.overdue + stats.checkouts.long_overdue;
if (!this.noTallyClaimsReturned) {
stats.checkouts.total_out += stats.checkouts.claims_returned;
}
if (this.tallyLost) {
- stats.checkouts.total_out += stats.checkouts.lost
+ stats.checkouts.total_out += stats.checkouts.lost;
}
this.patronStats = stats;
return this.net.request(
'open-ils.circ',
'open-ils.circ.open_non_cataloged_circulation.user.authoritative',
- this.auth.token(), id).toPromise()
+ this.auth.token(), id).toPromise();
}).then(noncats => {
if (noncats && this.patronStats) {
}
// If true, show recently canceled holds only.
- @Input() showRecentlyCanceled: boolean = false;
+ @Input() showRecentlyCanceled = false;
// Include holds fulfilled on or after hte provided date.
// If no value is passed, fulfilled holds are not displayed.
const INCLUDE_INACTIVE = 'eg.circ.patron.search.include_inactive';
export interface PatronSearchField {
- value: any,
- group?: number
+ value: any;
+ group?: number;
}
export interface PatronSearchFieldSet {
- [field: string]: PatronSearchField
+ [field: string]: PatronSearchField;
}
export interface PatronSearch {
- search: PatronSearchFieldSet,
- orgId: number
+ search: PatronSearchFieldSet;
+ orgId: number;
}
@Component({
return user;
}
- // Absorbe a patron search object into the search form.
+ // Absorb a patron search object into the search form.
absorbPatronSearch(pSearch: PatronSearch) {
if (pSearch.orgId) {
Object.keys(this.search).forEach(field => {
search[field] = this.mapSearchField(field);
- if (field !== 'inactive') { // one filter is not enough
- if (search[field]) { hasSearch = true; }
+ if (search[field]) {
+ // one filter is not enough
+ if (field !== 'inactive') { hasSearch = true; }
+ } else {
+ delete search[field];
}
});