From: Mike Rylander Date: Fri, 6 Mar 2015 00:09:13 +0000 (-0500) Subject: webstaff: add actions to various grids X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ee12ddd9c4d858c72ae063b36825fc85c1f9268d;p=evergreen%2Ftadl.git webstaff: add actions to various grids * show holds * show patrons * show recent circs * show triggered events Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 index c233b24bd4..0aa87fb064 100644 --- a/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 +++ b/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 @@ -22,6 +22,8 @@ + diff --git a/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 b/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 index f803a1d774..4f4502f88a 100644 --- a/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 +++ b/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 @@ -25,6 +25,8 @@ + diff --git a/Open-ILS/src/templates/staff/circ/holds/t_shelf_list.tt2 b/Open-ILS/src/templates/staff/circ/holds/t_shelf_list.tt2 index 598d86ee3c..ae2df27c45 100644 --- a/Open-ILS/src/templates/staff/circ/holds/t_shelf_list.tt2 +++ b/Open-ILS/src/templates/staff/circ/holds/t_shelf_list.tt2 @@ -22,6 +22,8 @@ + diff --git a/Open-ILS/src/templates/staff/circ/patron/t_holds_list.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_holds_list.tt2 index bca50208fd..b97b5869b3 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_holds_list.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_holds_list.tt2 @@ -11,6 +11,8 @@ + diff --git a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 index cc3a9d95d1..24b4e0e790 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 @@ -67,6 +67,10 @@ label="[% l('Check In') %]"> + + diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js index 88a8983bec..3bd2b2a0b6 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js @@ -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) diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js index 5c0ac9db1a..057cfa3a54 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js @@ -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()});