From c5b1e57734fcdc97169fbc749f1c1906bde0d9e7 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 11 Jun 2014 16:41:45 -0400 Subject: [PATCH] more transit slip work Signed-off-by: Bill Erickson --- .../share/print_templates/t_hold_transit_slip.tt2 | 34 +++++++++++++++++++++ .../staff/share/print_templates/t_transit_slip.tt2 | 32 ++++++++++++-------- .../web/js/ui/default/staff/circ/services/circ.js | 35 +++++++++++++--------- 3 files changed, 74 insertions(+), 27 deletions(-) create mode 100644 Open-ILS/src/templates/staff/share/print_templates/t_hold_transit_slip.tt2 diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_hold_transit_slip.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_hold_transit_slip.tt2 new file mode 100644 index 0000000000..6b36c25f87 --- /dev/null +++ b/Open-ILS/src/templates/staff/share/print_templates/t_hold_transit_slip.tt2 @@ -0,0 +1,34 @@ +
+
[% l('This item needs to be routed to [_1]', '{{dest_location.shortname}}') %]
+
{{dest_location.name}}
+
{{dest_address.street1}} +
{{dest_address.street2}}
+
{{dest_address.city}}, + {{dest_address.state}} + {{dest_address.post_code}}
+
+ + [% l('Barcode: [_1]', '{{copy.barcode}}') %]
+ [% l('Title: [_1]', '{{title}}') %]
+ [% l('Author: [_1]', '{{author}}') %] + +
+ +
[% l('Hold for patron [_1], [_2] [_3]', + '{{patron.family_given_name}}', + '{{patron.first_given_name}}', + '{{patron.second_given_name}}') %]
+
[% l('Barcode: [_1]', '{{patron.card.barcode}}') %]
+
[% l('Notify by phone: [_1]', '{{hold.phone_notify}}') %]
+
[% l('Notify by text: [_1]', '{{hold.sms_notify}}') %]
+
[% l('Notify by email: [_1]', '{{patron.email}}') %]
+ +
+ +
[% l('Request Date: [_1]', + '{{hold.request_time | date:"short"}}') %]
+
[% l('Slip Date: [_1]', '{{today | date:"short"}}') %]
+
[% l('Printed by [_1] at [_2]', + '{{staff.first_given_name}}', '{{current_location.shortname}}') %]
+ + diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_transit_slip.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_transit_slip.tt2 index 20d0095407..324ad5e1eb 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_transit_slip.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_transit_slip.tt2 @@ -1,15 +1,21 @@
-
[% l('This item needs to be routed to [_1]', '{{transit.dest.shortname}}') %]
- {{transit.dest.name}}
- {{transit.dest.holds_address.street1}} - {{transit.dest.holds_address.street2}}
- {{transit.dest.holds_address.city}}, - {{transit.dest.holds_address.state}} - {{transit.dest.holds_address.post_code}}

- [% l('Barcode: [_1]', '{{transit.target_copy.barcode}}') %]
- [% l('Title: [_1]', '{{title}}') %]
- [% l('Author: [_1]', '{{author}}') %]
- [% l('Slip Date: [_1]', '{{today | date:"short"}}') %]
- [% l('Printed by [_1] at [_2]', - '{{staff.first_given_name}}', '{{current_location.shortname}}') %]
+
[% l('This item needs to be routed to [_1]', '{{dest_location.shortname}}') %]
+
{{dest_location.name}}
+
{{dest_address.street1}} +
{{dest_address.street2}}
+
{{dest_address.city}}, + {{dest_address.state}} + {{dest_address.post_code}}
+
+ + [% l('Barcode: [_1]', '{{copy.barcode}}') %]
+ [% l('Title: [_1]', '{{title}}') %]
+ [% l('Author: [_1]', '{{author}}') %] + +
+ +
[% l('Slip Date: [_1]', '{{today | date:"short"}}') %]
+
[% l('Printed by [_1] at [_2]', + '{{staff.first_given_name}}', '{{current_location.shortname}}') %]
+ diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js index bab34b6bad..23376f1ae4 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js @@ -357,21 +357,28 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) { var transit = evt.payload.transit; - // flesh data into the transit to match the print template - transit.target_copy(evt.payload.copy); - transit.dest(egCore.org.get(transit.dest())); - transit.dest().holds_address(destAddr); - - egCore.hatch.printFromTemplate('default', 'transit_slip', - { transit : egCore.idl.toHash(transit), - title : evt.payload.record.title(), - author : evt.payload.record.author(), - staff : egCore.idl.toHash(egCore.auth.user()), - current_location : egCore.idl.toHash( - egCore.org.get(egCore.auth.user().ws_ou())) - } - ); + var print_context = { + transit : egCore.idl.toHash(transit), + title : evt.payload.record.title(), + author : evt.payload.record.author(), + staff : egCore.idl.toHash(egCore.auth.user()), + copy : egCore.idl.toHash(evt.payload.copy), + dest_location : + egCore.idl.toHash(egCore.org.get(transit.dest())), + dest_address : egCore.idl.toHash(destAddr), + current_location : egCore.idl.toHash( + egCore.org.get(egCore.auth.user().ws_ou())) + } + + var template = 'transit_slip'; + if (holdUser) { + template = 'hold_transit_slip'; + print_context.hold = egCore.idl.toHash(evt.payload.hold), + print_context.patron = egCore.idl.toHash(holdUser); + } + egCore.hatch.printFromTemplate( + 'default', template, print_context); } }], resolve : { -- 2.11.0