diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index bdcef99c2..628672602 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -76,12 +76,14 @@ class IssuesController < ApplicationController # else # @limit = 10#per_page_option # end + @tracker_id = params[:tracker_id] @assign_to_id = params[:assigned_to_id] @author_id = params[:author_id] @priority_id = params[:priority_id] @status_id = params[:status_id] @subject = params[:subject] @done_ratio = params[:done_ratio] + @fixed_version_id = params[:fixed_version_id] @issue_count = @query.issue_count # @issue_pages = Paginator.new @issue_count, @limit, params['page'] # params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1 diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 489854ead..7b1347d3f 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -126,6 +126,10 @@ module IssuesHelper end end + def options_for_version_isuue_list(project) + versions = Version.where(:project_id => project, :status => "open").map{|version| version.name}.unshift(["里程碑", 0]) + end + def render_issue_subject_with_tree(issue) s = '' ancestors = issue.root? ? [] : issue.ancestors.visible.all diff --git a/app/views/issues/_new_issue_list.html.erb b/app/views/issues/_new_issue_list.html.erb new file mode 100644 index 000000000..a2de27b7d --- /dev/null +++ b/app/views/issues/_new_issue_list.html.erb @@ -0,0 +1,91 @@ +
+
+ 新 增 + + 导出EXCEL +
+ <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> + <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %> + <%= hidden_field_tag 'set_filter', '1' %> +
+ + 清除 +
+ + <%= text_field_tag 'issue_create_date_start_show', '开始日期', :readonly => true, :size => 13, :nhname => 'date_show', :class => 'issues_calendar_input fl '%> + <%= calendar_for('issue_create_date_start_show') %> + + + <%= text_field_tag 'issue_create_date_end_show', '结束日期', :readonly => true, :size => 13, :nhname => 'date_show', :class => 'issues_calendar_input fl'%> + <%= calendar_for('issue_create_date_end_show') %> + + + +
+
+ +
+ +
+
+ <%= select(:issue, :tracker_id, [["缺陷",1],["功能",2],["支持",3],["任务",4],["周报",5]].unshift(["类型",0]), + {:include_blank => false, :selected => @tracker_id ? @tracker_id : 0}, + {:onchange => "remote_function();", :id => "tracker_id", :name => "tracker_id", :class => "fl issues_filter_select_min"}) %> + <%= select( :issue, :user_id, principals_options_for_isuue_list(@project), + { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0}, + {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl"}) + %> + + <%= select(:issue, :fixed_version_id, options_for_version_isuue_list(@project), + {:include_blank => false, :selected => @fixed_version_id ? @fixed_version_id : 0}, + {:onchange => "remote_function();", :id => "fixed_version_id", :name => "fixed_version_id", :class => "f1"}) %> + + <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), + { :include_blank => false,:selected=>@status_id ? @status_id : 0 + }, + {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"fl issues_filter_select_min"} + ) %> + + <%= select(:issue, :done_ratio, [["10%",1],["20%",2],["30%",3],["40%",4],["50%",5],["60%",6],["70%",7],["80%",8],["90%",9],["10%",10]].unshift(["完成度",0]), + {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0 }, + {:onchange => "remote_function();", :id => "done_ratio", :name => "done_ratio", :class => "f1"}) %> + + <%= select(:issue, :test, [["最早创建",1],["最早更新",2]].unshift(["排序",0]), + {:include_blank => false, :selected => @order ? @order : 0 }, + {:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %> +
+
+
+ <% if @issues.empty? %> +

<%= l(:label_no_data) %>

+ <% else %> +
+ <%= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> +
+ <% end %> + <%#= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> +
+ + <% end %> + <% end %> +
diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 13ea19882..87ce27a71 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -1,183 +1,3 @@ - - - - - 缺陷列表及头部 - - - - - - -
-
-
- -
-
- -

邀请码
Y7AUZ

-
-
-

尹刚/Trustie Forge

私有 -
-

- 项目评分:123 - 浏览:123 - 关注:123 - 成员:123 -

-
- 关注 -
-
-
-
- - - -
- - -
- -
- - 清除 -
- - -
-
- - -
- -
-
- - <%= select( :issue, :user_id, principals_options_for_isuue_list(@project), - { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 - }, - {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl"} - ) - %> - - <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), - { :include_blank => false,:selected=>@status_id ? @status_id : 0 - }, - {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"fl issues_filter_select_min"} - ) - %> - - -
-
-
-
- <%= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> -
- -
- ddd - -
-
- - ddd -
-
- -
- -
- - - - - - - - - - - - - <%= content_for(:header_tags) do %> <%= import_ke(enable_at: true,init_activity: true) %> <% end %> @@ -239,7 +59,7 @@ // 点击的时候让过滤条件选中assign_to function switch_assign_to(assign) { var assign = "option[value =" + assign + "]" - $("#assignToMe").click(function(){ + $("#issues_type_2").click(function(){ }); $("select[id='assigned_to_id']").find(assign).attr("selected", "selected"); @@ -264,152 +84,81 @@
-
-
<%= l(:label_issue_tracking) %>
-
-
- <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> - <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %> - <%= hidden_field_tag 'set_filter', '1' %> - - <%#= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %> -

<%= l(:label_issues_sum) %>:<%= @project.project_score.issue_num %> - <%= l(:lable_issues_undo) %>:<%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> -

- -
-
- - <%= select( :issue, :user_id, principals_options_for_isuue_list(@project), - { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 - }, - {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"w90 mr18"} - ) - %> - <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), - { :include_blank => false,:selected=>@priority_id ? @priority_id : 0 - }, - {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w90 mr18"} - ) - %> - <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), - { :include_blank => false,:selected=>@status_id ? @status_id : 0 - }, - {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"w90 mr18"} - ) - %> - <%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]), - { :include_blank => false,:selected=>@author_id ? @author_id : 0 - }, - {:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"w90 mr18"} - ) - %> -
- 指派我的 - 所有的 - 我发布的 - - -
-
 
-
- - <%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%> - <%= calendar_for('issue_create_date_start_show') %> -
-
 - 
-
- - <%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%> - <%= calendar_for('issue_create_date_end_show') %> -
-
-
- <% end %> - -
- <% end %> + <%= render :partial => 'issues/new_issue_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> +
+ <% if !@query.new_record? && @query.editable_by?(User.current) %> + <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> + <%= delete_link query_path(@query) %> + <% end %>
+ <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> +
+
-
- <% if !@query.new_record? && @query.editable_by?(User.current) %> - <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> - <%= delete_link query_path(@query) %> - <% end %> -
+ <%= error_messages_for 'query' %> - <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> -
-
- - <%= error_messages_for 'query' %> - - <% if @query.valid? %> - <% if @issues.empty? %> -

- <%= l(:label_no_data) %> -

- <% else %> -
+ <% if @query.valid? %> + <% if @issues.empty? %> +

+ <%= l(:label_no_data) %> +

+ <% else %> +
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> -
+
+ <% end %> + +
+ <%= link_to "导出:Excel", project_issues_path(:project_id => @project, :format => 'xls') %> + <%# other_formats_links do |f| %> + <%#= f.link_to "XLS", :url => params, :remote => false %> + <%#= f.link_to 'PDF', :url => params %> + <%# end %> +
+ + + <% end %> + <%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %> + <% content_for :sidebar do %> + <%= render :partial => 'issues/sidebar' %> + <% end %> -
- <%= link_to "导出:Excel", project_issues_path(:project_id => @project, :format => 'xls') %> - <%# other_formats_links do |f| %> - <%#= f.link_to "XLS", :url => params, :remote => false %> - <%#= f.link_to 'PDF', :url => params %> - <%# end %> -
+ <% content_for :header_tags do %> + <%= auto_discovery_link_tag(:atom, + {:query_id => @query, :format => 'atom', + :page => nil, :key => User.current.rss_key}, + :title => l(:label_issue_plural)) %> + <%= auto_discovery_link_tag(:atom, + {:controller => 'journals', :action => 'index', + :query_id => @query, :format => 'atom', + :page => nil, :key => User.current.rss_key}, + :title => l(:label_changes_details)) %> + <% end %> - - <% end %> - <%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %> - <% content_for :sidebar do %> - <%= render :partial => 'issues/sidebar' %> - <% end %> - - <% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, - {:query_id => @query, :format => 'atom', - :page => nil, :key => User.current.rss_key}, - :title => l(:label_issue_plural)) %> - <%= auto_discovery_link_tag(:atom, - {:controller => 'journals', :action => 'index', - :query_id => @query, :format => 'atom', - :page => nil, :key => User.current.rss_key}, - :title => l(:label_changes_details)) %> - <% end %> - - <%= context_menu issues_context_menu_path %> + <%= context_menu issues_context_menu_path %>
\ No newline at end of file