From: Dan Scott Date: Wed, 1 Aug 2012 15:12:36 +0000 (-0400) Subject: TPAC: Add config options to hide phone / user prefs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5a7aaa6e832342b99eadca6c73ef7fc8c9d48867;p=contrib%2FConifer.git TPAC: Add config options to hide phone / user prefs Libraries using centralized authentication (such as LDAP via open-ils.auth_proxy) will not want to allow users to change their passwords or email addresses. In addition, many libraries do not want to deal with phone notifications. This commit adds preferences to config.tt2 that hide these options from the user. Signed-off-by: Dan Scott Signed-off-by: Dan Wells --- diff --git a/Open-ILS/src/templates/opac/myopac/prefs.tt2 b/Open-ILS/src/templates/opac/myopac/prefs.tt2 index 38b78b47f9..8e45561eb4 100644 --- a/Open-ILS/src/templates/opac/myopac/prefs.tt2 +++ b/Open-ILS/src/templates/opac/myopac/prefs.tt2 @@ -84,21 +84,29 @@ [% l("Username") %] [% ctx.user.usrname | html %] - [% IF ctx.username_change_disallowed %] + [%- IF ctx.username_change_disallowed %] - [% ELSE %] + [%- ELSE %] [% l("Change") %] - [% END %] + [%- END %] [% l("Password") %] [% l("(not shown)") %] + [%- IF disable_password_change == 'true' %] + + [%- ELSE %] [% l("Change") %] + [%- END %] [% l("Email Address") %] [% ctx.user.email | html %] + [%- IF disable_email_change == 'true' %] + + [%- ELSE %] [% l('Change') %] + [%- END %] [% IF ctx.user.ident_value %] diff --git a/Open-ILS/src/templates/opac/myopac/prefs_notify.tt2 b/Open-ILS/src/templates/opac/myopac/prefs_notify.tt2 index 57eed227d8..cf7309a4ce 100644 --- a/Open-ILS/src/templates/opac/myopac/prefs_notify.tt2 +++ b/Open-ILS/src/templates/opac/myopac/prefs_notify.tt2 @@ -27,6 +27,7 @@ [% IF (matches = ctx.user_setting_map.$setting.match('email')); %] checked='checked' [% END %]/> + [%- IF allow_phone_notifications == 'true' %] [% l('Notify by Phone by default when a hold is ready for pickup?') %] @@ -43,6 +44,7 @@ [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/> + [%- END %] [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %] [% l('Notify by Text by default when a hold is ready for pickup?') %] diff --git a/Open-ILS/src/templates/opac/parts/config.tt2 b/Open-ILS/src/templates/opac/parts/config.tt2 index e334975330..c8e87ef95f 100644 --- a/Open-ILS/src/templates/opac/parts/config.tt2 +++ b/Open-ILS/src/templates/opac/parts/config.tt2 @@ -56,6 +56,22 @@ google_analytics.code = 'UA-9999999-99'; reset_password = 'true'; ############################################################################## +# Hide various options from user preferences that you might not want to expose +# if you rely on centralized authentication via open-ils.auth_proxy, like LDAP +# +# Username changes can be disabled by the opac.lock_usernames OU setting. +############################################################################## +disable_password_change = 'false'; +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 +############################################################################## +allow_phone_notifications = 'true'; + +############################################################################## # Misc. UI Settings ############################################################################## diff --git a/Open-ILS/src/templates/opac/parts/place_hold.tt2 b/Open-ILS/src/templates/opac/parts/place_hold.tt2 index edbaa42d11..31892fd871 100644 --- a/Open-ILS/src/templates/opac/parts/place_hold.tt2 +++ b/Open-ILS/src/templates/opac/parts/place_hold.tt2 @@ -80,6 +80,7 @@
[% l('Email Address:') %] [% ctx.user.email %]
+ [%- IF allow_phone_notifications == 'true' %] [% l('Yes, by Phone') %]
@@ -88,6 +89,7 @@ IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [%- ELSIF ctx.user.day_phone; %] value='[% ctx.user.day_phone | html %]' [% END %]/> + [%- END -%] [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %]