当前位置: 首页>>代码示例>>PHP>>正文


PHP GanttBar::SetConstrain方法代码示例

本文整理汇总了PHP中GanttBar::SetConstrain方法的典型用法代码示例。如果您正苦于以下问题:PHP GanttBar::SetConstrain方法的具体用法?PHP GanttBar::SetConstrain怎么用?PHP GanttBar::SetConstrain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GanttBar的用法示例。


在下文中一共展示了GanttBar::SetConstrain方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parse

 function parse($input, $parser)
 {
     foreach (split("\n", $input) as $line) {
         // skip empty line or comments
         if (preg_match("/^(\\s*)#.*\$|^(\\s*)\$/", $line)) {
             continue;
         }
         #               1ID>, 2P%,   3DEP,   4TASKNAME ,5DATE>,  6DATE,       7Tag
         if (preg_match("/(\\d+),(\\d+)%,([\\d:]*),([^,]+),([\\d\\s\\-]+),([\\d\\s\\-]+),?([^,]+)?/", $line, $parse_result)) {
             # $bar = new GanttBar(ID,             Comment,          start,            end,            tag, height);
             $bar = new GanttBar($parse_result[1], $parse_result[4], $parse_result[5], $parse_result[6]);
             foreach (split(",", $parse_result[3]) as $dep) {
                 if (!$dep) {
                     continue;
                 }
                 $bar->SetConstrain($dep, CONSTRAIN_STARTEND);
             }
             if ($this->min_date) {
                 if (strtotime($parse_result[5]) < strtotime($this->min_date)) {
                     $this->min_date = $parse_result[5];
                 }
             } else {
                 $this->min_date = $parse_result[5];
             }
             if ($this->max_date) {
                 if (strtotime($parse_result[6]) > strtotime($this->max_date)) {
                     $this->max_date = $parse_result[6];
                 }
             } else {
                 $this->max_date = $parse_result[6];
             }
             $bar->SetPattern(BAND_RDIAG, "yellow");
             $bar->SetFillColor("gray");
             //$bar->progress->Set($parse_result[2]/100);
             $bar->progress->SetPattern(GANTT_SOLID, "darkgreen");
             $this->graph->Add($bar);
         } else {
             throw new Exception("Error while parsing line '{$line}': expected 'ID,PURCENT%,DEPENDENCY,TASK NAME,DATE,DATE'");
         }
     }
 }
开发者ID:mediawiki-extensions,项目名称:jpgraphmw,代码行数:41,代码来源:jpgraphmw.php

示例2: CreateSimple

 function CreateSimple($data, $constrains = array(), $progress = array())
 {
     $num = count($data);
     for ($i = 0; $i < $num; ++$i) {
         switch ($data[$i][1]) {
             case ACTYPE_GROUP:
                 // Create a slightly smaller height bar since the
                 // "wings" at the end will make it look taller
                 $a = new GanttBar($data[$i][0], $data[$i][2], $data[$i][3], $data[$i][4], '', 8);
                 $a->title->SetFont($this->iSimpleFont, FS_BOLD, $this->iSimpleFontSize);
                 $a->rightMark->Show();
                 $a->rightMark->SetType(MARK_RIGHTTRIANGLE);
                 $a->rightMark->SetWidth(8);
                 $a->rightMark->SetColor('black');
                 $a->rightMark->SetFillColor('black');
                 $a->leftMark->Show();
                 $a->leftMark->SetType(MARK_LEFTTRIANGLE);
                 $a->leftMark->SetWidth(8);
                 $a->leftMark->SetColor('black');
                 $a->leftMark->SetFillColor('black');
                 $a->SetPattern(BAND_SOLID, 'black');
                 $csimpos = 6;
                 break;
             case ACTYPE_NORMAL:
                 $a = new GanttBar($data[$i][0], $data[$i][2], $data[$i][3], $data[$i][4], '', 10);
                 $a->title->SetFont($this->iSimpleFont, FS_NORMAL, $this->iSimpleFontSize);
                 $a->SetPattern($this->iSimpleStyle, $this->iSimpleColor);
                 $a->SetFillColor($this->iSimpleBkgColor);
                 // Check if this activity should have a constrain line
                 $n = count($constrains);
                 for ($j = 0; $j < $n; ++$j) {
                     if (empty($constrains[$j]) || count($constrains[$j]) != 3) {
                         JpGraphError::RaiseL(6003, $j);
                         //("Invalid format for Constrain parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Constrain-To,Constrain-Type)");
                     }
                     if ($constrains[$j][0] == $data[$i][0]) {
                         $a->SetConstrain($constrains[$j][1], $constrains[$j][2], 'black', ARROW_S2, ARROWT_SOLID);
                     }
                 }
                 // Check if this activity have a progress bar
                 $n = count($progress);
                 for ($j = 0; $j < $n; ++$j) {
                     if (empty($progress[$j]) || count($progress[$j]) != 2) {
                         JpGraphError::RaiseL(6004, $j);
                         //("Invalid format for Progress parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Progress)");
                     }
                     if ($progress[$j][0] == $data[$i][0]) {
                         $a->progress->Set($progress[$j][1]);
                         $a->progress->SetPattern($this->iSimpleProgressStyle, $this->iSimpleProgressColor);
                         $a->progress->SetFillColor($this->iSimpleProgressBkgColor);
                         //$a->progress->SetPattern($progress[$j][2],$progress[$j][3]);
                         break;
                     }
                 }
                 $csimpos = 6;
                 break;
             case ACTYPE_MILESTONE:
                 $a = new MileStone($data[$i][0], $data[$i][2], $data[$i][3]);
                 $a->title->SetFont($this->iSimpleFont, FS_NORMAL, $this->iSimpleFontSize);
                 $a->caption->SetFont($this->iSimpleFont, FS_NORMAL, $this->iSimpleFontSize);
                 $csimpos = 5;
                 break;
             default:
                 die('Unknown activity type');
                 break;
         }
         // Setup caption
         $a->caption->Set($data[$i][$csimpos - 1]);
         // Check if this activity should have a CSIM target�?
         if (!empty($data[$i][$csimpos])) {
             $a->SetCSIMTarget($data[$i][$csimpos]);
             $a->SetCSIMAlt($data[$i][$csimpos + 1]);
         }
         if (!empty($data[$i][$csimpos + 2])) {
             $a->title->SetCSIMTarget($data[$i][$csimpos + 2]);
             $a->title->SetCSIMAlt($data[$i][$csimpos + 3]);
         }
         $this->Add($a);
     }
 }
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:80,代码来源:jpgraph_gantt.php

示例3: GanttGraph

<?php

// Gantt example
include "../jpgraph.php";
include "../jpgraph_gantt.php";
// Create the basic graph
$graph = new GanttGraph();
$graph->title->Set("Example with multiple constrains");
$bar1 = new GanttBar(0, "Label 1", "2003-06-08", "2003-06-12");
$bar2 = new GanttBar(1, "Label 2", "2003-06-16", "2003-06-19");
$bar3 = new GanttBar(2, "Label 3", "2003-06-15", "2003-06-21");
//create constraints
$bar1->SetConstrain(1, CONSTRAIN_ENDSTART);
$bar1->SetConstrain(2, CONSTRAIN_ENDSTART);
// Setup scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR);
// Add the specified activities
$graph->Add($bar1);
$graph->Add($bar2);
$graph->Add($bar3);
// .. and stroke the graph
$graph->Stroke();
开发者ID:Ethennoob,项目名称:Web,代码行数:23,代码来源:multconstganttex01.php

示例4: CreateSimple

 function CreateSimple($data, $constrains = array(), $progress = array())
 {
     $num = count($data);
     for ($i = 0; $i < $num; ++$i) {
         switch ($data[$i][1]) {
             case ACTYPE_GROUP:
                 $a = new GanttBar($data[$i][0], $data[$i][2], $data[$i][3], $data[$i][4], '', 8);
                 $a->title->SetFont($this->iSimpleFont, FS_BOLD, $this->iSimpleFontSize);
                 $a->rightMark->Show();
                 $a->rightMark->SetType(MARK_RIGHTTRIANGLE);
                 $a->rightMark->SetWidth(8);
                 $a->rightMark->SetColor('black');
                 $a->rightMark->SetFillColor('black');
                 $a->leftMark->Show();
                 $a->leftMark->SetType(MARK_LEFTTRIANGLE);
                 $a->leftMark->SetWidth(8);
                 $a->leftMark->SetColor('black');
                 $a->leftMark->SetFillColor('black');
                 $a->SetPattern(BAND_SOLID, 'black');
                 $csimpos = 6;
                 break;
             case ACTYPE_NORMAL:
                 $a = new GanttBar($data[$i][0], $data[$i][2], $data[$i][3], $data[$i][4], '', 10);
                 $a->title->SetFont($this->iSimpleFont, FS_NORMAL, $this->iSimpleFontSize);
                 $a->SetPattern($this->iSimpleStyle, $this->iSimpleColor);
                 $a->SetFillColor($this->iSimpleBkgColor);
                 $n = count($constrains);
                 for ($j = 0; $j < $n; ++$j) {
                     if (empty($constrains[$j]) || count($constrains[$j]) != 3) {
                         JpGraphError::RaiseL(6003, $j);
                     }
                     if ($constrains[$j][0] == $data[$i][0]) {
                         $a->SetConstrain($constrains[$j][1], $constrains[$j][2], 'black', ARROW_S2, ARROWT_SOLID);
                     }
                 }
                 $n = count($progress);
                 for ($j = 0; $j < $n; ++$j) {
                     if (empty($progress[$j]) || count($progress[$j]) != 2) {
                         JpGraphError::RaiseL(6004, $j);
                     }
                     if ($progress[$j][0] == $data[$i][0]) {
                         $a->progress->Set($progress[$j][1]);
                         $a->progress->SetHeight(0.5);
                         $a->progress->SetPattern($this->iSimpleProgressStyle, $this->iSimpleProgressColor);
                         $a->progress->SetFillColor($this->iSimpleProgressBkgColor);
                         break;
                     }
                 }
                 $csimpos = 6;
                 break;
             case ACTYPE_MILESTONE:
                 $a = new MileStone($data[$i][0], $data[$i][2], $data[$i][3]);
                 $a->title->SetFont($this->iSimpleFont, FS_NORMAL, $this->iSimpleFontSize);
                 $a->caption->SetFont($this->iSimpleFont, FS_NORMAL, $this->iSimpleFontSize);
                 $csimpos = 5;
                 break;
             default:
                 die('Unknown activity type');
                 break;
         }
         $a->caption->Set($data[$i][$csimpos - 1]);
         if (!empty($data[$i][$csimpos])) {
             $a->SetCSIMTarget($data[$i][$csimpos]);
             $a->SetCSIMAlt($data[$i][$csimpos + 1]);
         }
         if (!empty($data[$i][$csimpos + 2])) {
             $a->title->SetCSIMTarget($data[$i][$csimpos + 2]);
             $a->title->SetCSIMAlt($data[$i][$csimpos + 3]);
         }
         $this->Add($a);
     }
 }
开发者ID:natanoj,项目名称:nuBuilderPro,代码行数:72,代码来源:jpgraph_gantt.php

示例5: getJPGraphBar

 public function getJPGraphBar($issueActivityMapping)
 {
     $user = UserCache::getInstance()->getUser($this->userid);
     $issue = IssueCache::getInstance()->getIssue($this->bugid);
     if (NULL != $issue->getTcId()) {
         $formatedActivityName = substr($this->bugid . " [" . $issue->getTcId() . "] - " . $issue->getSummary(), 0, 50);
     } else {
         $formatedActivityName = substr($this->bugid . " - " . $issue->getSummary(), 0, 50);
     }
     $formatedActivityInfo = $user->getName();
     if ($issue->getCurrentStatus() < $issue->getBugResolvedStatusThreshold()) {
         $formatedActivityInfo .= " (" . Constants::$statusNames[$issue->getCurrentStatus()] . ")";
     }
     $bar = new GanttBar($this->activityIdx, utf8_decode($formatedActivityName), date('Y-m-d', $this->startTimestamp), date('Y-m-d', $this->endTimestamp), $formatedActivityInfo, 10);
     // --- colors
     $bar->SetPattern(GANTT_SOLID, $this->color);
     $bar->progress->Set($this->progress);
     $bar->progress->SetPattern(GANTT_SOLID, 'slateblue');
     // --- add constrains
     $relationships = $issue->getRelationships();
     $relationships = $relationships['' . Constants::$relationship_constrains];
     if (is_array($relationships)) {
         foreach ($relationships as $bugid) {
             // Add a constrain from the end of this activity to the start of the activity $bugid
             $bar->SetConstrain($issueActivityMapping[$bugid], CONSTRAIN_ENDSTART);
         }
     }
     if (self::$logger->isDebugEnabled()) {
         self::$logger->debug("JPGraphBar bugid={$this->bugid} prj=" . $issue->getProjectId() . " activityIdx={$this->activityIdx}" . " progress={$this->progress} [" . date('Y-m-d', $this->startTimestamp) . " -> " . date('Y-m-d', $this->endTimestamp) . "]");
         self::$logger->debug("JPGraphBar bugid={$this->bugid} GanttBar = " . var_export($bar, TRUE));
     }
     return $bar;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:33,代码来源:gantt_manager.class.php

示例6: prj_paintProjectBar

function prj_paintProjectBar($testMonitor, $pid, $name, $startdate, $enddate, $parent_task, $progress, $status, $expanded, $userid, $nameIndent, &$graph, &$count, &$row, $sm, $stm)
{
    global $_TABLES, $_CONF, $_PRJCONF;
    $name = html_entity_decode($name);
    if (strlen($name) > $_PRJCONF['project_name_length']) {
        $name = substr($name, 0, $_PRJCONF['project_name_length']);
        $name .= "...";
    }
    $strdate = strftime("%Y/%m/%d", $startdate);
    $edate = strftime("%Y/%m/%d", $enddate);
    $sql = 'SELECT  c.fullname ';
    $sql .= "FROM {$_TABLES['prj_users']} a ";
    $sql .= "INNER JOIN {$_TABLES['prj_projects']} b on a.pid=b.pid ";
    $sql .= "INNER JOIN {$_TABLES['users']} c on a.uid=c.uid ";
    $sql .= "WHERE a.role='o' AND a.pid={$pid}";
    $result2 = DB_query($sql);
    list($owner) = DB_fetchArray($result2);
    $link = $_CONF['site_url'] . "/nexproject/viewproject.php?pid=" . $pid;
    $count = $count + 1;
    $doesAnyoneDependOnMe = DB_count($_TABLES['prj_projects'], 'parent_id', $pid);
    if (array_keys($expanded, $pid) != array()) {
        $sign = '[-]';
    } else {
        $sign = '[+]';
    }
    if ($doesAnyoneDependOnMe == 0) {
        $sign = '';
    }
    if ($strdate == $edate) {
        $milestone = new Milestone($row, "{$nameIndent}{$name}   {$sign}", $strdate);
        $milestone->mark->SetType(MARK_DIAMOND);
        //$milestone->title->SetFont(FF_ARIAL,FS_BOLD,10);
        if ($sign != '') {
            $tempval2 = $_SERVER['PHP_SELF'];
            $milestone->title->SetCSIMTarget("javascript:projectGanttClick('{$pid}','{$sign}','{$tempval}', '{$gdate1}', '{$gdate2}', '{$tempval2}');");
        }
        $graph->Add($milestone);
    } else {
        $activity = new GanttBar($count, "{$nameIndent}{$name}   {$sign}", "{$strdate}", "{$edate}", "{$owner}");
        if ($status == 0) {
            // Yellow diagonal line pattern on a red background
            $activity->SetPattern(GANTT_SOLID, "darkgreen");
            $activity->progress->SetPattern(GANTT_RDIAG, "black");
            $activity->progress->SetFillColor("white");
        } elseif ($status == 1) {
            $activity->SetPattern(GANTT_SOLID, "yellow");
            $activity->progress->SetPattern(GANTT_RDIAG, "black");
            $activity->progress->SetFillColor("white");
        } else {
            $activity->SetPattern(GANTT_SOLID, "red");
            $activity->progress->SetPattern(GANTT_RDIAG, "black");
            $activity->progress->SetFillColor("white");
        }
        // Set absolute height
        $activity->SetHeight(10);
        $activity->progress->Set($progress / 100);
        // Specify progress
        $activity->SetCSIMTarget("{$link}");
        $activity->SetCSIMAlt($progress . "% completed");
        $tempval2 = $_SERVER['PHP_SELF'];
        if ($sign != '') {
            $activity->title->SetCSIMTarget("javascript:projectGanttClick('{$pid}','{$sign}','{$tempval}', '{$gdate1}', '{$gdate2}', '{$tempval2}');");
        }
        //$activity->title->SetFont(FF_ARIAL,FS_NORMAL,9);
        $activity->title->SetCSIMAlt($progress . "% completed");
        $qconstraints = DB_query("SELECT pid FROM {$_TABLES['prj_projects']} WHERE parent_id='{$pid}' ORDER BY lhs ASC");
        $numconstraints = DB_numRows($qconstraints);
        if ($sign == '[-]') {
            for ($c = 1; $c <= $numconstraints; $c++) {
                list($testingThisPID) = DB_fetchArray($qconstraints);
                $tempPerms = prj_getProjectPermissions($testingThisPID, $userid);
                $tempOwner = getProjectToken($testingThisPID, $userid, "{$_TABLES['prj_users']}");
                $buffer = 0;
                if (array_keys($expanded, $pid) != array() && DB_count($_TABLES['prj_projects'], 'parent_id', $pid) > 0) {
                    if ($showTasksForExpandedProjects == 'true') {
                        if ($testMonitor == false) {
                            //my projects
                            if ($tempPerms['teammember'] == '1' || $tempPerms['full'] == '1' || $tempOwner != 0) {
                                prj_drawProjectTasksGanttBar($tmpg, $buffer, $tmpcount, $pid, $nameIndent, 0, 1, $sm, $stm);
                            }
                        } else {
                            //all projects
                            if ($tempPerms['monitor'] == '1' || $tempPerms['teammember'] == '1' || $tempPerms['full'] == '1' || $tempOwner != 0) {
                                prj_drawProjectTasksGanttBar($tmpg, $buffer, $tmpcount, $pid, $nameIndent, 0, 1, $sm, $stm);
                            }
                        }
                    }
                }
                if ($testMonitor == false) {
                    if ($tempPerms['teammember'] == '1' || $tempPerms['full'] == '1' || $tempOwner == '1') {
                        $activity->SetConstrain($row + $c + $buffer, CONSTRAIN_STARTSTART, "maroon4");
                    }
                } else {
                    if ($tempPerms['monitor'] == '1' || $tempPerms['teammember'] == '1' || $tempPerms['full'] == '1' || $tempOwner == '1') {
                        $activity->SetConstrain($row + $c + $buffer, CONSTRAIN_STARTSTART, "maroon4");
                    }
                }
            }
            //end for
        }
//.........这里部分代码省略.........
开发者ID:hostellerie,项目名称:nexpro,代码行数:101,代码来源:projects_gantt.php

示例7: foreach

     		$bar->setColor('gray');
     		$bar->SetFillColor('gray');
     		$bar->SetPattern(BAND_SOLID,'gray');
     		$bar->progress->SetFillColor('gray');
     		$bar->progress->SetPattern(BAND_SOLID,'gray',98);
     	}
     */
     $q->addTable('task_dependencies');
     $q->addQuery('dependencies_task_id');
     $q->addWhere('dependencies_req_task_id=' . $a['task_id']);
     $query = $q->loadList();
     foreach ($query as $dep) {
         // find row num of dependencies
         for ($d = 0; $d < count($gts); $d++) {
             if ($gts[$d][0]['task_id'] == $dep['dependencies_task_id']) {
                 $bar->SetConstrain($d, CONSTRAIN_ENDSTART);
             }
         }
     }
     unset($query);
     $q->clear();
     $graph->Add($bar);
 }
 unset($gts);
 $today = date('y-m-d');
 $vline = new GanttVLine($today, $AppUI->_('Today', UI_OUTPUT_RAW));
 if ($monospacefont) {
     $vline->title->SetFont(FF_DEJAVUMONO, FS_BOLD, $printpdfhr == '1' ? 12 : 8);
     //16); //8); //specify the use of VeraMono
 } else {
     $vline->title->SetFont(FF_DEJAVU, FS_BOLD, $printpdfhr == '1' ? 12 : 8);
开发者ID:hightechcompany,项目名称:dotproject,代码行数:31,代码来源:gantt_pdf.php

示例8: prj_drawGanttBar

function prj_drawGanttBar(&$graph, $pid, $tid = 0, &$row, &$count)
{
    global $_TABLES, $_CONF, $_PRJCONF;
    $sql = "SELECT tid,name,start_date, estimated_end_date,parent_task, progress, progress_id ";
    $sql .= "FROM {$_TABLES['prj_tasks']} ";
    if ($tid == 0) {
        $sql .= "WHERE pid={$pid} AND parent_task=0 ORDER BY lhs ASC";
    } else {
        $sql .= "WHERE parent_task='{$tid}' ORDER BY lhs ASC";
    }
    $result = DB_query($sql);
    for ($j = 0; $j < DB_numrows($result); $j++) {
        list($tid, $name, $startdate, $enddate, $parent_task, $progress, $status) = DB_fetchArray($result);
        $name = html_entity_decode($name);
        $strdate = strftime("%Y/%m/%d", $startdate);
        $edate = strftime("%Y/%m/%d", $enddate);
        $sql = "SELECT fullname FROM {$_TABLES['users']}, {$_TABLES['prj_task_users']} ";
        $sql .= "WHERE {$_TABLES['prj_task_users']}.tid={$tid} AND {$_TABLES['prj_task_users']}.uid={$_TABLES['users']}.uid";
        $result2 = DB_query($sql);
        list($owner) = DB_fetchArray($result2);
        $link = $_CONF['site_url'] . "/nexproject/viewproject.php?mode=view&id=" . $tid;
        $count = $count + 1;
        //echo "<br>Count:$count, row:$row";
        //$constrains[$j]=array($count, $parentcount, "CONSTRAIN_STARTEND");
        if (strlen($name) > $_PRJCONF['project_name_length']) {
            $name = substr($name, 0, $_PRJCONF['project_name_length']);
            $name .= "...";
        }
        if ($strdate == $edate) {
            $milestone = new Milestone($row, $name, $strdate);
            $milestone->mark->SetType(MARK_DIAMOND);
            $graph->Add($milestone);
        } else {
            $activity = new GanttBar($count, "{$name}", "{$strdate}", "{$edate}", "{$owner}");
            if ($status == 0) {
                // Yellow diagonal line pattern on a red background
                $activity->SetPattern(GANTT_SOLID, "darkgreen");
                $activity->progress->SetPattern(GANTT_RDIAG, "black");
                $activity->progress->SetFillColor("white");
            } elseif ($status == 1) {
                $activity->SetPattern(GANTT_SOLID, "yellow");
                $activity->progress->SetPattern(GANTT_RDIAG, "black");
                $activity->progress->SetFillColor("white");
            } else {
                $activity->SetPattern(GANTT_SOLID, "red");
                $activity->progress->SetPattern(GANTT_RDIAG, "black");
                $activity->progress->SetFillColor("white");
            }
            // Set absolute height
            $activity->SetHeight(10);
            $activity->progress->Set($progress / 100);
            // Specify progress
            $activity->SetCSIMTarget("{$link}");
            $activity->SetCSIMAlt($progress . "% completed");
            $activity->title->SetCSIMTarget("{$link}");
            $activity->title->SetCSIMAlt($progress . "% completed");
            $qconstraints = DB_query("SELECT tid FROM {$_TABLES['prj_tasks']} WHERE parent_task='{$tid}' ORDER BY lhs ASC");
            $numconstraints = DB_numRows($qconstraints);
            for ($c = 1; $c <= $numconstraints; $c++) {
                $activity->SetConstrain($row + $c, CONSTRAIN_STARTSTART, "maroon4");
            }
            // Add line to Gnatt Chart
            $graph->Add($activity);
        }
        $row++;
        if (DB_count($_TABLES['prj_tasks'], 'parent_task', $tid) > 0) {
            prj_drawGanttBar($graph, $pid, $tid, $row, $count);
        }
    }
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:70,代码来源:taskgantt.php

示例9: gantt_chart


//.........这里部分代码省略.........
                        $t_activity_arr['right'] = array('row' => $t_row, 'label' => "", 'start' => $t_range['max'], 'end' => $t_range['max'], 'info' => graph_date_format($t_end_date) . " ->" . $t_extra);
                    }
                }
            }
            switch ($t_activity_type) {
                case ACTYPE_NORMAL:
                    if (null != $t_activity_arr['left']) {
                        $t_activity_left = new GanttBar($t_activity_arr['left']['row'], $t_activity_arr['left']['label'], graph_date_format($t_activity_arr['left']['start']), graph_date_format($t_activity_arr['left']['end']), $t_activity_arr['left']['info']);
                        // Add a left marker
                        $t_activity_left->leftMark->Show();
                        $t_activity_left->leftMark->SetType(MARK_FILLEDCIRCLE);
                        $t_activity_left->leftMark->SetWidth(8);
                        //                        $t_activity_left->leftMark->SetColor( 'red' );
                        $t_activity_left->leftMark->SetFillColor('red');
                        $t_activity_left->leftMark->title->Set('');
                        $t_activity_left->leftMark->title->SetFont($t_graph_font, FS_NORMAL, 8);
                        $t_activity_left->leftMark->title->SetColor('white');
                        if (null != gantt_get_resolution_date($t_bug_id)) {
                            $t_activity_left->SetPattern(BAND_RDIAG, get_status_color(bug_get_field($t_bug_id, 'status')));
                        }
                        $t_activity_left->SetFillColor(get_status_color(bug_get_field($t_bug_id, 'status')));
                    }
                    if (null != $t_activity_arr['main']) {
                        $t_activity_main = new GanttBar($t_activity_arr['main']['row'], $t_activity_arr['main']['label'], graph_date_format($t_activity_arr['main']['start']), graph_date_format($t_activity_arr['main']['end']), $t_activity_arr['main']['info']);
                        if (null != gantt_get_resolution_date($t_bug_id)) {
                            $t_activity_main->SetPattern(BAND_RDIAG, get_status_color(bug_get_field($t_bug_id, 'status')));
                        }
                        $t_activity_main->SetFillColor(get_status_color(bug_get_field($t_bug_id, 'status')));
                        $t_activity_main->title->SetFont($t_graph_font, FS_NORMAL, 8);
                        // Set the constraint if any...
                        foreach ($t_constraints as $t_constraint) {
                            // ... and if possible
                            if (in_array($t_constraint['row'], $t_row_list)) {
                                $t_activity_main->SetConstrain($t_constraint['row'], $t_constraint['type']);
                            }
                        }
                        $graph->add($t_activity_main);
                    }
                    if (null != $t_activity_arr['right']) {
                        $t_activity_right = new GanttBar($t_activity_arr['right']['row'], $t_activity_arr['right']['label'], graph_date_format($t_activity_arr['right']['start']), graph_date_format($t_activity_arr['right']['end']), $t_activity_arr['right']['info']);
                        // Add a left marker
                        $t_activity_right->rightMark->Show();
                        $t_activity_right->rightMark->SetType(MARK_FILLEDCIRCLE);
                        $t_activity_right->rightMark->SetWidth(8);
                        $t_activity_right->rightMark->SetColor('red');
                        $t_activity_right->rightMark->SetFillColor('red');
                        $t_activity_right->rightMark->title->Set('');
                        $t_activity_right->rightMark->title->SetFont($t_graph_font, FS_NORMAL, 8);
                        $t_activity_right->rightMark->title->SetColor('white');
                        if (null != gantt_get_resolution_date($t_bug_id)) {
                            $t_activity_right->SetPattern(BAND_RDIAG, get_status_color(bug_get_field($t_bug_id, 'status')));
                        }
                        $t_activity_right->SetFillColor(get_status_color(bug_get_field($t_bug_id, 'status')));
                    }
                    if (isset($t_activity_left)) {
                        $graph->add($t_activity_left);
                    }
                    if (isset($t_activity_right)) {
                        $graph->add($t_activity_right);
                    }
                    break;
                case ACTYPE_MILESTONE:
                    $t_size = 5;
                    if ($t_start_date < $t_range['min']) {
                        $t_extra = "(<-- " . graph_date_format($t_start_date) . ")" . $t_extra;
                        $t_start_date = $t_range['min'];
开发者ID:martijnveen,项目名称:GanttChart,代码行数:67,代码来源:gantt_api.php


注:本文中的GanttBar::SetConstrain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。