From 287d86e3632546b06aeb955db8b0e5eea139082b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 30 Mar 2008 12:29:07 +0000 Subject: Queries can be marked as 'For all projects'. Such queries will be available on all projects and on the global issue list (#897, closes #671). Only admin users can create/edit queries that are public and for all projects. Note: this change does not allow to save a query from the global issue list. You have to be inside a project but then you can mark the query as 'For all projects'. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1311 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/queries/_form.rhtml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'app/views/queries/_form.rhtml') diff --git a/app/views/queries/_form.rhtml b/app/views/queries/_form.rhtml index 2d4b96fd1..8da264032 100644 --- a/app/views/queries/_form.rhtml +++ b/app/views/queries/_form.rhtml @@ -6,11 +6,16 @@

<%= text_field 'query', 'name', :size => 80 %>

-<% if current_role.allowed_to?(:manage_public_queries) %> -

- <%= check_box 'query', 'is_public' %>

+<% if User.current.admin? || (@project && current_role.allowed_to?(:manage_public_queries)) %> +

+<%= 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")}' %>

-- cgit v1.2.3