ChiliProject is not maintained anymore. Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.
tweak_project_overview.patch
b/app/controllers/projects_controller.rb | ||
---|---|---|
128 | 128 |
# Show @project |
129 | 129 |
def show |
130 | 130 |
@users_by_role = @project.users_by_role |
131 |
@subprojects = @project.children.visible.all
|
|
131 |
@subprojects = @project.all_visible_children
|
|
132 | 132 |
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC") |
133 | 133 |
@trackers = @project.rolled_up_trackers |
134 | 134 |
b/app/models/project.rb | ||
---|---|---|
562 | 562 |
project_hierarchy = parents | descendants # Set union |
563 | 563 |
end |
564 | 564 | |
565 |
# Returns an ordered list containing all descendant projects that are |
|
566 |
# visible to the current user |
|
567 |
def all_visible_children(user = nil) |
|
568 |
user ||= User.current |
|
569 |
Project.find(:all, |
|
570 |
:conditions => ["#{Project.visible_by(user)} AND (#{Project.table_name}.lft > ?) AND (#{Project.table_name}.rgt < ?)", lft, rgt], |
|
571 |
:order => "lft" |
|
572 |
) |
|
573 |
end |
|
574 | ||
565 | 575 |
# Returns an auto-generated project identifier based on the last identifier used |
566 | 576 |
def self.next_identifier |
567 | 577 |
p = Project.find(:first, :order => 'created_on DESC') |
b/app/views/projects/show.rhtml | ||
---|---|---|
12 | 12 |
</div> |
13 | 13 |
<ul> |
14 | 14 |
<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %> |
15 |
<% if @subprojects.any? %> |
|
16 |
<li><%=l(:label_subproject_plural)%>: |
|
17 |
<%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li> |
|
18 |
<% end %> |
|
19 | 15 |
<% @project.visible_custom_field_values.each do |custom_value| %> |
20 | 16 |
<% if !custom_value.value.blank? %> |
21 | 17 |
<li><%= h(custom_value.custom_field.name) %>: <%=h show_value(custom_value) %></li> |
22 | 18 |
<% end %> |
23 | 19 |
<% end %> |
24 | 20 |
</ul> |
21 |
<% if @subprojects.any? %> |
|
22 |
<h3><%=l(:label_subproject_plural)%>:</h3> |
|
23 |
<%= render_project_hierarchy(@subprojects) %> |
|
24 |
<% end %> |
|
25 | 25 | |
26 | 26 |
<% if User.current.allowed_to?(:view_issues, @project) %> |
27 | 27 |
<div class="issues box"> |