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


PHP CProject::getTotalProjectHours方法代码示例

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


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

示例1: intval

 $none = false;
 $start_date = intval($row['project_start_date']) ? new w2p_Utilities_Date($row['project_start_date']) : null;
 $end_date = intval($row['project_end_date']) ? new w2p_Utilities_Date($row['project_end_date']) : null;
 $actual_end_date = intval($row['project_actual_end_date']) ? new w2p_Utilities_Date($row['project_actual_end_date']) : null;
 $style = $actual_end_date > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : '';
 $s = '<tr><td width="65" align="right" style="border: outset #eeeeee 1px;background-color:#' . $row['project_color_identifier'] . '"><font color="' . bestColor($row['project_color_identifier']) . '">' . sprintf('%.1f%%', $row['project_percent_complete']) . '</font></td>';
 $s .= '<td align="center">';
 if ($row['project_priority'] < 0) {
     $s .= '<img src="' . w2PfindImage('icons/priority-' . -$row['project_priority'] . '.gif') . '" width="13" height="16" alt="">';
 } elseif ($row['project_priority'] > 0) {
     $s .= '<img src="' . w2PfindImage('icons/priority+' . $row['project_priority'] . '.gif') . '"  width="13" height="16" alt="">';
 }
 $s .= '</td><td width="40%"><a href="?m=projects&a=view&project_id=' . $row['project_id'] . '" ><span title="' . (nl2br(htmlspecialchars($row['project_description'])) ? htmlspecialchars($row['project_name'], ENT_QUOTES) . '::' . nl2br(htmlspecialchars($row['project_description'])) : '') . '" >' . htmlspecialchars($row['project_name'], ENT_QUOTES) . '</span></a></td>';
 $s .= '<td width="30%"><a href="?m=companies&a=view&company_id=' . $row['project_company'] . '" ><span title="' . (nl2br(htmlspecialchars($row['company_description'])) ? htmlspecialchars($row['company_name'], ENT_QUOTES) . '::' . nl2br(htmlspecialchars($row['company_description'])) : '') . '" >' . htmlspecialchars($row['company_name'], ENT_QUOTES) . '</span></a></td>';
 $s .= '<td nowrap="nowrap" align="center">' . ($start_date ? $start_date->format($df) : '-') . '</td>';
 $s .= '<td nowrap="nowrap" align="right">' . $project->getTotalProjectHours() . $AppUI->_('h') . '</td>';
 $s .= '<td nowrap="nowrap" align="center" nowrap="nowrap" style="background-color:' . $priority[$row['project_priority']]['color'] . '">';
 $s .= $end_date ? $end_date->format($df) : '-';
 $s .= '</td><td nowrap="nowrap" align="center">';
 $s .= $actual_end_date ? '<a href="?m=tasks&a=view&task_id=' . $row['critical_task'] . '">' : '';
 $s .= $actual_end_date ? '<span ' . $style . '>' . $actual_end_date->format($df) . '</span>' : '-';
 $s .= $actual_end_date ? '</a>' : '';
 $s .= '</td><td align="center">';
 $s .= $row['task_log_problem'] ? '<a href="?m=tasks&a=index&f=all&project_id=' . $row['project_id'] . '">' : '';
 $s .= $row['task_log_problem'] ? w2PshowImage('icons/dialog-warning5.png', 16, 16, 'Problem', 'Problem') : '-';
 $s .= $row['task_log_problem'] ? '</a>' : '';
 $s .= '</td><td align="center" nowrap="nowrap">' . htmlspecialchars($row['owner_name'], ENT_QUOTES) . '</td>';
 $s .= '<td align="center" nowrap="nowrap">';
 $s .= $row['project_task_count'];
 $s .= '</td><td align="left" nowrap="nowrap">' . $AppUI->_($pstatus[$row['project_status']]) . '</td></tr>';
 echo $s;
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:departments_tab.view.projects.php

示例2: intval

 $projectPriority = w2PgetSysVal('ProjectPriority');
 $projectPriorityColor = w2PgetSysVal('ProjectPriorityColor');
 $pstatus = w2PgetSysVal('ProjectStatus');
 $ptype = w2PgetSysVal('ProjectType');
 // load the record data
 $obj->loadFull($AppUI, $project_id);
 if (!$obj) {
     $AppUI->setMsg('Project');
     $AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
     $AppUI->redirect();
 } else {
     $AppUI->savePlace();
 }
 $worked_hours = $obj->project_worked_hours;
 $total_hours = $obj->getTotalHours();
 $total_project_hours = $obj->getTotalProjectHours();
 // create Date objects from the datetime fields
 $start_date = intval($obj->project_start_date) ? new CDate($obj->project_start_date) : null;
 $end_date = intval($obj->project_end_date) ? new CDate($obj->project_end_date) : null;
 $actual_end_date = intval($criticalTasks[0]['task_end_date']) ? new CDate($criticalTasks[0]['task_end_date']) : null;
 $today = new CDate();
 $style = $actual_end_date > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : '';
 $style = $obj->project_percent_complete < 99.98999999999999 && $today > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : $style;
 // setup the title block
 $ttl = 'ProjectDesigner';
 $titleBlock = new CTitleBlock($ttl, 'projectdesigner.png', $m, $m . '.' . $a);
 $titleBlock->addCrumb('?m=projects', 'projects list');
 $titleBlock->addCrumb('?m=' . $m, 'select another project');
 $titleBlock->addCrumb('?m=projects&a=view&bypass=1&project_id=' . $project_id, 'normal view project');
 if ($canAddProject) {
     $titleBlock->addCell();
开发者ID:joly,项目名称:web2project,代码行数:31,代码来源:index.php

示例3: storeTokenTask

 /**
  *
  * @param CAppUI $AppUI
  * @param CProject $projectId
  *
  * The point of this function is to create/update a task to represent a
  *   subproject.
  *
  */
 public static function storeTokenTask(CAppUI $AppUI, $project_id)
 {
     $subProject = new CProject();
     $subProject->load($project_id);
     if ($subProject->project_id != $subProject->project_parent) {
         $q = new w2p_Database_Query();
         $q->addTable('tasks');
         $q->addQuery('MIN(task_start_date) AS min_task_start_date');
         $q->addQuery('MAX(task_end_date) AS max_task_end_date');
         $q->addWhere('task_project = ' . $subProject->project_id);
         $projectDates = $q->loadList();
         $q->clear();
         $q->addTable('tasks');
         $q->addQuery('task_id');
         $q->addWhere('task_represents_project = ' . $subProject->project_id);
         $task_id = $q->loadResult();
         $task = new CTask();
         if ($task_id) {
             $task->load($task_id);
         } else {
             $task->task_description = $task->task_name;
             $task->task_priority = $subProject->project_priority;
             $task->task_project = $subProject->project_parent;
             $task->task_represents_project = $subProject->project_id;
             $task->task_owner = $AppUI->user_id;
         }
         $task->task_name = $AppUI->_('Subproject') . ': ' . $subProject->project_name;
         $task->task_duration_type = 1;
         $task->task_duration = $subProject->getTotalProjectHours();
         $task->task_start_date = $projectDates[0]['min_task_start_date'];
         $task->task_end_date = $projectDates[0]['max_task_end_date'];
         $task->task_percent_complete = $subProject->project_percent_complete;
         $result = $task->store($AppUI);
         //TODO: we should do something with this store result?
     }
 }
开发者ID:eureka2,项目名称:web2project,代码行数:45,代码来源:tasks.class.php

示例4: CTask

$obj = $project;
if (!$project) {
    $AppUI->setMsg('Project');
    $AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
    $AppUI->redirect();
} else {
    $AppUI->savePlace();
}
global $w2Pconfig;
$task = new CTask();
$q = new w2p_Database_Query();
$q->clear();
$hasTasks = $project->project_task_count;
if ($hasTasks) {
    $worked_hours = $project->project_worked_hours;
    $total_project_hours = $project->getTotalProjectHours();
} else {
    //no tasks in project so "fake" project data
    $worked_hours = $total_hours = $total_project_hours = 0.0;
}
global $task_access;
$extra = array(0 => '(none)', 1 => 'Milestone', 2 => 'Dynamic Task', 3 => 'Inactive Task');
//Though we are in suppressHeaders mode, we should properly set the HTML Headers
//For this report.
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta name="Description" content="web2Project Default Style" />
        <meta name="Version" content="<?php 
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:printproject.php


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