From b8b406a6c4ed7e6cfd99a6c0b69cb12a09b7351d Mon Sep 17 00:00:00 2001 From: Victor Boctor Date: Thu, 10 Nov 2016 08:54:55 -0800 Subject: [PATCH] User preference UI for full issue details in email Fixes #21876 --- account_prefs_inc.php | 9 +++++++++ account_prefs_update.php | 7 +++++++ lang/strings_english.txt | 1 + 3 files changed, 17 insertions(+) diff --git a/account_prefs_inc.php b/account_prefs_inc.php index d7ebb04745..352c7671d5 100644 --- a/account_prefs_inc.php +++ b/account_prefs_inc.php @@ -82,6 +82,7 @@ function edit_account_prefs( $p_user_id = null, $p_error_if_protected = true, $p } $t_pref = user_pref_get( $p_user_id ); + $t_email_full_issue = (int)config_get( 'email_notifications_verbose', /* default */ null, $p_user_id, ALL_PROJECTS ); # Account Preferences Form BEGIN ?> @@ -261,6 +262,13 @@ function edit_account_prefs( $p_user_id = null, $p_error_if_protected = true, $p +
+ + + /> + + +
@@ -281,6 +289,7 @@ function edit_account_prefs( $p_user_id = null, $p_error_if_protected = true, $p +
diff --git a/account_prefs_update.php b/account_prefs_update.php index 242a20ed2c..d459355650 100644 --- a/account_prefs_update.php +++ b/account_prefs_update.php @@ -106,6 +106,13 @@ $t_prefs->bugnote_order = gpc_get_string( 'bugnote_order' ); $t_prefs->email_bugnote_limit = gpc_get_int( 'email_bugnote_limit' ); +# Save user preference with regards to getting full issue details in notifications or not. +$t_email_full_issue = gpc_get_bool( 'email_full_issue' ) ? 1 : 0; +$t_email_full_config_option = 'email_notifications_verbose'; +if( config_get( $t_email_full_config_option, /* default */ null, $f_user_id, ALL_PROJECTS ) != $t_email_full_issue ) { + config_set( $t_email_full_config_option, $t_email_full_issue, $f_user_id, ALL_PROJECTS ); +} + # make sure the delay isn't too low if( ( config_get( 'min_refresh_delay' ) > $t_prefs->refresh_delay )&& ( $t_prefs->refresh_delay != 0 )) { diff --git a/lang/strings_english.txt b/lang/strings_english.txt index 8c19ee8063..e0ce88211d 100644 --- a/lang/strings_english.txt +++ b/lang/strings_english.txt @@ -409,6 +409,7 @@ $s_email_on_bugnote_added = 'E-mail on Note Added'; $s_email_on_status_change = 'E-mail on Status Change'; $s_email_on_priority_change = 'E-mail on Priority Change'; $s_email_bugnote_limit = 'E-mail Notes Limit'; +$s_email_full_issue_details = 'E-mail Full Issue Details'; $s_language = 'Language'; $s_update_prefs_button = 'Update Prefs'; $s_reset_prefs_button = 'Reset Prefs';