0001-Setting-issue-attributes-by-mail-allow-lower-mixed-c.patch

Alex Shulgin, 2011-07-07 08:44

Download (2.55 KB)

View differences:

app/models/mail_handler.rb
227 227
    else
228 228
      @keywords[attr] = begin
229 229
        if (options[:override] || @@handler_options[:allow_override].include?(attr.to_s)) && (v = extract_keyword!(plain_text_body, attr, options[:format]))
230
          v = v.titleize unless options[:raw] || options[:format]
230 231
          v
231 232
        elsif !@@handler_options[:issue][attr].blank?
232 233
          @@handler_options[:issue][attr]
......
261 262

  
262 263
  # Returns a Hash of issue attributes extracted from keywords in the email body
263 264
  def issue_attributes_from_keywords(issue)
264
    assigned_to = (k = get_keyword(:assigned_to, :override => true)) && find_user_from_keyword(k)
265
    assigned_to = (k = get_keyword(:assigned_to, :override => true, :raw => true)) && find_user_from_keyword(k)
265 266
    assigned_to = nil if assigned_to && !issue.assignable_users.include?(assigned_to)
266 267

  
267 268
    attrs = {
......
270 271
      'priority_id' => (k = get_keyword(:priority)) && IssuePriority.find_by_name(k).try(:id),
271 272
      'category_id' => (k = get_keyword(:category)) && issue.project.issue_categories.find_by_name(k).try(:id),
272 273
      'assigned_to_id' => assigned_to.try(:id),
273
      'fixed_version_id' => (k = get_keyword(:fixed_version, :override => true)) && issue.project.shared_versions.find_by_name(k).try(:id),
274
      'fixed_version_id' => (k = get_keyword(:fixed_version, :override => true, :raw => true)) && issue.project.shared_versions.find_by_name(k).try(:id),
274 275
      'start_date' => get_keyword(:start_date, :override => true, :format => '\d{4}-\d{2}-\d{2}'),
275 276
      'due_date' => get_keyword(:due_date, :override => true, :format => '\d{4}-\d{2}-\d{2}'),
276
      'estimated_hours' => get_keyword(:estimated_hours, :override => true),
277
      'estimated_hours' => get_keyword(:estimated_hours, :override => true, :raw => true),
277 278
      'done_ratio' => get_keyword(:done_ratio, :override => true, :format => '(\d|10)?0')
278 279
    }.delete_if {|k, v| v.blank? }
279 280

  
280
-