<h3 i18n>Place Hold
- <ng-container *ngIf="user">
- ({{user.family_name()}}, {{user.first_given_name()}} {{user.second_given_name()}})
- </ng-container>
+ <ng-container *ngIf="user">
+ ({{user.family_name()}}, {{user.first_given_name()}})
+ </ng-container>
</h3>
<form class="form form-validated common-form striped-odd"
</div>
<div class="col-lg-3">
<div class="form-check">
+ <input class="form-check-input" type="checkbox"
+ name="suspend" [(ngModel)]="suspend"/>
+ <label class="form-check-label" i18n>Suspend Hold</label>
+ </div>
+ </div>
+ <div class="col-lg-3">
+ <eg-date-select (onChangeAsISO)="activeDateSelected($event)"
+ [disabled]="!suspend">
+ </eg-date-select>
+ </div>
+ </div>
+ <div class="row mt-2">
+ <div class="col-lg-3">
+ <div class="form-check">
<input class="form-check-input" type="radio"
(change)="holdForChanged()"
name="holdFor" value="staff" [(ngModel)]="holdFor"/>
<label class="form-check-label" i18n>
- Place hold for this staff account: {{requestor.usrname()}}
+ Place hold for this staff account:
</label>
</div>
</div>
- </div>
- <div class="row mt-2">
- <div class="col-lg-3">
- <label i18n>Pickup Location: </label>
- </div>
- <div class="col-lg-3">
- <eg-org-select [applyOrgId]="pickupLib"></eg-org-select>
- </div>
- </div>
- <div class="row mt-2">
+ <div class="col-lg-3 font-weight-bold">{{requestor.usrname()}}</div>
<div class="col-lg-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="notifyEmail"
</div>
<div class="row mt-2">
<div class="col-lg-3">
+ <label i18n>Pickup Location: </label>
+ </div>
+ <div class="col-lg-3">
+ <eg-org-select [applyOrgId]="pickupLib"></eg-org-select>
+ </div>
+ <div class="col-lg-3">
<div class="form-check">
<input class="form-check-input" type="checkbox"
name="notifyPhone" [(ngModel)]="notifyPhone"/>
</div>
<div class="row mt-2">
<div class="col-lg-3">
- <div class="form-check">
- <input class="form-check-input" type="checkbox"
- name="suspend" [(ngModel)]="suspend"/>
- <label class="form-check-label" i18n>Suspend Hold</label>
- </div>
- </div>
- <div class="col-lg-3">
- <eg-date-select (onChangeAsISO)="activeDateSelected($event)"
- [disabled]="!suspend">
- </eg-date-select>
- </div>
- </div>
- <div class="row mt-2">
- <div class="col-lg-3">
<button class="btn btn-success" (click)="placeHolds()"
[disabled]="!user" i18n>Submit</button>
</div>
<div class="hold-records-list common-form striped-even">
<div class="row mt-2 ml-1 mr-1 font-weight-bold">
- <div class="col-lg-3" i18n>Title</div>
+ <div class="col-lg-1" i18n>Format</div>
+ <div class="col-lg-2" i18n>Title</div>
<div class="col-lg-2" i18n>Author</div>
<div class="col-lg-1" i18n>TCN</div>
<div class="col-lg-2" i18n>Call Number</div>
</div>
<div class="row mt-1 ml-1 mr-1" *ngFor="let ctx of holdContexts">
<ng-container *ngIf="ctx.bibSummary">
- <div class="col-lg-3">
+ <div class="col-lg-1">
+ <ng-container *ngFor="let code of ctx.bibSummary.attributes.icon_format">
+ <img class="pr-1"
+ alt="{{iconFormatLabel(code)}}"
+ title="{{iconFormatLabel(code)}}"
+ src="/images/format_icons/icon_format/{{code}}.png"/>
+ </ng-container>
+ </div>
+ <div class="col-lg-2">
<a routerLink="/staff/catalog/record/{{ctx.recordId}}">
{{ctx.bibSummary.display.title}}
</a>
pickupLib: number;
notifyEmail: boolean;
notifyPhone: boolean;
- notifySms: boolean;
phoneValue: string;
+ notifySms: boolean;
+ smsValue: string;
+ smsCarrier: string;
suspend: boolean;
activeDate: string;
}
holdForChanged() {
+ this.user = null;
if (this.holdFor === 'patron') {
if (this.userBarcode) {
recipient: this.user.id(),
requestor: this.requestor.id(),
pickupLib: this.pickupLib,
- override: override
+ override: override,
+ notifyEmail: this.notifyEmail, // bool
+ notifyPhone: this.notifyPhone ? this.phoneValue : null,
+ notifySms: this.notifySms ? this.smsValue : null,
+ smsCarrier: this.notifySms ? this.smsCarrier : null,
+ thawDate: this.suspend ? this.activeDate : null,
+ frozen: this.suspend
}).toPromise().then(request => {
console.log('hold returned: ', request);
return ctx.lastRequest &&
!ctx.lastRequest.result.success && ctx.canOverride;
}
+
+ iconFormatLabel(code: string): string {
+ return this.cat.iconFormatLabel(code);
+ }
}
requestor: number;
pickupLib: number;
override?: boolean;
+ notifyEmail?: boolean;
+ notifyPhone?: string;
+ notifySms?: string;
+ smsCarrier?: string;
+ thawDate?: string; // ISO date
+ frozen?: boolean;
//holdableFormats?: {[id: number]: string[]};
result?: HoldRequestResult
// ...
return this.net.request(
'open-ils.circ', method, this.auth.token(), {
- patronid: request.recipient,
- pickup_lib: request.pickupLib,
- hold_type: request.holdType,
+ patronid: request.recipient,
+ pickup_lib: request.pickupLib,
+ hold_type: request.holdType,
+ email_notify: request.notifyEmail,
+ phone_notify: request.notifyPhone,
+ thaw_date: request.thawDate,
+ frozen: request.frozen,
+ sms_notify: request.notifySms,
+ sms_carrier: request.smsCarrier
//holdable_formats_map: request.holdableFormats
},
[request.holdTarget]