diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-01-17 14:14:12 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-01-17 14:14:12 +0000 |
commit | e3618bdbecd9b5d86eb6d2c8c256ba3fcdf05189 (patch) | |
tree | 3b54c10eecece6cc2674491a76a4e5e932d82d1e /app/helpers | |
parent | 7f29c2fd88f271ac59f1c10b90942fec57b35ae2 (diff) | |
download | redmine-e3618bdbecd9b5d86eb6d2c8c256ba3fcdf05189.tar.gz redmine-e3618bdbecd9b5d86eb6d2c8c256ba3fcdf05189.zip |
Add support for multiple email addresses per user (#4244).
git-svn-id: http://svn.redmine.org/redmine/trunk@13886 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/email_addresses_helper.rb | 38 | ||||
-rw-r--r-- | app/helpers/users_helper.rb | 6 |
2 files changed, 44 insertions, 0 deletions
diff --git a/app/helpers/email_addresses_helper.rb b/app/helpers/email_addresses_helper.rb new file mode 100644 index 000000000..f397e9907 --- /dev/null +++ b/app/helpers/email_addresses_helper.rb @@ -0,0 +1,38 @@ +# encoding: utf-8 +# +# Redmine - project management software +# Copyright (C) 2006-2015 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +module EmailAddressesHelper + + # Returns a link to enable or disable notifications for the address + def toggle_email_address_notify_link(address) + if address.notify? + link_to image_tag('email.png'), + user_email_address_path(address.user, address, :notify => '0'), + :method => :put, + :title => l(:label_disable_notifications), + :remote => true + else + link_to image_tag('email_disabled.png'), + user_email_address_path(address.user, address, :notify => '1'), + :method => :put, + :title => l(:label_enable_notifications), + :remote => true + end + end +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 1bd1d9a91..2ba41fa62 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -42,6 +42,12 @@ module UsersHelper end end + def additional_emails_link(user) + if user.email_addresses.count > 1 || Setting.max_additional_emails.to_i > 0 + link_to l(:label_email_address_plural), user_email_addresses_path(@user), :class => 'icon icon-email-add', :remote => true + end + end + def user_settings_tabs tabs = [{:name => 'general', :partial => 'users/general', :label => :label_general}, {:name => 'memberships', :partial => 'users/memberships', :label => :label_project_plural} |