[% 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">
* 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';
});
}
+ $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 = [];