LP1806087 Catalog holds display WIP (grid actions) user/berick/lp1806087-ang-staff-cat-phase2-additions
authorBill Erickson <berickxx@gmail.com>
Tue, 19 Feb 2019 20:12:19 +0000 (15:12 -0500)
committerBill Erickson <berickxx@gmail.com>
Tue, 19 Feb 2019 20:12:19 +0000 (15:12 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.component.html
Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.component.ts

index d52bd08..dfb03f5 100644 (file)
       [multiSortable]="true" persistKey="cat.catalog.wide_holds">
 
       <eg-grid-toolbar-action label="Show Details" i18n-label
-          [action]="showDetails"></eg-grid-toolbar-action>
+        [action]="showDetails"></eg-grid-toolbar-action>
+
+      <eg-grid-toolbar-action 
+        i18n-label label="Show Last Few Circulations" group="Item" i18n-group 
+        [action]="showRecentCircs"></eg-grid-toolbar-action>
+
+      <eg-grid-toolbar-action 
+        i18n-label label="Retrieve Patron" group="Patron" i18n-group
+        [action]="showPatron">
+      </eg-grid-toolbar-action>
 
       <!--
-      <eg-grid-action handler="grid_actions.show_recent_circs_wide" group="Item"
-        i18n-label label="Show Last Few Circulations"></eg-grid-action>
-      <eg-grid-action handler="grid_actions.show_patrons_wide" group="Patron"
-        i18n-label label="Retrieve Patron"></eg-grid-action>
-      <eg-grid-action group="Hold" handler="grid_actions.set_copy_quality_wide"
-        i18n-label label="Set Desired Item Quality"></eg-grid-action>
-      <eg-grid-action group="Hold" handler="grid_actions.edit_pickup_lib_wide"
-        i18n-label label="Edit Pickup Library"></eg-grid-action>
-      <eg-grid-action group="Hold" handler="grid_actions.edit_notify_prefs_wide"
-        i18n-label label="Edit Notification Settings"></eg-grid-action>
-      <eg-grid-action group="Hold" handler="grid_actions.edit_dates_wide"
-        i18n-label label="Edit Hold Dates"></eg-grid-action>
-      <eg-grid-action handler="grid_actions.activate_wide" group="Hold"
-        i18n-label label="Activate"></eg-grid-action>
-      <eg-grid-action handler="grid_actions.suspend_wide" group="Hold"
-        i18n-label label="Suspend"></eg-grid-action>
-      <eg-grid-action handler="grid_actions.set_top_of_queue_wide" group="Hold"
-        i18n-label label="Set Top of Queue"></eg-grid-action>
-      <eg-grid-action handler="grid_actions.clear_top_of_queue_wide" group="Hold"
-        i18n-label label="Un-Set Top of Queue"></eg-grid-action>
-      <eg-grid-action handler="grid_actions.transfer_to_marked_title_wide" group="Hold"
-        i18n-label label="Transfer To Marked Title"></eg-grid-action>
-      <eg-grid-action handler="grid_actions.mark_damaged_wide" group="Item"
-        i18n-label label="Mark Item Damaged"></eg-grid-action>
-      <eg-grid-action handler="grid_actions.mark_missing_wide" group="Item"
-        i18n-label label="Mark Item Missing"></eg-grid-action>
-      <eg-grid-action handler="grid_actions.retarget_wide" group="Hold"
-        i18n-label label="Find Another Target"></eg-grid-action>
-      <eg-grid-action handler="grid_actions.cancel_wide_hold" group="Hold"
-        i18n-label label="Cancel Hold"></eg-grid-action>
+      <eg-grid-toolbar-action group="Hold" handler="grid_actions.set_copy_quality_wide"
+        i18n-label label="Set Desired Item Quality"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action group="Hold" handler="grid_actions.edit_pickup_lib_wide"
+        i18n-label label="Edit Pickup Library"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action group="Hold" handler="grid_actions.edit_notify_prefs_wide"
+        i18n-label label="Edit Notification Settings"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action group="Hold" handler="grid_actions.edit_dates_wide"
+        i18n-label label="Edit Hold Dates"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action handler="grid_actions.activate_wide" group="Hold"
+        i18n-label label="Activate"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action handler="grid_actions.suspend_wide" group="Hold"
+        i18n-label label="Suspend"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action handler="grid_actions.set_top_of_queue_wide" group="Hold"
+        i18n-label label="Set Top of Queue"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action handler="grid_actions.clear_top_of_queue_wide" group="Hold"
+        i18n-label label="Un-Set Top of Queue"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action handler="grid_actions.transfer_to_marked_title_wide" group="Hold"
+        i18n-label label="Transfer To Marked Title"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action handler="grid_actions.mark_damaged_wide" group="Item"
+        i18n-label label="Mark Item Damaged"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action handler="grid_actions.mark_missing_wide" group="Item"
+        i18n-label label="Mark Item Missing"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action handler="grid_actions.retarget_wide" group="Hold"
+        i18n-label label="Find Another Target"></eg-grid-toolbar-action>
+      <eg-grid-toolbar-action handler="grid_actions.cancel_wide_hold" group="Hold"
+        i18n-label label="Cancel Hold"></eg-grid-toolbar-action>
         -->
 
       <eg-grid-column i18n-label label="Hold ID" path='id' [index]="true">
index d72018f..6f04cea 100644 (file)
@@ -73,7 +73,10 @@ export class HoldsGridComponent implements OnInit {
         }
     }
 
+    // Grid Toolbar Handlers
     showDetails: (rows: any[]) => void;
+    showRecentCircs: (rows: any[]) => void;
+    showPatron: (rows: any[]) => void;
 
     constructor(
         private net: NetService,
@@ -82,12 +85,29 @@ export class HoldsGridComponent implements OnInit {
     ) {
         this.gridDataSource = new GridDataSource();
 
+        // Grid Toolbar Handlers
         this.showDetails = (rows: any[]) => {
             if (rows.length) {
                 this.mode = 'detail';
                 this.detailHold = rows[0];
             }
         }
+
+        this.showRecentCircs = (rows: any[]) => {
+            if (rows.length) {
+                const url = 
+                    '/eg/staff/cat/item/' + rows[0].cp_id + '/circ_list';
+                window.open(url, '_blank');
+            }
+        }
+
+        this.showPatron = (rows: any[]) => {
+            if (rows.length) {
+                const url = 
+                    '/eg/staff/circ/patron/' + rows[0].usr_id + '/checkout';
+                window.open(url, '_blank');
+            }
+        }
     }
 
     ngOnInit() {