From: Jeff Godin Date: Tue, 4 Sep 2012 11:50:07 +0000 (-0400) Subject: Add tadlHoldName macro to print_custom.js X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=afe1a324e31b0331f1f726b688ddbae5171b655b;p=evergreen%2Ftadl.git 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 --- 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; } }