%#-- copyright OpenProject is a project management system. Copyright (C) 2012-2013 the OpenProject Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3. See doc/COPYRIGHT.rdoc for more details. ++#%> <%= error_messages_for 'query' %> <%= hidden_field_tag 'confirm', 1 %>
<%= label_tag :query_name, Query.human_attribute_name(:name) %> <%= text_field 'query', 'name', :size => 80 %>
<% if query.any_summable_columns? %><%= label_tag :display_sums, l(:label_display_sums) %> <%= check_box 'query', 'display_sums' %>
<% end %> <%= call_hook(:view_query_form_top, :query => query) %> <% if User.current.admin? || User.current.allowed_to?(:manage_public_queries, @project) %><%= check_box 'query', 'is_public', :onchange => (User.current.admin? ? nil : 'if (this.checked) {$("query_is_for_all").checked = false; $("query_is_for_all").disabled = true;} else {$("query_is_for_all").disabled = false;}') %>
<% end %><%= check_box_tag 'query_is_for_all', 1, @query.project.nil?, :disabled => (!@query.new_record? && (@query.project.nil? || (@query.is_public? && !User.current.admin?))) %>
<%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns', :onclick => 'if (this.checked) {Element.hide("columns")} else {Element.show("columns")}' %>
<%= select 'query', 'group_by', @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, :include_blank => true %>