Actions
Patch #4293
closedAdd the possibility to log time through mail receive gateway
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Start date:
2009-11-25
Due date:
% Done:
0%
Estimated time:
Description
to test:
Just send typical mail to update an issue and add a line with "Time:X.XX" in it
Best regards,
Arnaud Ligot.
- svn diff
Index: app/models/mail_handler.rb
===================================================================
--- app/models/mail_handler.rb (revision 3092)
+++ app/models/mail_handler.rb (working copy)
@@ -34,6 +34,7 @@
@@handler_options[:allow_override] << 'project' unless @@handler_options[:issue].has_key?(:project)
# Status overridable by default
@@handler_options[:allow_override] << 'status' unless @@handler_options[:issue].has_key?(:status)
+ @@handler_options[:allow_override] << 'time' unless @@handler_options[:issue].has_key?(:time)
super email
end
@@ -144,6 +145,18 @@
issue.save!
add_attachments(issue)
logger.info "MailHandler: issue ##{issue.id} created by #{user}" if logger && logger.info
+
+ #add time functions
+ time = get_keyword(:time)
+ if (time)
+ t = issue.time_entries.new
+ t.spent_on = Time.now
+ t.user_id = user.id
+ t.hours = time
+ t.save!
+ logger.info "MailHandler: time entry of #{t.hours} hours added to issue ##{issue.id}" if logger && logger.info
+ end
+
issue
end
@@ -173,6 +186,18 @@
if status && issue.new_statuses_allowed_to(user).include?(status)
issue.status = status
end
+
+ #add time functions
+ time = get_keyword(:time)
+ if (time)
+ t = issue.time_entries.new
+ t.spent_on = Time.now
+ t.user_id = user.id
+ t.hours = time
+ t.save!
+ logger.info "MailHandler: time entry of #{t.hours} hours added to issue ##{issue.id}" if logger && logger.info
+ end
+
issue.save!
logger.info "MailHandler: issue ##{issue.id} updated by #{user}" if logger && logger.info
journal
Updated by Jean-Philippe Lang over 15 years ago
- Category changed from Email notifications to Email receiving
Updated by Mischa The Evil over 10 years ago
- Status changed from New to Closed
Implemented through #4155 a long time ago. Closing this as such.
Actions