Mercurial > hg > soundsoftware-site
comparison app/controllers/users_controller.rb @ 55:bbb139d5ca95 luisf
changes to add SSAMR info. This is a development Commit - DO NOT USE this version.
author | luisf |
---|---|
date | Fri, 26 Nov 2010 15:44:34 +0000 |
parents | 94944d00e43c |
children | e77d73b181e3 |
comparison
equal
deleted
inserted
replaced
54:cbaf7863aafb | 55:bbb139d5ca95 |
---|---|
50 end | 50 end |
51 | 51 |
52 def show | 52 def show |
53 @user = User.find(params[:id]) | 53 @user = User.find(params[:id]) |
54 | 54 |
55 print @user.ssamr_user_detail.description | |
56 | |
57 # @description = @user.ssamr_user_detail.description | |
58 | |
55 # show projects based on current user visibility | 59 # show projects based on current user visibility |
56 @memberships = @user.memberships.all(:conditions => Project.visible_by(User.current)) | 60 @memberships = @user.memberships.all(:conditions => Project.visible_by(User.current)) |
57 | 61 |
58 events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 10) | 62 events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 10) |
59 @events_by_day = events.group_by(&:event_date) | 63 @events_by_day = events.group_by(&:event_date) |
85 | 89 |
86 @user = User.new(params[:user]) | 90 @user = User.new(params[:user]) |
87 @user.admin = params[:user][:admin] || false | 91 @user.admin = params[:user][:admin] || false |
88 @user.login = params[:user][:login] | 92 @user.login = params[:user][:login] |
89 @user.password, @user.password_confirmation = params[:password], params[:password_confirmation] unless @user.auth_source_id | 93 @user.password, @user.password_confirmation = params[:password], params[:password_confirmation] unless @user.auth_source_id |
94 | |
95 @user.ssamr_user_detail.description = params[:user.ssamr_user_detail][:description] | |
96 | |
97 @ssamr_description = params[:user.ssamr_user_detail][:description] | |
90 | 98 |
91 # TODO: Similar to My#account | 99 # TODO: Similar to My#account |
92 @user.mail_notification = params[:notification_option] || 'only_my_events' | 100 @user.mail_notification = params[:notification_option] || 'only_my_events' |
93 @user.pref.attributes = params[:pref] | 101 @user.pref.attributes = params[:pref] |
94 @user.pref[:no_self_notified] = (params[:no_self_notified] == '1') | 102 @user.pref[:no_self_notified] = (params[:no_self_notified] == '1') |
112 | 120 |
113 def edit | 121 def edit |
114 @user = User.find(params[:id]) | 122 @user = User.find(params[:id]) |
115 @notification_options = @user.valid_notification_options | 123 @notification_options = @user.valid_notification_options |
116 @notification_option = @user.mail_notification | 124 @notification_option = @user.mail_notification |
125 | |
126 # @ssamr_description = @user.ssamr_user_detail | |
117 | 127 |
118 @auth_sources = AuthSource.find(:all) | 128 @auth_sources = AuthSource.find(:all) |
119 @membership ||= Member.new | 129 @membership ||= Member.new |
120 end | 130 end |
121 | 131 |
122 verify :method => :put, :only => :update, :render => {:nothing => true, :status => :method_not_allowed } | 132 verify :method => :put, :only => :update, :render => {:nothing => true, :status => :method_not_allowed } |
123 def update | 133 def update |
124 @user = User.find(params[:id]) | 134 @user = User.find(params[:id]) |
135 | |
125 @notification_options = @user.valid_notification_options | 136 @notification_options = @user.valid_notification_options |
126 @notification_option = @user.mail_notification | 137 @notification_option = @user.mail_notification |
127 | 138 |
128 @user.admin = params[:user][:admin] if params[:user][:admin] | 139 @user.admin = params[:user][:admin] if params[:user][:admin] |
129 @user.login = params[:user][:login] if params[:user][:login] | 140 @user.login = params[:user][:login] if params[:user][:login] |