/** * Get all elapsed time items for a specified task */ public function getListByTask($taskId, array $order = array(), array $filter = array()) { global $USER; $result = array(); if ($taskId = $this->checkTaskId($taskId)) { $result = Manager\Task\ElapsedTime::getList($USER->GetId(), $taskId); } return $result; }
public static function get($userId, $taskId, array $parameters) { $errors = static::ensureHaveErrorCollection($parameters); list($data, $can) = static::getBasic($userId, $taskId, $parameters); // select sub-entity related data if (!is_array($parameters['GET_PARAMETERS']['ENTITY_SELECT'])) { $parameters['GET_PARAMETERS']['ENTITY_SELECT'] = array('CHECKLIST', 'REMINDER', 'ELAPSEDTIME', 'LOG', 'TAG'); } $entitySelect = array_flip($parameters['GET_PARAMETERS']['ENTITY_SELECT']); if (isset($entitySelect['TAG'])) { $mgrResult = Task\Tag::getList($userId, $taskId); $data[static::SE_PREFIX . 'TAG'] = $mgrResult['DATA']; if (!empty($mgrResult['CAN'])) { $can[static::SE_PREFIX . 'TAG'] = $mgrResult['CAN']; } } if (isset($entitySelect['CHECKLIST'])) { $mgrResult = Task\CheckList::getList($userId, $taskId, $parameters); $data[static::SE_PREFIX . 'CHECKLIST'] = $mgrResult['DATA']; if (!empty($mgrResult['CAN'])) { $can[static::SE_PREFIX . 'CHECKLIST'] = $mgrResult['CAN']; } } if (isset($entitySelect['REMINDER'])) { $mgrResult = Task\Reminder::getList($userId, $taskId, $parameters); $data[static::SE_PREFIX . 'REMINDER'] = $mgrResult['DATA']; if (!empty($mgrResult['CAN'])) { $can[static::SE_PREFIX . 'REMINDER'] = $mgrResult['CAN']; } } if (isset($entitySelect['LOG'])) { $mgrResult = Task\Log::getList($userId, $taskId, $parameters); $data[static::SE_PREFIX . 'LOG'] = $mgrResult['DATA']; if (!empty($mgrResult['CAN'])) { $can[static::SE_PREFIX . 'LOG'] = $mgrResult['CAN']; } } if (isset($entitySelect['ELAPSEDTIME'])) { $mgrResult = Task\ElapsedTime::getList($userId, $taskId, $parameters); $data[static::SE_PREFIX . 'ELAPSEDTIME'] = $mgrResult['DATA']; if (!empty($mgrResult['CAN'])) { $can[static::SE_PREFIX . 'ELAPSEDTIME'] = $mgrResult['CAN']; } } // load ingoing and outgoing dependences separately here //static::injectIngoingDependenceFields($parameters, $mgrResult['DATA'], $mgrResult['CAN']); $subData = array($data['ID'] => &$data); $subCan = array($data['ID'] => &$can); static::injectTimemanFields($userId, $parameters, $subData, $subCan); return array('DATA' => $data, 'CAN' => $can, 'ERRORS' => $errors); }