// patron tab is open. Wait until we know it's defined.
if (tb) {
tb.saveClicked.subscribe(_ => this.save());
- tb.saveCloneClicked.subscribe(_ => this.saveClone());
+ tb.saveCloneClicked.subscribe(_ => this.save(true));
tb.printClicked.subscribe(_ => this.printPatron());
}
}
return this.patron.addresses().filter(a => !a.isdeleted());
}
- save(): Promise<any> {
+ save(clone?: boolean): Promise<any> {
// TODO clear unload prompt
.then(_ => this.saveUserSettings())
.then(_ => this.updateHoldPrefs())
.then(_ => this.removeStagedUser())
- .then(_ => this.postSaveRedirect());
+ .then(_ => this.postSaveRedirect(clone));
}
- postSaveRedirect() {
+ postSaveRedirect(clone: boolean) {
if (this.stageUser) {
this.broadcaster.broadcast('eg.pending_usr.update',
return;
}
- window.location.href = window.location.href;
- }
+ if (clone) {
+ this.context.patron = null;
+ this.router.navigate(
+ ['/staff/circ/patron/register/clone', this.modifiedPatron.id()]);
- saveClone() {
- // TODO
+ } else {
+ // Full refresh to force reload of modified patron data.
+ window.location.href = window.location.href;
+ }
}
// Resolves on success, rejects on error
</eg-grid-column>
</eg-grid>
-<hr class="mt-4 mb-2"/>
-
-<div class="row mt-4 mb-2">
+<div class="row mt-5 mb-2">
<div class="col-lg-4">
<h3 i18n>Archived Penalties / Messages</h3>
</div>
+ <div class="col-lg-4 form-inline">
+ <label class="mr-2" i18n>Start Date:</label>
+ <eg-date-select [initialIso]="startDateYmd"
+ (onChangeAsIso)="dateChange($event, true)"></eg-date-select>
+ </div>
+ <div class="col-lg-4 form-inline">
+ <label class="mr-2" i18n>End Date:</label>
+ <eg-date-select [initialIso]="endDateYmd"
+ (onChangeAsIso)="dateChange($event, false)"></eg-date-select>
+ </div>
</div>
<eg-grid #archiveGrid idlClass="ausp" [dataSource]="archiveDataSource"