# The < and > highlight that the value is not set; translate Unset and change the delimiters as needed
staff.patron.field.unset=<Unset>
+# Unused by default but available: %7 is county; %10 is country.
+staff.patron.mailable_address_format=%1$s %2$s %3$s\n%4$s\n%5$s\n%6$s %8$s, %9$s
+
web.staff.patron.ue.session_no_defined=User session is not defined
web.staff.patron.ue.uedit_show_search.search_would_be=Search would be:\n%1$s
web.staff.patron.ue.uedit_show_addr_replacement=<div>Replaces address <b>%1$s</b><br/> %2$s %3$s<br/> %4$s, %5$s %6$s</div>
}
}
+ function copy_address(a) {
+ var p = g.summary.patron;
+ var s = $("patronStrings").getFormattedString(
+ 'staff.patron.mailable_address_format',
+ [p.first_given_name(), p.second_given_name(), p.family_name(),
+ a.street1(), a.street2(), a.city(), a.county(),
+ a.state(), a.post_code(), a.country()]
+ );
+ // Without the following call to replace(), you get
+ // literal instances of '\n' in the string.
+ copy_to_clipboard(s.replace(/(\\n)+/g, "\n"));
+ }
+
function copy_mailing_address() {
var a = g.summary.patron.mailing_address();
if (!a) return;
- copy_to_clipboard(
- (a.street1() ? a.street1() : "") + "\t" +
- (a.street2() ? a.street2() : "") + "\t" +
- (a.county() ? a.county() : "") + "\t" +
- (a.city() ? a.city() : "") + "\t" +
- (a.post_code() ? a.post_code() : "") + "\t" +
- (a.country() ? a.country() : "")
- );
+ copy_address(a);
}
-
+
function copy_billing_address() {
var a = g.summary.patron.billing_address();
if (!a) return;
- copy_to_clipboard(
- (a.street1() ? a.street1() : "") + "\t" +
- (a.street2() ? a.street2() : "") + "\t" +
- (a.county() ? a.county() : "") + "\t" +
- (a.city() ? a.city() : "") + "\t" +
- (a.post_code() ? a.post_code() : "") + "\t" +
- (a.country() ? a.country() : "")
- );
+ copy_address(a);
}
function post_overlay() {