|
2 | 2 |
|
3 | 3 | <div class="box">
|
4 | 4 | <div class="tabular">
|
| 5 | +<%= hidden_field_tag 'gantt', '1' if params[:gantt] %> |
| 6 | + |
5 | 7 | <p><label for="query_name"><%=l(:field_name)%></label>
|
6 | 8 | <%= text_field 'query', 'name', :size => 80 %></p>
|
7 | 9 |
|
|
15 | 17 | <%= javascript_tag "new Ajax.Autocompleter('query_category', 'query_categories_choices', '#{ url_for(:controller => 'smart_issues_sort', :action => 'autocomplete_for_category') }', { minChars: 1, frequency: 0.5, paramName: 'category' });" %>
|
16 | 18 | <%# VVK end %>
|
17 | 19 |
|
18 |
| -<% if User.current.admin? || User.current.allowed_to?(:manage_public_queries, @project) %> |
19 |
| -<p><label for="query_is_public"><%=l(:field_is_public)%></label> |
20 |
| -<%= check_box 'query', 'is_public', |
21 |
| - :onchange => (User.current.admin? ? nil : 'if (this.checked) {$("#query_is_for_all").removeAttr("checked"); $("#query_is_for_all").attr("disabled", true);} else {$("#query_is_for_all").removeAttr("disabled");}') %></p> |
22 | 20 |
|
| 21 | +<% if User.current.admin? || User.current.allowed_to?(:manage_public_queries, @project) %> |
| 22 | +<p><label><%=l(:field_visible)%></label> |
| 23 | + <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PRIVATE %> <%= l(:label_visibility_private) %></label> |
| 24 | + <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_ROLES %> <%= l(:label_visibility_roles) %>:</label> |
| 25 | + <% Role.givable.sorted.each do |role| %> |
| 26 | + <label class="block role-visibility"><%= check_box_tag 'query[role_ids][]', role.id, @query.roles.include?(role), :id => nil %> <%= role.name %></label> |
| 27 | + <% end %> |
| 28 | + <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PUBLIC %> <%= l(:label_visibility_public) %></label> |
| 29 | + <%= hidden_field_tag 'query[role_ids][]', '' %> |
| 30 | +</p> |
23 | 31 | <% end %>
|
24 | 32 |
|
25 | 33 | <p><label for="query_is_for_all"><%=l(:field_is_for_all)%></label>
|
26 | 34 | <%= check_box_tag 'query_is_for_all', 1, @query.project.nil?,
|
27 | 35 | :disabled => (!@query.new_record? && (@query.project.nil? || (@query.is_public? && !User.current.admin?))) %></p>
|
28 | 36 |
|
| 37 | +<fieldset><legend><%= l(:label_options) %></legend> |
29 | 38 | <p><label for="query_default_columns"><%=l(:label_default_columns)%></label>
|
30 | 39 | <%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns',
|
31 | 40 | :onclick => 'if (this.checked) {$("#columns").hide();} else {$("#columns").show();}' %></p>
|
32 | 41 |
|
33 |
| - |
34 | 42 | <p><label for="query_group_by"><%= l(:field_group_by) %></label>
|
35 | 43 | <%= select 'query', 'group_by', @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, :include_blank => true %></p>
|
36 | 44 |
|
37 | 45 | <p><label><%= l(:button_show) %></label>
|
38 | 46 | <%= available_block_columns_tags(@query) %></p>
|
| 47 | + |
| 48 | +<% if params[:gantt] %> |
| 49 | + <p><label><%= l(:label_gantt) %></label> |
| 50 | + <label class="inline"><%= check_box_tag "query[draw_relations]", "1", @query.draw_relations %> <%= l(:label_related_issues) %></label> |
| 51 | + <label class="inline"><%= check_box_tag "query[draw_progress_line]", "1", @query.draw_progress_line %> <%= l(:label_gantt_progress_line) %></label> |
| 52 | + </p> |
| 53 | +<% end %> |
| 54 | +</fieldset> |
39 | 55 | </div>
|
40 | 56 |
|
41 | 57 | <fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend>
|
42 | 58 | <%= render :partial => 'queries/filters', :locals => {:query => query}%>
|
43 | 59 | </fieldset>
|
44 | 60 |
|
45 | 61 | <fieldset><legend><%= l(:label_sort) %></legend>
|
46 |
| -<%# VVK start %> |
| 62 | + <%# VVK start %> |
47 | 63 | <p>
|
48 | 64 |
|
49 | 65 | <%= check_box 'query', 'sort_by_parent_first' %>
|
50 | 66 | <label for="query_sort_by_parent_first"><%=l(:label_qg_sort_by_parent_issue)%></label>
|
51 | 67 | </p>
|
52 | 68 | <%# VVK end %>
|
| 69 | + |
53 | 70 | <% 3.times do |i| %>
|
54 |
| -<%= i+1 %>: |
| 71 | +<%= i+1 %>: |
55 | 72 | <%= label_tag "query_sort_criteria_attribute_" + i.to_s,
|
56 | 73 | l(:description_query_sort_criteria_attribute), :class => "hidden-for-sighted" %>
|
57 | 74 | <%= select_tag("query[sort_criteria][#{i}][]",
|
|
73 | 90 |
|
74 | 91 | </div>
|
75 | 92 |
|
| 93 | +<%= javascript_tag do %> |
| 94 | +$(document).ready(function(){ |
| 95 | + $("input[name='query[visibility]']").change(function(){ |
| 96 | + var checked = $('#query_visibility_1').is(':checked'); |
| 97 | + $("input[name='query[role_ids][]'][type=checkbox]").attr('disabled', !checked); |
| 98 | + }).trigger('change'); |
| 99 | +}); |
| 100 | +<% end %> |
| 101 | + |
76 | 102 | <%# VVK start %>
|
77 | 103 | <% content_for :header_tags do %>
|
78 | 104 | <%= stylesheet_link_tag 'stylesheet', :plugin => SIS_AssetHelpers::PLUGIN_NAME %>
|
79 | 105 | <% end %>
|
80 | 106 | <%# VVK end %>
|
| 107 | + |
0 commit comments