summaryrefslogtreecommitdiffstats
path: root/app/helpers/issues_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-02-21 13:34:33 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-02-21 13:34:33 +0000
commit0efc783a7e4be71447da94b149e1b8a5196f001f (patch)
tree7c6ed18c6f3ef6f33252e4b57df0a28962567fdd /app/helpers/issues_helper.rb
parenta189b4b3770930cf7a38fa53dd533ef074ced501 (diff)
downloadredmine-0efc783a7e4be71447da94b149e1b8a5196f001f.tar.gz
redmine-0efc783a7e4be71447da94b149e1b8a5196f001f.zip
Splits private/public issue queries in the sidebar (#1067).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4908 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r--app/helpers/issues_helper.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index ce23668ef..38cc52fee 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -106,13 +106,29 @@ module IssuesHelper
# Project specific queries and global queries
visible << (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
@sidebar_queries = Query.find(:all,
- :select => 'id, name',
+ :select => 'id, name, is_public',
:order => "name ASC",
:conditions => visible.conditions)
end
@sidebar_queries
end
+ def query_links(title, queries)
+ content_tag('h3', title) +
+ queries.collect {|query|
+ link_to(h(query.name), :controller => 'issues', :action => 'index', :project_id => @project, :query_id => query)
+ }.join('<br />')
+ end
+
+ def render_sidebar_queries
+ out = ''
+ queries = sidebar_queries.select {|q| !q.is_public?}
+ out << query_links(l(:label_my_queries), queries) if queries.any?
+ queries = sidebar_queries.select {|q| q.is_public?}
+ out << query_links(l(:label_query_plural), queries) if queries.any?
+ out
+ end
+
def show_detail(detail, no_html=false)
case detail.property
when 'attr'