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


PHP CTask::pushDependencies方法代码示例

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


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

示例1:

         $result = $upd_task->store($AppUI);
         if (is_array($result)) {
             break;
         }
         $upd_task->shiftDependentTasks();
     }
 }
 //Action: Modify End Date
 if (isset($_POST['add_task_bulk_end_date']) && $bulk_task_end_date != '' && $bulk_end_date) {
     if ($upd_task->task_id) {
         $upd_task->task_end_date = $bulk_end_date;
         $result = $upd_task->store($AppUI);
         if (is_array($result)) {
             break;
         }
         $upd_task->pushDependencies($upd_task->task_id, $upd_task->task_end_date);
     }
 }
 //Action: Modify Start Date
 if (isset($_POST['add_task_bulk_start_date']) && $bulk_task_start_date != '' && $bulk_start_date) {
     if ($upd_task->task_id) {
         $upd_task->task_start_date = $bulk_start_date;
         $result = $upd_task->store($AppUI);
         if (is_array($result)) {
             break;
         }
     }
 }
 //Action: Modify Duration
 if (isset($_POST['bulk_task_duration']) && $bulk_task_duration != '' && is_numeric($bulk_task_duration)) {
     if ($upd_task->task_id) {
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:do_task_bulk_aed.php

示例2: executePost


//.........这里部分代码省略.........
         } elseif ($tmp[0] != '') {
             $hperc_assign_ar[$tmp[0]] = 100;
         }
     }
     // let's check if there are some assigned departments to task
     $task->task_departments = implode(',', $this->getParam('dept_ids', self::TYPE_ARRAY));
     // convert dates to SQL format first
     if ($task->task_start_date) {
         $date = new w2p_Utilities_Date($task->task_start_date);
         $task->task_start_date = $date->format(FMT_DATETIME_MYSQL);
     }
     $end_date = null;
     if ($task->task_end_date) {
         if (strpos($task->task_end_date, '2400') !== false) {
             $task->task_end_date = str_replace('2400', '2359', $task->task_end_date);
         }
         $end_date = new w2p_Utilities_Date($task->task_end_date);
         $task->task_end_date = $end_date->format(FMT_DATETIME_MYSQL);
     }
     $error_array = $task->store($AppUI);
     // Return all the validation messages
     if ($error_array !== true) {
         $error_message = '';
         foreach ($error_array as $error) {
             $error_message .= $error . '. ';
         }
         throw new Frapi_Error('SAVE_ERROR', $error_message);
     }
     $task_parent = $this->getParam('task_parent') ? $this->getParam('task_parent', SELF::TYPE_INT) : 0;
     $old_task_parent = $this->getParam('old_task_parent') ? $this->getParam('old_task_parent', SELF::TYPE_INT) : 0;
     if ($task_parent != $old_task_parent) {
         $oldTask = new CTask();
         $oldTask->load($old_task_parent);
         $oldTask->updateDynamics(false);
     }
     // How to handle custom fields? Do we support it in api?
     // Now add any task reminders
     // If there wasn't a task, but there is one now, and
     // that task date is set, we need to set a reminder.
     if (empty($task_end_date) || !empty($end_date) && $task_end_date->dateDiff($end_date)) {
         $task->addReminder();
     }
     if (isset($hassign)) {
         $task->updateAssigned($hassign, $hperc_assign_ar);
     }
     if (isset($hdependencies)) {
         // && !empty($hdependencies)) {
         // there are dependencies set!
         // backup initial start and end dates
         $tsd = new w2p_Utilities_Date($task->task_start_date);
         $ted = new w2p_Utilities_Date($task->task_end_date);
         // updating the table recording the
         // dependency relations with this task
         $task->updateDependencies($hdependencies, $task_parent);
         // we will reset the task's start date based upon dependencies
         // and shift the end date appropriately
         if ($adjustStartDate && !is_null($hdependencies)) {
             // load already stored task data for this task
             $tempTask = new CTask();
             $tempTask->load($task->task_id);
             // shift new start date to the last dependency end date
             $nsd = new w2p_Utilities_Date($tempTask->get_deps_max_end_date($tempTask));
             // prefer Wed 8:00 over Tue 16:00 as start date
             $nsd = $nsd->next_working_day();
             // prepare the creation of the end date
             $ned = new w2p_Utilities_Date();
             $ned->copy($nsd);
             if (empty($task->task_start_date)) {
                 // appropriately calculated end date via start+duration
                 $ned->addDuration($task->task_duration, $task->task_duration_type);
             } else {
                 // calc task time span start - end
                 $d = $tsd->calcDuration($ted);
                 // Re-add (keep) task time span for end date.
                 // This is independent from $obj->task_duration.
                 // The value returned by Date::Duration() is always in hours ('1')
                 $ned->addDuration($d, '1');
             }
             // prefer tue 16:00 over wed 8:00 as an end date
             $ned = $ned->prev_working_day();
             $task->task_start_date = $nsd->format(FMT_DATETIME_MYSQL);
             $task->task_end_date = $ned->format(FMT_DATETIME_MYSQL);
             $q = new w2p_Database_Query();
             $q->addTable('tasks', 't');
             $q->addUpdate('task_start_date', $task->task_start_date);
             $q->addUpdate('task_end_date', $task->task_end_date);
             $q->addWhere('task_id = ' . (int) $task->task_id);
             $q->addWhere('task_dynamic <> 1');
             $q->exec();
             $q->clear();
         }
         $task->pushDependencies($task->task_id, $task->task_end_date);
     }
     //$task = (array)$task;
     $task->load($task_id);
     unset($task->_query, $task->_error, $task->_tbl_prefix, $task->_tbl, $task->_tbl_key, $task->_tbl_module);
     $this->data['task'] = $task;
     $this->data['success'] = true;
     return $this->toArray();
 }
开发者ID:robertbasic,项目名称:web2project-api,代码行数:101,代码来源:Task.php

示例3: updateTaskSummary

 /**
  * Updates the variable information on the task.
  *
  * @param int $task_log_task that task id of task this task log is for
  *
  * @return void
  *
  * @access private
  */
 protected function updateTaskSummary($AppUI = null, $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;
         }
         $task = new CTask();
         $task->overrideDatabase($this->_query);
         $task->load($task_id);
         $task->task_percent_complete = $percentComplete;
         $diff = strtotime($this->task_log_task_end_date) - strtotime($task->task_end_date);
         $task->task_end_date = 0 == $diff ? $task->task_end_date : $this->task_log_task_end_date;
         $success = $task->store();
         if (!$success) {
             $this->_AppUI->setMsg($task->getError(), UI_MSG_ERROR, true);
         }
         $task->pushDependencies($task_id, $task->task_end_date);
     }
     $q->addQuery('SUM(task_log_hours)');
     $q->addTable('task_log');
     $q->addWhere('task_log_task = ' . (int) $task_id);
     $totalHours = $q->loadResult();
     CTask::updateHoursWorked($task_id, $totalHours);
 }
开发者ID:,项目名称:,代码行数:42,代码来源:

示例4:

         $new_date = new w2p_Utilities_Date($_POST['task_end_date']);
         $new_date->setTime($task_end_date->hour, $task_end_date->minute, $task_end_date->second);
         $task->task_end_date = $new_date->format(FMT_DATETIME_MYSQL);
     }
     if ($task->task_percent_complete >= 100 && (!$task->task_end_date || $task->task_end_date == '0000-00-00 00:00:00')) {
         $task->task_end_date = $obj->task_log_date;
     }
     $msg = $task->store($AppUI);
     if (is_array($msg)) {
         $AppUI->setMsg($msg, UI_MSG_ERROR, true);
     }
     $new_task_end = new w2p_Utilities_Date($task->task_end_date);
     if ($new_task_end->dateDiff($task_end_date)) {
         $task->addReminder();
     }
     $task->pushDependencies($task->task_id, $task->task_end_date);
 }
 if ('on' == $notify_owner) {
     if ($msg = $task->notifyOwner()) {
         $AppUI->setMsg($msg, UI_MSG_ERROR);
     }
 }
 // Check if we need to email the task log to anyone.
 $email_assignees = w2PgetParam($_POST, 'email_assignees', null);
 $email_task_contacts = w2PgetParam($_POST, 'email_task_contacts', null);
 $email_project_contacts = w2PgetParam($_POST, 'email_project_contacts', null);
 $email_others = w2PgetParam($_POST, 'email_others', '');
 $email_log_user = w2PgetParam($_POST, 'email_log_user', '');
 $task_log_creator = (int) w2PgetParam($_POST, 'task_log_creator', 0);
 $email_extras = w2PgetParam($_POST, 'email_extras', null);
 // Email the user this task log is being created for, might not be the person
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:do_updatetask.php

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

示例6: updateTaskSummary

 /**
  * Updates the variable information on the task.
  *
  * @param int $task_log_task that task id of task this task log is for
  *
  * @return void
  *
  * @access private
  */
 private function updateTaskSummary(CAppUI $AppUI, $task_id)
 {
     $perms = $AppUI->acl();
     $q = $this->_query;
     if ($perms->checkModuleItem('tasks', 'edit', $task_id)) {
         if ($this->task_log_percent_complete < 100) {
             $q->addQuery('task_log_percent_complete, task_log_date, task_log_task_end_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();
             $q->clear();
             $percentComplete = $results['task_log_percent_complete'];
             /*
              * TODO: In theory, we shouldn't just use the task_log_task_end_date, 
              *   because if we're after that date and someone is still adding 
              *   logs to a task, obviously the task isn't complete. We may want 
              *   to check to see if task_log_date > task_log_task_end_date and 
              *   use the later one as the end date.. not sure yet.
              */
             $taskEndDate = $results['task_log_task_end_date'];
         } else {
             $percentComplete = 100;
             $taskEndDate = $this->task_log_date;
         }
         $task = new CTask();
         $task->load($task_id);
         $task->task_percent_complete = $percentComplete;
         $task->task_end_date = $taskEndDate;
         $msg = $task->store($AppUI);
         if (is_array($msg)) {
             $AppUI->setMsg($msg, UI_MSG_ERROR, true);
         }
         $task->pushDependencies($task_id, $task->task_end_date);
     }
     $q->addQuery('SUM(task_log_hours)');
     $q->addTable('task_log');
     $q->addWhere('task_log_task = ' . (int) $task_log_task);
     $totalHours = $q->loadResult();
     CTask::updateHoursWorked($task_id, $totalHours);
 }
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:51,代码来源:tasklogs.class.php


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