@@ -1,372 +1,372 | |||
|
1 | 1 | <% @gantt.view = self %> |
|
2 | 2 | <div class="contextual"> |
|
3 | 3 | <% if !@query.new_record? && @query.editable_by?(User.current) %> |
|
4 | 4 | <%= link_to l(:button_edit), edit_query_path(@query, :gantt => 1), :class => 'icon icon-edit' %> |
|
5 | 5 | <%= delete_link query_path(@query, :gantt => 1) %> |
|
6 | 6 | <% end %> |
|
7 | 7 | </div> |
|
8 | 8 | |
|
9 | 9 | <h2><%= @query.new_record? ? l(:label_gantt) : @query.name %></h2> |
|
10 | 10 | |
|
11 | 11 | <%= form_tag({:controller => 'gantts', :action => 'show', |
|
12 | 12 | :project_id => @project, :month => params[:month], |
|
13 | 13 | :year => params[:year], :months => params[:months]}, |
|
14 | 14 | :method => :get, :id => 'query_form') do %> |
|
15 | 15 | <%= hidden_field_tag 'set_filter', '1' %> |
|
16 | 16 | <%= hidden_field_tag 'gantt', '1' %> |
|
17 | 17 | <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> |
|
18 | 18 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
19 | 19 | <div style="<%= @query.new_record? ? "" : "display: none;" %>"> |
|
20 | 20 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> |
|
21 | 21 | </div> |
|
22 | 22 | </fieldset> |
|
23 | <fieldset class="collapsible collapsed"> | |
|
23 | <fieldset id="options" class="collapsible collapsed"> | |
|
24 | 24 | <legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend> |
|
25 | 25 | <div style="display: none;"> |
|
26 | 26 | <table> |
|
27 | 27 | <tr> |
|
28 | 28 | <td> |
|
29 | 29 | <fieldset> |
|
30 | 30 | <legend><%= l(:label_related_issues) %></legend> |
|
31 | 31 | <label for="draw_relations"> |
|
32 | 32 | <%= check_box 'query', 'draw_relations', :id => 'draw_relations' %> |
|
33 | 33 | <% rels = [IssueRelation::TYPE_BLOCKS, IssueRelation::TYPE_PRECEDES] %> |
|
34 | 34 | <% rels.each do |rel| %> |
|
35 | 35 | <% color = Redmine::Helpers::Gantt::DRAW_TYPES[rel][:color] %> |
|
36 | 36 | <%= content_tag(:span, ' '.html_safe, |
|
37 | 37 | :style => "background-color: #{color}") %> |
|
38 | 38 | <%= l(IssueRelation::TYPES[rel][:name]) %> |
|
39 | 39 | <% end %> |
|
40 | 40 | </label> |
|
41 | 41 | </fieldset> |
|
42 | 42 | </td> |
|
43 | 43 | <td> |
|
44 | 44 | <fieldset> |
|
45 | 45 | <legend><%= l(:label_gantt_progress_line) %></legend> |
|
46 | 46 | <label for="draw_progress_line"> |
|
47 | 47 | <%= check_box 'query', 'draw_progress_line', :id => 'draw_progress_line' %> |
|
48 | 48 | <%= l(:label_display) %> |
|
49 | 49 | </label> |
|
50 | 50 | </fieldset> |
|
51 | 51 | </td> |
|
52 | 52 | </tr> |
|
53 | 53 | </table> |
|
54 | 54 | </div> |
|
55 | 55 | </fieldset> |
|
56 | 56 | |
|
57 | 57 | <p class="contextual"> |
|
58 | 58 | <%= gantt_zoom_link(@gantt, :in) %> |
|
59 | 59 | <%= gantt_zoom_link(@gantt, :out) %> |
|
60 | 60 | </p> |
|
61 | 61 | |
|
62 | 62 | <p class="buttons"> |
|
63 | 63 | <%= text_field_tag 'months', @gantt.months, :size => 2 %> |
|
64 | 64 | <%= l(:label_months_from) %> |
|
65 | 65 | <%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %> |
|
66 | 66 | <%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %> |
|
67 | 67 | <%= hidden_field_tag 'zoom', @gantt.zoom %> |
|
68 | 68 | |
|
69 | 69 | <%= link_to_function l(:button_apply), '$("#query_form").submit()', |
|
70 | 70 | :class => 'icon icon-checked' %> |
|
71 | 71 | <%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, |
|
72 | 72 | :class => 'icon icon-reload' %> |
|
73 | 73 | <% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %> |
|
74 | 74 | <%= link_to_function l(:button_save), |
|
75 | 75 | "$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit();", |
|
76 | 76 | :class => 'icon icon-save' %> |
|
77 | 77 | <% end %> |
|
78 | 78 | </p> |
|
79 | 79 | <% end %> |
|
80 | 80 | |
|
81 | 81 | <%= error_messages_for 'query' %> |
|
82 | 82 | <% if @query.valid? %> |
|
83 | 83 | <% |
|
84 | 84 | zoom = 1 |
|
85 | 85 | @gantt.zoom.times { zoom = zoom * 2 } |
|
86 | 86 | |
|
87 | 87 | subject_width = 330 |
|
88 | 88 | header_height = 18 |
|
89 | 89 | |
|
90 | 90 | headers_height = header_height |
|
91 | 91 | show_weeks = false |
|
92 | 92 | show_days = false |
|
93 | 93 | show_day_num = false |
|
94 | 94 | |
|
95 | 95 | if @gantt.zoom > 1 |
|
96 | 96 | show_weeks = true |
|
97 | 97 | headers_height = 2 * header_height |
|
98 | 98 | if @gantt.zoom > 2 |
|
99 | 99 | show_days = true |
|
100 | 100 | headers_height = 3 * header_height |
|
101 | 101 | if @gantt.zoom > 3 |
|
102 | 102 | show_day_num = true |
|
103 | 103 | headers_height = 4 * header_height |
|
104 | 104 | end |
|
105 | 105 | end |
|
106 | 106 | end |
|
107 | 107 | |
|
108 | 108 | # Width of the entire chart |
|
109 | 109 | g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i |
|
110 | 110 | @gantt.render(:top => headers_height + 8, |
|
111 | 111 | :zoom => zoom, |
|
112 | 112 | :g_width => g_width, |
|
113 | 113 | :subject_width => subject_width) |
|
114 | 114 | g_height = [(20 * (@gantt.number_of_rows + 6)) + 150, 206].max |
|
115 | 115 | t_height = g_height + headers_height |
|
116 | 116 | %> |
|
117 | 117 | |
|
118 | 118 | <% if @gantt.truncated %> |
|
119 | 119 | <p class="warning"><%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p> |
|
120 | 120 | <% end %> |
|
121 | 121 | |
|
122 | 122 | <table style="width:100%; border:0; border-collapse: collapse;"> |
|
123 | 123 | <tr> |
|
124 | 124 | <td style="width:<%= subject_width %>px; padding:0px;"> |
|
125 | 125 | <% |
|
126 | 126 | style = "" |
|
127 | 127 | style += "position:relative;" |
|
128 | 128 | style += "height: #{t_height + 24}px;" |
|
129 | 129 | style += "width: #{subject_width + 1}px;" |
|
130 | 130 | %> |
|
131 | 131 | <%= content_tag(:div, :style => style) do %> |
|
132 | 132 | <% |
|
133 | 133 | style = "" |
|
134 | 134 | style += "right:-2px;" |
|
135 | 135 | style += "width: #{subject_width}px;" |
|
136 | 136 | style += "height: #{headers_height}px;" |
|
137 | 137 | style += 'background: #eee;' |
|
138 | 138 | %> |
|
139 | 139 | <%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %> |
|
140 | 140 | <% |
|
141 | 141 | style = "" |
|
142 | 142 | style += "right:-2px;" |
|
143 | 143 | style += "width: #{subject_width}px;" |
|
144 | 144 | style += "height: #{t_height}px;" |
|
145 | 145 | style += 'border-left: 1px solid #c0c0c0;' |
|
146 | 146 | style += 'overflow: hidden;' |
|
147 | 147 | %> |
|
148 | 148 | <%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %> |
|
149 | 149 | <%= content_tag(:div, :class => "gantt_subjects") do %> |
|
150 | 150 | <%= @gantt.subjects.html_safe %> |
|
151 | 151 | <% end %> |
|
152 | 152 | <% end %> |
|
153 | 153 | </td> |
|
154 | 154 | |
|
155 | 155 | <td> |
|
156 | 156 | <div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;" id="gantt_area"> |
|
157 | 157 | <% |
|
158 | 158 | style = "" |
|
159 | 159 | style += "width: #{g_width - 1}px;" |
|
160 | 160 | style += "height: #{headers_height}px;" |
|
161 | 161 | style += 'background: #eee;' |
|
162 | 162 | %> |
|
163 | 163 | <%= content_tag(:div, ' '.html_safe, :style => style, :class => "gantt_hdr") %> |
|
164 | 164 | |
|
165 | 165 | <% ###### Months headers ###### %> |
|
166 | 166 | <% |
|
167 | 167 | month_f = @gantt.date_from |
|
168 | 168 | left = 0 |
|
169 | 169 | height = (show_weeks ? header_height : header_height + g_height) |
|
170 | 170 | %> |
|
171 | 171 | <% @gantt.months.times do %> |
|
172 | 172 | <% |
|
173 | 173 | width = (((month_f >> 1) - month_f) * zoom - 1).to_i |
|
174 | 174 | style = "" |
|
175 | 175 | style += "left: #{left}px;" |
|
176 | 176 | style += "width: #{width}px;" |
|
177 | 177 | style += "height: #{height}px;" |
|
178 | 178 | %> |
|
179 | 179 | <%= content_tag(:div, :style => style, :class => "gantt_hdr") do %> |
|
180 | 180 | <%= link_to "#{month_f.year}-#{month_f.month}", |
|
181 | 181 | @gantt.params.merge(:year => month_f.year, :month => month_f.month), |
|
182 | 182 | :title => "#{month_name(month_f.month)} #{month_f.year}" %> |
|
183 | 183 | <% end %> |
|
184 | 184 | <% |
|
185 | 185 | left = left + width + 1 |
|
186 | 186 | month_f = month_f >> 1 |
|
187 | 187 | %> |
|
188 | 188 | <% end %> |
|
189 | 189 | |
|
190 | 190 | <% ###### Weeks headers ###### %> |
|
191 | 191 | <% if show_weeks %> |
|
192 | 192 | <% |
|
193 | 193 | left = 0 |
|
194 | 194 | height = (show_days ? header_height - 1 : header_height - 1 + g_height) |
|
195 | 195 | %> |
|
196 | 196 | <% if @gantt.date_from.cwday == 1 %> |
|
197 | 197 | <% |
|
198 | 198 | # @date_from is monday |
|
199 | 199 | week_f = @gantt.date_from |
|
200 | 200 | %> |
|
201 | 201 | <% else %> |
|
202 | 202 | <% |
|
203 | 203 | # find next monday after @date_from |
|
204 | 204 | week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1) |
|
205 | 205 | width = (7 - @gantt.date_from.cwday + 1) * zoom - 1 |
|
206 | 206 | style = "" |
|
207 | 207 | style += "left: #{left}px;" |
|
208 | 208 | style += "top: 19px;" |
|
209 | 209 | style += "width: #{width}px;" |
|
210 | 210 | style += "height: #{height}px;" |
|
211 | 211 | %> |
|
212 | 212 | <%= content_tag(:div, ' '.html_safe, |
|
213 | 213 | :style => style, :class => "gantt_hdr") %> |
|
214 | 214 | <% left = left + width + 1 %> |
|
215 | 215 | <% end %> |
|
216 | 216 | <% while week_f <= @gantt.date_to %> |
|
217 | 217 | <% |
|
218 | 218 | width = ((week_f + 6 <= @gantt.date_to) ? |
|
219 | 219 | 7 * zoom - 1 : |
|
220 | 220 | (@gantt.date_to - week_f + 1) * zoom - 1).to_i |
|
221 | 221 | style = "" |
|
222 | 222 | style += "left: #{left}px;" |
|
223 | 223 | style += "top: 19px;" |
|
224 | 224 | style += "width: #{width}px;" |
|
225 | 225 | style += "height: #{height}px;" |
|
226 | 226 | %> |
|
227 | 227 | <%= content_tag(:div, :style => style, :class => "gantt_hdr") do %> |
|
228 | 228 | <%= content_tag(:small) do %> |
|
229 | 229 | <%= week_f.cweek if width >= 16 %> |
|
230 | 230 | <% end %> |
|
231 | 231 | <% end %> |
|
232 | 232 | <% |
|
233 | 233 | left = left + width + 1 |
|
234 | 234 | week_f = week_f + 7 |
|
235 | 235 | %> |
|
236 | 236 | <% end %> |
|
237 | 237 | <% end %> |
|
238 | 238 | |
|
239 | 239 | <% ###### Day numbers headers ###### %> |
|
240 | 240 | <% if show_day_num %> |
|
241 | 241 | <% |
|
242 | 242 | left = 0 |
|
243 | 243 | height = g_height + header_height*2 - 1 |
|
244 | 244 | wday = @gantt.date_from.cwday |
|
245 | 245 | day_num = @gantt.date_from |
|
246 | 246 | %> |
|
247 | 247 | <% (@gantt.date_to - @gantt.date_from + 1).to_i.times do %> |
|
248 | 248 | <% |
|
249 | 249 | width = zoom - 1 |
|
250 | 250 | style = "" |
|
251 | 251 | style += "left:#{left}px;" |
|
252 | 252 | style += "top:37px;" |
|
253 | 253 | style += "width:#{width}px;" |
|
254 | 254 | style += "height:#{height}px;" |
|
255 | 255 | style += "font-size:0.7em;" |
|
256 | 256 | clss = "gantt_hdr" |
|
257 | 257 | clss << " nwday" if @gantt.non_working_week_days.include?(wday) |
|
258 | 258 | %> |
|
259 | 259 | <%= content_tag(:div, :style => style, :class => clss) do %> |
|
260 | 260 | <%= day_num.day %> |
|
261 | 261 | <% end %> |
|
262 | 262 | <% |
|
263 | 263 | left = left + width+1 |
|
264 | 264 | day_num = day_num + 1 |
|
265 | 265 | wday = wday + 1 |
|
266 | 266 | wday = 1 if wday > 7 |
|
267 | 267 | %> |
|
268 | 268 | <% end %> |
|
269 | 269 | <% end %> |
|
270 | 270 | |
|
271 | 271 | <% ###### Days headers ####### %> |
|
272 | 272 | <% if show_days %> |
|
273 | 273 | <% |
|
274 | 274 | left = 0 |
|
275 | 275 | height = g_height + header_height - 1 |
|
276 | 276 | top = (show_day_num ? 55 : 37) |
|
277 | 277 | wday = @gantt.date_from.cwday |
|
278 | 278 | %> |
|
279 | 279 | <% (@gantt.date_to - @gantt.date_from + 1).to_i.times do %> |
|
280 | 280 | <% |
|
281 | 281 | width = zoom - 1 |
|
282 | 282 | style = "" |
|
283 | 283 | style += "left: #{left}px;" |
|
284 | 284 | style += "top: #{top}px;" |
|
285 | 285 | style += "width: #{width}px;" |
|
286 | 286 | style += "height: #{height}px;" |
|
287 | 287 | style += "font-size:0.7em;" |
|
288 | 288 | clss = "gantt_hdr" |
|
289 | 289 | clss << " nwday" if @gantt.non_working_week_days.include?(wday) |
|
290 | 290 | %> |
|
291 | 291 | <%= content_tag(:div, :style => style, :class => clss) do %> |
|
292 | 292 | <%= day_letter(wday) %> |
|
293 | 293 | <% end %> |
|
294 | 294 | <% |
|
295 | 295 | left = left + width + 1 |
|
296 | 296 | wday = wday + 1 |
|
297 | 297 | wday = 1 if wday > 7 |
|
298 | 298 | %> |
|
299 | 299 | <% end %> |
|
300 | 300 | <% end %> |
|
301 | 301 | |
|
302 | 302 | <%= @gantt.lines.html_safe %> |
|
303 | 303 | |
|
304 | 304 | <% ###### Today red line (excluded from cache) ###### %> |
|
305 | 305 | <% if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %> |
|
306 | 306 | <% |
|
307 | 307 | today_left = (((Date.today - @gantt.date_from + 1) * zoom).floor() - 1).to_i |
|
308 | 308 | style = "" |
|
309 | 309 | style += "position: absolute;" |
|
310 | 310 | style += "height: #{g_height}px;" |
|
311 | 311 | style += "top: #{headers_height + 1}px;" |
|
312 | 312 | style += "left: #{today_left}px;" |
|
313 | 313 | style += "width:10px;" |
|
314 | 314 | style += "border-left: 1px dashed red;" |
|
315 | 315 | %> |
|
316 | 316 | <%= content_tag(:div, ' '.html_safe, :style => style, :id => 'today_line') %> |
|
317 | 317 | <% end %> |
|
318 | 318 | <% |
|
319 | 319 | style = "" |
|
320 | 320 | style += "position: absolute;" |
|
321 | 321 | style += "height: #{g_height}px;" |
|
322 | 322 | style += "top: #{headers_height + 1}px;" |
|
323 | 323 | style += "left: 0px;" |
|
324 | 324 | style += "width: #{g_width - 1}px;" |
|
325 | 325 | %> |
|
326 | 326 | <%= content_tag(:div, '', :style => style, :id => "gantt_draw_area") %> |
|
327 | 327 | </div> |
|
328 | 328 | </td> |
|
329 | 329 | </tr> |
|
330 | 330 | </table> |
|
331 | 331 | |
|
332 | 332 | <table style="width:100%"> |
|
333 | 333 | <tr> |
|
334 | 334 | <td style="text-align:left;"> |
|
335 | 335 | <%= link_to_content_update("\xc2\xab " + l(:label_previous), |
|
336 | 336 | params.merge(@gantt.params_previous), |
|
337 | 337 | :accesskey => accesskey(:previous)) %> |
|
338 | 338 | </td> |
|
339 | 339 | <td style="text-align:right;"> |
|
340 | 340 | <%= link_to_content_update(l(:label_next) + " \xc2\xbb", |
|
341 | 341 | params.merge(@gantt.params_next), |
|
342 | 342 | :accesskey => accesskey(:next)) %> |
|
343 | 343 | </td> |
|
344 | 344 | </tr> |
|
345 | 345 | </table> |
|
346 | 346 | |
|
347 | 347 | <% other_formats_links do |f| %> |
|
348 | 348 | <%= f.link_to 'PDF', :url => params.merge(@gantt.params) %> |
|
349 | 349 | <%= f.link_to('PNG', :url => params.merge(@gantt.params)) if @gantt.respond_to?('to_image') %> |
|
350 | 350 | <% end %> |
|
351 | 351 | <% end # query.valid? %> |
|
352 | 352 | |
|
353 | 353 | <% content_for :sidebar do %> |
|
354 | 354 | <%= render :partial => 'issues/sidebar' %> |
|
355 | 355 | <% end %> |
|
356 | 356 | |
|
357 | 357 | <% html_title(l(:label_gantt)) -%> |
|
358 | 358 | |
|
359 | 359 | <% content_for :header_tags do %> |
|
360 | 360 | <%= javascript_include_tag 'raphael' %> |
|
361 | 361 | <%= javascript_include_tag 'gantt' %> |
|
362 | 362 | <% end %> |
|
363 | 363 | |
|
364 | 364 | <%= javascript_tag do %> |
|
365 | 365 | var issue_relation_type = <%= raw Redmine::Helpers::Gantt::DRAW_TYPES.to_json %>; |
|
366 | 366 | $(document).ready(drawGanttHandler); |
|
367 | 367 | $(window).resize(drawGanttHandler); |
|
368 | 368 | $(function() { |
|
369 | 369 | $("#draw_relations").change(drawGanttHandler); |
|
370 | 370 | $("#draw_progress_line").change(drawGanttHandler); |
|
371 | 371 | }); |
|
372 | 372 | <% end %> |
@@ -1,121 +1,121 | |||
|
1 | 1 | <div class="contextual"> |
|
2 | 2 | <% if !@query.new_record? && @query.editable_by?(User.current) %> |
|
3 | 3 | <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> |
|
4 | 4 | <%= delete_link query_path(@query) %> |
|
5 | 5 | <% end %> |
|
6 | 6 | </div> |
|
7 | 7 | |
|
8 | 8 | <h2><%= @query.new_record? ? l(:label_issue_plural) : @query.name %></h2> |
|
9 | 9 | <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> |
|
10 | 10 | |
|
11 | 11 | <%= form_tag({ :controller => 'issues', :action => 'index', :project_id => @project }, |
|
12 | 12 | :method => :get, :id => 'query_form') do %> |
|
13 | 13 | <div id="query_form_with_buttons" class="hide-when-print"> |
|
14 | 14 | <%= hidden_field_tag 'set_filter', '1' %> |
|
15 | 15 | <div id="query_form_content"> |
|
16 | 16 | <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> |
|
17 | 17 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
18 | 18 | <div style="<%= @query.new_record? ? "" : "display: none;" %>"> |
|
19 | 19 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> |
|
20 | 20 | </div> |
|
21 | 21 | </fieldset> |
|
22 | <fieldset class="collapsible collapsed"> | |
|
22 | <fieldset id="options" class="collapsible collapsed"> | |
|
23 | 23 | <legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend> |
|
24 | 24 | <div style="display: none;"> |
|
25 | 25 | <table> |
|
26 | 26 | <tr> |
|
27 | <td><%= l(:field_column_names) %></td> | |
|
27 | <td class="field"><%= l(:field_column_names) %></td> | |
|
28 | 28 | <td><%= render_query_columns_selection(@query) %></td> |
|
29 | 29 | </tr> |
|
30 | 30 | <tr> |
|
31 | <td><label for='group_by'><%= l(:field_group_by) %></label></td> | |
|
31 | <td class="field"><label for='group_by'><%= l(:field_group_by) %></label></td> | |
|
32 | 32 | <td><%= select_tag('group_by', |
|
33 | 33 | options_for_select( |
|
34 | 34 | [[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, |
|
35 | 35 | @query.group_by) |
|
36 | 36 | ) %></td> |
|
37 | 37 | </tr> |
|
38 | 38 | <tr> |
|
39 | <td><%= l(:button_show) %></td> | |
|
39 | <td class="field"><%= l(:button_show) %></td> | |
|
40 | 40 | <td><%= available_block_columns_tags(@query) %></td> |
|
41 | 41 | </tr> |
|
42 | 42 | <tr> |
|
43 | 43 | <td><%= l(:label_total_plural) %></td> |
|
44 | 44 | <td><%= available_totalable_columns_tags(@query) %></td> |
|
45 | 45 | </tr> |
|
46 | 46 | </table> |
|
47 | 47 | </div> |
|
48 | 48 | </fieldset> |
|
49 | 49 | </div> |
|
50 | 50 | <p class="buttons"> |
|
51 | 51 | <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> |
|
52 | 52 | <%= link_to l(:button_clear), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload' %> |
|
53 | 53 | <% if @query.new_record? && 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 | </p> |
|
59 | 59 | </div> |
|
60 | 60 | <% end %> |
|
61 | 61 | |
|
62 | 62 | <%= error_messages_for 'query' %> |
|
63 | 63 | <% if @query.valid? %> |
|
64 | 64 | <% if @issues.empty? %> |
|
65 | 65 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
66 | 66 | <% else %> |
|
67 | 67 | <%= render_query_totals(@query) %> |
|
68 | 68 | <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> |
|
69 | 69 | <span class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></span> |
|
70 | 70 | <% end %> |
|
71 | 71 | |
|
72 | 72 | <% other_formats_links do |f| %> |
|
73 | 73 | <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %> |
|
74 | 74 | <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '350px'); return false;" %> |
|
75 | 75 | <%= f.link_to 'PDF', :url => params %> |
|
76 | 76 | <% end %> |
|
77 | 77 | |
|
78 | 78 | <div id="csv-export-options" style="display:none;"> |
|
79 | 79 | <h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3> |
|
80 | 80 | <%= form_tag(_project_issues_path(@project, :format => 'csv'), :method => :get, :id => 'csv-export-form') do %> |
|
81 | 81 | <%= query_as_hidden_field_tags(@query) %> |
|
82 | 82 | <%= hidden_field_tag 'sort', params[:sort], :id => nil %> |
|
83 | 83 | <p> |
|
84 | 84 | <label><%= radio_button_tag 'csv[columns]', '', true %> <%= l(:description_selected_columns) %></label><br /> |
|
85 | 85 | <label><%= radio_button_tag 'csv[columns]', 'all' %> <%= l(:description_all_columns) %></label> |
|
86 | 86 | </p> |
|
87 | 87 | <p> |
|
88 | 88 | <label><%= check_box_tag 'csv[description]', '1', @query.has_column?(:description) %> <%= l(:field_description) %></label> |
|
89 | 89 | </p> |
|
90 | 90 | <% if @issue_count > Setting.issues_export_limit.to_i %> |
|
91 | 91 | <p class="icon icon-warning"> |
|
92 | 92 | <%= l(:setting_issues_export_limit) %>: <%= Setting.issues_export_limit.to_i %> |
|
93 | 93 | </p> |
|
94 | 94 | <% end %> |
|
95 | 95 | <p class="buttons"> |
|
96 | 96 | <%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %> |
|
97 | 97 | <%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %> |
|
98 | 98 | </p> |
|
99 | 99 | <% end %> |
|
100 | 100 | </div> |
|
101 | 101 | |
|
102 | 102 | <% end %> |
|
103 | 103 | <%= call_hook(:view_issues_index_bottom, { :issues => @issues, :project => @project, :query => @query }) %> |
|
104 | 104 | |
|
105 | 105 | <% content_for :sidebar do %> |
|
106 | 106 | <%= render :partial => 'issues/sidebar' %> |
|
107 | 107 | <% end %> |
|
108 | 108 | |
|
109 | 109 | <% content_for :header_tags do %> |
|
110 | 110 | <%= auto_discovery_link_tag(:atom, |
|
111 | 111 | {:query_id => @query, :format => 'atom', |
|
112 | 112 | :page => nil, :key => User.current.rss_key}, |
|
113 | 113 | :title => l(:label_issue_plural)) %> |
|
114 | 114 | <%= auto_discovery_link_tag(:atom, |
|
115 | 115 | {:controller => 'journals', :action => 'index', |
|
116 | 116 | :query_id => @query, :format => 'atom', |
|
117 | 117 | :page => nil, :key => User.current.rss_key}, |
|
118 | 118 | :title => l(:label_changes_details)) %> |
|
119 | 119 | <% end %> |
|
120 | 120 | |
|
121 | 121 | <%= context_menu issues_context_menu_path %> |
@@ -1,92 +1,92 | |||
|
1 | 1 | <%= error_messages_for 'query' %> |
|
2 | 2 | |
|
3 | 3 | <div class="box"> |
|
4 | 4 | <div class="tabular"> |
|
5 | 5 | <%= hidden_field_tag 'gantt', '1' if params[:gantt] %> |
|
6 | 6 | |
|
7 | 7 | <p><label for="query_name"><%=l(:field_name)%></label> |
|
8 | 8 | <%= text_field 'query', 'name', :size => 80 %></p> |
|
9 | 9 | |
|
10 | 10 | <% if User.current.admin? || User.current.allowed_to?(:manage_public_queries, @query.project) %> |
|
11 | 11 | <p><label><%=l(:field_visible)%></label> |
|
12 | 12 | <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PRIVATE %> <%= l(:label_visibility_private) %></label> |
|
13 | 13 | <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PUBLIC %> <%= l(:label_visibility_public) %></label> |
|
14 | 14 | <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_ROLES %> <%= l(:label_visibility_roles) %>:</label> |
|
15 | 15 | <% Role.givable.sorted.each do |role| %> |
|
16 | 16 | <label class="block role-visibility"><%= check_box_tag 'query[role_ids][]', role.id, @query.roles.include?(role), :id => nil %> <%= role.name %></label> |
|
17 | 17 | <% end %> |
|
18 | 18 | <%= hidden_field_tag 'query[role_ids][]', '' %> |
|
19 | 19 | </p> |
|
20 | 20 | <% end %> |
|
21 | 21 | |
|
22 | 22 | <p><label for="query_is_for_all"><%=l(:field_is_for_all)%></label> |
|
23 | 23 | <%= check_box_tag 'query_is_for_all', 1, @query.project.nil?, :class => (User.current.admin? ? '' : 'disable-unless-private') %></p> |
|
24 | 24 | |
|
25 | 25 | <% unless params[:gantt] %> |
|
26 | <fieldset><legend><%= l(:label_options) %></legend> | |
|
26 | <fieldset id="options"><legend><%= l(:label_options) %></legend> | |
|
27 | 27 | <p><label for="query_default_columns"><%=l(:label_default_columns)%></label> |
|
28 | 28 | <%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns', |
|
29 | 29 | :onclick => 'if (this.checked) {$("#columns").hide();} else {$("#columns").show();}' %></p> |
|
30 | 30 | |
|
31 | 31 | <p><label for="query_group_by"><%= l(:field_group_by) %></label> |
|
32 | 32 | <%= select 'query', 'group_by', @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, :include_blank => true %></p> |
|
33 | 33 | |
|
34 | 34 | <p><label><%= l(:button_show) %></label> |
|
35 | 35 | <%= available_block_columns_tags(@query) %></p> |
|
36 | 36 | |
|
37 | 37 | <p><label><%= l(:label_total_plural) %></label> |
|
38 | 38 | <%= available_totalable_columns_tags(@query) %></p> |
|
39 | 39 | </fieldset> |
|
40 | 40 | <% else %> |
|
41 | <fieldset><legend><%= l(:label_options) %></legend> | |
|
41 | <fieldset id="options"><legend><%= l(:label_options) %></legend> | |
|
42 | 42 | <p><label><%= l(:button_show) %></label> |
|
43 | 43 | <label class="inline"><%= check_box_tag "query[draw_relations]", "1", @query.draw_relations %> <%= l(:label_related_issues) %></label> |
|
44 | 44 | <label class="inline"><%= check_box_tag "query[draw_progress_line]", "1", @query.draw_progress_line %> <%= l(:label_gantt_progress_line) %></label> |
|
45 | 45 | </p> |
|
46 | 46 | </fieldset> |
|
47 | 47 | <% end %> |
|
48 | 48 | </div> |
|
49 | 49 | |
|
50 | 50 | <fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend> |
|
51 | 51 | <%= render :partial => 'queries/filters', :locals => {:query => query}%> |
|
52 | 52 | </fieldset> |
|
53 | 53 | |
|
54 | 54 | <% unless params[:gantt] %> |
|
55 | 55 | <fieldset><legend><%= l(:label_sort) %></legend> |
|
56 | 56 | <% 3.times do |i| %> |
|
57 | 57 | <%= content_tag(:span, "#{i+1}:", :class => 'query_sort_criteria_count')%> |
|
58 | 58 | <%= label_tag "query_sort_criteria_attribute_" + i.to_s, |
|
59 | 59 | l(:description_query_sort_criteria_attribute), :class => "hidden-for-sighted" %> |
|
60 | 60 | <%= select_tag("query[sort_criteria][#{i}][]", |
|
61 | 61 | options_for_select([[]] + query.available_columns.select(&:sortable?).collect {|column| [column.caption, column.name.to_s]}, @query.sort_criteria_key(i)), |
|
62 | 62 | :id => "query_sort_criteria_attribute_" + i.to_s)%> |
|
63 | 63 | <%= label_tag "query_sort_criteria_direction_" + i.to_s, |
|
64 | 64 | l(:description_query_sort_criteria_direction), :class => "hidden-for-sighted" %> |
|
65 | 65 | <%= select_tag("query[sort_criteria][#{i}][]", |
|
66 | 66 | options_for_select([[], [l(:label_ascending), 'asc'], [l(:label_descending), 'desc']], @query.sort_criteria_order(i)), |
|
67 | 67 | :id => "query_sort_criteria_direction_" + i.to_s) %> |
|
68 | 68 | <br /> |
|
69 | 69 | <% end %> |
|
70 | 70 | </fieldset> |
|
71 | 71 | <% end %> |
|
72 | 72 | |
|
73 | 73 | <% unless params[:gantt] %> |
|
74 | 74 | <%= content_tag 'fieldset', :id => 'columns', :style => (query.has_default_columns? ? 'display:none;' : nil) do %> |
|
75 | 75 | <legend><%= l(:field_column_names) %></legend> |
|
76 | 76 | <%= render_query_columns_selection(query) %> |
|
77 | 77 | <% end %> |
|
78 | 78 | <% end %> |
|
79 | 79 | |
|
80 | 80 | </div> |
|
81 | 81 | |
|
82 | 82 | <%= javascript_tag do %> |
|
83 | 83 | $(document).ready(function(){ |
|
84 | 84 | $("input[name='query[visibility]']").change(function(){ |
|
85 | 85 | var roles_checked = $('#query_visibility_1').is(':checked'); |
|
86 | 86 | var private_checked = $('#query_visibility_0').is(':checked'); |
|
87 | 87 | $("input[name='query[role_ids][]'][type=checkbox]").attr('disabled', !roles_checked); |
|
88 | 88 | if (!private_checked) $("input.disable-unless-private").attr('checked', false); |
|
89 | 89 | $("input.disable-unless-private").attr('disabled', !private_checked); |
|
90 | 90 | }).trigger('change'); |
|
91 | 91 | }); |
|
92 | 92 | <% end %> |
@@ -1,36 +1,36 | |||
|
1 | 1 | <div id="query_form_with_buttons" class="hide-when-print"> |
|
2 | 2 | <div id="query_form_content"> |
|
3 | 3 | <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> |
|
4 | 4 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
5 | 5 | <div style="<%= @query.new_record? ? "" : "display: none;" %>"> |
|
6 | 6 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> |
|
7 | 7 | </div> |
|
8 | 8 | </fieldset> |
|
9 | <fieldset class="collapsible collapsed"> | |
|
9 | <fieldset id="options" class="collapsible collapsed"> | |
|
10 | 10 | <legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend> |
|
11 | 11 | <div style="display: none;"> |
|
12 | 12 | <table> |
|
13 | 13 | <tr> |
|
14 | <td><%= l(:field_column_names) %></td> | |
|
14 | <td class="field"><%= l(:field_column_names) %></td> | |
|
15 | 15 | <td><%= render_query_columns_selection(@query) %></td> |
|
16 | 16 | </tr> |
|
17 | 17 | </table> |
|
18 | 18 | </div> |
|
19 | 19 | </fieldset> |
|
20 | 20 | </div> |
|
21 | 21 | |
|
22 | 22 | <p class="buttons"> |
|
23 | 23 | <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> |
|
24 | 24 | <%= link_to l(:button_clear), {:project_id => @project, :issue_id => @issue}, :class => 'icon icon-reload' %> |
|
25 | 25 | </p> |
|
26 | 26 | </div> |
|
27 | 27 | |
|
28 | 28 | <div class="tabs hide-when-print"> |
|
29 | 29 | <% query_params = params.slice(:f, :op, :v, :sort) %> |
|
30 | 30 | <ul> |
|
31 | 31 | <li><%= link_to(l(:label_details), _time_entries_path(@project, @issue, query_params), |
|
32 | 32 | :class => (action_name == 'index' ? 'selected' : nil)) %></li> |
|
33 | 33 | <li><%= link_to(l(:label_report), _report_time_entries_path(@project, @issue, query_params), |
|
34 | 34 | :class => (action_name == 'report' ? 'selected' : nil)) %></li> |
|
35 | 35 | </ul> |
|
36 | 36 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now