backdate: this.backdate
};
+ Object.keys(this.modifiers).forEach(mod => {
+ if (this.modifiers[mod]) {
+ params[mod] = true;
+ }
+ });
+
return this.barcodeSelect.getBarcode('asset', this.barcode)
.then(selection => {
if (selection) {
hasAlerts(): boolean {
return (
- Boolean(this.backdate) ||
- this.modifiers.noop ||
- this.modifiers.manual_float ||
- this.modifiers.void_overdues ||
- this.modifiers.clear_expired ||
- this.modifiers.retarget_holds ||
- this.modifiers.hold_as_transit ||
- this.modifiers.no_precat_alert ||
- this.modifiers.do_inventory_update ||
- this.modifiers.auto_print_holds_transits
+ Boolean(this.backdate) ||
+ Object.keys(this.modifiers).filter(mod => this.modifiers[mod]).length > 0
);
}
capture?: string;
next_copy_status?: number[];
new_copy_alerts?: boolean;
+ clear_expired?: boolean;
+ hold_as_transit?: boolean;
+ manual_float?: boolean;
+ no_precat_alert?: boolean;
+ retarget_holds?: boolean;
+ retarget_holds_all?: boolean;
// internal / local values that are moved from the API request.
_override?: boolean;
const firstEvent = allEvents[0];
const payload = firstEvent.payload;
- if (!payload) {
- this.audio.play('error.unknown.no_payload');
- return Promise.reject();
- }
-
const success =
firstEvent.textcode.match(/SUCCESS|NO_CHANGE|ROUTE_ITEM/) !== null;
allEvents: allEvents,
params: params,
success: success,
- circ: payload.circ,
- parent_circ: payload.parent_circ,
- copy: payload.copy,
- volume: payload.volume,
- record: payload.record,
- transit: payload.transit,
- hold: payload.hold
};
+ if (!payload) {
+ // e.g. ASSET_COPY_NOT_FOUND
+ return Promise.resolve(result);
+ }
+
+ result.circ = payload.circ;
+ result.parent_circ = payload.parent_circ;
+ result.copy = payload.copy;
+ result.volume = payload.volume;
+ result.record = payload.record;
+ result.transit = payload.transit;
+ result.hold = payload.hold;
+
const copy = result.copy;
const volume = result.volume;
const transit = result.transit;
}
handleCheckinUncatAlert(result: CheckinResult): Promise<CheckinResult> {
- const copy = result.copy;
+ const barcode = result.copy ?
+ result.copy.barcode() : result.params.copy_barcode;
if (this.suppressCheckinPopups) {
return Promise.resolve(result);
}
return this.strings.interpolate(
- 'staff.circ.checkin.uncat.alert',
- {barcode: copy.barcode()}
+ 'staff.circ.checkin.uncat.alert', {barcode: barcode}
).then(str => {
this.components.uncatAlertDialog.dialogBody = str;
return this.components.uncatAlertDialog.open().toPromise()
<eg-string key="staff.circ.checkin.location.alert" [template]="locAlertTemplate">
</eg-string>
+<eg-alert-dialog #locationAlertDialog i18n-dialogTitle dialogTitle="Route Item">
+</eg-alert-dialog>
+
<ng-template #uncatAlertTemplate let-barcode="barcode" i18n>
- Item {{barcode}} was mis-scanned or is not cataloged
+ Item "{{barcode}}" was mis-scanned or is not cataloged
</ng-template>
<!-- dialogBody is generated dynamically from string above -->
<eg-string key="staff.circ.checkin.uncat.alert" [template]="uncatAlertTemplate">
</eg-string>
-<eg-alert-dialog #locationAlertDialog i18n-dialogTitle dialogTitle="Route Item">
+<eg-alert-dialog #uncatAlertDialog i18n-dialogTitle dialogTitle="Route Item">
</eg-alert-dialog>
<eg-open-circ-dialog #openCircDialog></eg-open-circ-dialog>