webstaff: add actions to various grids
authorMike Rylander <mrylander@gmail.com>
Fri, 6 Mar 2015 00:09:13 +0000 (19:09 -0500)
committerJason Stephenson <jstephenson@mvlc.org>
Wed, 19 Aug 2015 17:39:12 +0000 (13:39 -0400)
* show holds
* show patrons
* show recent circs
* show triggered events

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2
Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2
Open-ILS/src/templates/staff/circ/holds/t_shelf_list.tt2
Open-ILS/src/templates/staff/circ/patron/t_holds_list.tt2
Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
Open-ILS/web/js/ui/default/staff/circ/services/holds.js

index c233b24..0aa87fb 100644 (file)
@@ -22,6 +22,8 @@
 
     <eg-grid-action handler="grid_actions.show_recent_circs"
       label="[% l('Show Last Few Circulations') %]"></eg-grid-action>
+  <eg-grid-action handler="grid_actions.show_patrons"
+    label="[% l('Retrieve Patron') %]"></eg-grid-action>
     <eg-grid-action divider="true"></eg-grid-action>
     <eg-grid-action handler="grid_actions.set_copy_quality"
       label="[% l('Set Desired Copy Quality') %]"></eg-grid-action>
index f803a1d..4f4502f 100644 (file)
@@ -25,6 +25,8 @@
 
   <eg-grid-action handler="grid_actions.show_recent_circs"
     label="[% l('Show Last Few Circulations') %]"></eg-grid-action>
+  <eg-grid-action handler="grid_actions.show_patrons"
+    label="[% l('Retrieve Patron') %]"></eg-grid-action>
   <eg-grid-action divider="true"></eg-grid-action>
   <eg-grid-action handler="grid_actions.set_copy_quality"
     label="[% l('Set Desired Copy Quality') %]"></eg-grid-action>
index 598d86e..ae2df27 100644 (file)
@@ -22,6 +22,8 @@
 
   <eg-grid-action handler="grid_actions.show_recent_circs"
     label="[% l('Show Last Few Circulations') %]"></eg-grid-action>
+  <eg-grid-action handler="grid_actions.show_patrons"
+    label="[% l('Retrieve Patron') %]"></eg-grid-action>
   <eg-grid-action divider="true"></eg-grid-action>
   <eg-grid-action handler="grid_actions.set_copy_quality"
     label="[% l('Set Desired Copy Quality') %]"></eg-grid-action>
index bca5020..b97b586 100644 (file)
@@ -11,6 +11,8 @@
 
   <eg-grid-action handler="grid_actions.show_recent_circs"
     label="[% l('Show Last Few Circulations') %]"></eg-grid-action>
+  <eg-grid-action handler="grid_actions.show_holds_for_title"
+    label="[% l('Show Holds for Title') %]"></eg-grid-action>
   <eg-grid-action divider="true"></eg-grid-action>
   <eg-grid-action handler="grid_actions.set_copy_quality"
     label="[% l('Set Desired Copy Quality') %]"></eg-grid-action>
index cc3a9d9..24b4e0e 100644 (file)
     label="[% l('Check In') %]"></eg-grid-action>
   <eg-grid-action handler="add_billing" 
     label="[% l('Add Billing') %]"></eg-grid-action>
+  <eg-grid-action handler="show_recent_circs" 
+    label="[% l('Show Last Few Circulations') %]"></eg-grid-action>
+  <eg-grid-action handler="show_triggered_events" 
+    label="[% l('Show Triggered Events') %]"></eg-grid-action>
 
   <eg-grid-field label="[% l('Circ ID') %]" path='id'></eg-grid-field>
   <eg-grid-field label="[% l('Barcode') %]" path='target_copy.barcode'>
index 88a8983..3bd2b2a 100644 (file)
@@ -5,10 +5,10 @@
 angular.module('egPatronApp')
 
 .controller('PatronItemsOutCtrl',
-       ['$scope','$q','$routeParams','egCore','egUser','patronSvc',
-        'egGridDataProvider','$modal','egCirc','egConfirmDialog','egBilling',
-function($scope,  $q,  $routeParams,  egCore , egUser,  patronSvc 
-         egGridDataProvider , $modal , egCirc , egConfirmDialog , egBilling) {
+       ['$scope','$q','$routeParams','$timeout','egCore','egUser','patronSvc','$location',
+        'egGridDataProvider','$modal','egCirc','egConfirmDialog','egBilling','$window',
+function($scope,  $q,  $routeParams,  $timeout,  egCore , egUser,  patronSvc , $location
+         egGridDataProvider , $modal , egCirc , egConfirmDialog , egBilling , $window) {
 
     // list of noncatatloged circulations. Define before initTab to 
     // avoid any possibility of race condition, since they are loaded
@@ -349,6 +349,28 @@ function($scope,  $q,  $routeParams,  egCore , egUser,  patronSvc ,
         batch_action_with_barcodes(items, egCirc.mark_claims_never_checked_out);
     }
 
+    $scope.show_recent_circs = function(items) {
+        var focus = items.length == 1;
+        angular.forEach(items, function(item) {
+            var url = egCore.env.basePath +
+                      '/cat/item/' +
+                      item.target_copy().id() +
+                      '/circ_list';
+            $timeout(function() { var x = $window.open(url, '_blank'); if (focus) x.focus() });
+        });
+    }
+
+    $scope.show_triggered_events = function(items) {
+        var focus = items.length == 1;
+        angular.forEach(items, function(item) {
+            var url = egCore.env.basePath +
+                      '/cat/item/' +
+                      item.target_copy().id() +
+                      '/triggered_events';
+            $timeout(function() { var x = $window.open(url, '_blank'); if (focus) x.focus() });
+        });
+    }
+
     $scope.renew = function(items, msg) {
         if (!items.length) return;
         var barcodes = items.map(function(circ) 
index 5c0ac9d..057cfa3 100644 (file)
@@ -437,8 +437,8 @@ function($modal , $q , egCore , egConfirmDialog , egAlertDialog) {
  * most actionis are performed.
  */
 .factory('egHoldGridActions', 
-       ['$window','$location','egCore','egHolds','egCirc',
-function($window , $location , egCore , egHolds , egCirc) {
+       ['$window','$location','$timeout','egCore','egHolds','egCirc',
+function($window , $location , $timeout , egCore , egHolds , egCirc) {
     
     var service = {};
 
@@ -465,13 +465,41 @@ function($window , $location , egCore , egHolds , egCirc) {
     // jump to circ list for either 1) the targeted copy or
     // 2) the hold target copy for copy-level holds
     service.show_recent_circs = function(items) {
-        if (items.length && (copy = items[0].copy)) {
-            var url = $location.path(
-                '/cat/item/' + copy.id() + '/circ_list').absUrl();
-            $window.open(url, '_blank').focus();
-        }
+        var focus = items.length == 1;
+        angular.forEach(items, function(item) {
+            if (item.copy) {
+                var url = egCore.env.basePath +
+                          '/cat/item/' +
+                          item.copy.id() +
+                          '/circ_list';
+                $timeout(function() { var x = $window.open(url, '_blank'); if (focus) x.focus() });
+            }
+        });
+    }
+
+    service.show_patrons = function(items) {
+        var focus = items.length == 1;
+        angular.forEach(items, function(item) {
+            var url = egCore.env.basePath +
+                      'circ/patron/' +
+                      item.hold.usr().id() +
+                      '/holds';
+            $timeout(function() { var x = $window.open(url, '_blank'); if (focus) x.focus() });
+        });
     }
 
+    service.show_holds_for_title = function(items) {
+        var focus = items.length == 1;
+        angular.forEach(items, function(item) {
+            var url = egCore.env.basePath +
+                      'cat/catalog/record/' +
+                      item.mvr.doc_id() +
+                      '/holds';
+            $timeout(function() { var x = $window.open(url, '_blank'); if (focus) x.focus() });
+        });
+    }
+
+
     function generic_update(items, action) {
         if (!items.length) return $q.when();
         var hold_ids = items.map(function(item) {return item.hold.id()});