|
|
@ -106,13 +106,29 @@ module IssuesHelper |
|
|
|
# Project specific queries and global queries |
|
|
|
# Project specific queries and global queries |
|
|
|
visible << (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id]) |
|
|
|
visible << (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id]) |
|
|
|
@sidebar_queries = Query.find(:all, |
|
|
|
@sidebar_queries = Query.find(:all, |
|
|
|
:select => 'id, name', |
|
|
|
:select => 'id, name, is_public', |
|
|
|
:order => "name ASC", |
|
|
|
:order => "name ASC", |
|
|
|
:conditions => visible.conditions) |
|
|
|
:conditions => visible.conditions) |
|
|
|
end |
|
|
|
end |
|
|
|
@sidebar_queries |
|
|
|
@sidebar_queries |
|
|
|
end |
|
|
|
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) |
|
|
|
def show_detail(detail, no_html=false) |
|
|
|
case detail.property |
|
|
|
case detail.property |
|
|
|
when 'attr' |
|
|
|
when 'attr' |
|
|
|