* fixed Issue 87: admin account problem

git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@159 5e329b0b-a2ee-ea63-e329-299493fc886d
This commit is contained in:
vit.jonas@gmail.com 2011-06-15 12:54:10 +00:00
parent a1f7cc2fa7
commit 9267a4536b
10 changed files with 21 additions and 4 deletions

View File

@ -26,9 +26,13 @@ class DmsfStateController < ApplicationController
def user_pref_save
member = @project.members.find(:first, :conditions => {:user_id => User.current.id})
member.dmsf_mail_notification = params[:email_notify];
member.save!
flash[:notice] = l(:notice_your_preferences_were_saved)
if member
member.dmsf_mail_notification = params[:email_notify];
member.save!
flash[:notice] = l(:notice_your_preferences_were_saved)
else
flash[:warning] = l(:user_is_not_project_member)
end
redirect_to :controller => "projects", :action => 'settings', :tab => 'dmsf', :id => @project
end

View File

@ -3,11 +3,15 @@
<% form_tag({:controller => "dmsf_state", :action => "user_pref_save", :id => @project},
:method=>:post) do %>
<div>
<%
member = @project.members.find(:first, :conditions => {:user_id => User.current.id})
mail_notification = member ? member.dmsf_mail_notification : nil
%>
<%= l(:label_notifications) %>:
<%= select_tag("email_notify",
options_for_select([[l(:select_option_default), nil],
[l(:select_option_activated), true], [l(:select_option_deactivated), false]],
:selected => @project.members.find(:first, :conditions => {:user_id => User.current.id}).dmsf_mail_notification)) %>
:selected => mail_notification)) %>
<%= submit_tag(l(:submit_save), :title => l(:title_save_preferences)) %>
</div>
<% end %>

View File

@ -162,3 +162,5 @@ cs:
# Not translated
:label_physical_file_delete: "Physical file delete"
:user_is_not_project_member: "You are not member of the project"

View File

@ -161,4 +161,5 @@ de:
:warning_xapian_not_available: "Xapian not available"
:menu_dmsf: "DMSF"
:label_physical_file_delete: "Physical file delete"
:user_is_not_project_member: "You are not member of the project"

View File

@ -155,4 +155,5 @@ en-GB:
:warning_xapian_not_available: "Xapian not available"
:menu_dmsf: "DMSF"
:label_physical_file_delete: "Physical file delete"
:user_is_not_project_member: "You are not member of the project"

View File

@ -159,4 +159,5 @@ en:
:warning_xapian_not_available: "Xapian not available"
:menu_dmsf: "DMSF"
:label_physical_file_delete: "Physical file delete"
:user_is_not_project_member: "You are not member of the project"

View File

@ -157,4 +157,5 @@ es:
:warning_xapian_not_available: "Xapian not available"
:menu_dmsf: "DMSF"
:label_physical_file_delete: "Physical file delete"
:user_is_not_project_member: "You are not member of the project"

View File

@ -155,4 +155,5 @@ fr:
:warning_xapian_not_available: "Xapian not available"
:menu_dmsf: "DMSF"
:label_physical_file_delete: "Physical file delete"
:user_is_not_project_member: "You are not member of the project"

View File

@ -159,4 +159,5 @@ en:
:warning_xapian_not_available: "Xapian not available"
:menu_dmsf: "DMSF"
:label_physical_file_delete: "Physical file delete"
:user_is_not_project_member: "You are not member of the project"

View File

@ -155,4 +155,5 @@ ru:
:warning_xapian_not_available: "Xapian not available"
:menu_dmsf: "DMSF"
:label_physical_file_delete: "Physical file delete"
:user_is_not_project_member: "You are not member of the project"