const children = profiles.filter(p => p.parent() === grp.id());
children.forEach(child => traverseTree(child, failed));
- }
+ };
return this.perms.hasWorkPermAt(appPerms, true).then(orgs => {
appPerms.forEach(p => {
.then(_ => {
const requestor = this.stageUser.user.requesting_usr();
- if (!requestor) return;
-
- return this.pcrud.retrieve('au', requestor).toPromise();
+ if (requestor) {
+ return this.pcrud.retrieve('au', requestor).toPromise();
+ }
})
.then(reqr => this.stageUserRequestor = reqr)
const stageData = this.stageUser;
const patron = this.patron;
- for (let key in this.idl.classes.stgu.field_map) {
+ Object.keys(this.idl.classes.stgu.field_map).forEach(key => {
const field = this.idl.classes.au.field_map[key];
if (field && !field.virtual) {
const value = stageData.user[key]();
patron[key](value);
}
}
- };
+ });
// Clear the usrname if it looks like a UUID
- if (patron.usrname().replace(/-/g,'').match(/[0-9a-f]{32}/)) {
+ if (patron.usrname().replace(/-/g, '').match(/[0-9a-f]{32}/)) {
patron.usrname('');
}
this.strings.interpolate('circ.patron.edit.default_addr_type')
.then(msg => addr.address_type(msg));
- for (let key in this.idl.classes[cls].field_map) {
+ Object.keys(this.idl.classes[cls].field_map).forEach(key => {
const field = this.idl.classes.aua.field_map[key];
if (field && !field.virtual) {
const value = stageAddr[key]();
addr[key](value);
}
}
- }
+ });
patron.addresses().push(addr);
} else {
patron.billing_address(addr);
}
- }
+ };
addrFromStage(stageData.mailing_addresses[0]);
addrFromStage(stageData.billing_addresses[0]);
- if (patron.addresses().length == 1) {
+ if (patron.addresses().length === 1) {
// Only one address, use it for both purposes.
const addr = patron.addresses()[0];
patron.mailing_address(addr);
const patron = this.patron;
// flesh the home org locally
- patron.home_ou(clone.home_ou())
+ patron.home_ou(clone.home_ou());
if (!clone.billing_address() &&
!clone.mailing_address()) {
newAddr.valid('t');
patron.addresses().push(newAddr);
return newAddr;
- }
+ };
if (billAddr = clone.billing_address()) {
patron.billing_address(cloneAddr(billAddr));
if (mailAddr = clone.mailing_address()) {
- if (billAddr && billAddr.id() == mailAddr.id()) {
+ if (billAddr && billAddr.id() === mailAddr.id()) {
patron.mailing_address(patron.billing_address());
} else {
patron.mailing_address(cloneAddr(mailAddr));
if (addr = clone.mailing_address()) {
if (patron.billing_address() &&
- addr.id() == patron.billing_address().id()) {
+ addr.id() === patron.billing_address().id()) {
// mailing matches billing
patron.mailing_address(patron.billing_address());
} else {
this.holdNotifyValues.other_phone = this.patron.other_phone();
this.holdNotifyValues.evening_phone = this.patron.evening_phone();
- this.patron.settings().forEach(setting => {
- const value = setting.value();
+ this.patron.settings().forEach(stg => {
+ const value = stg.value();
if (value !== '' && value !== null) {
- usets[setting.name()] = JSON.parse(value);
+ usets[stg.name()] = JSON.parse(value);
}
});
this.net.request(
'open-ils.search', 'open-ils.search.zip', postCode
).subscribe(resp => {
- if (!resp) return;
+ if (!resp) { return; }
['city', 'state', 'county'].forEach(field => {
if (resp[field]) {
newValue = this.patron[field]();
} else if (matches = field.match(/(\w+)_notify/)) {
- const holdNotify = this.userSettings['opac.hold_notify'] || '';
- newValue = holdNotify.match(matches[1]) !== null;
+ const notify = this.userSettings['opac.hold_notify'] || '';
+ newValue = notify.match(matches[1]) !== null;
}
const oldValue = this.holdNotifyValues[field];
oldValue: oldValue,
holds: holds
});
- };
+ }
}));
})).toPromise().then(_ => mods);
}
@ViewChild('mainGrid') private mainGrid: GridComponent;
@ViewChild('archiveGrid') private archiveGrid: GridComponent;
@ViewChild('penaltyDialog')
- private penaltyDialog: PatronPenaltyDialogComponent
+ private penaltyDialog: PatronPenaltyDialogComponent;
constructor(
private org: OrgService,
ngOnInit() {
- const orgIds = this.org.fullPath(this.auth.user().ws_ou(), true);
+ const orgIds = this.org.fullPath(this.auth.user().ws_ou(), true);
const start = new Date();
start.setFullYear(start.getFullYear() - 1);
flesh.order_by = orderBy;
return this.pcrud.search('ausp', query, flesh, {authoritative: true});
- }
+ };
this.archiveDataSource.getRows = (pager: Pager, sort: any[]) => {
const orderBy: any = {ausp: 'set_date'};
flesh.order_by = orderBy;
return this.pcrud.search('ausp', query, flesh, {authoritative: true});
- }
+ };
}
dateRange(): string[] {
let endDate = this.endDateYmd;
const today = DateUtil.localYmdFromDate();
- if (endDate == today) { endDate = 'now'; }
+ if (endDate === today) { endDate = 'now'; }
return [this.startDateYmd, endDate];
}