<eg-string #userEditSuccessString i18n-text text="Update of User succeeded"></eg-string>
<eg-string #userEditFailedString i18n-text text="Update of User failed or was not allowed"></eg-string>
+<eg-patron-search-dialog #patronSearch>
+</eg-patron-search-dialog>
+
<ng-template #dialogContent>
<div class="modal-header bg-info"
[ngClass]="isDialog() ? 'modal-header' : 'alert mt-3'">
[(ngModel)]="userBarcode" (click)="$event.target.select()"
[disabled]="currentCourse && currentCourse.is_archived() == 't'"
(keyup.enter)="associateUser(userBarcode)" />
+ <button class="btn btn-outline-dark btn-sm" (click)="searchPatrons()">
+ <span class="material-icons mat-icon-in-button align-middle"
+ i18n-title title="Search for Patron">search</span>
+ <span class="align-middle" i18n>Search for Patron</span>
+ </button>
</div>
</div>
<div class="d-flex" [ngClass]="isDialog() ? 'col-md-6' : 'col-md-12 mt-3'">
import {IdlObject} from '@eg/core/idl.service';
import {StringComponent} from '@eg/share/string/string.component';
import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component';
+import {PatronSearchDialogComponent} from '@eg/staff/share/patron/search-dialog.component';
import {ToastService} from '@eg/share/toast/toast.service';
import {CourseService} from '@eg/staff/share/course.service';
import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
@Input() displayMode: String;
users: any[] = [];
@ViewChild('editDialog', { static: true }) editDialog: FmRecordEditorComponent;
+ @ViewChild('patronSearch') patronSearch: PatronSearchDialogComponent;
@ViewChild('usersGrid') usersGrid: GridComponent;
@ViewChild('userDeleteFailedString', { static: true })
userDeleteFailedString: StringComponent;
editOneThing(userFields.shift());
}
+ searchPatrons() {
+ this.patronSearch.open({size: 'xl'}).toPromise().then(
+ patrons => {
+ if (!patrons || patrons.length === 0) { return; }
+ const user = patrons[0];
+ this.userBarcode = user.card().barcode();
+ }
+ );
+ }
+
showEditDialog(user: IdlObject): Promise<any> {
this.editDialog.mode = 'update';
this.editDialog.recordId = user.id();
import {CourseReservesRoutingModule} from './routing.module';
import {ItemLocationSelectModule} from '@eg/share/item-location-select/item-location-select.module';
import {MarcSimplifiedEditorModule} from '@eg/staff/share/marc-edit/simplified-editor/simplified-editor.module';
+import {PatronModule} from '@eg/staff/share/patron/patron.module';
import {CourseTermMapComponent} from './course-term-map.component';
@NgModule({
CourseReservesRoutingModule,
ItemLocationSelectModule,
MarcSimplifiedEditorModule,
+ PatronModule,
TreeModule
],
exports: [