<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>
}])
.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;
$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')
+ });
+ });
}
}])