Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

This commit is contained in:
xianbo 2013-10-31 17:29:04 +08:00
commit c7d96dd183
5 changed files with 158 additions and 143 deletions

View File

@ -17,12 +17,18 @@ module CoursesHelper
# 根据角色查询
def searchCountByRoles project, roles_id
count = -1
people = searchPeopleByRoles project, roles_id
people.count
end
# 根据角色查人
def searchPeopleByRoles project, roles_id
people = []
begin
count = project.members.joins(:member_roles).where("member_roles.role_id = :role_id", {:role_id => roles_id }).count
people = project.members.joins(:member_roles).where("member_roles.role_id = :role_id", {:role_id => roles_id })
rescue Exception => e
logger.error "[CoursesHelper] ===> #{e}"
end
count
people
end
end

View File

@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>

View File

@ -5,8 +5,10 @@
</div>
<div class="member_content">
<%= error_messages_for 'member' %>
<% roles = Role.find_all_givable
members = @project.member_principals.includes(:roles, :principal).all.sort %>
<% roles = Role.find_all_givable %>
<% members = @project.member_principals.includes(:roles, :principal).all.sort %>
<% members = searchPeopleByRoles(@project, 3).sort if params[:role] == '1' %>
<% members = searchPeopleByRoles(@project, 5).sort if params[:role] == '2' %>
<% if @project.project_type == 1 %>
<%= render :partial => 'member_list', :locals => {:members => members} %>
<% else %>

View File

@ -17,7 +17,13 @@
<td>
<table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong><span class="font_lighter"> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> <%= l(:label_new_activity) %> </span> <%= link_to format_activity_title(e.event_title), e.event_url %> </td>
<td colspan="2" valign="top">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong>
<span class="font_lighter">
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<%= l(:label_new_activity) %> </span>
<%= link_to format_activity_title(e.event_title), e.event_url %>
</td>
</tr>
<tr>
<td colspan="2" width="580px" >