From 6bd1fc7600fb3813864a0a8ec2914900082419b2 Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Thu, 8 May 2014 11:47:03 -0400 Subject: [PATCH] print_custom: call sums func, add phone numbers Call the print_do_sums function so that span-based summing will work, and add a class-based replacement called tadlPhoneNumber (accepts library shortname as an argument). Signed-off-by: Jeff Godin --- .../chrome/content/util/print_custom.js | 26 +++++++++++++++++++ 1 file changed, 26 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 7554143a2f..1aac45689e 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 @@ -1,6 +1,11 @@ function print_custom(type) { var type; // we don't care about type + // call print_do_sums + if (typeof print_do_sums == "function") { + print_do_sums(); + } + var elements = document.getElementsByClassName("rcpt"); var i; @@ -22,6 +27,27 @@ function print_custom(type) { slipName = family_name.substring(0,20).toUpperCase() + ' ' + first_given_name.substring(0,2).toUpperCase(); } e.innerHTML = slipName; + } else if (e.className.match(/tadlPhoneNumber/gi)) { + var phone_number; + var lib_shortname = document.getElementById('lib_shortname').textContent; + + if (lib_shortname) { + var phonemap = { + 'TADL-EBB': '231-922-2085', + 'TADL-FLPL': '231-879-4101', + 'TADL-IPL': '231-276-6767', + 'TADL-KBL': '231-263-5484', + 'TADL-PCL': '231-223-7700', + 'TADL-WOOD': '231-932-8500', + } + + phone_number = phonemap[lib_shortname]; + + if (phone_number) { + e.innerHTML = phone_number; + } + + } } } -- 2.43.2