From f0a4e25a6181f9b788df642518db4b1975719a30 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 16 Nov 2016 03:07:22 -0500 Subject: [PATCH] webstaff: add print template and action for in-house uses list Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- .../admin/workstation/t_print_templates.tt2 | 1 + .../staff/circ/in_house_use/index.tt2 | 3 ++ .../print_templates/t_in_house_use_list.tt2 | 28 +++++++++++++++++++ .../ui/default/staff/admin/workstation/app.js | 16 ++++++++++- .../ui/default/staff/circ/in_house_use/app.js | 19 +++++++++++++ 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/templates/staff/share/print_templates/t_in_house_use_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 1b09453d76..25c3f2a8d0 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 @@ -24,6 +24,7 @@ + diff --git a/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 b/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 index 769d5338b2..edf032ce64 100644 --- a/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 +++ b/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 @@ -70,6 +70,9 @@ main-label="[% l('In-House Use') %]" items-provider="gridDataProvider" persist-key="circ.in_house_use"> + + + diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_in_house_use_list.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_in_house_use_list.tt2 new file mode 100644 index 0000000000..8bf85335ba --- /dev/null +++ b/Open-ILS/src/templates/staff/share/print_templates/t_in_house_use_list.tt2 @@ -0,0 +1,28 @@ + +
+
[% l('You marked the following in-house items used:') %]
+
+
    +
  1. +
    [% l('Barcode: [_1] Uses: [_2]', + '{{ihu.copy.barcode}}', + '{{ihu.num_uses}}') %]
    +
  2. +
+
+
{{current_location.shortname}} {{today | date:'short'}}
+
diff --git a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js index de37438754..0e5663ba57 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js +++ b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js @@ -401,7 +401,13 @@ function($scope , $q , egCore , ngToast) { }; var seed_copy = { - barcode : '33434322323' + barcode : '33434322323', + call_number : { + label : '636.8 JON' + }, + location : { + name : 'General Collection' + } } var one_hold = { @@ -449,6 +455,14 @@ function($scope , $q , egCore , ngToast) { }, ], + in_house_uses : [ + { + num_uses : 3, + copy : seed_copy, + title : seed_record.title + } + ], + previous_balance : 8.45, payment_total : 2.00, payment_applied : 2.00, diff --git a/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js b/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js index 0904c94fdb..45e9e5979d 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js @@ -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 + }); + } + }]) -- 2.43.2