mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 20:15:54 +02:00
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5602 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -188,7 +188,13 @@ class Issue < ActiveRecord::Base
|
||||
issue.attributes = options[:attributes]
|
||||
end
|
||||
if issue.save
|
||||
unless options[:copy]
|
||||
if options[:copy]
|
||||
if current_journal && current_journal.notes.present?
|
||||
issue.init_journal(current_journal.user, current_journal.notes)
|
||||
issue.current_journal.notify = false
|
||||
issue.save
|
||||
end
|
||||
else
|
||||
# Manually update project_id on related time entries
|
||||
TimeEntry.update_all("project_id = #{new_project.id}", {:issue_id => id})
|
||||
|
||||
|
||||
@@ -78,4 +78,12 @@ class Journal < ActiveRecord::Base
|
||||
s << ' has-details' unless details.blank?
|
||||
s
|
||||
end
|
||||
|
||||
def notify?
|
||||
@notify != false
|
||||
end
|
||||
|
||||
def notify=(arg)
|
||||
@notify = arg
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2011 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
@@ -17,10 +17,12 @@
|
||||
|
||||
class JournalObserver < ActiveRecord::Observer
|
||||
def after_create(journal)
|
||||
if Setting.notified_events.include?('issue_updated') ||
|
||||
(Setting.notified_events.include?('issue_note_added') && journal.notes.present?) ||
|
||||
(Setting.notified_events.include?('issue_status_updated') && journal.new_status.present?) ||
|
||||
(Setting.notified_events.include?('issue_priority_updated') && journal.new_value_for('priority_id').present?)
|
||||
if journal.notify? &&
|
||||
(Setting.notified_events.include?('issue_updated') ||
|
||||
(Setting.notified_events.include?('issue_note_added') && journal.notes.present?) ||
|
||||
(Setting.notified_events.include?('issue_status_updated') && journal.new_status.present?) ||
|
||||
(Setting.notified_events.include?('issue_priority_updated') && journal.new_value_for('priority_id').present?)
|
||||
)
|
||||
Mailer.deliver_issue_edit(journal)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user