Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty due date fix #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions config/locales/pl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pl:
mail_reminder_all_day1: "dnia"
mail_reminder_all_day2: "dni"
mail_reminder_all_day5: "dni"
mail_subject_reminder_all1: "Termin wykonania {{count}} zagadnienia upływa w przeciągu {{days}} {{day}}"
mail_body_reminder_auth1: "Termin wykonania {{count}} zagadnienia utworzonego przez ciebie upływa w przeciągu {{days}} {{day}}:"
mail_body_reminder_assigned1: "Termin wykonania {{count}} zagadnienia przydzielonego do ciebie upłwa za {{days}} {{day}}:"
mail_body_reminder_watched1: "Termin wykonania {{count}} zagadnienia obserwowanego przez ciebie upłwa za {{days}} {{day}}:"
mail_subject_reminder_all2: "Termin wykonania {{count}} zagadnień upływa w przeciągu {{days}} {{day}}"
mail_body_reminder_auth2: "Termin wykonania {{count}} zagadnień utworzonych przez ciebie upływa w przeciągu {{days}} {{day}}:"
mail_body_reminder_assigned2: "Termin wykonania {{count}} zagadnien przydzielonych do ciebie upływa w przeciągu {{days}} {{day}}:"
mail_body_reminder_watched2: "Termin wykonania {{count}} zagadnień obserwowanych przez ciebie upływa w przeciągu {{days}} {{day}}:"
mail_subject_reminder_all5: "Termin wykonania {{count}} zagadnien upływa w przeciągu {{days}} {{day}}"
mail_body_reminder_auth5: "Termin wykonania {{count}} zagadnien utworzonych przez ciebie upływa w przeciągu {{days}} {{day}}:"
mail_body_reminder_assigned5: "Termin wykonania {{count}} zagadnień przydzielonych do ciebie upływa w przeciągu {{days}} {{day}}:"
mail_body_reminder_watched5: "Termin wykonania {{count}} zagadnień obserwowanych przez ciebie upływa w przeciągu {{days}} {{day}}:"
39 changes: 20 additions & 19 deletions lib/tasks/reminder_all.rake
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@ class Reminder_all < Mailer
issues_by = Issue.find(:all, :include => [:status, :author, :project, :watchers , :tracker],
:conditions => s.conditions
)
issues_by.group_by(&:author).each do |author, issues|
found=0
over_due.each do |person|
if person[0].mail == author.mail && person[1]=="author" then
person << issues
found=1
end
end
if found==0 then
over_due<<[author, "author", issues]
end
end
# issues_by.group_by(&:author).each do |author, issues|
# found=0
# over_due.each do |person|
# if person[0].mail == author.mail && person[1]=="author" then
# person << issues
# found=1
# end
# end
# if found==0 then
# over_due<<[author, "author", issues]
# end
# end
issues_by.group_by(&:watchers).each do |watchers, issues|
found_watchers = Array.new
over_due.each do |person|
Expand All @@ -109,7 +109,7 @@ class Reminder_all < Mailer
end
end
over_due.sort!{|x,y| x[0].mail+x[1] <=> y[0].mail+y[1]}
previous_user = over_due[0][0]
previous_user = over_due[0][0] unless over_due[0].nil?
watched_tasks = Array.new
auth_tasks = Array.new
assigned_tasks = Array.new
Expand All @@ -122,9 +122,9 @@ class Reminder_all < Mailer
if type == "assignee" then
assigned_tasks += issues
sent_issues += issues
elsif type == "author" then
auth_tasks += issues
sent_issues += issues
#elsif type == "author" then
# auth_tasks += issues
# sent_issues += issues
elsif type == "watcher" then
watched_tasks += issues
sent_issues += issues
Expand All @@ -148,9 +148,9 @@ class Reminder_all < Mailer
if type == "assignee" then
assigned_tasks += issues
sent_issues += issues
elsif type == "author" then
auth_tasks += issues
sent_issues += issues
#elsif type == "author" then
# auth_tasks += issues
# sent_issues += issues
elsif type == "watcher" then
watched_tasks += issues
sent_issues += issues
Expand All @@ -167,6 +167,7 @@ namespace :redmine do
options[:days] = ENV['days'].to_i if ENV['days']
options[:project] = ENV['project'] if ENV['project']
options[:tracker] = ENV['tracker'].to_i if ENV['tracker']


Reminder_all.reminders_all(options)
end
Expand Down