Project

General

Profile

Projects Tree View Plugin - Version 0.0.1

Added by Chris Peterson over 15 years ago

This plugin will turn the projects index view into a tree view that can be expanded and collapsed. It propagates the tree view to the project show page's subprojects list.

Install Instructions:

1) Extract projects_tree_view.zip to /path/to/redmine/vendor/plugins/
2) Restart Redmine
3) Enjoy Project Tree Goodness!


Replies (128)

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Shane Pearlman over 15 years ago

Thanks. Now we just need to skin that sucker! I am looking it over and discussing it with out crew to see if we want to add this as part of our redesign.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Defferrari Suporte Suporte over 15 years ago

Hello,
I'm trying install this plugin, and if I only copy the files to Redmine's path and restart, I have an 500 error in my application. The solution is erase the plugin, and all returns to the normal.

Doing the steps according by http://www.redmine.org/wiki/redmine/Plugins (I have the 0.8.2 version), when I execute the command "rake db:migrate_plugins" I reveiced the error:
(in /data/home/redmine/public_html/redmine)
Migrating engines...
rake aborted!
#28000Access denied for user 'root'@'localhost' (using password: NO)

(See full trace by running task with --trace)

The plugin don't use the file database.yml information for access the database?

Can you help me?

Chris Peterson wrote:

This plugin will turn the projects index view into a tree view that can be expanded and collapsed. It propagates the tree view to the project show page's subprojects list.

Install Instructions:

1) Extract projects_tree_view.zip to /path/to/redmine/vendor/plugins/
2) Restart Redmine
3) Enjoy Project Tree Goodness!

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Chris Peterson over 15 years ago

Defferrari Suporte Suporte wrote:

Hello,
I'm trying install this plugin, and if I only copy the files to Redmine's path and restart, I have an 500 error in my application. The solution is erase the plugin, and all returns to the normal.

Are you extracting these to the root folder of redmine? When you are done extracting you should have a folder called projects_tree_view under the plugins directory. So, you would have the following folder:

/data/home/redmine/vendor/plugins/projects_tree_view

Doing the steps according by http://www.redmine.org/wiki/redmine/Plugins (I have the 0.8.2 version), when I execute the command "rake db:migrate_plugins" I reveiced the error:
(in /data/home/redmine/public_html/redmine)
Migrating engines...
rake aborted!
#28000Access denied for user 'root'@'localhost' (using password: NO)

(See full trace by running task with --trace)

Issuing the command

rake db:migrate_plugins
will try and migrate data to the development database. To migrate the plugins database for your production app issue the command
rake db:migrate_plugins RAILS_ENV="production"

The plugin don't use the file database.yml information for access the database?

This plugin does not require any database modifications to work. It should not be nessicary to migrate the database to get it to work.

Can you help me?

I have not tried this on anything but trunk, so I am not sure if this will work correctly under 0.8.2. If you have apache running, restarting apache might help. If the above does not work, please post the log file located at

/data/home/redmine/log/production.log

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Mischa The Evil over 15 years ago

Chris Peterson wrote:

Defferrari Suporte Suporte wrote:

Can you help me?

I have not tried this on anything but trunk, so I am not sure if this will work correctly under 0.8.2.

Since this plugin overloads critical core-parts which are changed heavily between 0.8.x and trunk it is not compatible with Redmine 0.8.x.

Due to the used overloading-technique the plugin needs to be modified (brought in-sync) upon core-changes within the overloaded files...
This is something which I encounter also with the Collapse plugin...
Sidenote: this plugin also conflicts with the Collapse plugin due to the fact that both are overloading the base-layout view (source:/trunk/app/views/layouts/base.rhtml).

Greetings,

Mischa.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Defferrari Suporte Suporte over 15 years ago

Chris Peterson wrote:

This plugin will turn the projects index view into a tree view that can be expanded and collapsed. It propagates the tree view to the project show page's subprojects list.

Install Instructions:

1) Extract projects_tree_view.zip to /path/to/redmine/vendor/plugins/
2) Restart Redmine
3) Enjoy Project Tree Goodness!

So, resuming, this plugin can't used with Redmine 0.8.x ??

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Chris Peterson over 15 years ago

I was afraid it would conflict with other plugins that also modify the base-layout file (I only override to include the .js and .css file) Any ideas on how to get those files included without modifying the base layout file?

At this time it does not appear to work with Redmine 0.8.X. I will attempt to test on 0.8.2 and workout any bugs. To foster this, please post your production.log file.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Mischa The Evil over 15 years ago

Chris Peterson wrote:

I was afraid it would conflict with other plugins that also modify the base-layout file (I only override to include the .js and .css file) Any ideas on how to get those files included without modifying the base layout file?

Untill your plugin was 'released' my Collapse plugin was the only plugin which overloads the base-layout as far as I'm aware of...

If inclusion of the Javascript and CSS is the only reason for overloading the base-layout you could take a look at the 'pluginization' by Jean-Philippe Lang himself of (my) patch #2457.
He shows that you could utilize the available hooks to include the Javascripts and CSS from the init.rb-file by extending Redmine::Hook::ViewListener like in the following snippet:

class RedmineGlobalNewLinksHookListener < Redmine::Hook::ViewListener
  # Adds javascript and stylesheet tags
  def view_layouts_base_html_head(context)
    javascript_include_tag('global_new_links', :plugin => :redmine_global_new_links) +
    stylesheet_link_tag('global_new_links', :plugin => :redmine_global_new_links)
  end

  [...]
end

Sadly for the Collapse plugin I cannot stick to such technique since it changes much more than only Javascript/CSS-inclusion...

Chris Peterson wrote:

At this time it does not appear to work with Redmine 0.8.X

This is correct. This is due to the fact that the base-layout has been changed on the trunk after 0.8.x... See the following diff between 0.8-stable branch and current trunk:

Index: base.rhtml
===================================================================
--- base.rhtml    (.../trunk/app/views/layouts)    (revision 2594)
+++ base.rhtml    (.../branches/0.8-stable/app/views/layouts)    (revision 2594)
@@ -34,10 +34,10 @@
         <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
         <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
         <% end %>
-        <%= render_project_jump_box %>
+        <%= render :partial => 'layouts/project_selector' if User.current.memberships.any? %>
     </div>

-    <h1><%= page_header_title %></h1>
+    <h1><%= h(@project && !@project.new_record? ? @project.name : Setting.app_title) %></h1>

     <div id="main-menu">
         <%= render_main_menu(@project) %>

HTH,

Mischa.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Defferrari Suporte Suporte over 15 years ago

So, what's the recomendation? Don't use with 0.8.2?

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Mischa The Evil over 15 years ago

Defferrari Suporte Suporte wrote:

So, what's the recomendation? Don't use with 0.8.2?

That seems obvious by now... The plugin currently doesn't work on 0.8.x...

After a good look at the plugins'source the Javascript/CSS-inclusion is the only change in the base-layout which prevents 0.8-compatibility though this plugin does more then only overloading the base-layout.

Since the way how projects are retrieved changed significantly between 0.8.x and current trunk (due to the implementation of nested-subprojects (see #594)) the "retrieval"-code used in this plugin (by overloading the projects-index and projects-view views) is not compatible with 0.8.x.

Greetings,

Mischa.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Chris Peterson over 15 years ago

Mischa The Evil,
Thank you for your help and explanations. I have implemented the suggested changes to remove the need for the overridden base layout file. I noticed that it does not give the correct URL if redmine is in a subdirectory. For example lets say we have the following redmine URL:
http://www.example.com/redmine
Using the base layout override I get the proper '/redmine' appended to the beginning of the URL in the generated <script> tag. When using the function call in the plugin, '/redmine' is not appended and the page cannot access the javascript of css files. I have confirmed this with your above linked plugin as well. Any Ideas? Is this a bug?

When redmine is at the root of the URL (i.e. http://www.example.com) it works.

Once I get this worked out, I will post a plugin update with the base layout override removed.

Thanks for the feedback.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Mischa The Evil over 15 years ago

Chris Peterson wrote:

[...]
Any Ideas? Is this a bug?

Am I correct when assuming you have "followed" HowTo_Install_Redmine_in_a_sub-URI?

Chris Peterson wrote:

[...]
Once I get this worked out, I will post a plugin update with the base layout override removed.

Nice, though like I've written earlier this isn't the full solution to make the plugin 0.8.x-proof...

Mischa.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Chris Peterson over 15 years ago

Mischa The Evil wrote:

Chris Peterson wrote:

[...]
Any Ideas? Is this a bug?

Am I correct when assuming you have "followed" HowTo_Install_Redmine_in_a_sub-URI?

Yes, you are correct.

Chris Peterson wrote:

[...]
Once I get this worked out, I will post a plugin update with the base layout override removed.

Nice, though like I've written earlier this isn't the full solution to make the plugin 0.8.x-proof...
Mischa.

I realize that. This update was to prevent my plugin from interfering from other plugins that modify the base layout file (i.e. your Collapse plugin).

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Mischa The Evil over 15 years ago

Chris Peterson wrote:

Mischa The Evil wrote:

Chris Peterson wrote:

[...]
Any Ideas? Is this a bug?

Am I correct when assuming you have "followed" HowTo_Install_Redmine_in_a_sub-URI?

Yes, you are correct.

Hrm... That would mean a new iteration of testing... Will see if I can do something about that when having some more time again...

Chris Peterson wrote:

Chris Peterson wrote:

[...]
Once I get this worked out, I will post a plugin update with the base layout override removed.

Nice, though like I've written earlier this isn't the full solution to make the plugin 0.8.x-proof...
Mischa.

I realize that. This update was to prevent my plugin from interfering from other plugins that modify the base layout file (i.e. your Collapse plugin).

Great! Thanks in advance for that... ;)

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Chris Peterson over 15 years ago

Here is the updated version 0.0.2 of Projects Tree View. Changes are listed below:

1) Switched to using javascript_include_tag and stylesheet_link_tag in the init.rb file so that the base.rhtml file is untouched ( makes it so this plugin should work with Collapse and others )
2) Added alternating Odd Even row highlighting
3) Tweaked the color scheme a little

Note: I could not get the new include / link tags to work properly when redmine resides in a subdirectory.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Nicolas Zinopoulos over 15 years ago

Chris,

A big thank you for your plugin which I have been using with the Redmine trunk rev.2711.
However it seems that it is not compatible with the latest trunk as my updated Redmine (rev.2759) throws an exeption whenever I try to reach my project pages; see error report below and full trace attached:

NoMethodError in Projects#show

Showing vendor/plugins/projects_tree_view/app/views/projects/show.rhtml where line #82 raised:

undefined method `any?' for nil:NilClass
Extracted source (around line #82):

79:   </div>
80:   <% end %>
81: 
82:     <% if @members_by_role.any? %>
83:     <div class="box">
84:         <h3 class="icon22 icon22-users"><%=l(:label_member_plural)%></h3>    
85:         <p><% @members_by_role.keys.sort.each do |role| %>
RAILS_ROOT: D:/USERS/NZI/HTTPServer/Redmine

I have tried removing the plugin and the problem also dissappears, Redmine working as usual, alas without your nice tree presentation :-(
I guess that it is due to the recent change of the database schema to accomodate multiple roles per user.
Any idea? Is there a way to get the best of the two (latest trunk with tree-view)? :-)

Thanks again.

Nicolas

error_trace.txt (5.94 KB) error_trace.txt Full trace of the caught exception.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Mischa The Evil over 15 years ago

Nicolas Zinopoulos wrote:

However it seems that it is not compatible with the latest trunk as my updated Redmine (rev.2759) throws an exeption whenever I try to reach my project pages

Confirmed! This plugin overloads projects show and index views. The core's show-view has been changed in r2734 to accommodate the multiple roles feature implemented for #706. This change is currently not yet reflected by the show-view provided by the plugin which overloads the core's projects show-view.

You could probably fix it by changing the following block of code in "../vendor/plugins/projects_tree_view/app/views/projects/show.rhtml" from:

    <% if @members_by_role.any? %>
        <div class="box">
                <h3 class="icon22 icon22-users"><%=l(:label_member_plural)%></h3>    
                <p><% @members_by_role.keys.sort.each do |role| %>
                <%= role.name %>:
                <%= @members_by_role[role].collect(&:user).sort.collect{|u| link_to_user u}.join(", ") %>
                <br />
                <% end %></p>
        </div>
    <% end %>

to:
    <% if @users_by_role.any? %>
        <div class="box">
                <h3 class="icon22 icon22-users"><%=l(:label_member_plural)%></h3>    
                <p><% @users_by_role.keys.sort.each do |role| %>
                <%=h role %>: <%= @users_by_role[role].sort.collect{|u| link_to_user u}.join(", ") %><br />
                <% end %></p>
        </div>
    <% end %>

Kind regards,

Mischa.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Nicolas Zinopoulos over 15 years ago

Yes! It works!
Thank you Mischa for your prompt and detailed answer.
I really appreciate it.

Best regards,

Nicolas

RE: Projects Tree View Plugin - Version 0.0.1 - Added by pa riera about 15 years ago

Plugin crashes when clicking on Projects

NoMethodError in Projects#index

Showing projects/index.rhtml where line #18 raised:

undefined method `each' for nil:NilClass
Extracted source (around line #18):

15: </thead>
16: <tbody>
17: <% ancestors = [] >
18: <
for project in Projects Projects >
19: <
rowid = "" >
20: <
classes = "" >
21: <
spanicon = "" %>

Any help ???

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Mischa The Evil about 15 years ago

pa riera wrote:

Plugin crashes when clicking on Projects

NoMethodError in Projects#index

Showing projects/index.rhtml where line #18 raised:

undefined method `each' for nil:NilClass
Extracted source (around line #18):

15: </thead>
16: <tbody>
17: <% ancestors = [] >
18: <
for project in Projects Projects >
19: <
rowid = "" >
20: <
classes = "" >
21: <
spanicon = "" %>

Any help ???

Can you try http://github.com/MischaTheEvil/projects_tree_view/tree/master and let me know if that fork fixes your issue?

Kind regards,

Mischa.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Mischa The Evil about 15 years ago

Chris Peterson wrote:

Here is the updated version 0.0.2 of Projects Tree View. [...]

@ Chris Peterson: Are you still following this forum-thread? I've sent you an e-mail on the third of august but haven't received a reply yet. Did the mail hit your spam-folder maybe or are you simply too busy? :)

Hope to hear from you... ;)

Kind regards,

Mischa.

RE: Projects Tree View Plugin - Version 0.0.1 - Added by pa riera about 15 years ago

Still the same problem with version 0.0.2 and 0.0.3

Showing projects/index.rhtml where line #18 raised:

undefined method `each' for nil:NilClass
Extracted source (around line #18):

15: </thead>
16: <tbody>
17: <% ancestors = [] >
18: <
for project in Projects Projects >
19: <
rowid = "" >
20: <
classes = "" >
21: <
spanicon = "" %>

I've checked the code and Projects Projects isn't present in the project_controller.

  1. Lists visible projects
    def index
    projects = Project.find :all,
    :conditions => Project.visible_by(User.current),
    :include => :parent
    respond_to do |format|
    format.html {
    @project_tree = projects.group_by {|p| p.parent || p}
    @project_tree.keys.each {|p| @project_tree[p] -= [p]}
    }
    format.atom {
    render_feed(projects.sort_by(&:created_on).reverse.slice(0, Setting.feeds_limit.to_i),
    :title => "#{Setting.app_title}: #{l(:label_project_latest)}")
    }
    end
    end

What is the version of Redmine u use ?

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Anonymous about 15 years ago

Still the same problem with version 0.0.2 and 0.0.3.

Please fix this...

RE: Projects Tree View Plugin - Version 0.0.1 - Added by Anonymous about 15 years ago

Mischa The Evil wrote:

pa riera wrote:

Plugin crashes when clicking on Projects

NoMethodError in Projects#index

Showing projects/index.rhtml where line #18 raised:

undefined method `each' for nil:NilClass
Extracted source (around line #18):

15: </thead>
16: <tbody>
17: <% ancestors = [] >
18: <
for project in Projects Projects >
19: <
rowid = "" >
20: <
classes = "" >
21: <
spanicon = "" %>

Any help ???

Can you try http://github.com/MischaTheEvil/projects_tree_view/tree/master and let me know if that fork fixes your issue?

Kind regards,

Mischa.

Mischa,

Your patch doesn't work. Viewing the page (/projects) gives a Internal Error 500. Don't you guys try this on your own redmine application with the latest version? :-)

Regards,
Pieter

(1-25/128)