LP#1402797 add a Retrieve All These Patrons button
authorJason Etheridge <jason@esilibrary.com>
Mon, 9 Feb 2015 20:44:10 +0000 (15:44 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 25 Feb 2015 16:16:08 +0000 (11:16 -0500)
in the Item Status -> Circ History List

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>

Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2
Open-ILS/web/js/ui/default/staff/cat/item/app.js

index 9f7bbb5..05ee925 100644 (file)
@@ -3,6 +3,16 @@
     [% l('Item has not circulated.') %]
   </div>
 </div>
+<div class="row" ng-show="circ_list.length">
+  <div class="flex-row">
+      <div class="flex-cell well">
+          <button class="btn btn-default" ng-click="retrieveAllPatrons()">
+            [% l('Retrieve All These Patrons') %]
+          </button>
+      </div>
+  </div>
+</div>
+
 
 <div class="row" ng-repeat="circ in circ_list">
   <div class="flex-row">
index 82ed923..a7d08fb 100644 (file)
@@ -210,8 +210,8 @@ function($scope , $q , $location , $timeout , egCore , egGridDataProvider , item
  * Detail view -- shows one copy
  */
 .controller('ViewCtrl', 
-       ['$scope','$q','$location','$routeParams','egCore','itemSvc','egBilling',
-function($scope , $q , $location , $routeParams , egCore , itemSvc , egBilling) {
+       ['$scope','$q','$location','$routeParams','$timeout','$window','egCore','itemSvc','egBilling',
+function($scope , $q , $location , $routeParams , $timeout , $window , egCore , itemSvc , egBilling) {
     var copyId = $routeParams.id;
     $scope.tab = $routeParams.tab || 'summary';
     $scope.context.page = 'detail';
@@ -366,6 +366,21 @@ function($scope , $q , $location , $routeParams , egCore , itemSvc , egBilling)
         });
     }
 
+    $scope.retrieveAllPatrons = function() {
+        var users = new Set();
+        angular.forEach($scope.circ_list.map(function(circ) { return circ.usr(); }),function(usr) {
+            users.add(usr);
+        });
+        users.forEach(function(usr) {
+            $timeout(function() {
+                var url = $location.absUrl().replace(
+                    /\/cat\/.*/,
+                    '/circ/patron/' + usr.id() + '/checkout');
+                $window.open(url, '_blank')
+            });
+        });
+    }
+
     function loadCircHistory() {
         $scope.circ_list = [];