]> source.dussan.org Git - redmine.git/commitdiff
Don't reveal issue subjects if user is only allowed to view spent time (#3187).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 14 Nov 2009 14:10:09 +0000 (14:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 14 Nov 2009 14:10:09 +0000 (14:10 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3043 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/timelog_helper.rb
app/views/timelog/_list.rhtml

index e8fff8cbdb4aea95938080961e85364af33f1298..e1136fc4f1735abb6b9ff46d38c635c1da26e3de 100644 (file)
@@ -22,7 +22,13 @@ module TimelogHelper
     links = []
     links << link_to(l(:label_project_all), {:project_id => nil, :issue_id => nil})
     links << link_to(h(@project), {:project_id => @project, :issue_id => nil}) if @project
-    links << link_to_issue(@issue, :subject => false) if @issue
+    if @issue
+      if @issue.visible?
+        links << link_to_issue(@issue, :subject => false)
+      else
+        links << "##{@issue.id}"
+      end
+    end
     breadcrumb links
   end
 
@@ -118,7 +124,18 @@ module TimelogHelper
   end
   
   def format_criteria_value(criteria, value)
-    value.blank? ? l(:label_none) : ((k = @available_criterias[criteria][:klass]) ? k.find_by_id(value.to_i) : format_value(value, @available_criterias[criteria][:format]))
+    if value.blank?
+      l(:label_none)
+    elsif k = @available_criterias[criteria][:klass]
+      obj = k.find_by_id(value.to_i)
+      if obj.is_a?(Issue)
+        obj.visible? ? "#{obj.tracker} ##{obj.id}: #{obj.subject}" : "##{obj.id}"
+      else
+        obj
+      end
+    else
+      format_value(value, @available_criterias[criteria][:format])
+    end
   end
   
   def report_to_csv(criterias, periods, hours)
index f6a1268dcaaa9b68ce01cbb0ba20c52ff7694393..e11695ebfc09ae856783cf382044ae83fabda683 100644 (file)
@@ -20,7 +20,7 @@
 <td class="project"><%=h entry.project %></td>
 <td class="subject">
 <% if entry.issue -%>
-<%= link_to_issue entry.issue, :truncate => 50 -%>
+<%= entry.issue.visible? ? link_to_issue(entry.issue, :truncate => 50) : "##{entry.issue.id}" -%>
 <% end -%>
 </td>
 <td class="comments"><%=h entry.comments %></td>