You are here

function views_gantt_plugin_style_gantt::check_duration in Views Gantt 7

Same name and namespace in other branches
  1. 7.2 views_gantt_plugin_style_gantt.inc \views_gantt_plugin_style_gantt::check_duration()
1 call to views_gantt_plugin_style_gantt::check_duration()
views_gantt_plugin_style_gantt::render in ./views_gantt_plugin_style_gantt.inc
Render the given style.

File

./views_gantt_plugin_style_gantt.inc, line 257
Contains the list style plugin.

Class

views_gantt_plugin_style_gantt
Style plugin to render Gantt charts.

Code

function check_duration($task, $parent_id = '') {
  if (!isset($this->tasks[$task['id']]['duration'])) {
    $this
      ->calculate_duration($task['id']);
  }
  if (isset($task['children'])) {
    foreach ($task['children'] as $child) {
      $this
        ->check_duration($child, $task['id']);
    }
  }
  if ($parent_id) {
    $duration = $this->tasks[$task['id']]['duration'];
    $parent_duration = $this->tasks[$parent_id]['duration'];
    if ($parent_duration < $duration) {
      $this->tasks[$parent_id]['duration'] = $duration;
      $this->tasks[$parent_id]['duration_modified'] = TRUE;
    }
  }
}