所有我的issue功能
This commit is contained in:
parent
e956d20d6e
commit
d65a062737
|
@ -91,14 +91,40 @@ class UsersController < ApplicationController
|
||||||
# subject 主题:搜索用(注意:搜索和列表调用同一方法,通过参数或者remote区分)
|
# subject 主题:搜索用(注意:搜索和列表调用同一方法,通过参数或者remote区分)
|
||||||
def user_issues
|
def user_issues
|
||||||
@subject = params[:subject]
|
@subject = params[:subject]
|
||||||
author_id = params[:author_id]
|
# author_id = params[:author_id]
|
||||||
|
params[:assigned_to_id].to_i == 0 ? @assigned_to = nil : @assigned_to = params[:assigned_to_id].to_i
|
||||||
|
params[:author_id].to_i == 0 ? author_id = nil : author_id = params[:author_id].to_i
|
||||||
params[:project_id].to_i == 0 ? @project_id = nil : @project_id = params[:project_id]
|
params[:project_id].to_i == 0 ? @project_id = nil : @project_id = params[:project_id]
|
||||||
if @project_id.nil?
|
if @project_id.nil?
|
||||||
@issues = Issue.where("(author_id =? or assigned_to_id =? ) and subject like ?", (author_id ? author_id : @user.id) , @user.id, "%#{@subject}%").order('updated_on desc')
|
if @assigned_to.nil?
|
||||||
|
if author_id.nil?
|
||||||
|
@issues = Issue.where("(author_id =? or assigned_to_id =? ) and subject like ?",
|
||||||
|
@user.id , @user.id, "%#{@subject}%").order('updated_on desc')
|
||||||
else
|
else
|
||||||
@issues = Issue.where("(author_id =? or assigned_to_id =? ) and project_id=? and subject like ?", (author_id ? author_id : @user.id) , @user.id, @project_id, "%#{@subject}%").order('updated_on desc')
|
@issues = Issue.where("author_id =? and subject like ?",
|
||||||
|
author_id , "%#{@subject}%").order('updated_on desc')
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@issues = Issue.where("assigned_to_id =? and subject like ?", @assigned_to, "%#{@subject}%").order('updated_on desc')
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
if @assigned_to.nil?
|
||||||
|
if author_id.nil?
|
||||||
|
@issues = Issue.where("(author_id =? or assigned_to_id =? ) and project_id=? and subject like ?",
|
||||||
|
(author_id ? author_id : @user.id) , @user.id, @project_id, "%#{@subject}%").order('updated_on desc')
|
||||||
|
else
|
||||||
|
@issues = Issue.where("author_id =? and project_id=? and subject like ?",
|
||||||
|
author_id , @project_id, "%#{@subject}%").order('updated_on desc')
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@issues = Issue.where("assigned_to_id =? and project_id=? and subject like ?",
|
||||||
|
@assigned_to, @project_id, "%#{@subject}%").order('updated_on desc')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@issues_filter = Issue.where("author_id =? or assigned_to_id =?", (author_id ? author_id : @user.id) , @user).order('updated_on desc')
|
@issues_filter = Issue.where("author_id =? or assigned_to_id =?", (author_id ? author_id : @user.id) , @user).order('updated_on desc')
|
||||||
|
@issues_assigned_count = Issue.where("assigned_to_id =? and subject like ?", @user.id, "%#{@subject}%").count
|
||||||
|
@issues_author_count = Issue.where("author_id =? and subject like ?", @user.id, "%#{@subject}%").count
|
||||||
@issue_open_count = Issue.where(" (author_id =? or assigned_to_id =?) and status_id in (1,2,3,4,6)", (author_id ? author_id : @user.id) , @user).count
|
@issue_open_count = Issue.where(" (author_id =? or assigned_to_id =?) and status_id in (1,2,3,4,6)", (author_id ? author_id : @user.id) , @user).count
|
||||||
@issue_close_count = Issue.where("(author_id =? or assigned_to_id =?) and status_id = 5", (author_id ? author_id : @user.id) , @user.id).count
|
@issue_close_count = Issue.where("(author_id =? or assigned_to_id =?) and status_id = 5", (author_id ? author_id : @user.id) , @user.id).count
|
||||||
@issue_count = @issues.count
|
@issue_count = @issues.count
|
||||||
|
|
|
@ -40,11 +40,19 @@ module UsersHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 我的issue 来源
|
||||||
def options_for_issue_project_list( issues )
|
def options_for_issue_project_list( issues )
|
||||||
issues = issues.group_by{|issue| issue.project_id}
|
issues = issues.group_by{|issue| issue.project_id}
|
||||||
issues.map{ |issue| [Project.find(issue[0]).name, issue[0]]}.unshift(["来源", 0])
|
issues.map{ |issue| [Project.find(issue[0]).name, issue[0]]}.unshift(["来源", 0])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 我的issue指派给我
|
||||||
|
def options_for_my_issue_list(issues)
|
||||||
|
# issues = issues.group_by{|issue| issue.assigned_to_id }
|
||||||
|
# issues.map{ |issue| [User.find(issue[0]).show_name, issue[0]]}.unshift(["指派给", 0])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
def get_resource_type type
|
def get_resource_type type
|
||||||
case type
|
case type
|
||||||
when 'Course'
|
when 'Course'
|
||||||
|
|
|
@ -6,3 +6,17 @@
|
||||||
</script>
|
</script>
|
||||||
<%= render :partial => 'users/my_issue_list', :locals => {:activity => issue, :user_activity_id => issue.id} %>
|
<%= render :partial => 'users/my_issue_list', :locals => {:activity => issue, :user_activity_id => issue.id} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<div style="text-align:left;">
|
||||||
|
<div style="width:auto; display:inline-block;">
|
||||||
|
<ul>
|
||||||
|
<a href="javascript:void(0)" class="hw_btn_blue ml10 mt10 mb10" alt="导出EXCEL">导出EXCEL</a>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="pages fr" style="width:auto; display:inline-block;margin-top:10px">
|
||||||
|
<ul id="issue_list_pagination" class="fr">
|
||||||
|
<%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<span class="issues_nav_tag ml5" ><%= @issues_assigned_count %></span>
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
<script xmlns="http://www.w3.org/1999/html">
|
<script xmlns="http://www.w3.org/1999/html">
|
||||||
function add_style(){
|
function add_style(){
|
||||||
|
$("#proeject_id").val("来源")
|
||||||
if($("select[id='tracker_id']").val() != 0){
|
if($("select[id='tracker_id']").val() != 0){
|
||||||
$("#tracker_id").addClass('issues_filter_active');
|
$("#tracker_id").addClass('issues_filter_active');
|
||||||
}
|
}
|
||||||
|
@ -170,7 +171,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--缺陷列表开始-->
|
<!--缺陷列表开始-->
|
||||||
<div class="myissues_con mb10" style="margin-left:157px;">
|
<div id="myissues_con" class="myissues_con mb10">
|
||||||
<div class="myissues_head mb5">
|
<div class="myissues_head mb5">
|
||||||
<h2 class="ml15">我的缺陷</h2>
|
<h2 class="ml15">我的缺陷</h2>
|
||||||
</div>
|
</div>
|
||||||
|
@ -199,16 +200,20 @@
|
||||||
|
|
||||||
<div class="issues_con_list" style="position: relative;">
|
<div class="issues_con_list" style="position: relative;">
|
||||||
<ul id="issues_list_nav" >
|
<ul id="issues_list_nav" >
|
||||||
<li id="issues_list_nav_1" class="issues_nav_hover" >
|
<li id="issues_list_nav_1" class="issues_nav_hover" onclick="HoverLi(1);all_reset_form();">
|
||||||
<a href="javascript:void(0);" id="issues_type_1" >搜索结果</a>
|
<a href="javascript:void(0);" id="issues_type_1" onclick="all_reset_form();" >搜索结果</a>
|
||||||
<span id="issue_filter_all"><%= render :partial => "users/my_issue_filter_all" %></span>
|
<span id="issue_filter_all"><%= render :partial => "users/my_issue_filter_all" %></span>
|
||||||
</li>
|
</li>
|
||||||
<!-- <li id="issues_list_nav_2" onclick="HoverLi(2);">
|
<li id="issues_list_nav_2" onclick="HoverLi(2);">
|
||||||
<a href="javascript:void(0);" id="issues_type_2" >指派给我<span class="issues_nav_tag ml5">25</span></a>
|
<a href="javascript:void(0);" id="issues_type_2" onclick="switch_assign_to(<%= User.current.id %>)">指派给我
|
||||||
|
<span id="issue_assigned_count"><%= render :partial => "users/my_issue_assigned_filter" %></span>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li id="issues_list_nav_3" onclick="HoverLi(3);">
|
<li id="issues_list_nav_3" onclick="HoverLi(3);">
|
||||||
<a href="javascript:void(0);" id="issues_type_3" >我的发布<span class="issues_nav_tag ml5">5</span></a>
|
<a href="javascript:void(0);" id="issues_type_3" onclick="createByMe(<%= User.current.id %>)">我的发布<span class="issues_nav_tag ml5">
|
||||||
</li>-->
|
<%= @issues_author_count %>
|
||||||
|
</span></a>
|
||||||
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="issues_filter">
|
<div class="issues_filter">
|
||||||
|
@ -220,34 +225,45 @@
|
||||||
</select>-->
|
</select>-->
|
||||||
<%= select( :project, :project_id, options_for_issue_project_list(@issues_filter),
|
<%= select( :project, :project_id, options_for_issue_project_list(@issues_filter),
|
||||||
{ :include_blank => false,:selected => @project_id ? @project_id : 0 },
|
{ :include_blank => false,:selected => @project_id ? @project_id : 0 },
|
||||||
{ :onchange => "remote_function();add_style();",:id => "proeject_id", :name => "project_id",:class => "fl mr10"}
|
{ :onchange => "remote_function();add_style();",:id => "proeject_id", :name => "project_id", :class => "fl mr20", :style=>"width:90px;padding-left:40px;"}
|
||||||
)%>
|
)%>
|
||||||
<select placeholder=" 发布人" class="fl" disabled="disabled">
|
<select placeholder=" 发布人" class="fl my_issues_filter" disabled="disabled" style="width:70px;padding-left:20px;">
|
||||||
<option value="0" selected="selected">发布人</option>
|
<option value="0" selected="selected">发布人</option>
|
||||||
</select>
|
</select>
|
||||||
<select placeholder=" 类型" class="fl issues_filter_select_min" disabled="disabled">
|
<%= select( :issue, :user_id, [[@user.show_name, @user.id]].unshift(["发布人",0]),
|
||||||
|
{ :include_blank => false,:selected => @author_id ? @author_id : 0},
|
||||||
|
{:onchange => "remote_function();add_style();",:id => "author_id", :name => "author_id", :class => "fl", :style => "visibility:hidden;width: 0px;margin:0px;padding:0px;"}
|
||||||
|
)
|
||||||
|
%>
|
||||||
|
|
||||||
|
<select placeholder=" 类型" class="fl my_issues_filter" disabled="disabled" style="width:50px">
|
||||||
<option value="0" selected="selected">类型</option>
|
<option value="0" selected="selected">类型</option>
|
||||||
</select>
|
</select>
|
||||||
<select placeholder=" 指派给" class="fl" disabled="disabled">
|
<select placeholder=" 指派给" class="fl my_issues_filter" disabled="disabled" style="width:70px;padding-left:20px;">
|
||||||
<option value="0" selected="selected">指派给</option>
|
<option value="0" selected="selected">指派给</option>
|
||||||
</select>
|
</select>
|
||||||
<select placeholder=" 优先度" class="fl issues_filter_select_min02" disabled="disabled">
|
<%= select( :issue, :user_id, [[@user.show_name, @user.id]].unshift(["指派给",0]),
|
||||||
|
{ :include_blank => false, :selected => @assigned_to ? @assigned_to : 0},
|
||||||
|
{:onchange=>"remote_function();add_style();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl", :style => "visibility:hidden;width: 0px;margin:0px;padding:0px;"} )
|
||||||
|
%>
|
||||||
|
<select placeholder=" 优先度" class="fl my_issues_filter" disabled="disabled" style="width:50px;padding-left:5px;padding-right:5px;">
|
||||||
<option value="0" selected="selected">优先度</option>
|
<option value="0" selected="selected">优先度</option>
|
||||||
</select>
|
</select>
|
||||||
<select placeholder=" 里程碑" class="fl mr10 ml10" disabled="disabled">
|
<select placeholder=" 里程碑" class="fl my_issues_filter" disabled="disabled" style="width:90px;padding-left:30px;padding-right:20px;">
|
||||||
<option value="0" selected="selected">里程碑</option>
|
<option value="0" selected="selected">里程碑</option>
|
||||||
</select>
|
</select>
|
||||||
<select placeholder=" 状态" class="fl issues_filter_select_min" disabled="disabled">
|
<select placeholder=" 状态" class="fl my_issues_filter" disabled="disabled" style="width:50px">
|
||||||
<option value="0" selected="selected">状态</option>
|
<option value="0" selected="selected">状态</option>
|
||||||
</select>
|
</select>
|
||||||
<select placeholder=" 完成度" class="fl issues_filter_select_min02" disabled="disabled">
|
<select placeholder=" 完成度" class="fl my_issues_filter" disabled="disabled" style="width:60px">
|
||||||
<option value="0" selected="selected">完成度</option>
|
<option value="0" selected="selected">完成度</option>
|
||||||
</select>
|
</select>
|
||||||
<select placeholder=" 排序" class="fl issues_filter_select_min" disabled="disabled">
|
<select placeholder=" 排序" class="fl my_issues_filter" disabled="disabled" style="width:50px;visibility:hidden;">
|
||||||
<option value="0" selected="selected">排序</option>
|
<option value="0" selected="selected">排序</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @issues.empty? %>
|
<% if @issues.empty? %>
|
||||||
<p class="nodata mt10"><%= l(:label_no_data) %></p>
|
<p class="nodata mt10"><%= l(:label_no_data) %></p>
|
||||||
|
@ -256,23 +272,18 @@
|
||||||
<%= render :partial => 'users/all_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages,:issue_count => @issue_count, :subject => @subject } %>
|
<%= render :partial => 'users/all_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages,:issue_count => @issue_count, :subject => @subject } %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
</div><!--issues_filter end-->
|
</div><!--issues_filter end-->
|
||||||
<div id="issues_list_content_1">
|
<div id="issues_list_content_1">
|
||||||
|
|
||||||
</div><!--issues_list_content_1 end-->
|
</div><!--issues_list_content_1 end-->
|
||||||
|
|
||||||
<div id="issues_list_content_2" class="undis">
|
<div id="issues_list_content_2" class="undis">
|
||||||
ddd
|
|
||||||
|
|
||||||
</div><!--issues_list_content_2 end-->
|
</div><!--issues_list_content_2 end-->
|
||||||
<div id="issues_list_content_3" class="undis">
|
<div id="issues_list_content_3" class="undis">
|
||||||
|
|
||||||
ddd
|
|
||||||
</div><!--issues_list_content_3 end-->
|
</div><!--issues_list_content_3 end-->
|
||||||
</div><!--issues_con_list end-->
|
<!--issues_con_list end-->
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!--缺陷列表结束-->
|
<!--缺陷列表结束-->
|
||||||
|
|
||||||
<!--缺陷列表结束-->
|
<!--缺陷列表结束-->
|
||||||
|
|
|
@ -709,7 +709,8 @@ input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;}
|
||||||
.issues_form_filter select.issues_filter_select_min{width:50px; }
|
.issues_form_filter select.issues_filter_select_min{width:50px; }
|
||||||
.issues_form_filter select:focus,.issues_form_filter input:focus{border:none; }
|
.issues_form_filter select:focus,.issues_form_filter input:focus{border:none; }
|
||||||
.issues_filter_data input{height:28px;width:91px; border:1px solid #c8c8c8;background-color:#fff;}
|
.issues_filter_data input{height:28px;width:91px; border:1px solid #c8c8c8;background-color:#fff;}
|
||||||
.issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("../images/project/arrow.png") no-repeat scroll right center transparent;}
|
.issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("/images/new_project/arrow.png") no-repeat scroll right center transparent;}
|
||||||
|
.issues_form_filter select.my_issues_filter{ background:none; width:70px; padding-right:10px;padding-left:10px;}
|
||||||
input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;}
|
input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;}
|
||||||
.issues_data_img{ display:block; width:25px; height:28px; border:1px solid #c8c8c8; border-left:none; background: url("../images/public_icon.png") -29px 9px no-repeat; }
|
.issues_data_img{ display:block; width:25px; height:28px; border:1px solid #c8c8c8; border-left:none; background: url("../images/public_icon.png") -29px 9px no-repeat; }
|
||||||
|
|
||||||
|
@ -801,3 +802,10 @@ select.issues_filter_active { font-weight: bold; color: #333;}
|
||||||
.issues_form_filter select.issues_filter_select_min02{width:60px; }
|
.issues_form_filter select.issues_filter_select_min02{width:60px; }
|
||||||
.issues_form_filter select.issues_filter_select_max{width:90px; }
|
.issues_form_filter select.issues_filter_select_max{width:90px; }
|
||||||
.issues_list_txt li.issues_list_max{ width:90px }
|
.issues_list_txt li.issues_list_max{ width:90px }
|
||||||
|
.btn_newpro_grey{display: inline-block;color: #7b7b7b; border:1px solid #dbdbdb;background:#fff;text-align: center;font-size: 12px; padding:0 15px; height:24px; line-height: 24px; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px;}
|
||||||
|
a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;}
|
||||||
|
|
||||||
|
.my_issues_form_filter{ position: absolute; top:0; right: 0;}
|
||||||
|
.my_issues_form_filter select{ width:70px; height:30px; border:none; font-size:14px; border:none;border-right:none; color: #888; font-size: 12px; line-height: 30px; text-align:center}
|
||||||
|
.my_issues_form_filter select.issues_filter_select_min{width:50px; }
|
||||||
|
.my_issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none;}
|
Loading…
Reference in New Issue