0001-Added-setting-for-issue-reopening-on-email-reply.patch

Alex Shulgin, 2011-08-10 13:26

Download (2.94 KB)

View differences:

app/models/mail_handler.rb
167 167
    add_attachments(issue)
168 168

  
169 169
    # Reopen issue on new mail reply
170
    issue.status = IssueStatus.default if issue.closed?
170
    if issue.closed? && Setting.mail_handler_reopen_on_reply?
171
      issue.status = IssueStatus.named(Setting.mail_handler_reopen_status).first || IssueStatus.default
172
    end
173

  
171 174
    issue.save!
172 175
    logger.info "MailHandler: issue ##{issue.id} updated by #{user}" if logger && logger.info
173 176
    journal
app/views/settings/_mail_handler.rhtml
18 18
</p>
19 19
</div>
20 20

  
21
<div class="box tabular settings">
22
<p><%= setting_check_box :mail_handler_reopen_on_reply,
23
       :onclick => "if (this.checked) { Form.Element.enable('settings_mail_handler_reopen_status'); } else { Form.Element.disable('settings_mail_handler_reopen_status'); }" %></p>
24
<p><%= setting_select :mail_handler_reopen_status,
25
       IssueStatus.all.reject{|s| s.is_closed?}.collect{|s| [s.name, s.name]},
26
       :disabled => !Setting.mail_handler_reopen_on_reply? %></p>
27
</div>
28

  
21 29
<%= submit_tag l(:button_save) %>
22 30

  
23 31
<% end %>
config/locales/en.yml
353 353
  setting_mail_handler_body_delimiters: "Truncate emails after one of these lines"
354 354
  setting_mail_handler_api_enabled: Enable WS for incoming emails
355 355
  setting_mail_handler_api_key: API key
356
  setting_mail_handler_reopen_on_reply: Reopen closed issues on email reply
357
  setting_mail_handler_reopen_status: Reopen with this status
356 358
  setting_sequential_project_identifiers: Generate sequential project identifiers
357 359
  setting_gravatar_enabled: Use Gravatar user icons
358 360
  setting_gravatar_default: Default Gravatar image
config/settings.yml
132 132
  default: 0
133 133
mail_handler_api_key:
134 134
  default: 
135
mail_handler_reopen_on_reply:
136
  default: 0
137
mail_handler_reopen_status:
138
  default: ''
135 139
issue_list_default_columns:
136 140
  serialized: true
137 141
  default: 
138
-