Comments

manuelBS’s picture

In general it should work. You just need to extend the tasks tho have the fields you need to set in the view gantt settings (like dependend tasks, estimation etc.)
You may check how the task setup is done in ERPAL Business Management and do it similar in OA2.

glennnz’s picture

@manuelBS

Thanks, but I can't get it to work.

I am now trying on a clean install of D7.28 with only the modules installed that I need to get the correct data into the nodes.

When I display the View as a table, it all displays correctly. When I run with the Gantt, I get nothing at all.

My view export is below.

Thanks,

Glenn

$view = new view();
$view->name = 'project_schedule';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Project Schedule';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Project Schedule';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'gantt';
$handler->display->display_options['style_options']['height'] = '1000';
$handler->display->display_options['style_options']['id_field'] = 'nid';
$handler->display->display_options['style_options']['name_field'] = 'title';
$handler->display->display_options['style_options']['date_field'] = 'field_task_dates_1';
$handler->display->display_options['style_options']['end_date_field'] = 'field_task_dates';
$handler->display->display_options['style_options']['progress_field'] = 'field_task_progress';
$handler->display->display_options['style_options']['project_id_field'] = 'field_task_project';
$handler->display->display_options['style_options']['columns'] = array(
  'title' => 'title',
);
/* Header: Global: View area */
$handler->display->display_options['header']['view']['id'] = 'view';
$handler->display->display_options['header']['view']['table'] = 'views';
$handler->display->display_options['header']['view']['field'] = 'view';
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
/* Field: Content: Dates */
$handler->display->display_options['fields']['field_task_dates']['id'] = 'field_task_dates';
$handler->display->display_options['fields']['field_task_dates']['table'] = 'field_data_field_task_dates';
$handler->display->display_options['fields']['field_task_dates']['field'] = 'field_task_dates';
$handler->display->display_options['fields']['field_task_dates']['label'] = 'End Date';
$handler->display->display_options['fields']['field_task_dates']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['field_task_dates']['alter']['text'] = '[field_task_dates-value2]';
$handler->display->display_options['fields']['field_task_dates']['settings'] = array(
  'format_type' => 'long',
  'fromto' => 'value2',
  'multiple_number' => '',
  'multiple_from' => '',
  'multiple_to' => '',
);
/* Field: Content: Nid */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
/* Field: Content: Progress */
$handler->display->display_options['fields']['field_task_progress']['id'] = 'field_task_progress';
$handler->display->display_options['fields']['field_task_progress']['table'] = 'field_data_field_task_progress';
$handler->display->display_options['fields']['field_task_progress']['field'] = 'field_task_progress';
$handler->display->display_options['fields']['field_task_progress']['type'] = 'number_unformatted';
$handler->display->display_options['fields']['field_task_progress']['settings'] = array(
  'thousand_separator' => '',
  'prefix_suffix' => 0,
);
/* Field: Content: Project */
$handler->display->display_options['fields']['field_task_project']['id'] = 'field_task_project';
$handler->display->display_options['fields']['field_task_project']['table'] = 'field_data_field_task_project';
$handler->display->display_options['fields']['field_task_project']['field'] = 'field_task_project';
$handler->display->display_options['fields']['field_task_project']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['field_task_project']['alter']['text'] = '[field_task_project-target_id]';
$handler->display->display_options['fields']['field_task_project']['settings'] = array(
  'link' => 0,
);
/* Field: Content: Dates */
$handler->display->display_options['fields']['field_task_dates_1']['id'] = 'field_task_dates_1';
$handler->display->display_options['fields']['field_task_dates_1']['table'] = 'field_data_field_task_dates';
$handler->display->display_options['fields']['field_task_dates_1']['field'] = 'field_task_dates';
$handler->display->display_options['fields']['field_task_dates_1']['label'] = 'Start Date';
$handler->display->display_options['fields']['field_task_dates_1']['alter']['alter_text'] = TRUE;
$handler->display->display_options['fields']['field_task_dates_1']['alter']['text'] = '[field_task_dates_1-value]';
$handler->display->display_options['fields']['field_task_dates_1']['settings'] = array(
  'format_type' => 'long',
  'fromto' => 'value',
  'multiple_number' => '',
  'multiple_from' => '',
  'multiple_to' => '',
);
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'schedule_task' => 'schedule_task',
);

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'project-schedule';

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'fullcalendar';
$handler->display->display_options['style_options']['firstDay'] = '1';
$handler->display->display_options['style_options']['weekMode'] = 'variable';
$handler->display->display_options['style_options']['fullcalendar_options']['allDaySlot'] = FALSE;
$handler->display->display_options['style_options']['fullcalendar_options']['dayClick'] = TRUE;
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['defaults']['row_options'] = FALSE;

glennnz’s picture

Title: Open Atrium 2 » No Display if Gantt Chart
glennnz’s picture

Title: No Display if Gantt Chart » No Display of Gantt Chart
glennnz’s picture

StatusFileSize
new40.71 KB

I have attached a screenshot of the table output from my View.

glennnz’s picture

Category: Support request » Bug report
Priority: Normal » Critical
glennnz’s picture

@alexshipilov

My dependant structure is:

Parent Node Type = Project
Child Node Type = Schedule Task

samhassell’s picture

im getting a similar result with a similar setup.

for some reason the tasks get deleted before being rendered..

samhassell’s picture

views_gantt_get_node_field_value() sets a parent_id and predecessor id on the Project node's item in $this->task. This causes build tree to exit out before it does anything.

I found i could put

    if ($node->type == 'project' && $field_options_name == 'parent_id_field') return;
    if ($node->type == 'project' && $field_options_name == 'predecessor_id_field') return;

at the top of views_gantt_get_node_field_value() at it fixes it, but a proper fix & patch will have to wait till tomorrow.

samhassell’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

Give this a spin. It checks $node->type because normal tasks won't have this set, and I'm assuming the only 'missing tasks' are the project level tasks.

Cheers,
Sam.

glennnz’s picture

Status: Needs review » Active

Hi Sam,

It's not working for me.... :-(

What else can I give you to help diagnose it?

Thanks,

Glenn

glennnz’s picture

Issue summary: View changes

@manuelBS

I installed a clean install of ERPAL too and have the same problem, no display of Gantt Charts...

glennnz’s picture

What other info can I provide to get this diagnosed?

Thanks

shijin.js’s picture

Hello glennz,

Are your tasks using entityreference? If so, that may be your issue. entityreference uses "target_id", and that isn't being checked for in the function that gets field values. If you are using entityreference, I have a quick patch that may help. Let me know if this does the trick for you.

shijin.js

glennnz’s picture

@shijin,

That's an improvement! I have a blank Gantt chart showing now, with the 'Fullscreen' link at the bottom.

I have my field outputs rewritten to output the raw value.

dobe’s picture

Don't rewrite your fields. It uses the load of the entity with shinjin.js's patch.

glennnz’s picture

Title: No Display of Gantt Chart » Respect non clean URL's

Solved.

It wasn't about rewriting the fields. Clean URL's were not enabled. There is a hard coded thing somewhere in the menu callback for views_gantt/data.json that doesn't respect clean URL's being switched off.

Enabling clean URL's solved the problem.

dobe’s picture

So turning on clean urls without the patch fixed your issue? Or with the patch and clean urls?

glennnz’s picture

With the patch

shijin.js’s picture

glennz, are you getting any notices or warnings in your logs when you try running Views Gantt without clean URLs? I have the dev version of Views Gantt running with the last patch I uploaded, without clean URLs, and everything is displaying properly for me. I'm just trying to get an idea of the conditions that may be triggering the problem with non-clean URLs, since the function that generates the JSON file operates directly from the $_GET and $_SESSION variables. I don't see any hard-coded values pointing to specific URLs, and the menu callback seems to be working fine with the non-clean URL scheme. Please let me know if you have anything that can help me trace this down.

Thank you,
shijin.js

glennnz’s picture

Shijin,

Strange. I just turned clean URL's off, and it still works...

I have no idera what was happening then; I can't see anything in the log.

A friend helped me with this; he was using Terminal and was forming a drupal_http_request to diagnose it. That's all I can tell you. When he put /Q= into that drupal_http_request, it failed. When he removed it, it worked.

Sorry I can't be of more help.

dobe’s picture

Status: Active » Reviewed & tested by the community

It needs to be /?q= otherwise drupal thinks the url is getting a 'q' argument passed instead of a 'q' parameter. I believe patch #14 fixed your issue so I am marking as reviewed.

glennnz’s picture

@dobe,

Sorry, typo. It was /?q=...

MREinJP’s picture

I too had this problem on a local server, which was recently set up.
The gantt chart frame would appear, with range selects, but no data.

After repeated attempts to install dhtmlxgantt, I found this post.

Enabling clean URLs on my server immediately fixed the problem.
Definately something worth mentioning in the project page requirements.

broon’s picture

Just wanted to note that patch in #10 fixed the issue for me.

At first, I had a weird error about undefined index: duration and disabled the "Exclude incorrect tasks" part in the render function. Then, the error disappeared, but the page would load forever and finally die with a blank chart.

After applying the mentioned patch, everything works fine so far, the chart displays parent and child tasks as well as predecessor relations.