From 55fc5f9f2c06ec84411def844268c5174afc402f Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Tue, 4 Sep 2012 07:50:07 -0400 Subject: [PATCH] Add tadlHoldName macro to print_custom.js Add tadlHoldName macro to print_custom.js, used for printing either the patron alias or a string based on the patron first and last name. Signed-off-by: Jeff Godin --- Open-ILS/xul/staff_client/chrome/content/util/print_custom.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print_custom.js b/Open-ILS/xul/staff_client/chrome/content/util/print_custom.js index f59ec8261a..7554143a2f 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/print_custom.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/print_custom.js @@ -11,6 +11,17 @@ function print_custom(type) { pullDate.setDate(pullDate.getDate() + 7); var writeString = parseInt(pullDate.getMonth()+1) + '/' + pullDate.getDate(); e.innerHTML = writeString; + } else if (e.className.match(/tadlHoldName/gi)) { + var family_name = document.getElementById('family_name').textContent; + var first_given_name = document.getElementById('first_given_name').textContent; + var patron_alias = document.getElementById('patron_alias').textContent; + var slipName; + if (patron_alias) { + slipName = patron_alias; + } else { + slipName = family_name.substring(0,20).toUpperCase() + ' ' + first_given_name.substring(0,2).toUpperCase(); + } + e.innerHTML = slipName; } } -- 2.11.0