Feature #27672 » 0003-Fix-changeable-items-on-the-queries-form.patch
| app/views/gantts/show.html.erb | ||
|---|---|---|
| 1 | 1 |
<% @gantt.view = self %> |
| 2 |
<div class="contextual"> |
|
| 3 |
<% if !@query.new_record? && @query.editable_by?(User.current) %> |
|
| 4 |
<%= link_to l(:button_edit), edit_query_path(@query, :gantt => 1), :class => 'icon icon-edit' %> |
|
| 5 |
<%= delete_link query_path(@query, :gantt => 1) %> |
|
| 6 |
<% end %> |
|
| 7 |
</div> |
|
| 8 | 2 | |
| 9 | 3 |
<h2><%= @query.new_record? ? l(:label_gantt) : @query.name %></h2> |
| 10 | 4 | |
| ... | ... | |
| 89 | 83 |
:class => 'icon icon-checked' %> |
| 90 | 84 |
<%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 },
|
| 91 | 85 |
:class => 'icon icon-reload' %> |
| 92 |
<% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %> |
|
| 93 |
<%= link_to_function l(:button_save), |
|
| 94 |
"$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit();",
|
|
| 95 |
:class => 'icon icon-save' %> |
|
| 86 |
<% if @query.new_record? %> |
|
| 87 |
<% if User.current.allowed_to?(:save_queries, @project, :global => true) %> |
|
| 88 |
<%= link_to_function l(:button_save), |
|
| 89 |
"$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit();",
|
|
| 90 |
:class => 'icon icon-save' %> |
|
| 91 |
<% end %> |
|
| 92 |
<% else %> |
|
| 93 |
<% if @query.editable_by?(User.current) %> |
|
| 94 |
<%= link_to l(:button_edit), edit_query_path(@query, :gantt => 1), :class => 'icon icon-edit' %> |
|
| 95 |
<%= delete_link query_path(@query, :gantt => 1) %> |
|
| 96 |
<% end %> |
|
| 96 | 97 |
<% end %> |
| 97 | 98 |
</p> |
| 98 | 99 |
</div> |
| app/views/queries/_form.html.erb | ||
|---|---|---|
| 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 |
<% unless params[:gantt] %> |
|
| 26 | 25 |
<fieldset id="options"><legend><%= l(:label_options) %></legend> |
| 27 | 26 |
<p><label for="query_default_columns"><%=l(:label_default_columns)%></label> |
| 28 | 27 |
<%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns', |
| 29 | 28 |
:data => {:disables => "#columns, .block_columns input"} %></p>
|
| 30 | 29 | |
| 30 |
<% unless params[:gantt] %> |
|
| 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 | |
| ... | ... | |
| 36 | 36 | |
| 37 | 37 |
<p><label><%= l(:label_total_plural) %></label> |
| 38 | 38 |
<%= available_totalable_columns_tags(@query) %></p> |
| 39 |
</fieldset> |
|
| 40 | 39 |
<% else %> |
| 41 |
<fieldset id="options"><legend><%= l(:label_options) %></legend> |
|
| 42 | 40 |
<p><label><%= l(:button_show) %></label> |
| 43 | 41 |
<label class="inline"><%= check_box_tag "query[draw_relations]", "1", @query.draw_relations %> <%= l(:label_related_issues) %></label> |
| 44 | 42 |
<label class="inline"><%= check_box_tag "query[draw_progress_line]", "1", @query.draw_progress_line %> <%= l(:label_gantt_progress_line) %></label> |
| 45 | 43 |
<label class="inline"><%= check_box_tag "query[draw_selected_columns]", "1", @query.draw_selected_columns %> <%= l(:label_gantt_selected_columns) %></label> |
| 46 | 44 |
</p> |
| 47 |
</fieldset> |
|
| 48 | 45 |
<% end %> |
| 46 |
</fieldset> |
|
| 49 | 47 |
</div> |
| 50 | 48 | |
| 51 | 49 |
<fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend> |
| ... | ... | |
| 71 | 69 |
</fieldset> |
| 72 | 70 |
<% end %> |
| 73 | 71 | |
| 74 |
<% unless params[:gantt] %> |
|
| 75 | 72 |
<%= content_tag 'fieldset', :id => 'columns' do %> |
| 76 | 73 |
<legend><%= l(:field_column_names) %></legend> |
| 77 | 74 |
<%= render_query_columns_selection(query) %> |
| 78 | 75 |
<% end %> |
| 79 |
<% end %> |
|
| 80 | 76 | |
| 81 | 77 |
</div> |
| 82 | 78 | |