]> source.dussan.org Git - redmine.git/commitdiff
Merged r16284 (#23803).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 Jan 2017 10:46:08 +0000 (10:46 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 Jan 2017 10:46:08 +0000 (10:46 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16302 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/time_entry.rb

index 431c1a55423ec29c631cbd3e2712e814be8c1283..10b3b4e271351c69e0a5eb3cf234faaf6e4c7ef5 100644 (file)
@@ -27,7 +27,11 @@ class TimeEntry < ActiveRecord::Base
   attr_protected :user_id, :tyear, :tmonth, :tweek
 
   acts_as_customizable
-  acts_as_event :title => Proc.new {|o| "#{l_hours(o.hours)} (#{(o.issue || o.project).event_title})"},
+  acts_as_event :title => Proc.new { |o|
+                  related   = o.issue if o.issue && o.issue.visible?
+                  related ||= o.project
+                  "#{l_hours(o.hours)} (#{related.event_title})"
+                },
                 :url => Proc.new {|o| {:controller => 'timelog', :action => 'index', :project_id => o.project, :issue_id => o.issue}},
                 :author => :user,
                 :group => :issue,