From f6577bb5908f7c78ebee4cf6a4de1dbc4e0bc5fa Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 11 Mar 2015 14:18:04 -0400 Subject: [PATCH] webstaff: give the Holds Shelf a template and print button Also expose both that and the Pull List in the workstation print interface Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- .../admin/workstation/t_print_templates.tt2 | 2 + .../staff/circ/holds/t_shelf_list.tt2 | 6 +++ .../print_templates/t_hold_shelf_list.tt2 | 29 +++++++++++++ .../web/js/ui/default/staff/circ/holds/app.js | 42 +++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 Open-ILS/src/templates/staff/share/print_templates/t_hold_shelf_list.tt2 diff --git a/Open-ILS/src/templates/staff/admin/workstation/t_print_templates.tt2 b/Open-ILS/src/templates/staff/admin/workstation/t_print_templates.tt2 index cbc79f8d80..c3f17a16c7 100644 --- a/Open-ILS/src/templates/staff/admin/workstation/t_print_templates.tt2 +++ b/Open-ILS/src/templates/staff/admin/workstation/t_print_templates.tt2 @@ -20,6 +20,8 @@ + + diff --git a/Open-ILS/src/templates/staff/circ/holds/t_shelf_list.tt2 b/Open-ILS/src/templates/staff/circ/holds/t_shelf_list.tt2 index ae2df27c45..1e3cfa4fd3 100644 --- a/Open-ILS/src/templates/staff/circ/holds/t_shelf_list.tt2 +++ b/Open-ILS/src/templates/staff/circ/holds/t_shelf_list.tt2 @@ -1,3 +1,6 @@ +
+ [% l('Loading... [_1]', '{{print_list_progress}}') %] +
+ + + + + + [% 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 f0f5be563d..83bb529d54 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 @@ -202,6 +202,48 @@ function($scope , $q , $routeParams , $window , $location , egCore , egHolds , e ); } + $scope.print_list_progress = null; + $scope.print_shelf_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.captured_holds.id_list.on_shelf.retrieve.authoritative.atomic', + egCore.auth.token(), $scope.pickup_ou.id() + ).then( function(idlist) { + + egHolds.fetch_holds(idlist).then( + function () { + console.debug('printing ' + print_holds.length + ' holds'); + // holds fetched, send to print + egCore.print.print({ + context : 'default', + template : 'hold_shelf_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; + }); + } + refresh_page(); }]) -- 2.43.2