From 5b5191464d777710dbff6c5a85f7c57b1135bbd5 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Tue, 20 Aug 2019 10:07:17 -0700 Subject: [PATCH] LP1816475: Pre-fill patron barcode in Create Reservations Addresses comment #1 from https://bugs.launchpad.net/evergreen/+bug/1816475/comments/20 Signed-off-by: Jane Sandberg Signed-off-by: Christine Burns Signed-off-by: Galen Charlton --- .../booking/create-reservation-dialog.component.html | 2 +- .../staff/booking/create-reservation-dialog.component.ts | 9 +++++++++ .../app/staff/booking/create-reservation.component.html | 1 + .../app/staff/booking/create-reservation.component.ts | 1 - 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.html index 1fe01953e2..243e4bf739 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.html @@ -12,7 +12,7 @@ + class="form-control col-lg-7" formControlName="patronBarcode" [disabled]="patronId"> {{ (patron$ | async)?.first_given_name}} {{ (patron$ | async)?.second_given_name}} diff --git a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts index 759c8e477d..96b2b6c3ae 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts @@ -37,6 +37,7 @@ export class CreateReservationDialogComponent @Input() targetResource: number; @Input() targetResourceBarcode: string; @Input() targetResourceType: ComboboxEntry; + @Input() patronId: number; @Input() attributes: number[] = []; @Input() resources: IdlObject[] = []; @Output() onComplete: EventEmitter; @@ -83,6 +84,14 @@ export class CreateReservationDialogComponent 'resourceList': new FormControl(), }, [startTimeIsBeforeEndTimeValidator] ); + if (this.patronId) { + this.pcrud.search('au', {id: this.patronId}, { + flesh: 1, + flesh_fields: {'au': ['card']} + }).subscribe((usr) => + this.create.patchValue({patronBarcode: usr.card().barcode()}) + ); + } this.addBresv$ = () => { let selectedResourceId = this.targetResource ? [this.targetResource] : null; diff --git a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.html b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.html index ef67b08db9..64bbdf84df 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.html +++ b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.html @@ -182,6 +182,7 @@ GridRowFlairEntry; - patronBarcode: string; patronId: number; resourceBarcode: string; resourceId: number; -- 2.43.2