From: Bill Erickson Date: Fri, 12 May 2017 20:22:14 +0000 (-0400) Subject: LP#1670242 Webstaff checkin transit holds addr fix X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Flp1670242-hold-transit-checkin-fix;p=working%2FEvergreen.git LP#1670242 Webstaff checkin transit holds addr fix Gracefully handle cases where a checkin results in a transit to a branch with no holds address. Route dialog and print templates now display "We do not have a holds address for this library. " Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/circ/share/t_transit_dialog.tt2 b/Open-ILS/src/templates/staff/circ/share/t_transit_dialog.tt2 index 69d927148a..2562e6afc8 100644 --- a/Open-ILS/src/templates/staff/circ/share/t_transit_dialog.tt2 +++ b/Open-ILS/src/templates/staff/circ/share/t_transit_dialog.tt2 @@ -14,8 +14,14 @@
{{dest_location.name}}
- {{dest_address.street1}} {{dest_address.street2}}
- {{dest_address.city}}, {{dest_address.state}} {{dest_address.post_code}}
+ + {{dest_address.street1}} {{dest_address.street2}}
+ {{dest_address.city}}, {{dest_address.state}} {{dest_address.post_code}} +
+ + [% l('We do not have a holds address for this library.') %] + +
P: {{dest_location.phone}}
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 index eb002b893e..a0aa6ef501 100644 --- 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 @@ -24,11 +24,16 @@ Template for printing hold transit slips. Fields include:
[% 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}}
+
+
{{dest_address.street1}}
+
{{dest_address.street2}}
+
{{dest_address.city}}, + {{dest_address.state}} + {{dest_address.post_code}}
+
+
+ [% l('We do not have a holds address for this library.') %] +

[% l('Barcode: [_1]', '{{copy.barcode}}') %]
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 afd5aabfd8..ccf9e8c05d 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 @@ -15,11 +15,16 @@ Template for printing a transit slip. Fields include:
[% 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}}
+
+
{{dest_address.street1}}
+
{{dest_address.street2}}
+
{{dest_address.city}}, + {{dest_address.state}} + {{dest_address.post_code}}
+
+
+ [% l('We do not have a holds address for this library.') %] +

[% l('Barcode: [_1]', '{{copy.barcode}}') %]
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 4c48ae6099..d669400d96 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 @@ -624,6 +624,8 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, var org = egCore.org.get(org_id); var addr_id = org[addr_type](); + if (!addr_id) return $q.when(null); + if (egCore.env.aoa && egCore.env.aoa.map[addr_id]) return $q.when(egCore.env.aoa.map[addr_id]); @@ -1404,7 +1406,9 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, // route_dialog includes the "route to holds shelf" // dialog, which has no transit print_context.transit = egCore.idl.toHash(data.transit); - print_context.dest_address = egCore.idl.toHash(data.address); + if (data.address) { + print_context.dest_address = egCore.idl.toHash(data.address); + } print_context.dest_location = egCore.idl.toHash(egCore.org.get(data.transit.dest())); }