1 |
1 |
<%= error_messages_for 'query' %>
|
2 |
2 |
|
3 |
3 |
<div class="box">
|
4 |
|
<div class="tabular">
|
5 |
|
<%= hidden_field_tag 'gantt', '1' if params[:gantt] %>
|
6 |
|
<%= hidden_field_tag 'calendar', '1' if params[:calendar] %>
|
|
4 |
<div class="tabular">
|
|
5 |
<%= hidden_field_tag 'gantt', '1' if params[:gantt] %>
|
|
6 |
<%= hidden_field_tag 'calendar', '1' if params[:calendar] %>
|
7 |
7 |
|
8 |
|
<p><label for="query_name"><%=l(:field_name)%></label>
|
9 |
|
<%= text_field 'query', 'name', :size => 80 %></p>
|
|
8 |
<p><label for="query_name"><%=l(:field_name)%></label>
|
|
9 |
<%= text_field 'query', 'name', :size => 80 %></p>
|
10 |
10 |
|
11 |
|
<% if User.current.admin? || User.current.allowed_to?(:manage_public_queries, @query.project) %>
|
12 |
|
<p><label><%=l(:field_visible)%></label>
|
13 |
|
<label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PRIVATE %> <%= l(:label_visibility_private) %></label>
|
14 |
|
<label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PUBLIC %> <%= l(:label_visibility_public) %></label>
|
15 |
|
<label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_ROLES %> <%= l(:label_visibility_roles) %>:</label>
|
16 |
|
<% Role.givable.sorted.each do |role| %>
|
17 |
|
<label class="block role-visibility"><%= check_box_tag 'query[role_ids][]', role.id, @query.roles.include?(role), :id => nil %> <%= role.name %></label>
|
18 |
|
<% end %>
|
19 |
|
<%= hidden_field_tag 'query[role_ids][]', '' %>
|
20 |
|
</p>
|
21 |
|
<% end %>
|
|
11 |
<% if User.current.admin? || User.current.allowed_to?(:manage_public_queries, @query.project) %>
|
|
12 |
<p>
|
|
13 |
<label><%=l(:field_visible)%></label>
|
|
14 |
<label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PRIVATE %> <%= l(:label_visibility_private) %></label>
|
|
15 |
<label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PUBLIC %> <%= l(:label_visibility_public) %></label>
|
|
16 |
<label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_ROLES %> <%= l(:label_visibility_roles) %>:</label>
|
|
17 |
<% Role.givable.sorted.each do |role| %>
|
|
18 |
<label class="block role-visibility"><%= check_box_tag 'query[role_ids][]', role.id, @query.roles.include?(role), :id => nil %> <%= role.name %></label>
|
|
19 |
<% end %>
|
|
20 |
<%= hidden_field_tag 'query[role_ids][]', '' %>
|
|
21 |
</p>
|
|
22 |
<% end %>
|
22 |
23 |
|
23 |
|
<p><label for="query_is_for_all"><%=l(:field_is_for_all)%></label>
|
24 |
|
<%= check_box_tag 'query_is_for_all', 1, @query.project.nil?, :class => (User.current.admin? ? '' : 'disable-unless-private') %></p>
|
|
24 |
<p><label for="query_is_for_all"><%=l(:field_is_for_all)%></label>
|
|
25 |
<%= check_box_tag 'query_is_for_all', 1, @query.project.nil?, :class => (User.current.admin? ? '' : 'disable-unless-private') %></p>
|
25 |
26 |
|
26 |
|
<% unless params[:calendar] %>
|
27 |
|
<fieldset id="options"><legend><%= l(:label_options) %></legend>
|
28 |
|
<p><label for="query_default_columns"><%=l(:label_default_columns)%></label>
|
29 |
|
<%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns',
|
30 |
|
:data => {:disables => "#columns, .block_columns input"} %></p>
|
|
27 |
<% if params[:calendar].nil? %>
|
|
28 |
<fieldset id="options">
|
|
29 |
<legend><%= l(:label_options) %></legend>
|
|
30 |
<p><label for="query_default_columns"><%=l(:label_default_columns)%></label>
|
|
31 |
<%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns',
|
|
32 |
:data => {:disables => "#columns, .block_columns input"} %></p>
|
31 |
33 |
|
32 |
|
<% unless params[:gantt] %>
|
33 |
|
<p><label for="query_group_by"><%= l(:field_group_by) %></label>
|
34 |
|
<%= select 'query', 'group_by', @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, :include_blank => true %></p>
|
|
34 |
<% if params[:gantt].nil? %>
|
|
35 |
<p><label for="query_group_by"><%= l(:field_group_by) %></label>
|
|
36 |
<%= select 'query', 'group_by', @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, :include_blank => true %></p>
|
35 |
37 |
|
36 |
|
<p class="block_columns"><label><%= l(:button_show) %></label>
|
37 |
|
<%= available_block_columns_tags(@query) %></p>
|
|
38 |
<p class="block_columns"><label><%= l(:button_show) %></label>
|
|
39 |
<%= available_block_columns_tags(@query) %></p>
|
38 |
40 |
|
39 |
|
<p><label><%= l(:label_total_plural) %></label>
|
40 |
|
<%= available_totalable_columns_tags(@query) %></p>
|
41 |
|
<% else %>
|
42 |
|
<p><label><%= l(:button_show) %></label>
|
43 |
|
<%= hidden_field_tag 'query[draw_relations]', '0' %>
|
44 |
|
<%= hidden_field_tag 'query[draw_progress_line]', '0' %>
|
45 |
|
<%= hidden_field_tag 'query[draw_selected_columns]', '0' %>
|
46 |
|
<label class="inline"><%= check_box_tag "query[draw_relations]", "1", @query.draw_relations %> <%= l(:label_related_issues) %></label>
|
47 |
|
<label class="inline"><%= check_box_tag "query[draw_progress_line]", "1", @query.draw_progress_line %> <%= l(:label_gantt_progress_line) %></label>
|
48 |
|
<label class="inline"><%= check_box_tag "query[draw_selected_columns]", "1", @query.draw_selected_columns, :data => { :enables => 'span.query-columns select, span.query-columns input'} %> <%= l(:description_selected_columns) %></label>
|
49 |
|
</p>
|
50 |
|
<% end # unless params[:gantt] %>
|
51 |
|
</fieldset>
|
52 |
|
<% end # unless params[:calendar] %>
|
53 |
|
</div>
|
|
41 |
<p><label><%= l(:label_total_plural) %></label>
|
|
42 |
<%= available_totalable_columns_tags(@query) %></p>
|
|
43 |
<% else %>
|
|
44 |
<p>
|
|
45 |
<label><%= l(:button_show) %></label>
|
|
46 |
<%= hidden_field_tag 'query[draw_relations]', '0' %>
|
|
47 |
<%= hidden_field_tag 'query[draw_progress_line]', '0' %>
|
|
48 |
<%= hidden_field_tag 'query[draw_selected_columns]', '0' %>
|
|
49 |
<label class="inline"><%= check_box_tag "query[draw_relations]", "1", @query.draw_relations %> <%= l(:label_related_issues) %></label>
|
|
50 |
<label class="inline"><%= check_box_tag "query[draw_progress_line]", "1", @query.draw_progress_line %> <%= l(:label_gantt_progress_line) %></label>
|
|
51 |
<label class="inline"><%= check_box_tag "query[draw_selected_columns]", "1", @query.draw_selected_columns, :data => { :enables => 'span.query-columns select, span.query-columns input'} %> <%= l(:description_selected_columns) %></label>
|
|
52 |
</p>
|
|
53 |
<% end %>
|
|
54 |
</fieldset>
|
|
55 |
<% end %>
|
|
56 |
</div>
|
54 |
57 |
|
55 |
|
<fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend>
|
56 |
|
<%= render :partial => 'queries/filters', :locals => {:query => query}%>
|
57 |
|
</fieldset>
|
|
58 |
<fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend>
|
|
59 |
<%= render :partial => 'queries/filters', :locals => {:query => query}%>
|
|
60 |
</fieldset>
|
58 |
61 |
|
59 |
|
<% unless params[:calendar] %>
|
60 |
|
<% unless params[:gantt] %>
|
61 |
|
<fieldset><legend><%= l(:label_sort) %></legend>
|
62 |
|
<% 3.times do |i| %>
|
63 |
|
<%= content_tag(:span, "#{i+1}:", :class => 'query_sort_criteria_count')%>
|
64 |
|
<%= label_tag "query_sort_criteria_attribute_" + i.to_s,
|
65 |
|
l(:description_query_sort_criteria_attribute), :class => "hidden-for-sighted" %>
|
66 |
|
<%= select_tag("query[sort_criteria][#{i}][]",
|
67 |
|
options_for_select([[]] + query.available_columns.select(&:sortable?).collect {|column| [column.caption, column.name.to_s]}, @query.sort_criteria_key(i)),
|
68 |
|
:id => "query_sort_criteria_attribute_" + i.to_s)%>
|
69 |
|
<%= label_tag "query_sort_criteria_direction_" + i.to_s,
|
70 |
|
l(:description_query_sort_criteria_direction), :class => "hidden-for-sighted" %>
|
71 |
|
<%= select_tag("query[sort_criteria][#{i}][]",
|
72 |
|
options_for_select([[], [l(:label_ascending), 'asc'], [l(:label_descending), 'desc']], @query.sort_criteria_order(i)),
|
73 |
|
:id => "query_sort_criteria_direction_" + i.to_s) %>
|
74 |
|
<br />
|
75 |
|
<% end %>
|
76 |
|
</fieldset>
|
77 |
|
<% end %>
|
|
62 |
<% if params[:gantt].nil? && params[:calendar].nil? %>
|
|
63 |
<fieldset><legend><%= l(:label_sort) %></legend>
|
|
64 |
<% 3.times do |i| %>
|
|
65 |
<%= content_tag(:span, "#{i+1}:", :class => 'query_sort_criteria_count')%>
|
|
66 |
<%= label_tag "query_sort_criteria_attribute_" + i.to_s,
|
|
67 |
l(:description_query_sort_criteria_attribute), :class => "hidden-for-sighted" %>
|
|
68 |
<%= select_tag("query[sort_criteria][#{i}][]",
|
|
69 |
options_for_select([[]] + query.available_columns.select(&:sortable?).collect {|column| [column.caption, column.name.to_s]}, @query.sort_criteria_key(i)),
|
|
70 |
:id => "query_sort_criteria_attribute_" + i.to_s)%>
|
|
71 |
<%= label_tag "query_sort_criteria_direction_" + i.to_s,
|
|
72 |
l(:description_query_sort_criteria_direction), :class => "hidden-for-sighted" %>
|
|
73 |
<%= select_tag("query[sort_criteria][#{i}][]",
|
|
74 |
options_for_select([[], [l(:label_ascending), 'asc'], [l(:label_descending), 'desc']], @query.sort_criteria_order(i)),
|
|
75 |
:id => "query_sort_criteria_direction_" + i.to_s) %>
|
|
76 |
<br />
|
|
77 |
<% end %>
|
|
78 |
</fieldset>
|
|
79 |
<% end %>
|
78 |
80 |
|
79 |
|
<%= content_tag 'fieldset', :id => 'columns' do %>
|
80 |
|
<legend><%= l(:field_column_names) %></legend>
|
81 |
|
<%= render_query_columns_selection(query) %>
|
82 |
|
<% end %>
|
83 |
|
<% end # unless params[:calendar] %>
|
|
81 |
<% if params[:calendar].nil? %>
|
|
82 |
<%= content_tag 'fieldset', :id => 'columns' do %>
|
|
83 |
<legend><%= l(:field_column_names) %></legend>
|
|
84 |
<%= render_query_columns_selection(query) %>
|
|
85 |
<% end %>
|
|
86 |
<% end %>
|
84 |
87 |
|
85 |
88 |
</div>
|
86 |
89 |
|