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


PHP GanttBar::SetCSIMAlt方法代码示例

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


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

示例1: prj_drawProjectTasksGanttBar

function prj_drawProjectTasksGanttBar(&$graph, &$row, &$count, $pid = 0, $nameIndent = '', $tid = 0, $sampleCounting = 0, $sm, $stm)
{
    global $_TABLES, $_CONF, $showMonitor, $showTeamMember, $userid, $_PRJCONF, $filterCSV;
    $sql = 'SELECT tid,name,start_date, estimated_end_date,parent_task, progress, progress_id ';
    $sql .= "FROM {$_TABLES['prj_tasks']} ";
    if ($pid == 0) {
        $sql .= 'WHERE pid=0 ';
    } else {
        $sql .= "WHERE pid='{$pid}' ";
    }
    $sql .= "and parent_task={$tid} ";
    if ($filterCSV != '') {
        $sql .= "AND  {$_TABLES['prj_tasks']}.pid  in ({$filterCSV}) ";
    }
    $sql .= ' ORDER BY lhs ASC';
    $result = DB_query($sql, true);
    $testnumrows = DB_numRows($result);
    if ($testnumrows == 0) {
        //this is to help overcome any COOKIE issues with the filtercsv
        $sql = 'SELECT tid,name,start_date, estimated_end_date,parent_task, progress, progress_id ';
        $sql .= "FROM {$_TABLES['prj_tasks']} ";
        if ($pid == 0) {
            $sql .= 'WHERE pid=0 ';
        } else {
            $sql .= "WHERE pid='{$pid}' ";
        }
        $sql .= "and parent_task={$tid} ";
        $sql .= ' 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);
        $permsArray = prj_getProjectPermissions($pid, $userid, $tid);
        $ownertoken = getTaskToken($tid, $userid, "{$_TABLES['prj_task_users']}", "{$_TABLES['prj_tasks']}");
        if ($sm == '1' && $stm == '1') {
            // all projects
            if ($permsArray['monitor'] == '1' || $permsArray['teammember'] == '1' || $ownertoken != 0) {
                $name = html_entity_decode($name);
                $strdate = strftime("%Y/%m/%d", $startdate);
                $edate = strftime("%Y/%m/%d", $enddate);
                $sql = "SELECT c.fullname ";
                $sql .= "FROM {$_TABLES['prj_task_users']} a ";
                $sql .= "INNER JOIN {$_TABLES['prj_tasks']} b on a.tid=b.tid ";
                $sql .= "INNER JOIN {$_TABLES['users']} c on a.uid=c.uid ";
                $sql .= "WHERE a.role='o' AND a.tid={$tid} ";
                $result2 = DB_query($sql);
                list($owner) = DB_fetchArray($result2);
                $link = $_CONF['site_url'] . "/nexproject/viewproject.php?mode=view&id=" . $tid;
                $count = $count + 1;
                if (strlen($name) > $_PRJCONF['project_name_length']) {
                    $name = substr($name, 0, $_PRJCONF['project_name_length']);
                    $name .= "...";
                }
                $name = $nameIndent . $name;
                if ($strdate == $edate) {
                    $milestone = new Milestone($row, $name, $strdate);
                    $milestone->mark->SetType(MARK_DIAMOND);
                    $graph->Add($milestone);
                } else {
                    $taskActivity = new GanttBar($count, $name, "{$strdate}", "{$edate}", "");
                    if ($status == 0) {
                        // Yellow diagonal line pattern on a red background
                        $taskActivity->SetPattern(BAND_RDIAG, "green");
                        $taskActivity->progress->SetPattern(GANTT_RDIAG, "black");
                        $taskActivity->progress->SetFillColor("white");
                    } elseif ($status == 1) {
                        $taskActivity->SetPattern(BAND_RDIAG, "yellow");
                        $taskActivity->progress->SetPattern(GANTT_RDIAG, "black");
                        $taskActivity->progress->SetFillColor("white");
                    } else {
                        $taskActivity->SetPattern(BAND_RDIAG, "red");
                        $taskActivity->progress->SetPattern(GANTT_RDIAG, "black");
                        $taskActivity->progress->SetFillColor("white");
                    }
                    $taskActivity->caption->SetFont(FF_FONT1, FS_NORMAL, 10);
                    $taskActivity->caption->SetColor('black');
                    $taskActivity->caption->Set($name);
                    // Set absolute height
                    $taskActivity->SetHeight(10);
                    $taskActivity->progress->Set($progress / 100);
                    // Specify progress
                    $taskActivity->SetCSIMTarget("{$link}");
                    $taskActivity->SetCSIMAlt($progress . "% completed");
                    $tempval = $_GET['expanded'];
                    $tempval2 = $_SERVER['PHP_SELF'];
                    $taskActivity->title->SetCSIMTarget("");
                    $taskActivity->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++) {
                        //$taskActivity->SetConstrain($row+$c,CONSTRAIN_STARTSTART,"maroon4");
                    }
                    // Add line to Gantt Chart
                    if (!$sampleCounting) {
                        $graph->Add($taskActivity);
                    }
                }
                $row++;
            }
        } else {
//.........这里部分代码省略.........
开发者ID:hostellerie,项目名称:nexpro,代码行数:101,代码来源:projects_gantt.php

示例2: 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


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