用户本身能够看到与我相关,其他用户则看不到该项!

This commit is contained in:
huangjingquan 2013-08-10 20:34:32 +08:00
parent e3be481bac
commit f4fc3d9dbe
3 changed files with 14 additions and 2 deletions

View File

@ -218,7 +218,7 @@ class UsersController < ApplicationController
def info def info
@message = [] @message = []
if @user == User.current if @user == User.current
@message = JournalsForMessage.reference_message(@user.id) @message = JournalsForMessage.reference_message(@user.id)
end end
unless User.current.admin? unless User.current.admin?

View File

@ -92,6 +92,7 @@
<!--fans--> <!--fans-->
<div class="user_fans"> <div class="user_fans">
<div class="font_title_left"> <div class="font_title_left">
<strong><%= l(:label_user_fans) %></strong>
</div> </div>
<div class="left_wf"> <div class="left_wf">
<table> <table>
@ -110,7 +111,11 @@
<div id="content" style="padding-top: 0px;"> <div id="content" style="padding-top: 0px;">
<div class="tabs_new"> <div class="tabs_new">
<% if @user == User.current %>
<%= render_menu :user_menu_self %>
<%else%>
<%= render_menu :user_menu %> <%= render_menu :user_menu %>
<%end%>
</div> </div>
<%= yield %> <%= yield %>
<%= call_hook :view_layouts_base_content %> <%= call_hook :view_layouts_base_content %>

View File

@ -266,8 +266,15 @@ end
#end #end
#added by young #added by young
Redmine::MenuManager.map :user_menu do |menu| Redmine::MenuManager.map :user_menu do |menu|
menu.push :activity, {:controller => 'users', :action => 'show' }
menu.push :project, {:controller => 'users', :action => 'user_projects'}
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'}
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback'}
end
Redmine::MenuManager.map :user_menu_self do |menu|
menu.push :activity, {:controller => 'users', :action => 'show' } menu.push :activity, {:controller => 'users', :action => 'show' }
menu.push :user_information, {:controller => 'users', :action => 'info'} menu.push :user_information, {:controller => 'users', :action => 'info'}
menu.push :project, {:controller => 'users', :action => 'user_projects'} menu.push :project, {:controller => 'users', :action => 'user_projects'}
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'}
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback'} menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback'}