webstaff: add print template and action for in-house uses list
[working/Evergreen.git] / Open-ILS / web / js / ui / default / staff / circ / in_house_use / app.js
index 0904c94..45e9e59 100644 (file)
@@ -121,4 +121,23 @@ function($scope,  egCore,  egGridDataProvider , egConfirmDialog) {
         });
     }
 
+    $scope.print_list = function() {
+        var print_data = { in_house_uses : [] };
+
+        if (checkouts.length == 0) return $q.when();
+
+        angular.forEach(checkouts, function(ihu) {
+            print_data.in_house_uses.push({
+                num_uses : ihu.num_uses,
+                copy : egCore.idl.toHash(ihu.copy),
+                title : ihu.title
+            })
+        });
+
+        return egCore.print.print({
+            template : 'in_house_use_list',
+            scope : print_data
+        });
+    }
+
 }])