]> source.dussan.org Git - redmine.git/commitdiff
Added an option to see all versions in the roadmap view (including completed ones).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 7 May 2007 16:54:26 +0000 (16:54 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 7 May 2007 16:54:26 +0000 (16:54 +0000)
On calendar and gantt, versions are now clickable and link to the corresponding entry in the roadmap.

Since calendar and gantt are now cached, don't forget to empty your cache before restarting the application.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@516 e93f8b46-1217-0410-a6f0-8f06a7374b81

19 files changed:
app/controllers/projects_controller.rb
app/helpers/projects_helper.rb
app/models/version.rb
app/views/projects/calendar.rhtml
app/views/projects/changelog.rhtml
app/views/projects/gantt.rhtml
app/views/projects/roadmap.rhtml
lang/bg.yml
lang/de.yml
lang/en.yml
lang/es.yml
lang/fr.yml
lang/it.yml
lang/ja.yml
lang/pt.yml
lang/zh.yml
public/images/arrow_bw.png
public/images/arrow_from.png
public/images/arrow_to.png

index ca6ea8d8e7af6a6a1068fa086ca793e0dc530c83..971d0acd35eaef4beeb41b950fd85fbdab290fa1 100644 (file)
@@ -448,10 +448,11 @@ class ProjectsController < ApplicationController
 
   def roadmap
     @trackers = Tracker.find(:all, :conditions => ["is_in_roadmap=?", true], :order => 'position')
-    retrieve_selected_tracker_ids(@trackers)
+    retrieve_selected_tracker_ids(@trackers)    
+    conditions = ("1" == params[:completed] ? nil : [ "#{Version.table_name}.effective_date > ?", Date.today])
     
     @versions = @project.versions.find(:all,
-      :conditions => [ "#{Version.table_name}.effective_date>?", Date.today],
+      :conditions => conditions,
       :order => "#{Version.table_name}.effective_date ASC"
     )
   end
index c7e80b0a09315e2ce6d21942348bf45d0fcf74c0..74805ba5350eb25768c02d1cdabcbdfc58b95107 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 module ProjectsHelper
+  def link_to_version(version, options = {})
+    return '' unless version && version.is_a?(Version)
+    link_to version.name, {:controller => 'projects',
+                           :action => 'roadmap',
+                           :id => version.project_id,
+                           :completed => (version.completed? ? 1 : nil),
+                           :anchor => version.name
+                          }, options
+  end
 end
index ddae037a66057a261e589d85b7e5dbd03c2b67ee..463ca3354f871c934c670f6a3bde684e6df259ae 100644 (file)
@@ -33,6 +33,10 @@ class Version < ActiveRecord::Base
     effective_date
   end
   
+  def completed?
+    effective_date && effective_date <= Date.today
+  end
+  
 private
   def check_integrity
     raise "Can't delete version" if self.fixed_issues.find(:first)
index 2a53831fee1cf9a4f217573083033cfe93e9621f..48fdaf64d14bbf4302f6e68107d4a56baffa41be 100644 (file)
@@ -74,7 +74,7 @@ while day <= @date_to
         </span>                
                </div>
                <% else %>
-        <%= image_tag('milestone.png') %> <small><%= "#{l(:label_version)}: #{i.name}" %></small>
+        <small><%= link_to_version i, :class => "icon icon-package" %></small>
                <% end %>
        <% end %>
     </td>
index 51724f149d7201a6b37af0bb56358b2d63c5b731..f42f32c42da8b61d6093b1ac460d5e5411a6c5fb 100644 (file)
@@ -1,14 +1,12 @@
 <h2><%=l(:label_change_log)%></h2>
 
-<div>
-
 <div class="rightbox" style="width:140px;">
 <% form_tag do %>
-<p><strong><%=l(:label_tracker_plural)%></strong></p>
+<p><strong><%=l(:label_tracker_plural)%></strong><br />
 <% @trackers.each do |tracker| %>
   <%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %>
   <%= tracker.name %><br />
-<% end %>
+<% end %></p>
 <p><center><%= submit_tag l(:button_apply), :class => 'button-small' %></center></p>
 <% end %>
 </div>
@@ -27,4 +25,3 @@
     end %>
     <li><%= link_to_issue issue %>: <%=h issue.subject %></li>
 <% end %>
-</div>
\ No newline at end of file
index 317fd993d8d6008dfae73528ee99d257853fd7f6..ccc9a019a94656e0671f2eb25dfc716eeb263ea2 100644 (file)
@@ -90,7 +90,7 @@ top = headers_height + 8
        <%= link_to_issue i %><%= " (#{i.project.name})" unless @project && @project == i.project %>:
        <%=h i.subject %>
        <% else %>
-       <strong><%= "#{l(:label_version)}: #{i.name}" %></strong>
+       <%= link_to_version i, :class => "icon icon-package" %>
        <% end %>       
        </small></div>
     <% top = top + 20
index e1449dcfa63f29ff96728b4a98f853e32d2f58dd..ab591a830c7b08a57a2212f0d50ae17fa3d51e48 100644 (file)
@@ -1,14 +1,13 @@
 <h2><%=l(:label_roadmap)%></h2>
 
-<div>
-
-<div class="rightbox" style="width:140px;">
+<div class="rightbox">
 <% form_tag do %>
-<p><strong><%=l(:label_tracker_plural)%></strong></p>
+<p><strong><%=l(:label_tracker_plural)%></strong><br />
 <% @trackers.each do |tracker| %>
   <%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %>
   <%= tracker.name %><br />
-<% end %>
+<% end %></p>
+<p class="small"><label for="completed"><%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %></label></p>
 <p><center><%= submit_tag l(:button_apply), :class => 'button-small' %></center></p>
 <% end %>
 </div>
 <% if @versions.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
 
 <% @versions.each do |version| %>   
-    <h3 class="icon22 icon22-package"><%= version.name %></h3>
+    <a name="<%= version.name %>"><h3 class="icon22 icon22-package"><%= version.name %></h3></a>
+    <% if version.completed? %>
+      <p><%= format_date(version.effective_date) %></p>
+    <% else %>
+      <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 %>
     <p><%=h version.description %></p>
-    <p><strong><%=l(:label_roadmap_due_in)%> <%= distance_of_time_in_words Time.now, version.effective_date %> (<%= format_date(version.effective_date) %>)</strong></p>    
     <% issues = version.fixed_issues.find(:all,
-                                 :include => :status,
+                                 :include => [:status, :tracker],
                                  :conditions => ["tracker_id in (#{@selected_tracker_ids.join(',')})"],
-                                 :order => "position")
+                                 :order => "#{Tracker.table_name}.position")
 
        total = issues.size
        complete = issues.inject(0) {|c,i| i.status.is_closed? ? c + 1 : c } 
@@ -56,4 +59,3 @@
       <% end %>
     </ul>
 <% end %>
-</div>
index 1e348cb75dc35456ae64d21ff5034f41c3c1e6f6..3db6cc89138c71e22251a5ad1d79f94d85e2e9a1 100644 (file)
@@ -383,6 +383,7 @@ label_start_to_start: start to start
 label_start_to_end: start to end
 label_stay_logged_in: Stay logged in
 label_disabled: disabled
+label_show_completed_versions: Show completed versions
 
 button_login: Вход
 button_submit: Изпращане
index 1fc529badc29c23e00a6283be39c27fd76db05e9..bb43bf3930702f2265c70bf7c1d5a6b6698f88fd 100644 (file)
@@ -383,6 +383,7 @@ label_start_to_start: start to start
 label_start_to_end: start to end
 label_stay_logged_in: Stay logged in
 label_disabled: disabled
+label_show_completed_versions: Show completed versions
 
 button_login: Einloggen
 button_submit: OK
index 1800b5d33dbdadffcdcbf38db284f263534f1983..ef56872e5ef9ace017c64f1b7948ce8ef781936e 100644 (file)
@@ -383,6 +383,7 @@ label_start_to_start: start to start
 label_start_to_end: start to end
 label_stay_logged_in: Stay logged in
 label_disabled: disabled
+label_show_completed_versions: Show completed versions
 
 button_login: Login
 button_submit: Submit
index 3a66e0bcf5e7ae8698ecd923df6aeea695a06fb7..dce15514f1ed9496c6ae00af76184067bfc64dbf 100644 (file)
@@ -383,6 +383,7 @@ label_start_to_start: start to start
 label_start_to_end: start to end
 label_stay_logged_in: Stay logged in
 label_disabled: disabled
+label_show_completed_versions: Show completed versions
 
 button_login: Conexión
 button_submit: Someter
index bd1973b4dc8f5cdd053be5dbcbcb2cc7b42b75d5..e332f1c6de3fa936a34527d94a307f1de1647d18 100644 (file)
@@ -383,6 +383,7 @@ label_start_to_start: début à début
 label_start_to_end: début à fin
 label_stay_logged_in: Rester connecté
 label_disabled: désactivé
+label_show_completed_versions: Voire les versions passées
 
 button_login: Connexion
 button_submit: Soumettre
index c1e964548da2a3c2c4d88dbae062783d697e7f39..4d100a2e8fd3fb6d3c4b167bb90e446548139c88 100644 (file)
@@ -383,6 +383,7 @@ label_start_to_start: start to start
 label_start_to_end: start to end
 label_stay_logged_in: Stay logged in
 label_disabled: disabled
+label_show_completed_versions: Show completed versions
 
 button_login: Login
 button_submit: Invia
index 95579949427339101fbe336fea99210755c37648..ac5e48ee1e46da481c4535f0f6b0e0fd43080238 100644 (file)
@@ -384,6 +384,7 @@ label_start_to_start: start to start
 label_start_to_end: start to end
 label_stay_logged_in: Stay logged in
 label_disabled: disabled
+label_show_completed_versions: Show completed versions
 
 button_login: ログイン
 button_submit: 変更
index 3c6debfbe06e5e1b9f887d621385be9a7863aa63..33da15fe0d81dd306d51e57fdb13dd9a576e2830 100644 (file)
@@ -383,6 +383,7 @@ label_start_to_start: start to start
 label_start_to_end: start to end
 label_stay_logged_in: Stay logged in
 label_disabled: disabled
+label_show_completed_versions: Show completed versions
 
 button_login: Login
 button_submit: Enviar
index f9f2a75a7170a48c648507594e9c253b4b1a9831..894aa1f4629e9dfe4c82f796a5e2a96a01245c0f 100644 (file)
@@ -386,6 +386,7 @@ label_start_to_start: start to start
 label_start_to_end: start to end
 label_stay_logged_in: Stay logged in
 label_disabled: disabled
+label_show_completed_versions: Show completed versions
 
 button_login: 登录
 button_submit: 提交
index 52dfc96f02a57a6fa62164322a79f426da2bd98a..2af9e2cd4bf59db8d46bf266dab6f11a1c64fa22 100644 (file)
Binary files a/public/images/arrow_bw.png and b/public/images/arrow_bw.png differ
index 4d5eeb9ea6903e0cbc23134adb69a62623007a1e..7d94ad185ba3d2c7382cbb918eb266cf6b4a2808 100644 (file)
Binary files a/public/images/arrow_from.png and b/public/images/arrow_from.png differ
index 4f969716f4f344dfdd7e8f042b1dd03101bb49f6..f021e98c941ef145fe9095e30dda3ac645b3a6fd 100644 (file)
Binary files a/public/images/arrow_to.png and b/public/images/arrow_to.png differ