Exemplo n.º 1
0
 /**
  * Date string to timestamp
  *
  * @param string $strdate Date string in the format yyyymmdd
  * @return int
  */
 function str2stamp($strdate)
 {
     return dateutil::arr2stamp(dateutil::str2arr($strdate));
 }
Exemplo n.º 2
0
                $caption .= '[0/' . round($gantphase['planned'] / 60) . ']';
            }
        }
    } else {
        $activity[$i]->SetPattern(BAND_RDIAG, "red");
    }
    $activity[$i]->caption->Set($caption);
    //$graph->Add($activity[$i]);
    $i++;
}
atkimport("module.utils.dateutil");
// milestones
$milestonenode =& atkGetNode("project.deliverable");
$deliverables = $milestonenode->selectDb("project_id=" . $projectid, "duedate");
for ($i = 0, $_i = count($deliverables); $i < $_i; $i++) {
    $due = date("Y-m-d", dateutil::arr2stamp($deliverables[$i]["duedate"]));
    $ms = new MileStone(count($gant) + $i, $deliverables[$i]["name"], $due, $due . " (" . $deliverables[$i]["name"] . ")");
    $graph->Add($ms);
}
// dependencies
for ($i = 0, $_i = count($dbrecordsdep); $i < $_i; $i++) {
    $activity[$reverselookup[$dbrecordsdep[$i]["dependency_phaseid_row"]]]->SetConstrain($reverselookup[$dbrecordsdep[$i]["dependency_phaseid_col"]], CONSTRAIN_ENDSTART);
}
for ($i = 0, $_i = count($activity); $i < $_i; $i++) {
    $graph->Add($activity[$i]);
}
//TO DO: find a good solution for errorhandling
//here you can set a subtitle
//$graph->subtitle->Set('title');
if (count($gant) == 0) {
    $graph->SetDateRange(time(), time() + 86400);