From 6f165e8013be90f33d40310d7f16df6f5b84441f Mon Sep 17 00:00:00 2001 From: phasefx Date: Fri, 13 Aug 2010 02:39:49 +0000 Subject: [PATCH] change the (Copy) link next to addresses in the patron summary to (Copy/Print), with a popup menu for choosing which action to do git-svn-id: svn://svn.open-ils.org/ILS/trunk@17204 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 6 +-- .../xul/staff_client/server/patron/summary.xul | 48 +++++++++++----------- .../staff_client/server/patron/summary_overlay.xul | 11 ++++- .../server/patron/summary_overlay_horiz.xul | 16 ++++++-- 4 files changed, 49 insertions(+), 32 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 575f100d5..0b12f8992 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1356,7 +1356,6 @@ - @@ -1364,14 +1363,15 @@ - + + + - diff --git a/Open-ILS/xul/staff_client/server/patron/summary.xul b/Open-ILS/xul/staff_client/server/patron/summary.xul index 33b821b28..b80e4afb5 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary.xul +++ b/Open-ILS/xul/staff_client/server/patron/summary.xul @@ -76,8 +76,19 @@ } } - function copy_address(a) { + function export_address(ev) { + var action = ev.originalTarget.id; + var a; var p = g.summary.patron; + switch(document.popupNode.id) { + case 'addr_export_mailing': + a = g.summary.patron.mailing_address(); + break; + case 'addr_export_physical': + a = g.summary.patron.billing_address(); + break; + }; + var parts = [ p.first_given_name(), p.second_given_name(), p.family_name(), a.street1(), a.street2(), a.city(), a.county(), @@ -89,30 +100,19 @@ var s = $("patronStrings").getFormattedString( 'staff.patron.mailable_address_format', parts ); - // Replace literal instances of '\n' and excessive whitespace. - copy_to_clipboard( - s.replace(/(\\n)+/g, "\r\n").replace(/ {2,}/g, " ") - ); - } - - function copy_displayed_address() { - if ( $('radio_address').selectedIndex == 0 ) { - copy_mailing_address(); - } else { - copy_billing_address(); - } - } - - function copy_mailing_address() { - var a = g.summary.patron.mailing_address(); - if (!a) return; - copy_address(a); - } - function copy_billing_address() { - var a = g.summary.patron.billing_address(); - if (!a) return; - copy_address(a); + switch(action) { + case 'addr_export_copy': + // Replace literal instances of '\n' and excessive whitespace. + s = s.replace(/(\\n)+/g, "\r\n").replace(/ {2,}/g, " "); + copy_to_clipboard(s); + break; + case 'addr_export_print': + // Replace literal instances of '\n' and excessive whitespace. + s = s.replace(/(\\n)+/g, "
").replace(/ {2,}/g, " "); + JSAN.use('util.print'); var print = new util.print(); print.simple(s); + break; + }; } function post_overlay() { diff --git a/Open-ILS/xul/staff_client/server/patron/summary_overlay.xul b/Open-ILS/xul/staff_client/server/patron/summary_overlay.xul index 2371a8cd9..0c540e1f8 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/summary_overlay.xul @@ -198,6 +198,13 @@ + + + + + + + @@ -209,7 +216,7 @@ - @@ -224,7 +231,7 @@ - diff --git a/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul b/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul index 8ddd04ce8..1e30b78f1 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul +++ b/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul @@ -247,6 +247,13 @@ + + + + + + + @@ -273,16 +280,19 @@ - -- 2.11.0