LP#1402797 change Retrieve Selected Patron
authorJason Etheridge <jason@esilibrary.com>
Fri, 6 Feb 2015 21:33:51 +0000 (16:33 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 25 Feb 2015 16:16:08 +0000 (11:16 -0500)
to Retrieve Selected Patrons for Other -> Group Member Details interface

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/circ/patron/t_group.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/app.js

index 21bb4c2..8725652 100644 (file)
@@ -28,7 +28,7 @@
   <eg-grid-action label="[% l("Move Selected Patrons to Another Patron's Group") %]" 
     handler="moveToAnotherGroup"></eg-grid-action>
 
-  <eg-grid-action label="[% l("Retrieve Selected Patron") %]" 
+  <eg-grid-action label="[% l("Retrieve Selected Patrons") %]"
     handler="retrieveSelected"></eg-grid-action>
 
   <eg-grid-field path="active"></eg-grid-field>
index 14a9bb8..70247fd 100644 (file)
@@ -1322,9 +1322,9 @@ function($scope,  $routeParams , $location , egCore , patronSvc , $modal) {
 }])
 
 .controller('PatronGroupCtrl',
-       ['$scope','$routeParams','$q','$window','$location','egCore',
+       ['$scope','$routeParams','$q','$window','$timeout','$location','egCore',
         'patronSvc','$modal','egPromptDialog','egConfirmDialog',
-function($scope,  $routeParams , $q , $window , $location , egCore ,
+function($scope,  $routeParams , $q , $window , $timeout,  $location , egCore ,
          patronSvc , $modal , egPromptDialog , egConfirmDialog) {
 
     var usr_id = $routeParams.id;
@@ -1483,10 +1483,14 @@ function($scope,  $routeParams , $q , $window , $location , egCore ,
 
     $scope.retrieveSelected = function(selected) {
         if (!selected.length) return;
-        var url = $location.absUrl().replace(
-            /\/patron\/.*/, 
-            '/patron/' + selected[0].id + '/checkout');
-        $window.open(url, '_blank').focus();
+        angular.forEach(selected, function(usr) {
+            $timeout(function() {
+                var url = $location.absUrl().replace(
+                    /\/patron\/.*/,
+                    '/patron/' + usr.id + '/checkout');
+                $window.open(url, '_blank')
+            });
+        });
     }
 
 }])