Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop
This commit is contained in:
commit
c7d96dd183
|
@ -17,12 +17,18 @@ module CoursesHelper
|
||||||
|
|
||||||
# 根据角色查询
|
# 根据角色查询
|
||||||
def searchCountByRoles project, roles_id
|
def searchCountByRoles project, roles_id
|
||||||
count = -1
|
people = searchPeopleByRoles project, roles_id
|
||||||
|
people.count
|
||||||
|
end
|
||||||
|
|
||||||
|
# 根据角色查人
|
||||||
|
def searchPeopleByRoles project, roles_id
|
||||||
|
people = []
|
||||||
begin
|
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
|
rescue Exception => e
|
||||||
logger.error "[CoursesHelper] ===> #{e}"
|
logger.error "[CoursesHelper] ===> #{e}"
|
||||||
end
|
end
|
||||||
count
|
people
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
<title><%= h html_title %></title>
|
||||||
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
||||||
<meta name="keywords" content="issue,bug,tracker" />
|
<meta name="keywords" content="issue,bug,tracker" />
|
||||||
<%= csrf_meta_tag %>
|
<%= csrf_meta_tag %>
|
||||||
|
|
|
@ -5,8 +5,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="member_content">
|
<div class="member_content">
|
||||||
<%= error_messages_for 'member' %>
|
<%= error_messages_for 'member' %>
|
||||||
<% roles = Role.find_all_givable
|
<% roles = Role.find_all_givable %>
|
||||||
members = @project.member_principals.includes(:roles, :principal).all.sort %>
|
<% 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 %>
|
<% if @project.project_type == 1 %>
|
||||||
<%= render :partial => 'member_list', :locals => {:members => members} %>
|
<%= render :partial => 'member_list', :locals => {:members => members} %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -17,7 +17,13 @@
|
||||||
<td>
|
<td>
|
||||||
<table width="580px" border="0">
|
<table width="580px" border="0">
|
||||||
<tr>
|
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" width="580px" >
|
<td colspan="2" width="580px" >
|
||||||
|
|
Loading…
Reference in New Issue