Commit 886c3e29 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang Committed by Eric Davis

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
parent 0e39c0e5
...@@ -106,13 +106,29 @@ module IssuesHelper ...@@ -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'
......
...@@ -13,11 +13,5 @@ ...@@ -13,11 +13,5 @@
<% end %> <% end %>
<%= call_hook(:view_issues_sidebar_planning_bottom) %> <%= call_hook(:view_issues_sidebar_planning_bottom) %>
<% unless sidebar_queries.empty? -%> <%= render_sidebar_queries %>
<h3><%= l(:label_query_plural) %></h3>
<% sidebar_queries.each do |query| -%>
<%= link_to(h(query.name), :controller => 'issues', :action => 'index', :project_id => @project, :query_id => query) %><br />
<% end -%>
<%= call_hook(:view_issues_sidebar_queries_bottom) %> <%= call_hook(:view_issues_sidebar_queries_bottom) %>
<% end -%>
...@@ -945,3 +945,4 @@ bg: ...@@ -945,3 +945,4 @@ bg:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -959,3 +959,4 @@ bs: ...@@ -959,3 +959,4 @@ bs:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -948,3 +948,4 @@ ca: ...@@ -948,3 +948,4 @@ ca:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -1169,3 +1169,4 @@ cs: ...@@ -1169,3 +1169,4 @@ cs:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -961,3 +961,4 @@ da: ...@@ -961,3 +961,4 @@ da:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -962,3 +962,4 @@ de: ...@@ -962,3 +962,4 @@ de:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -945,3 +945,4 @@ el: ...@@ -945,3 +945,4 @@ el:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -595,6 +595,7 @@ en: ...@@ -595,6 +595,7 @@ en:
label_query: Custom query label_query: Custom query
label_query_plural: Custom queries label_query_plural: Custom queries
label_query_new: New query label_query_new: New query
label_my_queries: My custom queries
label_filter_add: Add filter label_filter_add: Add filter
label_filter_plural: Filters label_filter_plural: Filters
label_equals: is label_equals: is
......
...@@ -982,3 +982,4 @@ es: ...@@ -982,3 +982,4 @@ es:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -949,3 +949,4 @@ eu: ...@@ -949,3 +949,4 @@ eu:
setting_commit_logtime_enabled: "Erregistrutako denbora gaitu" setting_commit_logtime_enabled: "Erregistrutako denbora gaitu"
notice_gantt_chart_truncated: Grafikoa moztu da bistara daitekeen elementuen kopuru maximoa gainditu delako (%{max}) notice_gantt_chart_truncated: Grafikoa moztu da bistara daitekeen elementuen kopuru maximoa gainditu delako (%{max})
setting_gantt_items_limit: "Gantt grafikoan bistara daitekeen elementu kopuru maximoa" setting_gantt_items_limit: "Gantt grafikoan bistara daitekeen elementu kopuru maximoa"
label_my_queries: My custom queries
...@@ -941,3 +941,4 @@ fa: ...@@ -941,3 +941,4 @@ fa:
text_tip_issue_begin_end_day: issue beginning and ending this day text_tip_issue_begin_end_day: issue beginning and ending this day
text_tip_issue_end_day: issue ending this day text_tip_issue_end_day: issue ending this day
text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page.
label_my_queries: My custom queries
...@@ -966,3 +966,4 @@ fi: ...@@ -966,3 +966,4 @@ fi:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -596,6 +596,7 @@ fr: ...@@ -596,6 +596,7 @@ fr:
label_query: Rapport personnalisé label_query: Rapport personnalisé
label_query_plural: Rapports personnalisés label_query_plural: Rapports personnalisés
label_query_new: Nouveau rapport label_query_new: Nouveau rapport
label_my_queries: Mes rapports personnalisés
label_filter_add: "Ajouter le filtre " label_filter_add: "Ajouter le filtre "
label_filter_plural: Filtres label_filter_plural: Filtres
label_equals: égal label_equals: égal
......
...@@ -957,3 +957,4 @@ gl: ...@@ -957,3 +957,4 @@ gl:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -950,3 +950,4 @@ he: ...@@ -950,3 +950,4 @@ he:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -952,3 +952,4 @@ hr: ...@@ -952,3 +952,4 @@ hr:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -964,3 +964,4 @@ ...@@ -964,3 +964,4 @@
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -953,3 +953,4 @@ id: ...@@ -953,3 +953,4 @@ id:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -946,3 +946,4 @@ it: ...@@ -946,3 +946,4 @@ it:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -966,3 +966,4 @@ ja: ...@@ -966,3 +966,4 @@ ja:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -997,3 +997,4 @@ ko: ...@@ -997,3 +997,4 @@ ko:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -1005,3 +1005,4 @@ lt: ...@@ -1005,3 +1005,4 @@ lt:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -940,3 +940,4 @@ lv: ...@@ -940,3 +940,4 @@ lv:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -945,3 +945,4 @@ mk: ...@@ -945,3 +945,4 @@ mk:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -946,3 +946,4 @@ mn: ...@@ -946,3 +946,4 @@ mn:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -927,3 +927,4 @@ nl: ...@@ -927,3 +927,4 @@ nl:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -932,3 +932,4 @@ ...@@ -932,3 +932,4 @@
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -962,3 +962,4 @@ pl: ...@@ -962,3 +962,4 @@ pl:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -965,3 +965,4 @@ pt-BR: ...@@ -965,3 +965,4 @@ pt-BR:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -949,3 +949,4 @@ pt: ...@@ -949,3 +949,4 @@ pt:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -938,3 +938,4 @@ ro: ...@@ -938,3 +938,4 @@ ro:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -1058,3 +1058,4 @@ ru: ...@@ -1058,3 +1058,4 @@ ru:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Путь к каталогу .git label_git_path: Путь к каталогу .git
label_mercurial_path: Каталог label_mercurial_path: Каталог
label_my_queries: My custom queries
...@@ -940,3 +940,4 @@ sk: ...@@ -940,3 +940,4 @@ sk:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -941,3 +941,4 @@ sl: ...@@ -941,3 +941,4 @@ sl:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -945,3 +945,4 @@ sr-YU: ...@@ -945,3 +945,4 @@ sr-YU:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -946,3 +946,4 @@ sr: ...@@ -946,3 +946,4 @@ sr:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -986,3 +986,4 @@ sv: ...@@ -986,3 +986,4 @@ sv:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -942,3 +942,4 @@ th: ...@@ -942,3 +942,4 @@ th:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -964,3 +964,4 @@ tr: ...@@ -964,3 +964,4 @@ tr:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -941,3 +941,4 @@ uk: ...@@ -941,3 +941,4 @@ uk:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -996,3 +996,4 @@ vi: ...@@ -996,3 +996,4 @@ vi:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -1026,3 +1026,4 @@ ...@@ -1026,3 +1026,4 @@
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
...@@ -959,3 +959,4 @@ zh: ...@@ -959,3 +959,4 @@ zh:
label_cvs_path: CVSROOT label_cvs_path: CVSROOT
label_git_path: Path to .git directory label_git_path: Path to .git directory
label_mercurial_path: Root directory label_mercurial_path: Root directory
label_my_queries: My custom queries
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment