From da4979dd5a786dbdf6b9ee8729a72fd21b6a506d Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Fri, 28 Oct 2022 18:19:58 -0400 Subject: [PATCH] LP1895675 Bootstrap OPAC: Add notification method testing to My Account This adds the work done in the TPAC for LP1777677 to the Bootstrap OPAC. A test email button is added to My Account > Preferences, and a test text message button is added to My Account > Preferences > Notification Preferences. Signed-off-by: Terran McCanna Signed-off-by: Christine Burns Signed-off-by: Jane Sandberg --- .../templates-bootstrap/opac/myopac/prefs.tt2 | 21 +++++++++++++-- .../opac/myopac/prefs_notify.tt2 | 26 +++++++++++-------- .../opac/myopac/test_notification.tt2 | 18 +++++++++++++ .../templates-bootstrap/opac/parts/header.tt2 | 5 ++++ .../src/templates-bootstrap/opac/parts/js.tt2 | 2 ++ .../opac/parts/sms_carrier_selector.tt2 | 4 +-- 6 files changed, 61 insertions(+), 15 deletions(-) create mode 100644 Open-ILS/src/templates-bootstrap/opac/myopac/test_notification.tt2 diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2 index 5c34b56832..a7b1aa02dd 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2 @@ -2,8 +2,10 @@ WRAPPER "opac/parts/myopac/base.tt2"; myopac_page = "prefs"; parent="prefs"; - prefs_page = 'prefs' %] -

[% l('Account Information and Preferences') %]

+ prefs_page = 'prefs'; + can_call_action_trigger = 'true' %] + +

[% l('Account Information and Preferences') %]

@@ -91,6 +93,21 @@ [% l('Change') %] [%- END %] + [%- IF ctx.user.email %] + + + [% l('Send Test Email') %] + + + [%- END %] + + + + + diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/prefs_notify.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/prefs_notify.tt2 index 348bd45d6d..bb76c0b45e 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/prefs_notify.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/prefs_notify.tt2 @@ -2,8 +2,8 @@ WRAPPER "opac/parts/myopac/base.tt2"; myopac_page = "prefs_notify"; parent="prefs"; - prefs_page = 'prefs_notify' -%] + prefs_page = 'prefs_notify'; + can_call_action_trigger = 'true' %]

[% l('Notification Preferences') %]

@@ -127,26 +127,30 @@ [% setting = 'opac.default_sms_notify' %] - - - [% END %] + + + [% FOR optin IN ctx.opt_in_settings %] diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/test_notification.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/test_notification.tt2 new file mode 100644 index 0000000000..77ef5f56eb --- /dev/null +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/test_notification.tt2 @@ -0,0 +1,18 @@ +
+ [% l('Message Sent') %] +
+
+ [% l('If you do not receive ') %] [% IF message_type == "email" %] + [% l('an email') %] + [% ELSIF message_type == "sms" %] + [% l('a text') %] + [% END %] [% l(' message, contact your library for more information.') %] +
+ [% ctx.user.home_ou.name %]
+ [%- IF ctx.user.home_ou.phone; %] + [% ctx.user.home_ou.phone %]
+ [%- END %] + [%- IF ctx.user.home_ou.email %] + [% ctx.user.home_ou.email %]
+ [%- END %] +
\ No newline at end of file diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/header.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/header.tt2 index f54b472241..4bda61ee92 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/header.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/header.tt2 @@ -137,6 +137,11 @@ want_dojo = 1; END; + # ... and for interfaces that require manual trigger of action triggers + IF can_call_action_trigger == 'true'; + want_dojo = 1; + END; + # Especially useful for image 'alt' tags and link title tags, # where the content may need to be unique (making it longer) # but should not exceed 75 chars for ideal screen reader support. diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/js.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/js.tt2 index 87b7752a22..74e5ff868f 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/js.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/js.tt2 @@ -155,6 +155,8 @@ [% INCLUDE "opac/parts/ebook_api/login_js.tt2" IF (ctx.page == 'login') %] [% END %] + +
[% INCLUDE "opac/parts/sms_carrier_selector.tt2" sms_carrier_hide_label="true" %]
[% IF ctx.user_setting_map.$setting; %] - [% l('Send Test Text Message') %]
+ + + [% l('Send Test Text Message') %] + +
[% l('Hint: use the full 10 digits of your phone #, no spaces, no dashes'); %] [% END %]