Project

General

Profile

Feature #35647 » 0001-Dirty-and-untested-POC-for-35647.patch

Patch against trunk @ r21131 - Mischa The Evil, 2021-08-03 02:31

View differences:

app/controllers/reports_controller.rb
before_action :find_project, :authorize, :find_issue_statuses
def issue_report
with_subprojects = Setting.display_subprojects_issues?
@with_subprojects = params[:with_subprojects] || (Setting.display_subprojects_issues? ? 'true' : 'false')
@with_subprojects = 'false' unless %w(true false).include?(@with_subprojects)
with_subprojects = (@with_subprojects == 'true' ? true : false)
@trackers = @project.rolled_up_trackers(with_subprojects).visible
@versions = @project.shared_versions.sorted
@priorities = IssuePriority.all.reverse
......
end
def issue_report_details
with_subprojects = Setting.display_subprojects_issues?
@with_subprojects = params[:with_subprojects] || (Setting.display_subprojects_issues? ? 'true' : 'false')
@with_subprojects = 'false' unless %w(true false).include?(@with_subprojects)
with_subprojects = (@with_subprojects == 'true' ? true : false)
case params[:detail]
when "tracker"
@field = "tracker_id"
app/views/reports/_options_form.html.erb
<div id="options_form" class="<%= (@project.children.blank? ? 'hide-when-print' : '') %>">
<div id="options_form_content" style="margin-bottom: 1.4em;">
<fieldset id="options" class="collapsible collapsed">
<legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_options) %></legend>
<div class="hidden">
<!-- Choose with_subprojects param -->
<%= form_tag({:action => (action_name == 'issue_report' ? 'issue_report' : 'issue_report_details'), :id => @project}, :method => 'get') do %>
<div>
<table id="list-definition" %>
<tr>
<td>
<span class="field"><label for='with_subprojects'><%= l(:label_subproject_plural) %>:
</td>
<td>
<label><%= radio_button_tag 'with_subprojects', 'false', @with_subprojects != 'true', :onchange => "this.form.submit()" %> <%= l(:general_text_No) %></label>
<label><%= radio_button_tag 'with_subprojects', 'true', @with_subprojects == 'true', :onchange => "this.form.submit()" %> <%= l(:general_text_Yes) %></label>
</td>
</tr>
</table>
</div>
<% end %>
</div>
</fieldset>
</div>
</div>
app/views/reports/issue_report.html.erb
<h2><%=l(:label_report_plural)%></h2>
<% has_subproject = @project.children.any? %>
<%= render :partial => 'options_form' if has_subproject %>
<div class="splitcontent">
<div class="splitcontentleft">
<h3>
<%=l(:field_tracker)%>&nbsp;
<%= link_to l(:label_details),
project_issues_report_details_path(@project, :detail => 'tracker'),
project_issues_report_details_path(@project, :detail => 'tracker', :with_subprojects => @with_subprojects),
:class => 'icon-only icon-zoom-in',
:title => l(:label_details) %>
</h3>
......
<h3>
<%=l(:field_priority)%>&nbsp;
<%= link_to l(:label_details),
project_issues_report_details_path(@project, :detail => 'priority'),
project_issues_report_details_path(@project, :detail => 'priority', :with_subprojects => @with_subprojects),
:class => 'icon-only icon-zoom-in',
:title => l(:label_details) %>
</h3>
......
<h3>
<%=l(:field_assigned_to)%>&nbsp;
<%= link_to l(:label_details),
project_issues_report_details_path(@project, :detail => 'assigned_to'),
project_issues_report_details_path(@project, :detail => 'assigned_to', :with_subprojects => @with_subprojects),
:class => 'icon-only icon-zoom-in',
:title => l(:label_details) %>
</h3>
......
<h3>
<%=l(:field_author)%>&nbsp;
<%= link_to l(:label_details),
project_issues_report_details_path(@project, :detail => 'author'),
project_issues_report_details_path(@project, :detail => 'author', :with_subprojects => @with_subprojects),
:class => 'icon-only icon-zoom-in',
:title => l(:label_details) %>
</h3>
......
<h3>
<%=l(:field_version)%>&nbsp;
<%= link_to l(:label_details),
project_issues_report_details_path(@project, :detail => 'version'),
project_issues_report_details_path(@project, :detail => 'version', :with_subprojects => @with_subprojects),
:class => 'icon-only icon-zoom-in',
:title => l(:label_details) %>
</h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_version, :field_name => "fixed_version_id", :rows => @versions } %>
<br />
<% if @project.children.any? %>
<% if has_subproject %>
<h3>
<%=l(:field_subproject)%>&nbsp;
<%= link_to l(:label_details),
......
<h3>
<%=l(:field_category)%>&nbsp;
<%= link_to l(:label_details),
project_issues_report_details_path(@project, :detail => 'category'),
project_issues_report_details_path(@project, :detail => 'category', :with_subprojects => @with_subprojects),
:class => 'icon-only icon-zoom-in',
:title => l(:label_details) %>
</h3>
app/views/reports/issue_report_details.html.erb
<h2><%= link_to l(:label_report_plural), project_issues_report_path(@project) %> »</h2>
<h2><%= link_to l(:label_report_plural), project_issues_report_path(@project, :with_subprojects => @with_subprojects) %> »</h2>
<%= render :partial => 'options_form' if @project.children.any? %>
<h3><%=@report_title%></h3>
<%= render :partial => 'details', :locals => { :data => @data, :field_name => @field, :rows => @rows } %>
<br />
<%= link_to l(:button_back), project_issues_report_path(@project) %>
<%= link_to l(:button_back), project_issues_report_path(@project, :with_subprojects => @with_subprojects) %>
public/stylesheets/application.css
div.table-list.boards .table-list-cell.name {width: 30%;}
#query_form_content {font-size:90%;}
#query_form_content, #options_form_content {font-size:90%;}
#query_form_with_buttons > p.contextual {font-size:12px; margin:12px 0px;}
.query_sort_criteria_count {
(2-2/2)