From 7ef7c0c6f0cf34e179472f065284a45dc8b55fa6 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 27 Sep 2016 19:41:10 +0800 Subject: [PATCH 1/6] =?UTF-8?q?issue=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/index.html.erb | 38 ++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index d1bde712e..73decbf95 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -44,12 +44,30 @@ // }); } - function remote_function_export() { - $("#export_issue_hidden").attr("value","1"); -// $("#issue_query_form").attr("format","xls"); - $("#issue_query_form").submit(); + function remote_function_export(project_id) { +// $("#export_issue_hidden").attr("value","1"); +// $("#issue_query_form").attr("set_filter","1"); +// $("#issue_query_form").attr("action","/projects/"+project_id+"/issues.xls"); +// $("#issue_query_form").submit(); +// $("#issue_query_form").attr("action","/projects/"+project_id+"/issues"); // $("#issue_query_form").removeAttr("format"); - $("#export_issue_hidden").attr("value","0"); +// $("#issue_query_form").attr("set_filter","0"); +// $("#export_issue_hidden").attr("value","0"); + + var tracker_id = $("#tracker_id").attr("value"); + var subject = $("#v_subject").attr("value"); + var assigned_to_id = $("#assigned_to_id").attr("value"); + var fixed_version_id = $("#fixed_version_id").attr("value"); + var status_id = $("#status_id").attr("value"); + var done_ratio = $("#done_ratio").attr("value"); + var test = $("#test").attr("value"); + var author_id = $("#author_id").attr("value"); + var issue_create_date_start = $("#issue_date_start_issue_export").attr("value"); + var issue_create_date_end = $("#issue_date_end_issue_export").attr("value"); + $("#sendexcel").attr("href","/projects/"+project_id+"/issues.xls?export=true&set_filter=1&tracker_id="+tracker_id+"&assigned_to_id="+assigned_to_id+"&fixed_version_id="+fixed_version_id+"&status_id="+status_id+"&done_ratio="+done_ratio+"&test="+test+"&author_id="+author_id+"&subject="+subject+"&issue_create_date_start="+issue_create_date_start+"&issue_create_date_end="+issue_create_date_end); + ///projects/1811/issues.xls?export=true&set_filter=1 + + } // function nh_reset_form() { @@ -106,11 +124,11 @@
  • 关闭<%#= @issues_filter_author_count %><%= @project.issues.where(:status_id => 5 ).visible.all.count %>
  • - - " class="hw_btn_blue fr" alt="导出EXCEL" onclick="remote_function_export()">导出EXCEL + + " id="sendexcel" class="hw_btn_blue fr" alt="导出EXCEL" onclick="remote_function_export('<%= @project.id %>')">导出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 %> + <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'xls', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %> <%= hidden_field_tag 'set_filter', '1' %> <%= hidden_field_tag 'export_issue_hidden', '0' %> @@ -122,12 +140,12 @@ 清除
    - + <%= calendar_for('issue_create_date_end_show')%>
    - + <%= calendar_for('issue_create_date_start_show')%>
    From d656d3e94c909a992b486d922cbdcdf7d5a558b5 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 27 Sep 2016 19:43:11 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=84=E5=88=86?= =?UTF-8?q?=E4=B8=BA0=20=E7=9A=84=E6=97=B6=E5=80=99=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_project_top.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_base_project_top.html.erb b/app/views/layouts/_base_project_top.html.erb index c99155fad..2610b585b 100644 --- a/app/views/layouts/_base_project_top.html.erb +++ b/app/views/layouts/_base_project_top.html.erb @@ -25,13 +25,13 @@

    项目评分: <% if @project.project_type == 0 %> - <% unless static_project_score(@project.project_score) == 0 %> + <%# unless static_project_score(@project.project_score) == 0 %> <%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i, {:controller => 'projects', :action => 'show_projects_score', :remote => true, :id => @project.id}, :class => "sy_cblue" ) %> - <% end %> + <%# end %> <% end %> 浏览:<%= @project.visits.to_i %> From 7c76584e14b656e8a64898133f520aa9cf5fc422 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 27 Sep 2016 19:44:24 +0800 Subject: [PATCH 3/6] =?UTF-8?q?issue=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 6 +++--- app/controllers/versions_controller.rb | 13 +++++-------- app/views/projects/_project_jours.html.erb | 2 +- app/views/projects/settings.html.erb | 2 +- app/views/versions/index.html.erb | 2 +- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 3ddbcd9d6..263155f91 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -60,13 +60,13 @@ class IssuesController < ApplicationController def index if params[:set_filter] != "1" @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base' - @issues = @project.issues.visible.all - @issue_count = @issues.count + @issues_filter = Issue.where(:project_id => @project.id).order('updated_on desc') + @issue_count = @issues_filter.count @limit = 10 @is_remote = true @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 @offset ||= @issue_pages.offset - @issues = paginateHelper @issues, @limit + @issues = paginateHelper @issues_filter, @limit # if params[:set_filter] # @set_filter = params[:set_filter] # end diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 2dce0f37f..7e9d63e58 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -80,14 +80,11 @@ class VersionsController < ApplicationController all } format.api - format.xls { - @issues = @version.fixed_issues.visible. - includes(:status, :tracker, :priority). - reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id"). - all - filename = "#{@version.name.to_s}_#{l(:label_issue_list_xls)}.xls" - send_data(issue_list_xls(@issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) - } + # format.xls { + # @issues = @version.fixed_issues.visible.includes(:status, :tracker, :priority).reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").all + # filename = "#{@version.name.to_s}_#{l(:label_issue_list_xls)}.xls" + # send_data(issue_list_xls(@issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) + # } end end diff --git a/app/views/projects/_project_jours.html.erb b/app/views/projects/_project_jours.html.erb index a9f145c8a..6db3995ff 100644 --- a/app/views/projects/_project_jours.html.erb +++ b/app/views/projects/_project_jours.html.erb @@ -9,7 +9,7 @@ div.respond-form .reply_btn{margin-left:565px;margin-top:5px;} div.recall_con{width:570px;} - div.recall_con .reply_btn{margin-left:525px;margin-top:5px;} + div.recall_con .reply_btn{margin-left:606px;margin-top:5px;} <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> diff --git a/app/views/projects/settings.html.erb b/app/views/projects/settings.html.erb index faf3a48f8..0d4a55ff9 100644 --- a/app/views/projects/settings.html.erb +++ b/app/views/projects/settings.html.erb @@ -40,7 +40,7 @@ <% end %>

  • 组织
  • <% if User.current.allowed_to?(:manage_versions, @project) %> -
  • 版本
  • +
  • <%= l(:milestone) %>
  • <% end %> <% if User.current.allowed_to?(:manage_repository, @project) %> diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index 4e324aaf4..6b42dc3d8 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -58,7 +58,7 @@

    »<%= l(:label_versions_description)%>

    <%=h version.description %>

    -

    »<%= link_to "导出:Excel", version_path(version, :format => 'xls') %>

    +
    <% end %> From d647f7153acb6dc81b1323dd2275a1c8f16e5b33 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 27 Sep 2016 20:01:23 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=87=8C=E7=A8=8B?= =?UTF-8?q?=E7=A2=91=E6=9C=AF=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/zh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/zh.yml b/config/locales/zh.yml index d153ffe95..d57f29c39 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -623,7 +623,7 @@ zh: label_course_news_description: '课程必须是高校正式开设的课程,或是围绕特定主题定期发布课程资料的公共开放课程;
    如果您想创建一个协作研究空间,请您前往“我的项目”页面创建项目,谢谢!' label_course_board: 讨论区 label_version: 版本 - label_version_new: 新建版本 + label_version_new: 新建里程碑 label_close_versions: 关闭已完成的版本 label_confirmation: 确认 From b679783cc02739a9b51e0570ce1d5ca684c846c4 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 27 Sep 2016 20:04:29 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=ADissue=E5=9B=9E=E5=A4=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index e4f24d4e0..5a0065f86 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -95,7 +95,9 @@
    - +
    + <%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %> +