Defect #7000

Project filter not applied on versions in Gantt chart

Added by Tom Turner almost 7 years ago. Updated over 6 years ago.

Status:ClosedStart date:2010-11-29
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Gantt
Target version:1.2.0
Resolution:Fixed Affected version:1.0.4

Description

Redmine Version 1.0.4

I have versions which have Not shared set on them. This works correctly for things like adding new issues (I cannot add an issue to a version that is not shared with that project). However when I construct a view of an issue list which uses a project filter, the Gantt chart for that view includes all the versions across the entire install of Redmine regardless of the sharing settings.

For example:
Project 1 has Version 1 and Version 2
Project 2 has Version 3 and Version 4

If I construct a filter which says "All issues that are not in Project 2" I get all the issues filtered correctly but all four versions are shown in the Gantt chart.

I know that the Gantt rewrite for 1.1.0 is imminent but this issue seems like it should be fairly simple to correct (unfortunately I don't know Ruby well enough to understand how to do it myself). It looks like it just needs something added to the filter on line 32 of the gantt controller (http://www.redmine.org/projects/redmine/repository/entry/tags/1.0.4/app/controllers/gantts_controller.rb#L32)

Is there any chance of someone looking at whether this could be fixed with a simple fix to the version filter, please?

gantt_filter_not_filtering.png (65.3 KB) Cyber Sprocket, 2011-01-10 20:50

hide_closed_versions_on_gantt.patch Magnifier (503 Bytes) Cyber Sprocket, 2011-01-12 21:12


Related issues

Related to Redmine - Patch #7456: Gantt filters New 2011-01-26

Associated revisions

Revision 5077
Added by Jean-Philippe Lang over 6 years ago

Gantt: do not ignore project filter (#7000, #7352), do not display empty projects/versions, and display shared versions used in other projects (#5817, #6476, #6604).

History

#1 Updated by Cyber Sprocket almost 7 years ago

Using the latest 1.1 stable release, we see all versions on the build listed even though we set a filter to show just version 8.0.

#2 Updated by Cyber Sprocket almost 7 years ago

I have created this patch for the gantt charts to hide the closed versions on the gantt.

This is a hard-coded fix. I'd like to know more about Ruby so we could add an entry on the main administration settings panel (or project settings panel) to provide a checkbox that says [ ] Hide closed versions on gantt.

Anyway - here is the patch:


Index: lib/redmine/helpers/gantt.rb
===================================================================
--- lib/redmine/helpers/gantt.rb        (revision 4672)
+++ lib/redmine/helpers/gantt.rb        (working copy)
@@ -200,7 +200,9 @@

         # Third, Versions
         project.versions.sort.each do |version|
-          render_version(version, options)
+         if !version.closed?
+              render_version(version, options)
+         end
           return if abort?
         end

#3 Updated by Etienne Massip over 6 years ago

Could someone try this patch at #7456 ?

#4 Updated by Jean-Philippe Lang over 6 years ago

  • Status changed from New to Closed
  • Target version set to 1.2.0
  • Resolution set to Fixed

Project filter fixed in r5077.

Also available in: Atom PDF