LP1919465 Avoid dupe Current Item's in pull list
authorBill Erickson <berickxx@gmail.com>
Wed, 22 Sep 2021 14:24:30 +0000 (10:24 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 24 Sep 2021 19:21:18 +0000 (15:21 -0400)
* Show a value for Current Item when a hold is targeted
* Show a value for a new column on Requested Item for copy-level holds.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jennifer Weston <jennifer.weston@equinoxOLI.org>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/eg2/src/app/staff/circ/holds/pull-list.component.html
Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.html
Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts

index a881abb..5b019b5 100644 (file)
@@ -4,7 +4,7 @@
 <eg-holds-grid
   persistKey="circ.holds.pull_list"
   printTemplate="hold_pull_list"
-  showFields="acpl_name,cn_full_label,p_label,author,title,cp_barcode,pl_shortname,hold_type,potentials,request_time"
+  showFields="acpl_name,cn_full_label,p_label,author,title,current_item,pl_shortname,hold_type,potentials,request_time"
   [showRecordSummary]="true"
   [enablePreFetch]="true"
   [hidePickupLibFilter]="true"
index 3b553f1..8912709 100644 (file)
       <eg-grid-column i18n-label label="Title" [hidden]="true" name='title'
         [cellTemplate]="titleTmpl"></eg-grid-column>
 
-      <ng-template #barcodeTmpl let-hold="row">
+      <ng-template #barcodeTmpl let-hold="row" let-col="col">
         <a href="/eg/staff/cat/item/{{hold.cp_id}}/summary">
-          {{hold.cp_barcode}}
+          <ng-container *ngIf="col.name == 'current_item' && hold.current_copy">
+            {{hold.cp_barcode}}
+          </ng-container>
+          <ng-container *ngIf="col.name == 'requested_item' && isCopyHold(hold)">
+            {{hold.cp_barcode}}
+          </ng-container>
         </a>
       </ng-template>
-      <eg-grid-column i18n-label label="Current Item" name='cp_barcode'
+      <eg-grid-column i18n-label label="Current Item" name='current_item'
+        [cellTemplate]="barcodeTmpl">
+      </eg-grid-column>
+      <eg-grid-column i18n-label label="Requested Item" name='requested_item'
         [cellTemplate]="barcodeTmpl">
       </eg-grid-column>
       <eg-grid-column i18n-label label="Pickup Library" path='pl_shortname'></eg-grid-column>
       <eg-grid-column i18n-label label="Is Reference" path='cp_ref' datatype="bool" [hidden]="true"></eg-grid-column>
       <eg-grid-column i18n-label label="Is Holdable" path='cp_holdable' datatype="bool" [hidden]="true"></eg-grid-column>
       <eg-grid-column i18n-label label="Price" path='cp_price' [hidden]="true"></eg-grid-column>
-      <eg-grid-column i18n-label label="Item Barcode" path='cp_barcode' [hidden]="true"></eg-grid-column>
       <eg-grid-column i18n-label label="Circulation Modifier" path='cp_circ_modifier' [hidden]="true"></eg-grid-column>
       <eg-grid-column i18n-label label="Circulate as MARC Type" path='cp_circ_as_type' [hidden]="true"></eg-grid-column>
       <eg-grid-column i18n-label label="Precat Dummy Title" path='cp_dummy_title' [hidden]="true"></eg-grid-column>
index 630f363..4b7b776 100644 (file)
@@ -597,6 +597,10 @@ export class HoldsGridComponent implements OnInit {
             }
         });
     }
+
+    isCopyHold(holdData: any): boolean {
+        return holdData.hold_type.match(/C|R|F/) !== null;
+    }
 }