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
22 22
  before_action :find_project, :authorize, :find_issue_statuses
23 23

  
24 24
  def issue_report
25
    with_subprojects = Setting.display_subprojects_issues?
25
    @with_subprojects = params[:with_subprojects] || (Setting.display_subprojects_issues? ? 'true' : 'false')
26
    @with_subprojects = 'false' unless %w(true false).include?(@with_subprojects)
27
    with_subprojects = (@with_subprojects == 'true' ? true : false)
28

  
26 29
    @trackers = @project.rolled_up_trackers(with_subprojects).visible
27 30
    @versions = @project.shared_versions.sorted
28 31
    @priorities = IssuePriority.all.reverse
......
42 45
  end
43 46

  
44 47
  def issue_report_details
45
    with_subprojects = Setting.display_subprojects_issues?
48
    @with_subprojects = params[:with_subprojects] || (Setting.display_subprojects_issues? ? 'true' : 'false')
49
    @with_subprojects = 'false' unless %w(true false).include?(@with_subprojects)
50
    with_subprojects = (@with_subprojects == 'true' ? true : false)
51

  
46 52
    case params[:detail]
47 53
    when "tracker"
48 54
      @field = "tracker_id"
app/views/reports/_options_form.html.erb
1
<div id="options_form" class="<%= (@project.children.blank? ? 'hide-when-print' : '') %>">
2
  <div id="options_form_content" style="margin-bottom: 1.4em;">
3
    <fieldset id="options" class="collapsible collapsed">
4
      <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_options) %></legend>
5
      <div class="hidden">
6
        <!-- Choose with_subprojects param -->
7
        <%= form_tag({:action => (action_name == 'issue_report' ? 'issue_report' : 'issue_report_details'), :id => @project}, :method => 'get') do %>
8
          <div>
9
            <table id="list-definition" %>
10
              <tr>
11
                <td>
12
                  <span class="field"><label for='with_subprojects'><%= l(:label_subproject_plural) %>:
13
                </td>
14
                <td>
15
                  <label><%= radio_button_tag 'with_subprojects', 'false', @with_subprojects != 'true', :onchange => "this.form.submit()" %> <%= l(:general_text_No) %></label>
16
                  <label><%= radio_button_tag 'with_subprojects', 'true', @with_subprojects == 'true', :onchange => "this.form.submit()" %> <%= l(:general_text_Yes) %></label>
17
                </td>
18
              </tr>
19
            </table>
20
          </div>
21
        <% end %>
22
        </div>
23
    </fieldset>
24
  </div>
25
</div>
app/views/reports/issue_report.html.erb
1 1
<h2><%=l(:label_report_plural)%></h2>
2 2

  
3
<% has_subproject = @project.children.any? %>
4

  
5
<%= render :partial => 'options_form' if has_subproject %>
6

  
3 7
<div class="splitcontent">
4 8
<div class="splitcontentleft">
5 9
<h3>
6 10
  <%=l(:field_tracker)%>&nbsp;
7 11
  <%= link_to l(:label_details),
8
        project_issues_report_details_path(@project, :detail => 'tracker'),
12
        project_issues_report_details_path(@project, :detail => 'tracker', :with_subprojects => @with_subprojects),
9 13
        :class => 'icon-only icon-zoom-in',
10 14
        :title => l(:label_details) %>
11 15
</h3>
......
14 18
<h3>
15 19
  <%=l(:field_priority)%>&nbsp;
16 20
  <%= link_to l(:label_details),
17
        project_issues_report_details_path(@project, :detail => 'priority'),
21
        project_issues_report_details_path(@project, :detail => 'priority', :with_subprojects => @with_subprojects),
18 22
        :class => 'icon-only icon-zoom-in',
19 23
        :title => l(:label_details) %>
20 24
</h3>
......
23 27
<h3>
24 28
  <%=l(:field_assigned_to)%>&nbsp;
25 29
  <%= link_to l(:label_details),
26
        project_issues_report_details_path(@project, :detail => 'assigned_to'),
30
        project_issues_report_details_path(@project, :detail => 'assigned_to', :with_subprojects => @with_subprojects),
27 31
        :class => 'icon-only icon-zoom-in',
28 32
        :title => l(:label_details) %>
29 33
</h3>
......
32 36
<h3>
33 37
  <%=l(:field_author)%>&nbsp;
34 38
  <%= link_to l(:label_details),
35
        project_issues_report_details_path(@project, :detail => 'author'),
39
        project_issues_report_details_path(@project, :detail => 'author', :with_subprojects => @with_subprojects),
36 40
        :class => 'icon-only icon-zoom-in',
37 41
        :title => l(:label_details) %>
38 42
</h3>
......
45 49
<h3>
46 50
  <%=l(:field_version)%>&nbsp;
47 51
  <%= link_to l(:label_details),
48
        project_issues_report_details_path(@project, :detail => 'version'),
52
        project_issues_report_details_path(@project, :detail => 'version', :with_subprojects => @with_subprojects),
49 53
        :class => 'icon-only icon-zoom-in',
50 54
        :title => l(:label_details) %>
51 55
</h3>
52 56
<%= render :partial => 'simple', :locals => { :data => @issues_by_version, :field_name => "fixed_version_id", :rows => @versions } %>
53 57
<br />
54
<% if @project.children.any? %>
58
<% if has_subproject %>
55 59
<h3>
56 60
  <%=l(:field_subproject)%>&nbsp;
57 61
  <%= link_to l(:label_details),
......
65 69
<h3>
66 70
  <%=l(:field_category)%>&nbsp;
67 71
  <%= link_to l(:label_details),
68
        project_issues_report_details_path(@project, :detail => 'category'),
72
        project_issues_report_details_path(@project, :detail => 'category', :with_subprojects => @with_subprojects),
69 73
        :class => 'icon-only icon-zoom-in',
70 74
        :title => l(:label_details) %>
71 75
</h3>
app/views/reports/issue_report_details.html.erb
1
<h2><%= link_to l(:label_report_plural), project_issues_report_path(@project) %> »</h2>
1
<h2><%= link_to l(:label_report_plural), project_issues_report_path(@project, :with_subprojects => @with_subprojects) %> »</h2>
2

  
3
<%= render :partial => 'options_form' if @project.children.any? %>
2 4

  
3 5
<h3><%=@report_title%></h3>
4 6
<%= render :partial => 'details', :locals => { :data => @data, :field_name => @field, :rows => @rows } %>
5 7
<br />
6
<%= link_to l(:button_back), project_issues_report_path(@project) %>
8
<%= link_to l(:button_back), project_issues_report_path(@project, :with_subprojects => @with_subprojects) %>
public/stylesheets/application.css
391 391

  
392 392
div.table-list.boards .table-list-cell.name {width: 30%;}
393 393

  
394
#query_form_content {font-size:90%;}
394
#query_form_content, #options_form_content {font-size:90%;}
395 395
#query_form_with_buttons > p.contextual {font-size:12px; margin:12px 0px;}
396 396

  
397 397
.query_sort_criteria_count {
(2-2/2)