In app/helpers/application_helper.rb, in the link_to_issue function
def link_to_issue(issue, options={})
title = nil
subject = nil
text = options[:tracker] == false ? "##{issue.id}" : "#{issue.tracker} ##{issue.id}"
if options[:subject] == false
title = issue.subject.truncate(60)
else
subject = issue.subject
if truncate_length = options[:truncate]
subject = subject.truncate(truncate_length)
end
end
only_path = options[:only_path].nil? ? true : options[:only_path]
s = link_to(text, issue_url(issue, :only_path => only_path),
:class => issue.css_classes, :title => title)
s << h(": #{subject}") if subject
#This is the only line that changes here
s = h("Due date #{issue.due_date} : #{issue.project} - ") + s if options[:project]
s
end
The other change is in app/models/mailer.rb, in the reminders function
def self.reminders(options={})
days = options[:days] || 7
project = options[:project] ? Project.find(options[:project]) : nil
tracker = options[:tracker] ? Tracker.find(options[:tracker]) : nil
target_version_id = options[:version] ? Version.named(options[:version]).pluck(:id) : nil
if options[:version] && target_version_id.blank?
raise ActiveRecord::RecordNotFound.new("Couldn't find Version with named #{options[:version]}")
end
user_ids = options[:users]
scope = Issue.open.where("#{Issue.table_name}.assigned_to_id IS NOT NULL" +
" AND #{Project.table_name}.status = #{Project::STATUS_ACTIVE}" +
" AND #{Issue.table_name}.due_date <= ?", days.day.from_now.to_date
)
scope = scope.where(:assigned_to_id => user_ids) if user_ids.present?
scope = scope.where(:project_id => project.id) if project
scope = scope.where(:fixed_version_id => target_version_id) if target_version_id.present?
scope = scope.where(:tracker_id => tracker.id) if tracker
issues_by_assignee = scope.includes(:status, :assigned_to, :project, :tracker).
group_by(&:assigned_to)
issues_by_assignee.keys.each do |assignee|
if assignee.is_a?(Group)
assignee.users.each do |user|
issues_by_assignee[user] ||= []
issues_by_assignee[user] += issues_by_assignee[assignee]
end
end
end
issues_by_assignee.each do |assignee, issues|
#My changes start here
issues = issues.sort_by do |item|
item[:due_date]
end
#End of changes
reminder(assignee, issues, days).deliver if assignee.is_a?(User) && assignee.active?
end
end
I commented where the changes are.