Overdue versions (date reached and open issues > 0) are now always displayed on the roadmap.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@604 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-08-12 09:58:38 +00:00
parent 3be226d0c4
commit 3c8e7c79b6
15 changed files with 31 additions and 3 deletions

View File

@ -443,8 +443,8 @@ class ProjectsController < ApplicationController
def roadmap
@trackers = Tracker.find(:all, :conditions => ["is_in_roadmap=?", true], :order => 'position')
retrieve_selected_tracker_ids(@trackers)
conditions = ("1" == params[:completed] ? nil : [ "#{Version.table_name}.effective_date > ? OR #{Version.table_name}.effective_date IS NULL", Date.today])
@versions = @project.versions.find(:all, :conditions => conditions).sort
@versions = @project.versions.sort
@versions = @versions.select {|v| !v.completed? } unless params[:completed]
end
def activity

View File

@ -34,8 +34,22 @@ class Version < ActiveRecord::Base
effective_date
end
# Returns true if the version is completed: due date reached and no open issues
def completed?
effective_date && effective_date <= Date.today
effective_date && (effective_date <= Date.today) && (open_issues_count == 0)
end
# Returns true if the version is overdue: due date reached and some open issues
def overdue?
effective_date && (effective_date < Date.today) && (open_issues_count > 0)
end
def open_issues_count
@open_issues_count ||= Issue.count(:all, :conditions => ["fixed_version_id = ? AND is_closed = ?", self.id, false], :include => :status)
end
def closed_issues_count
@closed_issues_count ||= Issue.count(:all, :conditions => ["fixed_version_id = ? AND is_closed = ?", self.id, true], :include => :status)
end
def wiki_page

View File

@ -18,6 +18,8 @@
<a name="<%= version.name %>"><h3 class="icon22 icon22-package"><%= version.name %></h3></a>
<% if version.completed? %>
<p><%= format_date(version.effective_date) %></p>
<% elsif version.overdue? %>
<p><strong><%= l(:label_roadmap_overdue, distance_of_time_in_words(Time.now, version.effective_date)) %> (<%= format_date(version.effective_date) %>)</strong></p>
<% elsif version.effective_date %>
<p><strong><%=l(:label_roadmap_due_in)%> <%= distance_of_time_in_words Time.now, version.effective_date %> (<%= format_date(version.effective_date) %>)</strong></p>
<% end %>

View File

@ -339,6 +339,7 @@ label_sort_lower: Премести по-долу
label_sort_lowest: Премести най-долу
label_roadmap: Пътна карта
label_roadmap_due_in: Излиза след
label_roadmap_overdue: %s late
label_roadmap_no_issues: Няма задачи за тази версия
label_search: Търсене
label_result: %d резултат

View File

@ -339,6 +339,7 @@ label_sort_lower: eins tiefer
label_sort_lowest: Ende
label_roadmap: Roadmap
label_roadmap_due_in: Fällig in
label_roadmap_overdue: %s late
label_roadmap_no_issues: Keine Tickets für diese Version
label_search: Suche
label_result: %d Resultat

View File

@ -339,6 +339,7 @@ label_sort_lower: Move down
label_sort_lowest: Move to bottom
label_roadmap: Roadmap
label_roadmap_due_in: Due in
label_roadmap_overdue: %s late
label_roadmap_no_issues: No issues for this version
label_search: Search
label_result: %d result

View File

@ -339,6 +339,7 @@ label_sort_lower: Bajar
label_sort_lowest: Último
label_roadmap: Roadmap
label_roadmap_due_in: Due in
label_roadmap_overdue: %s late
label_roadmap_no_issues: No issues for this version
label_search: Búsqueda
label_result: %d resultado

View File

@ -339,6 +339,7 @@ label_sort_lower: Descendre
label_sort_lowest: Descendre en dernier
label_roadmap: Roadmap
label_roadmap_due_in: Echéance dans
label_roadmap_overdue: En retard de %s
label_roadmap_no_issues: Aucune demande pour cette version
label_search: Recherche
label_result: %d résultat

View File

@ -339,6 +339,7 @@ label_sort_lower: Giù
label_sort_lowest: Sposta in fondo
label_roadmap: Roadmap
label_roadmap_due_in: Da ultimare in
label_roadmap_overdue: %s late
label_roadmap_no_issues: Nessun contesto per questa versione
label_search: Ricerca
label_result: %d risultato

View File

@ -340,6 +340,7 @@ label_sort_lower: 下へ
label_sort_lowest: 一番下へ
label_roadmap: ロードマップ
label_roadmap_due_in: 期日まで
label_roadmap_overdue: %s late
label_roadmap_no_issues: このバージョンに向けての問題はありません
label_search: 検索
label_result: %d件の結果

View File

@ -339,6 +339,7 @@ label_sort_lower: Verplaats naar beneden
label_sort_lowest: Verplaats naar eind
label_roadmap: Roadmap
label_roadmap_due_in: Due in
label_roadmap_overdue: %s late
label_roadmap_no_issues: Geen issues voor deze versie
label_search: Zoeken
label_result: %d resultaat

View File

@ -339,6 +339,7 @@ label_sort_lower: Mover para baixo
label_sort_lowest: Mover para o fim
label_roadmap: Roadmap
label_roadmap_due_in: Due in
label_roadmap_overdue: %s late
label_roadmap_no_issues: Sem tarefas para essa versao
label_search: Busca
label_result: %d resultado

View File

@ -339,6 +339,7 @@ label_sort_lower: Mover para baixo
label_sort_lowest: Mover para o fim
label_roadmap: Roadmap
label_roadmap_due_in: Termina em
label_roadmap_overdue: %s late
label_roadmap_no_issues: Sem tarefas para essa versão
label_search: Busca
label_result: %d resultado

View File

@ -339,6 +339,7 @@ label_sort_lower: Flytta ner
label_sort_lowest: Flytta till botten
label_roadmap: Roadmap
label_roadmap_due_in: Färdig om
label_roadmap_overdue: %s late
label_roadmap_no_issues: Inga brister för denna version
label_search: Sök
label_result: %d resultat

View File

@ -342,6 +342,7 @@ label_sort_lower: 下移
label_sort_lowest: 置底
label_roadmap: 路线图
label_roadmap_due_in: Due in
label_roadmap_overdue: %s late
label_roadmap_no_issues: 该版本没有任务
label_search: 查找
label_result: %d 个结果