LP 1169193 transit_slip macro for copy status
authorBill Erickson <berick@esilibrary.com>
Wed, 24 Apr 2013 15:05:02 +0000 (11:05 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Fri, 9 Aug 2013 19:58:19 +0000 (15:58 -0400)
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 <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties

index c3a9c55..5b81b63 100644 (file)
@@ -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';
index cf4ae70..74402fb 100644 (file)
@@ -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