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


PHP CTask::updateHoursWorked2方法代码示例

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


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

示例1: updateHoursWorked

 /**
  * @deprecated
  */
 public static function updateHoursWorked($taskId, $totalHours)
 {
     trigger_error("CTask::updateHoursWorked() has been deprecated in v3.1 and will be removed by v4.0. Please use CTask->updateHoursWorked2() instead.", E_USER_NOTICE);
     $task = new CTask();
     $task->updateHoursWorked2($taskId, $totalHours);
 }
开发者ID:victorrod,项目名称:web2project,代码行数:9,代码来源:tasks.class.php

示例2: updateTaskSummary

 /**
  * Updates the variable information on the task.
  *
  * @param int $notUsed not used
  * @param int $task_id that task id of task this task log is for
  *
  * @return void
  *
  * @access protected
  */
 protected function updateTaskSummary($notUsed = null, $task_id)
 {
     $task = new CTask();
     $task->overrideDatabase($this->_query);
     $task->load($task_id);
     $q = $this->_getQuery();
     if ($this->_perms->checkModuleItem('tasks', 'edit', $task_id)) {
         if ($this->task_log_percent_complete <= 100) {
             $q->addQuery('task_log_percent_complete, task_log_date');
             $q->addTable('task_log');
             $q->addWhere('task_log_task = ' . (int) $task_id);
             $q->addOrder('task_log_date DESC, task_log_id DESC');
             $q->setLimit(1);
             $results = $q->loadHash();
             $percentComplete = $results['task_log_percent_complete'];
         } else {
             $percentComplete = 100;
         }
         $old_end_date = new w2p_Utilities_Date($task->task_end_date);
         $new_end_date = new w2p_Utilities_Date($this->task_log_task_end_date);
         $new_end_date->setHour($old_end_date->getHour());
         $new_end_date->setMinute($old_end_date->getMinute());
         $task_end_date = $new_end_date->format(FMT_DATETIME_MYSQL);
         /*
          * We're using a database update here instead of store() because a
          *   bunch of other things happen when you call store().. like the
          *   processing of contacts, departments, etc.
          */
         $q = $this->_getQuery();
         $q->addTable('tasks');
         $q->addUpdate('task_percent_complete', $percentComplete);
         $q->addUpdate('task_end_date', $task_end_date);
         $q->addWhere('task_id = ' . (int) $task_id);
         $success = $q->exec();
         if (!$success) {
             $this->_AppUI->setMsg($task->getError(), UI_MSG_ERROR, true);
         }
         $task->pushDependencies($task_id, $task_end_date);
     }
     $q->addQuery('SUM(task_log_hours)');
     $q->addTable('task_log');
     $q->addWhere('task_log_task = ' . (int) $task_id);
     $totalHours = $q->loadResult();
     $task->updateHoursWorked2($task_id, $totalHours);
     $task->updateDynamics();
 }
开发者ID:illuminate3,项目名称:web2project,代码行数:56,代码来源:logs.class.php


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