text="Item CONC40000598 has never circulated."></eg-string>
<eg-backdate-dialog #backdateDialog></eg-backdate-dialog>
<eg-cancel-transit-dialog #cancelTransitDialog></eg-cancel-transit-dialog>
+<eg-worklog-strings-components></eg-worklog-strings-components>
<div class="row" *ngIf="hasAlerts()">
<div class="col-lg-12 alert alert-danger p-1">
const params = result.params;
const mode = checkin ? 'checkin' : (params._renewal ? 'renew' : 'checkout');
+ const holdShelfEvent = events.filter(e => e.textcode === 'ITEM_ON_HOLDS_SHELF')[0];
+
+ if (holdShelfEvent) {
+ this.components.circEventsDialog.clearHolds = this.clearHoldsOnCheckout;
+ this.components.circEventsDialog.patronId = holdShelfEvent.payload.patron_id;
+ this.components.circEventsDialog.patronName = holdShelfEvent.payload.patron_name;
+ }
+
this.components.circEventsDialog.events = events;
this.components.circEventsDialog.mode = mode;
return this.components.circEventsDialog.open().toPromise()
- .then(confirmed => {
+ .then(resp => {
+ const confirmed = resp.override;
if (!confirmed) { return null; }
+ let promise = Promise.resolve(null);
+
if (!checkin) {
// Indicate these events have been seen and overridden.
events.forEach(evt => {
this.autoOverrideCheckoutEvents[evt.textcode] = true;
}
});
- }
- params._override = true;
+ if (holdShelfEvent && resp.clearHold) {
+ const holdId = holdShelfEvent.payload.hold_id;
+
+ // Cancel the hold that put our checkout item
+ // on the holds shelf.
+
+ promise = promise.then(_ => {
+ return this.net.request(
+ 'open-ils.circ',
+ 'open-ils.circ.hold.cancel',
+ this.auth.token(),
+ holdId,
+ 5, // staff forced
+ 'Item checked out by other patron' // FIXME I18n
+ ).toPromise();
+ });
+ }
+ }
- return this[mode](params); // checkout/renew/checkin
+ return promise.then(_ => {
+ params._override = true;
+ return this[mode](params); // checkout/renew/checkin
+ });
});
}
<div class="mt-2 font-weight-bold">{{evt.payload}}</div>
</ng-container>
</ng-container>
+ <ng-container *ngIf="evt.textcode == 'ITEM_ON_HOLDS_SHELF'">
+ <a target="_blank" class="mt-3"
+ routerLink="/staff/circ/patron/{{patronId}}/checkout">{{patronName}}</a>.
+
+ <div class="mt-3 mb-3">
+ <div class="form-check form-check-inline">
+ <input class="form-check-input" type="checkbox"
+ id="clear-hold-cbox" [(ngModel)]="clearHold"/>
+ <label class="form-check-label" for="clear-hold-cbox" i18n>
+ Cancel this hold upon checkout?
+ </label>
+ </div>
+ </div>
+
+ </ng-container>
</div>
</div>
</ng-container>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-info"
- (click)="close(true)" i18n>Force Action?</button>
+ (click)="close({override: true, clearHold: clearHold})" i18n>
+ Force Action?</button>
<button type="button" class="btn btn-warning"
(click)="close(false)" i18n>Cancel</button>
</div>