[sortable]="true" persistKey="booking.current_reservations" >
<eg-grid-toolbar-action label="Edit Selected" i18n-label [action]="editSelected"></eg-grid-toolbar-action>
<eg-grid-toolbar-action label="Cancel Selected" i18n-label [action]="cancelSelected"></eg-grid-toolbar-action>
+ <eg-grid-toolbar-action label="View Reservations for This Patron" i18n-label [action]="viewByPatron"></eg-grid-toolbar-action>
<eg-grid-column name="id" [hidden]="true" [index]="true" i18n-label label="ID" path="id"></eg-grid-column>
<eg-grid-column i18n-label [hidden]="true" path="usr.first_given_name"></eg-grid-column>
<eg-grid-column i18n-label [hidden]="true" path="usr.second_given_name"></eg-grid-column>
<eg-fm-record-editor #editDialog
idlClass="bresv"
- mode="update"
readonlyFields="usr,xact_start,xact_finish,request_time,capture_time,cancel_time,pickup_time,return_time,capture_staff">
</eg-fm-record-editor>
editSelected: (rows: IdlObject[]) => void;
cancelSelected: (rows: IdlObject[]) => void;
+ viewByPatron: (rows: IdlObject[]) => void;
constructor(
private route: ActivatedRoute,
+ private router: Router,
private toast: ToastService,
private pcrud: PcrudService,
private auth: AuthService,
this.grid.reload();
}
+ this.viewByPatron = (reservations: IdlObject[]) => {
+ let patronIds = reservations.map(reservation => reservation.usr().id());
+ this.router.navigate(['/staff', 'booking', 'current_reservations', 'by_patron', patronIds[0]]);
+ }
+
+ this.editDialog.mode = 'update'; // this fmeditor is not used for creating objects, just updates
}
showEditDialog(idlThing: IdlObject) {