added roadmap view

git-svn-id: http://redmine.rubyforge.org/svn/trunk@228 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-02-04 09:18:40 +00:00
parent 8c3dc34359
commit 879a614cde
11 changed files with 78 additions and 13 deletions

View File

@ -421,6 +421,20 @@ class ProjectsController < ApplicationController
@fixed_issues ||= [] @fixed_issues ||= []
end end
def roadmap
@trackers = Tracker.find(:all, :conditions => ["is_in_roadmap=?", true], :order => 'position')
if request.get?
@selected_tracker_ids = @trackers.collect {|t| t.id.to_s }
else
@selected_tracker_ids = params[:tracker_ids].collect { |id| id.to_i.to_s } if params[:tracker_ids] and params[:tracker_ids].is_a? Array
end
@selected_tracker_ids ||= []
@versions = @project.versions.find(:all,
:conditions => [ "versions.effective_date>?", Date.today],
:order => "versions.effective_date ASC"
)
end
def activity def activity
if params[:year] and params[:year].to_i > 1900 if params[:year] and params[:year].to_i > 1900
@year = params[:year].to_i @year = params[:year].to_i

View File

@ -89,6 +89,7 @@
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'activity', :id => @project }, :class => "menuItem" %> <%= link_to l(:label_activity), {:controller => 'projects', :action => 'activity', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_news_plural), {:controller => 'projects', :action => 'list_news', :id => @project }, :class => "menuItem" %> <%= link_to l(:label_news_plural), {:controller => 'projects', :action => 'list_news', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_change_log), {:controller => 'projects', :action => 'changelog', :id => @project }, :class => "menuItem" %> <%= link_to l(:label_change_log), {:controller => 'projects', :action => 'changelog', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_roadmap), {:controller => 'projects', :action => 'roadmap', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %> <%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_member_plural), {:controller => 'projects', :action => 'list_members', :id => @project }, :class => "menuItem" %> <%= link_to l(:label_member_plural), {:controller => 'projects', :action => 'list_members', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %> <%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %>
@ -111,6 +112,7 @@
<li><%= link_to l(:label_activity), :controller => 'projects', :action => 'activity', :id => @project %></li> <li><%= link_to l(:label_activity), :controller => 'projects', :action => 'activity', :id => @project %></li>
<li><%= link_to l(:label_news_plural), :controller => 'projects', :action => 'list_news', :id => @project %></li> <li><%= link_to l(:label_news_plural), :controller => 'projects', :action => 'list_news', :id => @project %></li>
<li><%= link_to l(:label_change_log), :controller => 'projects', :action => 'changelog', :id => @project %></li> <li><%= link_to l(:label_change_log), :controller => 'projects', :action => 'changelog', :id => @project %></li>
<li><%= link_to l(:label_roadmap), :controller => 'projects', :action => 'roadmap', :id => @project %></li>
<li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li> <li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li>
<li><%= link_to l(:label_member_plural), :controller => 'projects', :action => 'list_members', :id => @project %></li> <li><%= link_to l(:label_member_plural), :controller => 'projects', :action => 'list_members', :id => @project %></li>
<li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li> <li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li>

View File

@ -0,0 +1,26 @@
<h2><%=l(:label_roadmap)%></h2>
<div>
<div class="rightbox" style="width:140px;">
<% form_tag do %>
<p><strong><%=l(:label_tracker_plural)%></strong></p>
<% @trackers.each do |tracker| %>
<%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %>
<%= tracker.name %><br />
<% end %>
<p><center><%= submit_tag l(:button_apply), :class => 'button-small' %></center></p>
<% end %>
</div>
<% @versions.each do |version| %>
<h3 class="icon22 icon22-package"><%= version.name %></h3>
<p><%= format_date(version.effective_date) %><br />
<%=h version.description %></p>
<ul>
<% version.fixed_issues.find(:all, :conditions => ["issues.tracker_id in (#{@selected_tracker_ids.join(',')})"]).each do |issue| %>
<li><%= link_to "#{issue.tracker.name} #{issue.id}", :controller => 'issues', :action => 'show', :id => issue %>: <%=h issue.subject %></li>
<% end %>
</ul>
<% end %>
</div>

View File

@ -3,5 +3,6 @@
<!--[form:tracker]--> <!--[form:tracker]-->
<p><%= f.text_field :name, :required => true %></p> <p><%= f.text_field :name, :required => true %></p>
<p><%= f.check_box :is_in_chlog %></p> <p><%= f.check_box :is_in_chlog %></p>
<p><%= f.check_box :is_in_roadmap %></p>
<!--[eoform:tracker]--> <!--[eoform:tracker]-->
</div> </div>

View File

@ -0,0 +1,9 @@
class AddTrackerIsInRoadmap < ActiveRecord::Migration
def self.up
add_column :trackers, :is_in_roadmap, :boolean, :default => true, :null => false
end
def self.down
remove_column :trackers, :is_in_roadmap
end
end

View File

@ -0,0 +1,9 @@
class AddRoadmapPermission < ActiveRecord::Migration
def self.up
Permission.create :controller => "projects", :action => "roadmap", :description => "label_roadmap", :sort => 107, :is_public => true, :mail_option => 1, :mail_enabled => 0
end
def self.down
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'roadmap']).destroy
end
end

View File

@ -313,6 +313,7 @@ label_sort_highest: Erste
label_sort_higher: Aufzurichten label_sort_higher: Aufzurichten
label_sort_lower: Herabzusteigen label_sort_lower: Herabzusteigen
label_sort_lowest: Letzter label_sort_lowest: Letzter
label_roadmap: Roadmap
button_login: Einloggen button_login: Einloggen
button_submit: Einreichen button_submit: Einreichen

View File

@ -313,6 +313,7 @@ label_sort_highest: Move to top
label_sort_higher: Move up label_sort_higher: Move up
label_sort_lower: Move down label_sort_lower: Move down
label_sort_lowest: Move to bottom label_sort_lowest: Move to bottom
label_roadmap: Roadmap
button_login: Login button_login: Login
button_submit: Submit button_submit: Submit

View File

@ -313,6 +313,7 @@ label_sort_highest: Primero
label_sort_higher: Subir label_sort_higher: Subir
label_sort_lower: Bajar label_sort_lower: Bajar
label_sort_lowest: Último label_sort_lowest: Último
label_roadmap: Roadmap
button_login: Conexión button_login: Conexión
button_submit: Someter button_submit: Someter

View File

@ -313,6 +313,7 @@ label_sort_highest: Remonter en premier
label_sort_higher: Remonter label_sort_higher: Remonter
label_sort_lower: Descendre label_sort_lower: Descendre
label_sort_lowest: Descendre en dernier label_sort_lowest: Descendre en dernier
label_roadmap: Roadmap
button_login: Connexion button_login: Connexion
button_submit: Soumettre button_submit: Soumettre

View File

@ -35,29 +35,29 @@ begin
puts "Loading default configuration data for language: #{current_language}" puts "Loading default configuration data for language: #{current_language}"
# roles # roles
manager = Role.create :name => l(:default_role_manager) manager = Role.create :name => l(:default_role_manager), :position => 1
manager.permissions = Permission.find(:all, :conditions => ["is_public=?", false]) manager.permissions = Permission.find(:all, :conditions => ["is_public=?", false])
developper = Role.create :name => l(:default_role_developper) developper = Role.create :name => l(:default_role_developper), :position => 2
perms = [150, 320, 321, 322, 420, 421, 422, 1050, 1060, 1070, 1075, 1130, 1220, 1221, 1222, 1223, 1224, 1320, 1322, 1061, 1057] perms = [150, 320, 321, 322, 420, 421, 422, 1050, 1060, 1070, 1075, 1130, 1220, 1221, 1222, 1223, 1224, 1320, 1322, 1061, 1057]
developper.permissions = Permission.find(:all, :conditions => ["sort IN (#{perms.join(',')})"]) developper.permissions = Permission.find(:all, :conditions => ["sort IN (#{perms.join(',')})"])
reporter = Role.create :name => l(:default_role_reporter) reporter = Role.create :name => l(:default_role_reporter), :position => 3
perms = [1050, 1060, 1070, 1057, 1130] perms = [1050, 1060, 1070, 1057, 1130]
reporter.permissions = Permission.find(:all, :conditions => ["sort IN (#{perms.join(',')})"]) reporter.permissions = Permission.find(:all, :conditions => ["sort IN (#{perms.join(',')})"])
# trackers # trackers
Tracker.create(:name => l(:default_tracker_bug), :is_in_chlog => true) Tracker.create(:name => l(:default_tracker_bug), :is_in_chlog => true, :is_in_roadmap => false, :position => 1)
Tracker.create(:name => l(:default_tracker_feature), :is_in_chlog => true) Tracker.create(:name => l(:default_tracker_feature), :is_in_chlog => true, :is_in_roadmap => true, :position => 2)
Tracker.create(:name => l(:default_tracker_support), :is_in_chlog => false) Tracker.create(:name => l(:default_tracker_support), :is_in_chlog => false, :is_in_roadmap => false, :position => 3)
# issue statuses # issue statuses
new = IssueStatus.create(:name => l(:default_issue_status_new), :is_closed => false, :is_default => true, :html_color => 'F98787') new = IssueStatus.create(:name => l(:default_issue_status_new), :is_closed => false, :is_default => true, :html_color => 'F98787', :position => 1)
assigned = IssueStatus.create(:name => l(:default_issue_status_assigned), :is_closed => false, :is_default => false, :html_color => 'C0C0FF') assigned = IssueStatus.create(:name => l(:default_issue_status_assigned), :is_closed => false, :is_default => false, :html_color => 'C0C0FF', :position => 2)
resolved = IssueStatus.create(:name => l(:default_issue_status_resolved), :is_closed => false, :is_default => false, :html_color => '88E0B3') resolved = IssueStatus.create(:name => l(:default_issue_status_resolved), :is_closed => false, :is_default => false, :html_color => '88E0B3', :position => 3)
feedback = IssueStatus.create(:name => l(:default_issue_status_feedback), :is_closed => false, :is_default => false, :html_color => 'F3A4F4') feedback = IssueStatus.create(:name => l(:default_issue_status_feedback), :is_closed => false, :is_default => false, :html_color => 'F3A4F4', :position => 4)
closed = IssueStatus.create(:name => l(:default_issue_status_closed), :is_closed => true, :is_default => false, :html_color => 'DBDBDB') closed = IssueStatus.create(:name => l(:default_issue_status_closed), :is_closed => true, :is_default => false, :html_color => 'DBDBDB', :position => 5)
rejected = IssueStatus.create(:name => l(:default_issue_status_rejected), :is_closed => true, :is_default => false, :html_color => 'F5C28B') rejected = IssueStatus.create(:name => l(:default_issue_status_rejected), :is_closed => true, :is_default => false, :html_color => 'F5C28B', :position => 6)
# workflow # workflow
Tracker.find(:all).each { |t| Tracker.find(:all).each { |t|