PINES Long-Overdue transit message long-overdue-gpls-transit
authorBill Erickson <berick@esilibrary.com>
Tue, 9 Jul 2013 15:46:30 +0000 (11:46 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 9 Jul 2013 15:49:49 +0000 (11:49 -0400)
Before printing any transit slips for long-overdue items, insert the
PINES long-overdue transit warning/message.  Since transit slips come
from stock templates OR the local file system (regardless of local
modifications), this is the only method for guaranteeing the message is
included in all transit slips.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/xul/staff_client/server/circ/util.js

index 36c168e..d687059 100644 (file)
@@ -3675,6 +3675,29 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                             'data' : print_data,
                             'context' : data.print_list_templates[ template ].context,
                         };
+
+                        /* PINES-specific long-overdue transit_slip handling.
+                         * This forces the long-overdue message into all 
+                         * transit slips for long-overdue items, regardless
+                         * of any local modifications.
+                         * ------------------------------------------------*/
+                        if (template == 'transit_slip' &&
+                                check.payload.transit &&
+                                check.payload.transit.copy_status() == 16) {
+                                // 16 == long-overdue
+
+                            // remove the trailing <br/>\r\n
+                            parms.header = parms.header.substring(
+                                0, parms.header.length - 7);
+
+                            // add the LO language and recover <br>, etc.
+                            parms.header += 
+                                'This item is in status Longoverdue, ' +
+                                'additional staff action may be required.' +
+                                '<br/>\r\n<br/>\r\n';
+                        }
+                        /* ------------------------------------------------*/
+
                         if ($('printer_prompt')) {
                             if (! $('printer_prompt').checked) { parms.no_prompt = true; }
                         }