From: Jason Stephenson Date: Tue, 26 Apr 2022 19:38:12 +0000 (-0400) Subject: Lp1969967: Move allow_phone_notifications to organizational unit settings X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1d20cc63b08e02d58735847642145fbe8fc7e601;p=working%2FEvergreen.git Lp1969967: Move allow_phone_notifications to organizational unit settings Move the allow_phone_notifications OPAC setting to the organizational unit settings as 'opac.allow_phone_notifications': 1. Create the new organizational unit setting. 2. Modify the OPAC to look the setting up from the OU settings. 3. Add a note to the OPAC config.tt2 files to indicate that the setting has moved. Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index a0f937cacf..ba29cb6f12 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -22176,3 +22176,22 @@ VALUES ( ) ); +INSERT INTO config.org_unit_setting_type (name, grp, label, description, datatype) VALUES +( + 'opac.allow_phone_notifications', + 'opac', + oils_i18n_gettext( + 'opac.allow_phone_notifications', + 'Enable phone notification features.', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'opac.allow_phone_notifications', + 'Enabling this setting exposes the notify by phone options for hold pickup in the OPAC. If this setting is not enabled, the phone options will not be offered to the user.', + 'coust', + 'description' + ), + 'bool' +); + diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.opac.allow_phone_notifications-ous.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.opac.allow_phone_notifications-ous.sql new file mode 100644 index 0000000000..5b55bffbe9 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.opac.allow_phone_notifications-ous.sql @@ -0,0 +1,24 @@ +BEGIN; + +--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +INSERT INTO config.org_unit_setting_type (name, grp, label, description, datatype) VALUES +( + 'opac.allow_phone_notifications', + 'opac', + oils_i18n_gettext( + 'opac.allow_phone_notifications', + 'Enable phone notification features.', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'opac.allow_phone_notifications', + 'Enabling this setting exposes the notify by phone options for hold pickup in the OPAC. If this setting is not enabled, the phone options will not be offered to the user.', + 'coust', + 'description' + ), + 'bool' +); + +COMMIT; 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 e7c8b80ce4..59077c1318 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/prefs_notify.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/prefs_notify.tt2 @@ -38,7 +38,7 @@ [% IF (matches = ctx.user_setting_map.$setting.match('email')); %] checked='checked' [% END %]/> - [%- IF allow_phone_notifications == 'true'; + [%- IF ctx.get_org_setting(ctx.search_ou, 'opac.allow_phone_notifications') == 1; setting = 'opac.hold_notify'; -%] diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/config-fresh.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/config-fresh.tt2 index 0cea9e4887..17157e7c36 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/config-fresh.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/config-fresh.tt2 @@ -79,8 +79,10 @@ disable_email_change = 'false'; # Some libraries do not do notifications by phone; if not true, then this # hides the user preference for phone notifications as well as the phone # notification portion of the hold dialogue +# +# The allow_phone_notificaitons setting has moved to the Library Settings in +# the staff client. It is no longer set here. ############################################################################## -allow_phone_notifications = 'true'; ############################################################################## # Format of parts selection on Place Holds screen diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/config.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/config.tt2 index 7409a4b4ec..2e7ff97507 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/config.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/config.tt2 @@ -80,8 +80,10 @@ disable_email_change = 'false'; # Some libraries do not do notifications by phone; if not true, then this # hides the user preference for phone notifications as well as the phone # notification portion of the hold dialogue +# +# The allow_phone_notificaitons setting has moved to the Library Settings in +# the staff client. It is no longer set here. ############################################################################## -allow_phone_notifications = 'true'; ############################################################################## # Format of parts selection on Place Holds screen diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 index 7af5d42848..c1a5446940 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 @@ -250,7 +250,7 @@ function maybeToggleNumCopies(obj) {

- [%- IF allow_phone_notifications == 'true' %] + [%- IF ctx.get_org_setting(ctx.search_ou, 'opac.allow_phone_notifications') == 1 %]