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
This commit is contained in:
Jean-Philippe Lang 2011-02-21 13:34:33 +00:00
parent a189b4b377
commit 0efc783a7e
46 changed files with 62 additions and 8 deletions

View File

@ -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'

View File

@ -13,11 +13,5 @@
<% end %>
<%= call_hook(:view_issues_sidebar_planning_bottom) %>
<% unless sidebar_queries.empty? -%>
<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 -%>
<%= render_sidebar_queries %>
<%= call_hook(:view_issues_sidebar_queries_bottom) %>
<% end -%>

View File

@ -938,3 +938,4 @@ bg:
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -952,3 +952,4 @@ bs:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -941,3 +941,4 @@ ca:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -942,3 +942,4 @@ cs:
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -954,3 +954,4 @@ da:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -955,3 +955,4 @@ de:
setting_gantt_items_limit: Maximale Anzahl von Aufgaben die im Gantt-Chart angezeigt werden.
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -938,3 +938,4 @@ el:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -942,3 +942,4 @@ en-GB:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -595,6 +595,7 @@ en:
label_query: Custom query
label_query_plural: Custom queries
label_query_new: New query
label_my_queries: My custom queries
label_filter_add: Add filter
label_filter_plural: Filters
label_equals: is

View File

@ -975,3 +975,4 @@ es:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -942,3 +942,4 @@ eu:
setting_gantt_items_limit: "Gantt grafikoan bistara daitekeen elementu kopuru maximoa"
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -941,3 +941,4 @@ fa:
text_tip_issue_begin_end_day: issue beginning and 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.
label_my_queries: My custom queries

View File

@ -959,3 +959,4 @@ fi:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -597,6 +597,7 @@ fr:
label_query: Rapport personnalisé
label_query_plural: Rapports personnalisés
label_query_new: Nouveau rapport
label_my_queries: Mes rapports personnalisés
label_filter_add: "Ajouter le filtre "
label_filter_plural: Filtres
label_equals: égal

View File

@ -950,3 +950,4 @@ gl:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -943,3 +943,4 @@ he:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -945,3 +945,4 @@ hr:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -957,3 +957,4 @@
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -946,3 +946,4 @@ id:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -939,3 +939,4 @@ it:
setting_gantt_items_limit: Massimo numero di oggetti da visualizzare sul diagramma di gantt
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -959,3 +959,4 @@ ja:
enumeration_system_activity: システム作業分類
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -990,3 +990,4 @@ ko:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -998,3 +998,4 @@ lt:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -933,3 +933,4 @@ lv:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -938,3 +938,4 @@ mk:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -939,3 +939,4 @@ mn:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -920,3 +920,4 @@ nl:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -925,3 +925,4 @@
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -955,3 +955,4 @@ pl:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -958,3 +958,4 @@ pt-BR:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -942,3 +942,4 @@ pt:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -931,3 +931,4 @@ ro:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -1051,3 +1051,4 @@ ru:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -933,3 +933,4 @@ sk:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -934,3 +934,4 @@ sl:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -938,3 +938,4 @@ sr-YU:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -939,3 +939,4 @@ sr:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -979,3 +979,4 @@ sv:
enumeration_system_activity: Systemaktivitet
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -935,3 +935,4 @@ th:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -957,3 +957,4 @@ tr:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -934,3 +934,4 @@ uk:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -989,3 +989,4 @@ vi:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -1019,3 +1019,4 @@
enumeration_system_activity: 系統活動
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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

View File

@ -952,3 +952,4 @@ zh:
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text
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