From ceb56824e7ca2031366580b2d41397bdcc8102d4 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 24 Apr 2013 11:05:02 -0400 Subject: [PATCH] LP 1169193 transit_slip macro for copy status Adds support for a new 'transit_slip' receipt template macro called "transit_copy_status", which displays the stored status of the in-transit copy (i.e. the status the copy will be placed in once it arrives at the transit destination). This is useful, in particular, for lost or long-overdue items which are not "immediately available" upon checkin. Signed-off-by: Bill Erickson Signed-off-by: Jason Stephenson --- Open-ILS/xul/staff_client/server/circ/util.js | 29 +++++++++++++++++-- .../server/locale/en-US/circ.properties | 1 + 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index c3a9c5542e..5b81b636d0 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -1,5 +1,4 @@ dump('entering circ/util.js\n'); -// vim:noet:sw=4:ts=4: if (typeof circ == 'undefined') { var circ = {}; } circ.util = {}; @@ -1827,6 +1826,24 @@ circ.util.transit_columns = function(modify,params) { 'hidden' : true, 'editable' : false, 'render' : function(my) { return my.atc.target_copy(); } }, + { + // status of the copy on the transit, not "in-transit". + // putting this here allows 'transit_copy_status' to + // appear as a MACRO for the 'transit_slip' receipt. + // Note that the actual value (for checkin) is + // collected below in circ.util.checkin_via_barcode2(). + 'persist' : 'hidden width ordinal', + 'id' : 'transit_copy_status', + 'label' : document.getElementById('circStrings'). + getString('staff.circ.utils.transit_copy_status'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'editable' : false, + 'render' : function(my) { + return data.hash.ccs[ my.atc.copy_status() ].name(); + } + }, ]; for (var i = 0; i < c.length; i++) { if (modify[ c[i].id ]) { @@ -2978,7 +2995,8 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che 'slip_date' : '', 'slip_date_msg' : '', 'user' : '', - 'user_stat_cat_entries' : '' + 'user_stat_cat_entries' : '', + 'transit_copy_status' : '' }; if (check.payload && check.payload.cancelled_hold_transit) { @@ -3483,6 +3501,13 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che print_data.item_author = payload_author; msg += print_data.item_author_msg; msg += '\n'; + if (check.payload.transit) { + // by adding this here, we make the data available to the + // receipt printing engine, but since we are not appending it + // to the 'msg', it will not display in the pre-print dialog. + print_data.transit_copy_status = + data.hash.ccs[check.payload.transit.copy_status()].name(); + } JSAN.use('util.date'); if (check.payload.hold) { check.what_happened = 'transit_for_hold'; diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties b/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties index cf4ae70781..74402fb2a3 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties @@ -307,6 +307,7 @@ staff.circ.utils.transit_source_send_time=Transit Send Time staff.circ.utils.transit_dest=Transit Destination staff.circ.utils.transit_dest_recv_time=Transit Completion Time staff.circ.utils.transit_target_copy=Transit Copy ID +staff.circ.utils.transit_copy_status=Transit Copy Status staff.circ.utils.request_lib=Request Library (Full Name) staff.circ.utils.request_lib_shortname=Request Library staff.circ.utils.request_time=Request Date -- 2.43.2