Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Addressing issue with localization between Redmine 0.8 and 0.9. The p…

…roblem is that 0.9 allows named parameters for labels, whereas 0.8 doesn't. Also, multiple parameters when unnamed doesn't work well in 0.9, so this hack should last until everyone transitions over to 0.9.
  • Loading branch information...
commit dbf828bc4efc4c899ce5ec6f708abf21652d98ab 1 parent ab13d5f
@bradbeattie bradbeattie authored
View
8 app/controllers/schedules_controller.rb
@@ -108,6 +108,7 @@ def edit
def estimate
# Obtain all open issues for the given version
+ raise l(:error_schedules_not_enabled) if !@version.project.module_enabled?('schedule_module')
@open_issues = @version.fixed_issues.collect { |issue| issue unless issue.closed? }.compact.index_by { |issue| issue.id }
# Confirm that all issues have estimates, are assigned and only have parents in this version
@@ -125,14 +126,13 @@ def estimate
# Obtain all assignees
assignees = @open_issues.collect { |issue_id, issue| issue.assigned_to }.uniq
- raise l(:error_schedules_estimate_project_unscheduled) if assignees.empty?
@entries = ScheduleEntry.find(
:all,
:conditions => sprintf("user_id IN (%s) AND date > NOW() AND project_id = %s", assignees.collect {|user| user.id }.join(','), @version.project.id),
:order => ["date"]
).group_by{ |entry| entry.user_id }
+ raise l(:error_schedules_estimate_insufficient_scheduling) if @entries.empty?
@entries.each { |user_id, user_entries| @entries[user_id] = user_entries.index_by { |entry| entry.date } }
- raise l(:error_schedules_estimate_project_unscheduled) if @entries.empty? || !@version.project.module_enabled?('schedule_module')
# Build issue precedence hierarchy
floating_issues = Set.new # Issues with no children or parents
@@ -555,7 +555,7 @@ def schedule_issue(issue)
considered_date = possible_start + 1
else
considered_date = @entries[issue.assigned_to.id].collect { |date, entry| entry if entry.date > possible_start }.compact
- raise l(:error_schedules_estimate_insufficient_scheduling_future, issue.assigned_to, issue, possible_start) if considered_date.empty?
+ raise l(:error_schedules_estimate_insufficient_scheduling, issue.assigned_to.to_s + "// " + issue.to_s + " // ", possible_start.to_s) if considered_date.empty?
considered_date = considered_date.min { |a,b| a.date <=> b.date }.date
end
hours_remaining = issue.estimated_hours * ((100-issue.done_ratio)*0.01) unless issue.estimated_hours.nil?
@@ -568,7 +568,7 @@ def schedule_issue(issue)
while !@entries[issue.assigned_to.id].nil? && @entries[issue.assigned_to.id][considered_date].nil? && !@entries[issue.assigned_to.id].empty? && (considered_date < Date.today + 365)
considered_date += 1
end
- raise l(:error_schedules_estimate_insufficient_scheduling, issue.assigned_to, issue) if @entries[issue.assigned_to.id].nil? || @entries[issue.assigned_to.id][considered_date].nil?
+ raise l(:error_schedules_estimate_insufficient_scheduling, issue.assigned_to.to_s + " // " + issue.to_s) if @entries[issue.assigned_to.id].nil? || @entries[issue.assigned_to.id][considered_date].nil?
if hours_remaining > @entries[issue.assigned_to.id][considered_date].hours
hours_remaining -= @entries[issue.assigned_to.id][considered_date].hours
@entries[issue.assigned_to.id][considered_date].hours = 0
View
1  config/locales/de.yml
@@ -20,7 +20,6 @@ de:
error_schedules_estimate_unestimated_issues: Der Aufwand aller Tickets in dieser Version muss geschätzt sein.
error_schedules_estimate_unassigned_issues: Alle Tickets dieser Version müssen zugewiesen sein.
error_schedules_estimate_open_interversion_parents: Alle offenen Ticket-Beziehungen müssen in dieser Version sein.
- error_schedules_estimate_project_unscheduled: Dieses Projekt wurde nicht geplant.
error_schedules_estimate_insufficient_scheduling: %s ist nicht genügend Zeit geplant für %s
error_schedules_insufficient_availability: Die Einträge einiger Benutzer konnten augrund mangelnder Verfügbarkeit im ihrem Zeitplan nicht gespeichert werden.
button_schedules_edit: Zeitplan bearbeiten
View
5 config/locales/en.yml
@@ -17,12 +17,11 @@ en:
label_global_schedule: All schedules
label_schedules_estimate: Estimate
label_schedules_estimate_updated: Issues and version dates updated.
+ error_schedules_not_enabled: Schedules module not enabled
error_schedules_estimate_unestimated_issues: Ensure all issues in this version have estimated times.
error_schedules_estimate_unassigned_issues: Ensure all issues in this version are assigned.
error_schedules_estimate_open_interversion_parents: Ensure all open issue relations are in the version.
- error_schedules_estimate_project_unscheduled: This project has not been scheduled.
- error_schedules_estimate_insufficient_scheduling: Not enough time scheduled for %s to address %s
- error_schedules_estimate_insufficient_scheduling_future: Not enough time scheduled for %s to address %s past %s
+ error_schedules_estimate_insufficient_scheduling: Users must be scheduled before estimating due dates. %s
error_schedules_insufficient_availability: Some user's entries could not be saved as there was not enough room in their schedules.
button_schedules_edit: Edit schedule
button_schedules_default_edit: Edit default availability
View
1  config/locales/es.yml
@@ -20,7 +20,6 @@ es:
error_schedules_estimate_unestimated_issues: Asegurese que todas las actividades han sido estimadas.
error_schedules_estimate_unassigned_issues: Asegurese que todas las actividades en esta version han sido asignadas.
error_schedules_estimate_open_interversion_parents: Ensure all open issue relations are in the version.
- error_schedules_estimate_project_unscheduled: Este proyecto no ha sido estimado.
error_schedules_estimate_insufficient_scheduling: No se ha agendado suficiente tiempo para %s para realizar %s
error_schedules_insufficient_availability: Algunas de las entradas en la agenda del usuario no pudiendo guardarse por falta de disponibilidad
button_schedules_edit: Editar Agenda
View
1  config/locales/fr.yml
@@ -20,7 +20,6 @@ fr:
error_schedules_estimate_unestimated_issues: Assurez vous que chaque demande pour cette version a une durée estimée.
error_schedules_estimate_unassigned_issues: Assurez vous que toutes les demandes pour cette version sont assignées.
error_schedules_estimate_open_interversion_parents: Assurez vous que toutes les relations de demandes ouvertes sont dans la version.
- error_schedules_estimate_project_unscheduled: Ce projet n'a pas été planifié.
error_schedules_estimate_insufficient_scheduling: Temps planifié de %s insuffisant pour %s
error_schedules_insufficient_availability: Les entrées pour quelques utilisateurs n'ont pas pu être sauvegardées car il n'y a pas assez de temps libre dans leur planning.
button_schedules_edit: Modifier planning
View
1  config/locales/nl.yml
@@ -20,7 +20,6 @@ nl:
error_schedules_estimate_unestimated_issues: Let op dat alle issues in deze versie geschatte tijden moeten hebben.
error_schedules_estimate_unassigned_issues: Let op dat alle issues in deze versie zijn toegewezen.
error_schedules_estimate_open_interversion_parents: Let op dat alle open issue relaties in deze versie zitten.
- error_schedules_estimate_project_unscheduled: Dit project is niet geplanned.
error_schedules_estimate_insufficient_scheduling: Niet genoeg tijd beschikbaar voor %s om te werken aan %s
error_schedules_estimate_insufficient_scheduling_future: Niet genoeg tijd beschikbaar voor %s om te werken aan %s na %s
error_schedules_insufficient_availability: "Sommige gebruikers items konden niet bewaard worden, aangezien er niet genoeg tijd beschikbaar was in hun planning."
View
1  config/locales/pt-br.yml
@@ -20,7 +20,6 @@ pt-BR:
error_schedules_estimate_unestimated_issues: Assegurar que todas as tarefas nesta versão tem estimativas de horas.
error_schedules_estimate_unassigned_issues: Assegurar que todas as tarefas nesta versão estão atribuídos.
error_schedules_estimate_open_interversion_parents: Assegurar que todas as tarefas abertas estão relacionadas com a versão.
- error_schedules_estimate_project_unscheduled: Este projeto não foi agendado.
error_schedules_estimate_insufficient_scheduling: Não há tempo suficiente na agenda do %s para a seguinte tarefa %s
error_schedules_insufficient_availability: Algumas entradas do usuário não podem ser salvos como não havia espaço suficiente nos seus horários.
button_schedules_edit: Editar agenda
View
1  config/locales/ru.yml
@@ -20,7 +20,6 @@ ru:
error_schedules_estimate_unestimated_issues: Все задачи этой версии должны иметь оценки времени выполнения.
error_schedules_estimate_unassigned_issues: Все задачи этой версии должны быть назначены.
error_schedules_estimate_open_interversion_parents: Все открытые задачи должны быть связаны с соответствующей версией.
- error_schedules_estimate_project_unscheduled: Этот проект не был запланирован.
error_schedules_estimate_insufficient_scheduling: "%s не хватает времени для выполнения %s"
error_schedules_insufficient_availability: Изменения в расписании некоторых пользователей не были сохранены из за недостатка доступного времени.
button_schedules_edit: Изменить расписание
View
1  lang/de.yml
@@ -19,7 +19,6 @@
error_schedules_estimate_unestimated_issues: Der Aufwand aller Tickets in dieser Version muss geschätzt sein.
error_schedules_estimate_unassigned_issues: Alle Tickets dieser Version müssen zugewiesen sein.
error_schedules_estimate_open_interversion_parents: Alle offenen Ticket-Beziehungen müssen in dieser Version sein.
- error_schedules_estimate_project_unscheduled: Dieses Projekt wurde nicht geplant.
error_schedules_estimate_insufficient_scheduling: "%s ist nicht genügend Zeit geplant für %s"
error_schedules_insufficient_availability: Die Einträge einiger Benutzer konnten augrund mangelnder Verfügbarkeit im ihrem Zeitplan nicht gespeichert werden.
button_schedules_edit: Zeitplan bearbeiten
View
9 lang/en.yml
@@ -16,12 +16,11 @@
label_global_schedule: All schedules
label_schedules_estimate: Estimate
label_schedules_estimate_updated: Issues and version dates updated.
+ error_schedules_not_enabled: Schedules module not enabled
error_schedules_estimate_unestimated_issues: Ensure all issues in this version have estimated times.
error_schedules_estimate_unassigned_issues: Ensure all issues in this version are assigned.
error_schedules_estimate_open_interversion_parents: Ensure all open issue relations are in the version.
- error_schedules_estimate_project_unscheduled: This project has not been scheduled.
- error_schedules_estimate_insufficient_scheduling: Not enough time scheduled for %s to address %s
- error_schedules_estimate_insufficient_scheduling_future: Not enough time scheduled for %s to address %s past %s
- error_schedules_insufficient_availability: "Some user's entries could not be saved as there was not enough room in their schedules."
+ error_schedules_estimate_insufficient_scheduling: Users must be scheduled before estimating due dates. %s
+ error_schedules_insufficient_availability: Some user's entries could not be saved as there was not enough room in their schedules.
button_schedules_edit: Edit schedule
- button_schedules_default_edit: Edit default availability
+ button_schedules_default_edit: Edit default availability
View
1  lang/es.yml
@@ -19,7 +19,6 @@
error_schedules_estimate_unestimated_issues: Asegurese que todas las actividades han sido estimadas.
error_schedules_estimate_unassigned_issues: Asegurese que todas las actividades en esta version han sido asignadas.
error_schedules_estimate_open_interversion_parents: Ensure all open issue relations are in the version.
- error_schedules_estimate_project_unscheduled: Este proyecto no ha sido estimado.
error_schedules_estimate_insufficient_scheduling: No se ha agendado suficiente tiempo para %s para realizar %s
error_schedules_insufficient_availability: Algunas de las entradas en la agenda del usuario no pudiendo guardarse por falta de disponibilidad
button_schedules_edit: Editar Agenda
View
1  lang/fr.yml
@@ -19,7 +19,6 @@
error_schedules_estimate_unestimated_issues: Assurez vous que chaque demande pour cette version a une durée estimée.
error_schedules_estimate_unassigned_issues: Assurez vous que toutes les demandes pour cette version sont assignées.
error_schedules_estimate_open_interversion_parents: Assurez vous que toutes les relations de demandes ouvertes sont dans la version.
- error_schedules_estimate_project_unscheduled: Ce projet n'a pas été planifié.
error_schedules_estimate_insufficient_scheduling: Temps planifié de %s insuffisant pour %s
error_schedules_insufficient_availability: Les entrées pour quelques utilisateurs n'ont pas pu être sauvegardées car il n'y a pas assez de temps libre dans leur planning.
button_schedules_edit: Modifier planning
View
1  lang/nl.yml
@@ -19,7 +19,6 @@
error_schedules_estimate_unestimated_issues: Let op dat alle issues in deze versie geschatte tijden moeten hebben.
error_schedules_estimate_unassigned_issues: Let op dat alle issues in deze versie zijn toegewezen.
error_schedules_estimate_open_interversion_parents: Let op dat alle open issue relaties in deze versie zitten.
- error_schedules_estimate_project_unscheduled: Dit project is niet geplanned.
error_schedules_estimate_insufficient_scheduling: Niet genoeg tijd beschikbaar voor %s om te werken aan %s
error_schedules_estimate_insufficient_scheduling_future: Niet genoeg tijd beschikbaar voor %s om te werken aan %s na %s
error_schedules_insufficient_availability: "Sommige gebruikers items konden niet bewaard worden, aangezien er niet genoeg tijd beschikbaar was in hun planning."
View
1  lang/pt-br.yml
@@ -19,7 +19,6 @@
error_schedules_estimate_unestimated_issues: Assegurar que todas as tarefas nesta versão tem estimativas de horas.
error_schedules_estimate_unassigned_issues: Assegurar que todas as tarefas nesta versão estão atribuídos.
error_schedules_estimate_open_interversion_parents: Assegurar que todas as tarefas abertas estão relacionadas com a versão.
- error_schedules_estimate_project_unscheduled: Este projeto não foi agendado.
error_schedules_estimate_insufficient_scheduling: Não há tempo suficiente na agenda do %s para a seguinte tarefa %s
error_schedules_insufficient_availability: Algumas entradas do usuário não podem ser salvos como não havia espaço suficiente nos seus horários.
button_schedules_edit: Editar agenda
View
1  lang/ru.yml
@@ -19,7 +19,6 @@
error_schedules_estimate_unestimated_issues: Все задачи этой версии должны иметь оценки времени выполнения.
error_schedules_estimate_unassigned_issues: Все задачи этой версии должны быть назначены.
error_schedules_estimate_open_interversion_parents: Все открытые задачи должны быть связаны с соответствующей версией.
- error_schedules_estimate_project_unscheduled: Этот проект не был запланирован.
error_schedules_estimate_insufficient_scheduling: "%s не хватает времени для выполнения %s"
error_schedules_insufficient_availability: Изменения в расписании некоторых пользователей не были сохранены из за недостатка доступного времени.
button_schedules_edit: Изменить расписание
Please sign in to comment.
Something went wrong with that request. Please try again.