From c8a263f9f3b0e9d14711bc3e49b7dcc091cb15f0 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Wed, 18 May 2011 19:12:42 -0400 Subject: [PATCH] Add Shelf Expire Time to hold slip, date formatter Date formatter would work like so: %DATE_FORMAT(date,format)% For example: %DATE_FORMAT(%shelf_expire_time%,%m/%d)% Signed-off-by: Thomas Berezansky Signed-off-by: Jason Etheridge --- Open-ILS/xul/staff_client/chrome/content/util/print.js | 8 ++++++++ Open-ILS/xul/staff_client/server/circ/util.js | 2 ++ 2 files changed, 10 insertions(+) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print.js b/Open-ILS/xul/staff_client/chrome/content/util/print.js index 4f9cbdd6da..8c571c5922 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/print.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js @@ -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; diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index 985941595c..32f3a6082d 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -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'; } -- 2.11.0