2006-12-16 16:37:32 +03:00
|
|
|
<%= error_messages_for 'query' %>
|
2007-10-03 21:38:18 +04:00
|
|
|
<%= hidden_field_tag 'confirm', 1 %>
|
2006-12-16 16:37:32 +03:00
|
|
|
|
|
|
|
<div class="box">
|
|
|
|
<div class="tabular">
|
|
|
|
<p><label for="query_name"><%=l(:field_name)%></label>
|
|
|
|
<%= text_field 'query', 'name', :size => 80 %></p>
|
2007-06-23 17:49:29 +04:00
|
|
|
|
2008-03-30 16:29:07 +04:00
|
|
|
<% if User.current.admin? || (@project && current_role.allowed_to?(:manage_public_queries)) %>
|
|
|
|
<p><label for="query_is_public"><%=l(:field_is_public)%></label>
|
|
|
|
<%= 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;}') %></p>
|
2007-06-23 17:49:29 +04:00
|
|
|
<% end %>
|
2007-10-01 12:44:17 +04:00
|
|
|
|
2008-03-30 16:29:07 +04:00
|
|
|
<p><label for="query_is_for_all"><%=l(:field_is_for_all)%></label>
|
|
|
|
<%= check_box_tag 'query_is_for_all', 1, @query.project.nil?,
|
|
|
|
:disabled => (!@query.new_record? && (@query.project.nil? || (@query.is_public? && !User.current.admin?))) %></p>
|
|
|
|
|
2007-10-01 14:44:45 +04:00
|
|
|
<p><label for="query_default_columns"><%=l(:label_default_columns)%></label>
|
|
|
|
<%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns',
|
2007-10-01 15:39:34 +04:00
|
|
|
:onclick => 'if (this.checked) {Element.hide("columns")} else {Element.show("columns")}' %></p>
|
2006-12-16 16:37:32 +03:00
|
|
|
</div>
|
|
|
|
|
2008-03-16 17:31:17 +03:00
|
|
|
<fieldset><legend><%= l(:label_filter_plural) %></legend>
|
2006-12-16 16:37:32 +03:00
|
|
|
<%= render :partial => 'queries/filters', :locals => {:query => query}%>
|
2008-03-16 17:31:17 +03:00
|
|
|
</fieldset>
|
|
|
|
|
2007-10-01 15:39:34 +04:00
|
|
|
<%= render :partial => 'queries/columns', :locals => {:query => query}%>
|
2006-12-16 16:37:32 +03:00
|
|
|
</div>
|