<eg-string #itemNeverCircedStr i18n-text
text="Item CONC40000598 has never circulated."></eg-string>
<eg-backdate-dialog #backdateDialog></eg-backdate-dialog>
+<eg-cancel-transit-dialog #cancelTransitDialog></eg-cancel-transit-dialog>
<div class="row" *ngIf="hasAlerts()">
<div class="col-lg-12 alert alert-danger p-1">
<ng-container *ngIf="!r.record">{{r.title}}</ng-container>
</ng-template>
+<ng-template #barcodeTemplate let-r="row">
+ <ng-container *ngIf="r.copy">
+ <a href="/eg/staff/cat/item/{{r.copy.id()}}">{{r.copy.barcode()}}</a>
+ </ng-container>
+</ng-template>
+
<div class="row">
<div class="col-lg-12">
<eg-grid #grid [dataSource]="gridDataSource" [sortable]="true"
(onClick)="markDamaged($event)"></eg-grid-toolbar-action>
<eg-grid-toolbar-action
- i18n-group group="Edit" i18n-label label="Manage Item Alerts"
+ group="Mark" i18n-group i18n-label label="Mark Missing Pieces"
+ (onClick)="markMissingPieces($event)"></eg-grid-toolbar-action>
+
+ <eg-grid-toolbar-action
+ i18n-group group="Manage" i18n-label label="Manage Item Alerts"
[disabled]="grid.context.rowSelector.selected().length !== 1"
(onClick)="manageItemAlerts($event)">
</eg-grid-toolbar-action>
</eg-grid-toolbar-action>
<eg-grid-toolbar-action
- i18n-group group="Edit" i18n-label label="Backdate Post-Checkin"
+ i18n-group group="Circulation" i18n-label label="Backdate Post-Checkin"
(onClick)="backdatePostCheckin($event)">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action
+ i18n-group group="Circulation" i18n-label label="Cancel Transits"
+ (onClick)="cancelTransits($event)">
+ </eg-grid-toolbar-action>
+
+ <eg-grid-toolbar-action
i18n-group group="Retrieve" i18n-label
label="Retrieve Last Patron Who Circulated Item"
[disabled]="grid.context.rowSelector.selected().length !== 1"
<eg-grid-column path="mbts.balance_owed" label="Balance Owed"
datatype="money" i18n-label></eg-grid-column>
- <eg-grid-column path="copy.barcode" label="Barcode" i18n-label>
- </eg-grid-column>
+ <eg-grid-column path="copy.barcode" label="Barcode"
+ i18n-label [cellTemplate]="barcodeTemplate"></eg-grid-column>
<eg-grid-column path="circ.id" label="Bill #" i18n-label>
</eg-grid-column>
import {Component, ViewChild, OnInit, AfterViewInit, HostListener} from '@angular/core';
+import {Location} from '@angular/common';
import {Router, ActivatedRoute, ParamMap} from '@angular/router';
import {from} from 'rxjs';
import {concatMap} from 'rxjs/operators';
import {ToastService} from '@eg/share/toast/toast.service';
import {StringComponent} from '@eg/share/string/string.component';
import {BackdateDialogComponent} from '@eg/staff/share/circ/backdate-dialog.component';
+import {CancelTransitDialogComponent
+ } from '@eg/staff/share/circ/cancel-transit-dialog.component';
+
interface CheckinGridEntry extends CheckinResult {
// May need to extend...
@ViewChild('bucketDialog') private bucketDialog: BucketDialogComponent;
@ViewChild('itemNeverCircedStr') private itemNeverCircedStr: StringComponent;
@ViewChild('backdateDialog') private backdateDialog: BackdateDialogComponent;
+ @ViewChild('cancelTransitDialog') private cancelTransitDialog: CancelTransitDialogComponent;
constructor(
private router: Router,
private route: ActivatedRoute,
+ private ngLocation: Location,
private net: NetService,
private org: OrgService,
private auth: AuthService,
}
});
}
+
+ markMissingPieces(rows: CheckinGridEntry[]) {
+ const copyId = this.getCopyIds(rows)[0];
+ if (copyId) {
+ const url = this.ngLocation.prepareExternalUrl(
+ `/staff/cat/item/missing_pieces/${copyId}`);
+ window.open(url);
+ }
+ }
+
+
+ cancelTransits(rows: CheckinGridEntry[]) {
+ const ids = rows
+ .filter(row => Boolean(row.transit))
+ .map(row => row.transit.id());
+
+ if (ids.length > 0) {
+ this.cancelTransitDialog.transitIds = ids;
+ this.cancelTransitDialog.open().subscribe();
+ }
+ }
}
row.paymentPending = 0;
row.billingLocation =
row['grocery.billing_location.shortname'] ||
- row['circulation.circ_lib.shortname']
+ row['circulation.circ_lib.shortname'];
}));
};
import {OpenCircDialogComponent} from './open-circ-dialog.component';
import {RouteDialogComponent} from './route-dialog.component';
import {CopyInTransitDialogComponent} from './in-transit-dialog.component';
+import {CancelTransitDialogComponent} from './cancel-transit-dialog.component';
import {BackdateDialogComponent} from './backdate-dialog.component';
@NgModule({
RouteDialogComponent,
BackdateDialogComponent,
CopyInTransitDialogComponent,
+ CancelTransitDialogComponent,
OpenCircDialogComponent
],
imports: [
exports: [
CircGridComponent,
BackdateDialogComponent,
+ CancelTransitDialogComponent,
CircComponentsComponent
],
providers: [