The requested changes are too big and content was truncated. Show full diff
@@ -1,73 +1,81 | |||
|
1 | 1 | # encoding: utf-8 |
|
2 | 2 | # |
|
3 | 3 | # Redmine - project management software |
|
4 | 4 | # Copyright (C) 2006-2016 Jean-Philippe Lang |
|
5 | 5 | # |
|
6 | 6 | # This program is free software; you can redistribute it and/or |
|
7 | 7 | # modify it under the terms of the GNU General Public License |
|
8 | 8 | # as published by the Free Software Foundation; either version 2 |
|
9 | 9 | # of the License, or (at your option) any later version. |
|
10 | 10 | # |
|
11 | 11 | # This program is distributed in the hope that it will be useful, |
|
12 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 | 14 | # GNU General Public License for more details. |
|
15 | 15 | # |
|
16 | 16 | # You should have received a copy of the GNU General Public License |
|
17 | 17 | # along with this program; if not, write to the Free Software |
|
18 | 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
19 | 19 | |
|
20 | 20 | module RoutesHelper |
|
21 | 21 | |
|
22 | 22 | # Returns the path to project issues or to the cross-project |
|
23 | 23 | # issue list if project is nil |
|
24 | 24 | def _project_issues_path(project, *args) |
|
25 | 25 | if project |
|
26 | 26 | project_issues_path(project, *args) |
|
27 | 27 | else |
|
28 | 28 | issues_path(*args) |
|
29 | 29 | end |
|
30 | 30 | end |
|
31 | 31 | |
|
32 | def _new_project_issue_path(project, *args) | |
|
33 | if project | |
|
34 | new_project_issue_path(project, *args) | |
|
35 | else | |
|
36 | new_issue_path(*args) | |
|
37 | end | |
|
38 | end | |
|
39 | ||
|
32 | 40 | def _project_calendar_path(project, *args) |
|
33 | 41 | project ? project_calendar_path(project, *args) : issues_calendar_path(*args) |
|
34 | 42 | end |
|
35 | 43 | |
|
36 | 44 | def _project_gantt_path(project, *args) |
|
37 | 45 | project ? project_gantt_path(project, *args) : issues_gantt_path(*args) |
|
38 | 46 | end |
|
39 | 47 | |
|
40 | 48 | def _time_entries_path(project, issue, *args) |
|
41 | 49 | if issue |
|
42 | 50 | issue_time_entries_path(issue, *args) |
|
43 | 51 | elsif project |
|
44 | 52 | project_time_entries_path(project, *args) |
|
45 | 53 | else |
|
46 | 54 | time_entries_path(*args) |
|
47 | 55 | end |
|
48 | 56 | end |
|
49 | 57 | |
|
50 | 58 | def _report_time_entries_path(project, issue, *args) |
|
51 | 59 | if issue |
|
52 | 60 | report_issue_time_entries_path(issue, *args) |
|
53 | 61 | elsif project |
|
54 | 62 | report_project_time_entries_path(project, *args) |
|
55 | 63 | else |
|
56 | 64 | report_time_entries_path(*args) |
|
57 | 65 | end |
|
58 | 66 | end |
|
59 | 67 | |
|
60 | 68 | def _new_time_entry_path(project, issue, *args) |
|
61 | 69 | if issue |
|
62 | 70 | new_issue_time_entry_path(issue, *args) |
|
63 | 71 | elsif project |
|
64 | 72 | new_project_time_entry_path(project, *args) |
|
65 | 73 | else |
|
66 | 74 | new_time_entry_path(*args) |
|
67 | 75 | end |
|
68 | 76 | end |
|
69 | 77 | |
|
70 | 78 | def board_path(board, *args) |
|
71 | 79 | project_board_path(board.project, board, *args) |
|
72 | 80 | end |
|
73 | 81 | end |
@@ -1,127 +1,127 | |||
|
1 | 1 | <div class="contextual"> |
|
2 |
<% if |
|
|
3 | <%= link_to l(:label_issue_new), new_project_issue_path(@project), :class => 'icon icon-add new-issue' %> | |
|
2 | <% if User.current.allowed_to?(:add_issues, @project, :global => true) && (@project.nil? || @project.trackers.any?) %> | |
|
3 | <%= link_to l(:label_issue_new), _new_project_issue_path(@project), :class => 'icon icon-add new-issue' %> | |
|
4 | 4 | <% end %> |
|
5 | 5 | </div> |
|
6 | 6 | |
|
7 | 7 | <h2><%= @query.new_record? ? l(:label_issue_plural) : @query.name %></h2> |
|
8 | 8 | <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> |
|
9 | 9 | |
|
10 | 10 | <%= form_tag({ :controller => 'issues', :action => 'index', :project_id => @project }, |
|
11 | 11 | :method => :get, :id => 'query_form') do %> |
|
12 | 12 | <div id="query_form_with_buttons" class="hide-when-print"> |
|
13 | 13 | <%= hidden_field_tag 'set_filter', '1' %> |
|
14 | 14 | <div id="query_form_content"> |
|
15 | 15 | <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> |
|
16 | 16 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
17 | 17 | <div style="<%= @query.new_record? ? "" : "display: none;" %>"> |
|
18 | 18 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> |
|
19 | 19 | </div> |
|
20 | 20 | </fieldset> |
|
21 | 21 | <fieldset id="options" class="collapsible collapsed"> |
|
22 | 22 | <legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend> |
|
23 | 23 | <div style="display: none;"> |
|
24 | 24 | <table> |
|
25 | 25 | <tr> |
|
26 | 26 | <td class="field"><%= l(:field_column_names) %></td> |
|
27 | 27 | <td><%= render_query_columns_selection(@query) %></td> |
|
28 | 28 | </tr> |
|
29 | 29 | <tr> |
|
30 | 30 | <td class="field"><label for='group_by'><%= l(:field_group_by) %></label></td> |
|
31 | 31 | <td><%= select_tag('group_by', |
|
32 | 32 | options_for_select( |
|
33 | 33 | [[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, |
|
34 | 34 | @query.group_by) |
|
35 | 35 | ) %></td> |
|
36 | 36 | </tr> |
|
37 | 37 | <tr> |
|
38 | 38 | <td class="field"><%= l(:button_show) %></td> |
|
39 | 39 | <td><%= available_block_columns_tags(@query) %></td> |
|
40 | 40 | </tr> |
|
41 | 41 | <tr> |
|
42 | 42 | <td><%= l(:label_total_plural) %></td> |
|
43 | 43 | <td><%= available_totalable_columns_tags(@query) %></td> |
|
44 | 44 | </tr> |
|
45 | 45 | </table> |
|
46 | 46 | </div> |
|
47 | 47 | </fieldset> |
|
48 | 48 | </div> |
|
49 | 49 | <p class="buttons"> |
|
50 | 50 | <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> |
|
51 | 51 | <%= link_to l(:button_clear), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload' %> |
|
52 | 52 | <% if @query.new_record? %> |
|
53 | 53 | <% if User.current.allowed_to?(:save_queries, @project, :global => true) %> |
|
54 | 54 | <%= link_to_function l(:button_save), |
|
55 | 55 | "$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit()", |
|
56 | 56 | :class => 'icon icon-save' %> |
|
57 | 57 | <% end %> |
|
58 | 58 | <% else %> |
|
59 | 59 | <% if @query.editable_by?(User.current) %> |
|
60 | 60 | <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> |
|
61 | 61 | <%= delete_link query_path(@query) %> |
|
62 | 62 | <% end %> |
|
63 | 63 | <% end %> |
|
64 | 64 | </p> |
|
65 | 65 | </div> |
|
66 | 66 | <% end %> |
|
67 | 67 | |
|
68 | 68 | <%= error_messages_for 'query' %> |
|
69 | 69 | <% if @query.valid? %> |
|
70 | 70 | <% if @issues.empty? %> |
|
71 | 71 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
72 | 72 | <% else %> |
|
73 | 73 | <%= render_query_totals(@query) %> |
|
74 | 74 | <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> |
|
75 | 75 | <span class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></span> |
|
76 | 76 | <% end %> |
|
77 | 77 | |
|
78 | 78 | <% other_formats_links do |f| %> |
|
79 | 79 | <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %> |
|
80 | 80 | <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '350px'); return false;" %> |
|
81 | 81 | <%= f.link_to 'PDF', :url => params %> |
|
82 | 82 | <% end %> |
|
83 | 83 | |
|
84 | 84 | <div id="csv-export-options" style="display:none;"> |
|
85 | 85 | <h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3> |
|
86 | 86 | <%= form_tag(_project_issues_path(@project, :format => 'csv'), :method => :get, :id => 'csv-export-form') do %> |
|
87 | 87 | <%= query_as_hidden_field_tags(@query) %> |
|
88 | 88 | <%= hidden_field_tag 'sort', @sort_criteria.to_param, :id => nil %> |
|
89 | 89 | <p> |
|
90 | 90 | <label><%= radio_button_tag 'csv[columns]', '', true %> <%= l(:description_selected_columns) %></label><br /> |
|
91 | 91 | <label><%= radio_button_tag 'csv[columns]', 'all' %> <%= l(:description_all_columns) %></label> |
|
92 | 92 | </p> |
|
93 | 93 | <p> |
|
94 | 94 | <label><%= check_box_tag 'csv[description]', '1', @query.has_column?(:description) %> <%= l(:field_description) %></label> |
|
95 | 95 | </p> |
|
96 | 96 | <% if @issue_count > Setting.issues_export_limit.to_i %> |
|
97 | 97 | <p class="icon icon-warning"> |
|
98 | 98 | <%= l(:setting_issues_export_limit) %>: <%= Setting.issues_export_limit.to_i %> |
|
99 | 99 | </p> |
|
100 | 100 | <% end %> |
|
101 | 101 | <p class="buttons"> |
|
102 | 102 | <%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %> |
|
103 | 103 | <%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %> |
|
104 | 104 | </p> |
|
105 | 105 | <% end %> |
|
106 | 106 | </div> |
|
107 | 107 | |
|
108 | 108 | <% end %> |
|
109 | 109 | <%= call_hook(:view_issues_index_bottom, { :issues => @issues, :project => @project, :query => @query }) %> |
|
110 | 110 | |
|
111 | 111 | <% content_for :sidebar do %> |
|
112 | 112 | <%= render :partial => 'issues/sidebar' %> |
|
113 | 113 | <% end %> |
|
114 | 114 | |
|
115 | 115 | <% content_for :header_tags do %> |
|
116 | 116 | <%= auto_discovery_link_tag(:atom, |
|
117 | 117 | {:query_id => @query, :format => 'atom', |
|
118 | 118 | :page => nil, :key => User.current.rss_key}, |
|
119 | 119 | :title => l(:label_issue_plural)) %> |
|
120 | 120 | <%= auto_discovery_link_tag(:atom, |
|
121 | 121 | {:controller => 'journals', :action => 'index', |
|
122 | 122 | :query_id => @query, :format => 'atom', |
|
123 | 123 | :page => nil, :key => User.current.rss_key}, |
|
124 | 124 | :title => l(:label_changes_details)) %> |
|
125 | 125 | <% end %> |
|
126 | 126 | |
|
127 | 127 | <%= context_menu issues_context_menu_path %> |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
General Comments 0
You need to be logged in to leave comments.
Login now