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


PHP CTask::getAllowedTaskList方法代码示例

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


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

示例1: intval

 if ($showLabels) {
     $caption .= $AppUI->_($projectStatus[$p['project_status']]) . ', ';
     $caption .= $p['project_active'] != 0 ? $AppUI->_('active') : $AppUI->_('archived');
 }
 $enddate = new w2p_Utilities_Date($end);
 $startdate = new w2p_Utilities_Date($start);
 $actual_end = intval($p['project_actual_end_date']) ? $p['project_actual_end_date'] : $end;
 $columnValues = array('project_name' => $pname, 'start_date' => $start, 'end_date' => $end, 'actual_end' => $actual_end);
 $gantt->addBar($columnValues, $caption, 0.6, $p['project_color_identifier'], $p['project_active'], $progress, $p['project_id']);
 // If showAllGant checkbox is checked
 if ($showAllGantt) {
     // insert tasks into Gantt Chart
     // select for tasks for each project
     $task = new CTask();
     $orderBy = $sortTasksByName ? 'task_name' : 'task_end_date ASC';
     $tasks = $task->getAllowedTaskList($AppUI, $p['project_id'], $orderBy);
     $bestColor = bestColor('#ffffff', '#' . $p['project_color_identifier'], '#000000');
     foreach ($tasks as $t) {
         $name = $t['task_name'];
         $name = mb_strlen($name) > 34 ? mb_substr($name, 0, 30) . '...' : $name;
         //Check if start date exists, if not try giving it the end date.
         //If the end date does not exist then set it for today.
         //This avoids jpgraphs internal errors that render the gantt completely useless
         if ($t['task_start_date'] == '0000-00-00 00:00:00') {
             if ($t['task_end_date'] == '0000-00-00 00:00:00') {
                 $todaydate = new w2p_Utilities_Date();
                 $t['task_start_date'] = $todaydate->format(FMT_TIMESTAMP_DATE);
             } else {
                 $t['task_start_date'] = $t['task_end_date'];
             }
         }
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:gantt.php

示例2: foreach

 case 'projects':
     $project_company = w2PgetParam($_GET, 'project_company', 0);
     if ($user_id > 0) {
         $projectList = CContact::getProjects($user_id);
     } else {
         $projectList = CCompany::getProjects($AppUI, $project_company);
     }
     foreach ($projectList as $project) {
         $resultList[$project['project_id']] = $project['project_name'];
     }
     break;
 case 'tasks':
     $title = 'Task';
     $task_project = (int) w2PgetParam($_GET, 'task_project', 0);
     $myTask = new CTask();
     $task_list = $myTask->getAllowedTaskList($AppUI, $task_project);
     $level = 0;
     $query_result = array();
     $last_parent = 0;
     foreach ($task_list as $task) {
         if ($task['task_parent'] != $task['task_id']) {
             if ($last_parent != $task['task_parent']) {
                 $last_parent = $task['task_parent'];
                 $level++;
             }
         } else {
             $last_parent = 0;
             $level = 0;
         }
         $query_result[$task['task_id']] = ($level ? str_repeat('  ', $level) : '') . $task['task_name'];
     }
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:selector.php

示例3: CTask

echo $AppUI->_('Target Budget');
?>
</th>
        <th width="10px" align="center"><?php 
echo $AppUI->_('Actual Cost');
?>
</th>
        <th width="10px" align="center"><?php 
echo $AppUI->_('Difference');
?>
</th>
    </tr>
    <?php 
//TODO: rotate the headers by 90 degrees?
$task = new CTask();
$taskList = $task->getAllowedTaskList(null, $project_id);
$bcode = new CSystem_Bcode();
if (count($taskList)) {
    foreach ($taskList as $taskItem) {
        $task->loadFull(null, $taskItem['task_id']);
        $costs = $bcode->calculateTaskCost($taskItem['task_id'], $start_date->format(FMT_DATETIME_MYSQL), $end_date->format(FMT_DATETIME_MYSQL));
        $tstart = new w2p_Utilities_Date($task->task_start_date);
        $tend = new w2p_Utilities_Date($task->task_end_date);
        $filterStart = $start_date;
        $filterEnd = $end_date;
        $workingDaysInSpans = $filterStart->findDaysInRangeOverlap($tstart, $tend, $filterStart, $filterEnd);
        $workingDaysForTask = $tstart->workingDaysInSpan($tend);
        $factor = $workingDaysInSpans / $workingDaysForTask;
        $factor = $factor > 1 ? 1 : $factor;
        ?>
<tr>
开发者ID:,项目名称:,代码行数:31,代码来源:

示例4: array

     $end = $start;
     $caption .= ' ' . $AppUI->_('(no end date)');
 }
 if ($showLabels == '1') {
     $caption .= $AppUI->_($projectStatus[$p['project_status']]) . ', ';
     $caption .= $p['project_active'] ? $AppUI->_('active') : $AppUI->_('archived');
 }
 $columnValues = array('project_name' => $pname, 'start_date' => $start, 'end_date' => $end, 'actual_end' => $actual_end);
 $gantt->addBar($columnValues, $caption, 0.6, $p['project_color_identifier'], $p['project_active'], $progress, $p['project_id']);
 // If showAllGant checkbox is checked
 if ($showAllGantt) {
     // insert tasks into Gantt Chart
     // select for tasks for each project
     $task = new CTask();
     $orderBy = $sortTasksByName ? 'task_name' : 'task_end_date ASC';
     $tasks = $task->getAllowedTaskList(null, $p['project_id'], $orderBy);
     $bestColor = bestColor('#ffffff', '#' . $p['project_color_identifier'], '#000000');
     foreach ($tasks as $t) {
         $name = $t['task_name'];
         $name = mb_strlen($name) > 34 ? mb_substr($name, 0, 30) . '...' : $name;
         $t['task_start_date'] = __extract_from_projects_gantt3($t);
         $t['task_end_date'] = __extract_from_projects_gantt4($t);
         if ($t['task_milestone'] != 1) {
             $columnValues = array('task_name' => $name, 'start_date' => $t['task_start_date'], 'end_date' => $t['task_end_date'], 'actual_end' => '');
             $height = $t['task_dynamic'] == 1 ? 0.1 : 0.6;
             $gantt->addBar($columnValues, $t['task_percent_complete'] . '% ' . $AppUI->_('Complete'), $height, $p['project_color_identifier'], $p['project_active'], $t['task_percent_complete'], $t['task_id']);
         } else {
             $gantt->addMilestone(array('-- ' . $name), $t['task_start_date']);
         }
         $task->task_id = $t['task_id'];
         $workers = $task->assignees($task->task_id);
开发者ID:illuminate3,项目名称:web2project,代码行数:31,代码来源:gantt.php

示例5: foreach

 case 'projects':
     $project_company = w2PgetParam($_GET, 'project_company', 0);
     if ($user_id > 0) {
         $projectList = CContact::getProjects($user_id);
     } else {
         $projectList = CCompany::getProjects($AppUI, $project_company);
     }
     foreach ($projectList as $project) {
         $resultList[$project['project_id']] = $project['project_name'];
     }
     break;
 case 'tasks':
     $title = 'Task';
     $task_project = (int) w2PgetParam($_GET, 'task_project', 0);
     $myTask = new CTask();
     $task_list = $myTask->getAllowedTaskList(null, $task_project);
     $level = 0;
     $query_result = array();
     $last_parent = 0;
     foreach ($task_list as $task) {
         if ($task['task_parent'] != $task['task_id']) {
             if ($last_parent != $task['task_parent']) {
                 $last_parent = $task['task_parent'];
                 $level++;
             }
         } else {
             $last_parent = 0;
             $level = 0;
         }
         $query_result[$task['task_id']] = ($level ? str_repeat('&nbsp;&nbsp;', $level) : '') . $task['task_name'];
     }
开发者ID:illuminate3,项目名称:web2project,代码行数:31,代码来源:selector.php


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