里程碑加入导出excel功能
This commit is contained in:
parent
2ae7dd0087
commit
c37c880eb2
|
@ -54,7 +54,6 @@ class VersionsController < ApplicationController
|
||||||
@versions = @versions.slice(@offset, @limit)
|
@versions = @versions.slice(@offset, @limit)
|
||||||
#end by young
|
#end by young
|
||||||
|
|
||||||
|
|
||||||
@issues_by_version = {}
|
@issues_by_version = {}
|
||||||
if @selected_tracker_ids.any? && @versions.any?
|
if @selected_tracker_ids.any? && @versions.any?
|
||||||
issues = Issue.visible.all(
|
issues = Issue.visible.all(
|
||||||
|
@ -81,6 +80,14 @@ class VersionsController < ApplicationController
|
||||||
all
|
all
|
||||||
}
|
}
|
||||||
format.api
|
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))
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -57,10 +57,10 @@
|
||||||
<div class="roadmap_list">
|
<div class="roadmap_list">
|
||||||
<p class="f14 mb5">»<%= l(:label_versions_description)%></p>
|
<p class="f14 mb5">»<%= l(:label_versions_description)%></p>
|
||||||
<p><%=h version.description %></p>
|
<p><%=h version.description %></p>
|
||||||
|
<p class="f14 mb5">»<%= link_to "导出:XLS", version_path(version, :format => 'xls') %></p>
|
||||||
</div><!--roadmap_list end-->
|
</div><!--roadmap_list end-->
|
||||||
</div><!--roadmap_box end-->
|
</div><!--roadmap_box end-->
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<ul class="wlist" >
|
<ul class="wlist" >
|
||||||
<%= pagination_links_full @versions_pages%>
|
<%= pagination_links_full @versions_pages%>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue