Hello,

I can't do more than one project by gantt diagramm.
Is it normal (only one project by diagramm) ?
Is it a bug ?
I use the module in a wrong way ?

Thanks for all

PS : I confirm the bug Gantt charts when i want to move the dates task or the progress task.

Comments

thfalvar’s picture

Issue summary: View changes
lalbright’s picture

StatusFileSize
new46.36 KB

I too have this problem. I have created Project A, and Project B with tasks as follows:

Project A
Task 1
Task 2
Task 3

Project B
Task 1
Task 2

In the gantt view, I can see the Project A line, and its tasks (1-3), but also attached to the same project are tasks 1 & 2 from Project B. See the attached screenshot (gantt.jpg).

I am using Drupal 7.24, and the Views Gantt module, version 7.x-2.0-alpha1. I have a project content type, and a task content type, with the task.project field as an entity reference to the associated project node. The Task content type has the following fields:

  • ID field - task nid
  • Name field - task title
  • Date field - task start date
  • End date field
  • Progress field
  • Project ID field

Do you need any other information from me to help resolve this issue?

lalbright’s picture

StatusFileSize
new73.06 KB
new80.67 KB
new110.23 KB

I have added screenshots of the Task Content Type Manage Fields screen, the views screen, and the views style options for the gantt. Hope this helps. :)

clemens.tolboom’s picture

#3

#4-1

#4-2

#4-3

alexshipilov’s picture

Currently module supports one project by diagramm. We will add multi project support near future.

dobe’s picture

StatusFileSize
new9.3 KB

Attached is a patch that accomplishes this (latest dev). We are starting to do a lot of development on this module so if you need help maintaining let us know.

-Jesse

dobe’s picture

Version: 7.x-2.0-alpha1 » 7.x-2.x-dev
StatusFileSize
new9.9 KB

I was going to split this patch up between the two queues but thought that would be nonsense. This patch adds the autoscroll to current date. We are soon to have a patch that provides finer grain control of views gantt as well.

-Jesse

clemens.tolboom’s picture

Assigned: thfalvar » Unassigned
Category: Support request » Feature request
Status: Active » Needs review

As there is a patch this is a feature which now needs review.

I unassigned this from @thfalvar.

I wonder why the core https://api.drupal.org/api/drupal/includes!graph.inc/7 is not used for the tree building.

Checking for http://docs.dhtmlx.com/gantt/desktop__how_to_start.html#step4loaddatatot... there does not seem to be any need to build trees?

@dobe thanks for your patch. I wish I had some time/money left to contribute too.

Yuri’s picture

It got worse..
When I apply patch#7, none of the projects are visible, only the tasks bars appear in the gantt view.
Also, before patching I could doubleclick on the taskname in the left column and open the task. This does not work any more.

Yuri’s picture

Ok I got something working...I've put the project ID as the 'Parent ID field' and now they show up. The tasks are also clickable links.
Am I doing this the right way?

dobe’s picture

Currently the way we have it setup is:

Task content type:
Project is an entityreference field to a task (projects don't have parents).
Parent is an entityreference field to a task.

dobe’s picture

#8 We agree with you. However the build tree is doing some clean up as far as we can tell. We may attempt to strip out tree in a future patch.

We took a step back from this and gave it a re-look, seems that we can accomplish getting projects to work as intended with a really, really simple patch. If what we are doing is going to cause unforeseen conflicts post it up. Enjoy.

sinasalek’s picture

Nice patch! #12
The patch is applicable but how to test it?

manuelBS’s picture

If we get it tested, I am really looking forward to commit it. Can somebody post an example view or feature so others can test it?

thfalvar’s picture

Hello, I passed in views Gantt 7.x-1.0-beta2 and the problems are always here (n projects, bug when using direct the diagram for changed the % progress, and the change start date in diagram don't changed in the task table).
So i do not pass the patch because i think that they are for the anterior version.

samstamport’s picture

I'm pretty new to Drupal. This is the first time I've tried to patch. Maybe I'm doing something wrong ...

None of the three patches seem to match the current code in views_gantt 7.x-2.0-rc1 or views_gantt 7.x-2.x-dev.

Please help.

jaspher’s picture

Confirming with #16 that this patch #12 does not apply to rc1 and dev:

[user@websrv views_gantt]# git apply -v views_gantt_multiple_projects-2218959-12.patch
Checking patch views_gantt.module...
error: while searching for:
  }

  if (isset($_SESSION['views_gantt'])) {
    $project_id = $_SESSION['views_gantt']['project']['id'];
    foreach ($_SESSION['views_gantt']['tasks'] as $id => $task) {
      if (!$task['parent_id'] && $id != $project_id) {
        $task['parent_id'] = $project_id;
      }
      $row = array(
        'id' => $id,
        'text' => $task['name'],

error: patch failed: views_gantt.module:66
error: views_gantt.module: patch does not apply
clemens.tolboom’s picture

Status: Needs review » Needs work

So the patch needs work :)

BigEd’s picture

Was there any progress on this issue?

I may need this for an upcoming project and its a bit of a deal breaker if i can't do more than one project.

marceldeb’s picture

Same problem here. Much appreciated!

clemens.tolboom’s picture

I still did not manage to generate multiple projects. Not even with #12.

Should we use #7 instead?

clemens.tolboom’s picture

+++ b/views_gantt.module
@@ -66,11 +66,7 @@ function views_gantt_data_json() {
-    $project_id = $_SESSION['views_gantt']['project']['id'];

Removing $project_id should be corrected in line 85

'type' => $id == $project_id ? 'project' : 'task',

Code part should look like

  if (isset($_SESSION['views_gantt'])) {
    foreach ($_SESSION['views_gantt']['tasks'] as $id => $task) {
      $row = array(
        'id' => $id,
        'text' => $task['name'],
        'start_date' => $task['est'],
        'duration' => $task['duration'] / 8,
        'progress' => $task['percentcompleted'] / 100,
        'parent' => $task['parent_id'],
        'open' => TRUE,
        'type' => $id == $project_id ? 'project' : 'task', <============== MISSING $project_id
      );

I'm not sure what to replace the 'type' line with.

iaminawe’s picture

I am also interested in this solution

iaminawe’s picture

I have this working with multiple projects using the patch from #7

I needed to add a relationship to the view based on the project reference field
Then I added a second nid, start date, end date and title all using the project relationship

The project ID field I used the nid using the relationship and then for Parent ID field I used the entity reference field to the project and it worked!

I do receive the following error but it seems to work correctly

Notice: Undefined index: id in views_gantt_plugin_style_gantt->views_gantt_before_render() (line 827 of /Users/***/Sites/****/sites/all/modules/views_gantt/views_gantt_plugin_style_gantt.inc).

matthieu_collet’s picture

hi

effectively, none of the patches work with 7.x-2.0-rc1
anybody has an idea how to progress ?

in fact, I don't understand if the patches where removing projects trees, of multipliying them (i hope it was this second option)

when I apply them it removes the tree display

with patches 7 and 8, is it required to put project id in "Parent ID field" ?

is this project still active ?

thank you

matthieu

asntbladewriter’s picture

StatusFileSize
new67.14 KB

For anyone wondering what the setup from #24 might look like, I got multiple projects to work on my test-bench with this: View Gantt Setup

drupupp’s picture

Per #26: How did you set up the settings for the chart?