From 0e6702f115120336db4da41fa9e98493a93fba7a Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 11 Jul 2014 13:03:59 -0400 Subject: [PATCH] hold pull list printing Signed-off-by: Bill Erickson --- .../src/templates/staff/circ/holds/t_pull_list.tt2 | 17 ++++++++ .../share/print_templates/t_hold_pull_list.tt2 | 29 ++++++++++++ Open-ILS/web/js/ui/default/staff/circ/holds/app.js | 51 +++++++++++++++++++++- 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2 diff --git a/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 b/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 index b7e7ba1aa7..312ad68b71 100644 --- a/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 +++ b/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 @@ -1,3 +1,7 @@ +
+ [% l('Loading... [_1]', '{{print_list_progress}}') %] +
+ + + + + @@ -46,6 +62,7 @@ + diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2 new file mode 100644 index 0000000000..ce23fe4993 --- /dev/null +++ b/Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + +
[% l('Type') %][% l('Title') %][% l('Author') %][% l('Shelf Location') %][% l('Call Number') %][% l('Barcode/Part') %]
{{hold_data.hold.hold_type}}{{hold_data.title}}{{hold_data.author}}{{hold_data.copy.location.name}}{{hold_data.volume.label}}{{hold_data.copy.barcode}} {{hold_data.part.label}}
diff --git a/Open-ILS/web/js/ui/default/staff/circ/holds/app.js b/Open-ILS/web/js/ui/default/staff/circ/holds/app.js index bf0bc5b5fa..21e9ffc400 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/holds/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/holds/app.js @@ -181,7 +181,6 @@ function($scope , $q , $routeParams , $window , $location , egCore , egHolds , e // clear shelf done; fetch the cached results. function(resp) { clearing = false; - console.debug('clear holds cache key is ' + resp.cache_key); egCore.net.request( 'open-ils.circ', 'open-ils.circ.hold.clear_shelf.get_cache', @@ -262,5 +261,55 @@ function($scope , $q , $routeParams , $window , $location , egCore , egHolds , e $scope.detail_hold_record_id = hold_data.mvr.doc_id(); } + // By default, this action is hidded from the UI, but leaving it + // here in case it's needed in the future + $scope.print_list_alt = function() { + var url = '/opac/extras/circ/alt_holds_print.html'; + var win = $window.open(url, '_blank'); + win.ses = function() {return egCore.auth.token()}; + win.open(); + win.focus(); + } + + $scope.print_list_progress = null; + $scope.print_full_list = function() { + var print_holds = []; + $scope.print_list_loading = true; + $scope.print_list_progress = 0; + + // collect the full list of holds + egCore.net.request( + 'open-ils.circ', + 'open-ils.circ.hold_pull_list.fleshed.stream', + egCore.auth.token(), 10000, 0 + ).then( + function() { + console.debug('printing ' + print_holds.length + ' holds'); + + // holds fetched, send to print + egCore.print.print({ + context : 'default', + template : 'hold_pull_list', + scope : {holds : print_holds} + }); + }, + null, + function(hold_data) { + $scope.print_list_progress++; + egHolds.local_flesh(hold_data); + print_holds.push(hold_data); + hold_data.title = hold_data.mvr.title(); + hold_data.author = hold_data.mvr.author(); + hold_data.hold = egCore.idl.toHash(hold_data.hold); + hold_data.copy = egCore.idl.toHash(hold_data.copy); + hold_data.volume = egCore.idl.toHash(hold_data.volume); + hold_data.part = egCore.idl.toHash(hold_data.part); + } + ).finally(function() { + $scope.print_list_loading = false; + $scope.print_list_progress = null; + }); + } + }]) -- 2.11.0