move to STI for journals so the journals themselves can be events
This commit is contained in:
parent
2287d7ce8c
commit
ff31875149
|
@ -197,7 +197,7 @@ class MailHandler < ActionMailer::Base
|
||||||
# Reply will be added to the issue
|
# Reply will be added to the issue
|
||||||
def receive_journal_reply(journal_id)
|
def receive_journal_reply(journal_id)
|
||||||
journal = Journal.find_by_id(journal_id)
|
journal = Journal.find_by_id(journal_id)
|
||||||
if journal && journal.versioned_type == 'Issue'
|
if journal && journal.versioned.is_a? Issue
|
||||||
receive_issue_reply(journal.versioned_id)
|
receive_issue_reply(journal.versioned_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -67,7 +67,7 @@ class Mailer < ActionMailer::Base
|
||||||
# Watchers in cc
|
# Watchers in cc
|
||||||
cc(issue.watcher_recipients - @recipients)
|
cc(issue.watcher_recipients - @recipients)
|
||||||
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
|
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
|
||||||
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
|
s << "(#{issue.status.name}) " if journal.details['status_id']
|
||||||
s << issue.subject
|
s << issue.subject
|
||||||
subject s
|
subject s
|
||||||
body :issue => issue,
|
body :issue => issue,
|
||||||
|
|
|
@ -26,7 +26,7 @@ class TimeEntry < ActiveRecord::Base
|
||||||
attr_protected :project_id, :user_id, :tyear, :tmonth, :tweek
|
attr_protected :project_id, :user_id, :tyear, :tmonth, :tweek
|
||||||
|
|
||||||
acts_as_customizable
|
acts_as_customizable
|
||||||
acts_as_journalized :event_title => Proc.new {|o| "#{l_hours(o.hours)} (#{(o.issue || o.project).event_title})"},
|
acts_as_journalized :event_title => Proc.new {|o| "#{l_hours(o.hours)} (#{(o.issue || o.project).current_journal.event_title})"},
|
||||||
:event_url => Proc.new {|o| {:controller => 'timelog', :action => 'details', :project_id => o.project, :issue_id => o.issue}},
|
:event_url => Proc.new {|o| {:controller => 'timelog', :action => 'details', :project_id => o.project, :issue_id => o.issue}},
|
||||||
:event_author => :user,
|
:event_author => :user,
|
||||||
:event_description => :comments
|
:event_description => :comments
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
<% if journal.details.any? %>
|
<% if journal.details.any? %>
|
||||||
<ul class="details">
|
<ul class="details">
|
||||||
<% for detail in journal.details %>
|
<% for detail in journal.details %>
|
||||||
<li><%= journal.show_detail(detail) %></li>
|
<% if d = journal.show_detail(detail) %>
|
||||||
|
<li><%= d %></li>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -73,7 +73,7 @@ module Redmine
|
||||||
end
|
end
|
||||||
|
|
||||||
with_scope(:find => scope_options) do
|
with_scope(:find => scope_options) do
|
||||||
Journal.find(:all, provider_options[:find_options].dup)
|
journal_class.find(:all, provider_options[:find_options].dup)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue