LP1904036 Claims never checked out
authorBill Erickson <berickxx@gmail.com>
Fri, 26 Feb 2021 21:16:07 +0000 (16:16 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:24 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts
Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.html
Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.ts
Open-ILS/src/eg2/src/app/staff/share/circ/precat-dialog.component.ts

index c7d3d8c..3bcaa29 100644 (file)
@@ -43,6 +43,7 @@ export interface CheckinParams {
     noop?: boolean;
     copy_id?: number;
     copy_barcode?: string;
+    claims_never_checked_out?: boolean;
 }
 
 export interface CheckinResult {
index 4cd4d90..df19104 100644 (file)
   dialogTitle="Items Checked Out"
   dialogBody="The selected items are checked out.  Check them in before continuing?">
 </eg-confirm-dialog>
+<eg-confirm-dialog #claimsNeverConfirm
+  i18n-dialogTitle i18n-dialogBody
+  dialogTitle="Claims Never Checked Out"
+  dialogBody="Mark {{claimsNeverCount}} items as Never Checked Out?">
+</eg-confirm-dialog>
 
 
 <ng-template #titleTemplate let-r="row">
     (onClick)="claimsReturned($event)"></eg-grid-toolbar-action>
 
   <eg-grid-toolbar-action
+    group="Mark" i18n-group i18n-label label="Mark Claims Never Checked Out"
+    (onClick)="claimsNeverCheckedOut($event)"></eg-grid-toolbar-action>
+
+  <eg-grid-toolbar-action
     group="Mark" i18n-group i18n-label label="Mark Lost (By Patron)"
     (onClick)="markLost($event)"></eg-grid-toolbar-action>
 
index 519c29a..32393fb 100644 (file)
@@ -89,6 +89,7 @@ export class CircGridComponent implements OnInit {
     cellTextGenerator: GridCellTextGenerator;
     rowFlair: (row: CircGridEntry) => GridRowFlairEntry;
     rowClass: (row: CircGridEntry) => string;
+    claimsNeverCount = 0;
 
     nowDate: number = new Date().getTime();
 
@@ -105,6 +106,8 @@ export class CircGridComponent implements OnInit {
         private itemsOutConfirm: ConfirmDialogComponent;
     @ViewChild('claimsReturnedConfirm')
         private claimsReturnedConfirm: ConfirmDialogComponent;
+    @ViewChild('claimsNeverConfirm')
+        private claimsNeverConfirm: ConfirmDialogComponent;
     @ViewChild('progressDialog')
         private progressDialog: ProgressDialogComponent;
     @ViewChild('claimsReturnedDialog')
@@ -456,5 +459,31 @@ export class CircGridComponent implements OnInit {
             }
         );
     }
+
+    claimsNeverCheckedOut(rows: CircGridEntry[]) {
+        const dialog = this.openProgressDialog(rows);
+
+        this.claimsNeverCount = rows.length;
+
+        this.claimsNeverConfirm.open().subscribe(confirmed => {
+            this.claimsNeverCount = 0;
+
+            if (!confirmed) {
+                dialog.close();
+                return;
+            }
+
+            this.circ.checkinBatch(
+                this.getCopyIds(rows), {claims_never_checked_out: true}
+            ).subscribe(
+                result => dialog.increment(),
+                err => console.error(err),
+                () => {
+                    dialog.close();
+                    this.emitReloadRequest();
+                }
+            );
+        });
+    }
 }
 
index 3b9ce8f..e69f592 100644 (file)
@@ -36,6 +36,12 @@ export class PrecatCheckoutDialogComponent extends DialogComponent implements On
 
     ngOnInit() {
         this.onOpen$.subscribe(_ => {
+
+            this.values.dummy_title = null;
+            this.values.dummy_author = null;
+            this.values.dummy_isbn = null;
+            this.values.circ_modifier = null;
+
             this.perm.hasWorkPermHere('CREATE_PRECAT')
             .then(perms => this.hasPerm = perms['CREATE_PRECAT']);