Project

General

Profile

Feature #3760 » redmine3.1-3760.patch

Patch for this issue against 3.1 stable - Brian Crowell, 2015-10-02 02:40

View differences:

app/models/mail_handler.rb
212 212

  
213 213
    # add To and Cc as watchers before saving so the watchers can reply to Redmine
214 214
    add_watchers(issue)
215
    issue.save!
216 215
    add_attachments(issue)
216
    issue.save!
217 217
    logger.info "MailHandler: issue ##{issue.id} created by #{user}" if logger
218 218
    issue
219 219
  end
......
287 287
    if email.attachments && email.attachments.any?
288 288
      email.attachments.each do |attachment|
289 289
        next unless accept_attachment?(attachment)
290
        obj.attachments << Attachment.create(:container => obj,
290
        obj.attachments << Attachment.create(
291 291
                          :file => attachment.decoded,
292 292
                          :filename => attachment.filename,
293 293
                          :author => user,
app/models/mailer.rb
48 48
    @issue = issue
49 49
    @users = to_users + cc_users
50 50
    @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue)
51

  
52
    unless Setting.plain_text_mail?
53
      issue.attachments.each do |attachment|
54
        attachments[attachment.filename] = File.read(attachment.diskfile)
55
      end
56
    end
57

  
51 58
    mail :to => to_users,
52 59
      :cc => cc_users,
53 60
      :subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
......
80 87
    @journal = journal
81 88
    @journal_details = journal.visible_details(@users.first)
82 89
    @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => "change-#{journal.id}")
90

  
91
    unless Setting.plain_text_mail?
92
      journal.details.each do |detail|
93
        if detail.property == 'attachment' && attachment = Attachment.find_by_id(detail.prop_key)
94
          attachments[attachment.filename] = File.read(attachment.diskfile)
95
        end
96
      end
97
    end
98

  
83 99
    mail :to => to_users,
84 100
      :cc => cc_users,
85 101
      :subject => s
(5-5/6)