--- /dev/null
+
+<div class="row">
+ <div class="col-md-1"></div>
+ <div class="col-md-3">[% l('Title') %]</div>
+ <div class="col-md-3">[% l('Author') %]</div>
+ <div class="col-md-2">[% l('Status') %]</div>
+</div>
+
+<div class="row"
+ ng-repeat="hold in holds | orderBy:'queue_position':reverse">
+ <div class="col-md-1">
+ <img src="/opac/extras/ac/jacket/small/r/{{hold.mvr.doc_id()}}"/>
+ </div>
+ <div class="col-md-3">{{hold.mvr.title()}}</div>
+ <div class="col-md-3">{{hold.mvr.author()}}</div>
+ <div class="col-md-2">
+ <span ng-if="hold.status == 4">[% l('Ready for Pickup') %]</span>
+ <span ng-if="hold.status != 4">[% l('#[_1] in line with [_2] copies',
+ '{{hold.queue_position}}', '{{hold.potential_copies}}') %]</span>
+ </div>
+</div>
+
resolve : resolver
});
+ $routeProvider.when('/circ/selfcheck/holds', {
+ templateUrl: './circ/selfcheck/t_holds',
+ controller: 'HoldsCtrl',
+ resolve : resolver
+ });
+
$routeProvider.otherwise({redirectTo : '/circ/selfcheck/login'});
})
session_circ_count : 0,
total_circ_count : 0,
- hold_ready_count : 0,
+ ready_hold_count : 0,
total_hold_count : 0,
-
};
+ service.get_counts = function() {
+ }
+
// called with each path load
service.new_path_init = function() {
if (!service.patron)
/*
* Returns a notify-stream of open circ blobs.
- * Resets total circ count to match the server.
*/
service.get_items_out = function() {
- service.total_circ_count = 0;
return egCore.net.request(
'open-ils.circ',
'open-ils.circ.actor.user.checked_out',
egCore.auth.token(), service.patron.id()
- ).then(null, null, function(circ_blob) {
- service.total_circ_count++;
- return circ_blob;
+ );
+ }
+
+ /*
+ * Returns a notify-stream of open hold blobs
+ */
+ service.get_holds = function() {
+ // Don't rely on promise chaining when the final outcome is
+ // a stream of notify()'s, since resolve() data from earlier
+ // promises will leak into the notify() stream.
+ var deferred = $q.defer();
+
+ egCore.net.request(
+ 'open-ils.circ',
+ 'open-ils.circ.holds.id_list.retrieve',
+ egCore.auth.token(), service.patron.id()
+
+ ).then(function(ids) {
+ egCore.net.request(
+ 'open-ils.circ',
+ 'open-ils.circ.hold.details.batch.retrieve',
+ egCore.auth.token(), ids
+ ).then(deferred.resolve, deferred.reject, deferred.notify)
});
+
+ return deferred.promise;
}
return service;
}])
+.controller('HoldsCtrl',
+ ['$scope','$q','$location','egCore','scSvc',
+function($scope, $q, $location , egCore, scSvc) {
+ scSvc.new_path_init();
+ $scope.scanbox.focus = true;
+ $scope.holds = [];
+
+ scSvc.get_holds().then(null, null,
+ function(hold_blob) { $scope.holds.push(hold_blob) });
+
+}])