]> source.dussan.org Git - redmine.git/commitdiff
"hide my email address" preference added, so that it's not displayed on account/show
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 3 Dec 2006 20:51:17 +0000 (20:51 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 3 Dec 2006 20:51:17 +0000 (20:51 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@63 e93f8b46-1217-0410-a6f0-8f06a7374b81

redmine/app/controllers/my_controller.rb
redmine/app/views/account/show.rhtml
redmine/app/views/my/account.rhtml
redmine/db/migrate/009_add_hide_mail_pref.rb [new file with mode: 0644]
redmine/lang/de.yml
redmine/lang/en.yml
redmine/lang/es.yml
redmine/lang/fr.yml

index 25f362df2d7b505925fd40ca668d157f488a389b..ff12b74d76a7d8e6e3540c935db1fb088addfe14 100644 (file)
@@ -44,7 +44,10 @@ class MyController < ApplicationController
   # Edit user's account
   def account
     @user = self.logged_in_user
-    if request.post? and @user.update_attributes(@params[:user])
+    @pref = @user.pref
+    @user.attributes = params[:user]
+    @user.pref.attributes = params[:pref]
+    if request.post? and @user.save
       set_localization
       flash.now[:notice] = l(:notice_account_updated)
       self.logged_in_user.reload
index 4fa3067649434a645fe26f26a2969238c67e75bf..9852389511f7200c30de11bdd324c0ceeebe4071 100644 (file)
@@ -1,7 +1,7 @@
 <h2><%= @user.display_name %></h2>\r
 \r
 <p>\r
-<%= mail_to @user.mail %>\r
+<%= mail_to @user.mail unless @user.pref.hide_mail %>\r
 <ul>\r
     <li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li>\r
 <% for custom_value in @custom_values %>\r
index 3a2c5f3ad45d67b2d6c73c6444e838f61b782664..58b0867ebb8add23d836992eaea8feb2d0ebd861 100644 (file)
@@ -28,6 +28,9 @@
   <p><label for="user_mail_notification"><%=l(:field_mail_notification)%></label>
   <%= check_box 'user', 'mail_notification' %></p>\r
 
+  <p><label for="pref_hide_mail"><%=l(:field_hide_mail)%></label>
+  <%= check_box 'pref', 'hide_mail' %></p>
+
   <center><%= submit_tag l(:button_save) %></center>
   <%= end_form_tag %>\r
   </div>\r
diff --git a/redmine/db/migrate/009_add_hide_mail_pref.rb b/redmine/db/migrate/009_add_hide_mail_pref.rb
new file mode 100644 (file)
index 0000000..a22eafd
--- /dev/null
@@ -0,0 +1,9 @@
+class AddHideMailPref < ActiveRecord::Migration
+  def self.up
+    add_column :user_preferences, :hide_mail, :boolean, :default => false
+  end
+
+  def self.down
+    remove_column :user_preferences, :hide_mail
+  end
+end
index 98625237b1eeaee6e670131698e9de2c3f63417d..7eaa3d05a31423f282c55900897e38cdc0175c06 100644 (file)
@@ -134,6 +134,7 @@ field_attr_mail: Emailattribut
 field_onthefly: On-the-fly Benutzerkreation\r
 field_start_date: Beginn\r
 field_done_ratio: %% Getan\r
+field_hide_mail: Mein email address verstecken\r
 \r
 label_user: Benutzer\r
 label_user_plural: Benutzer\r
index acdd8c66f1ef3225cc92c84bec8d1694c3b4f389..a3aad04679b46fae153e862581153006b74ab59b 100644 (file)
@@ -134,6 +134,7 @@ field_attr_mail: Email attribute
 field_onthefly: On-the-fly user creation\r
 field_start_date: Start\r
 field_done_ratio: %% Done\r
+field_hide_mail: Hide my email address\r
 \r
 label_user: User\r
 label_user_plural: Users\r
index 6cfb5c78f037201f8321e666a9703fb8f9fda50e..f87a3113380bac2664327d0ec45db6df1374e6da 100644 (file)
@@ -134,6 +134,7 @@ field_attr_mail: Cualidad del Email
 field_onthefly: Creación del usuario On-the-fly\r
 field_start_date: Comienzo\r
 field_done_ratio: %% Realizado\r
+field_hide_mail: Ocultar mi email address\r
 \r
 label_user: Usuario\r
 label_user_plural: Usuarios\r
index 5530b51524fc38e5f7fb0a14bf29f03a07a47a53..8e7829b193cea4c90d06aa85868cbd88ed108212 100644 (file)
@@ -135,6 +135,7 @@ field_onthefly: Création des utilisateurs à la volée
 field_start_date: Début\r
 field_done_ratio: %% Réalisé\r
 field_auth_source: Mode d'authentification\r
+field_hide_mail: Cacher mon adresse mail\r
 \r
 label_user: Utilisateur\r
 label_user_plural: Utilisateurs\r