Add Shelf Expire Time to hold slip, date formatter
authorThomas Berezansky <tsbere@mvlc.org>
Wed, 18 May 2011 23:12:42 +0000 (19:12 -0400)
committerJason Etheridge <jason@esilibrary.com>
Thu, 19 May 2011 14:05:02 +0000 (10:05 -0400)
Date formatter would work like so:
%DATE_FORMAT(date,format)%

For example:
%DATE_FORMAT(%shelf_expire_time%,%m/%d)%

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/chrome/content/util/print.js
Open-ILS/xul/staff_client/server/circ/util.js

index 4f9cbdd..8c571c5 100644 (file)
@@ -302,6 +302,14 @@ util.print.prototype = {
                 }
             } catch(E) { dump(E+'\n'); }
 
+            // Date Format
+            try {
+                var match;
+                var date_format_patt=/%DATE_FORMAT\(([^,]*),([^)]*)\)%/
+                while(match = date_format_patt.exec(s))
+                    s = s.replace(match[0], util.date.formatted_date(match[1], match[2]));
+            } catch(E) { dump(E+'\n'); }
+
             // Substrings
             try {
                 var match;
index 9859415..32f3a60 100644 (file)
@@ -2566,6 +2566,7 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
             'notify_by_email_msg' : '',
             'request_date' : '',
             'request_date_msg' : '',
+            'shelf_expire_time' : '',
             'slip_date' : '',
             'slip_date_msg' : '',
             'user' : '',
@@ -2764,6 +2765,7 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                         msg += '\n';
                         print_data.request_date = util.date.formatted_date(check.payload.hold.request_time(),'%F');
                         print_data.request_date_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.request_date', [print_data.request_date]);
+                        print_data.shelf_expire_time = check.payload.hold.shelf_expire_time();
                         msg += print_data.request_date_msg;
                         msg += '\n';
                     }