/** * Method to get a list of project items: * Milestones and tasks * * @return array */ protected static function getProjectDetails() { $pid = self::$project; $milestones = modPFcalendarHelperMilestones::getItems($pid); $tasks = modPFcalendarHelperTasks::getItems($pid); // Sort data by hierarchy $items = self::sortByHierarchy($milestones, $tasks); return $items; }
/** * Method to get the end date of a task * based on the parent list, milestone or project. * * @param integer $id The task id * @param integer $ms The parent milestone id * @param string $ms_date The parent milestone end date * * @return string The end date */ public static function getEndDate($id, $ms = 0, $ms_date = null) { static $cache = array(); // Check the cache if (isset($cache[$id])) { return $cache[$id]; } $nd = JFactory::getDbo()->getNullDate(); if (!empty($ms_date) && $ms_date != $nd) { return $ms_date; } elseif ($ms) { $date = modPFcalendarHelperMilestones::getEndDate($ms); } else { $date = modPFcalendarHelper::$project_end; } $cache[$id] = $date; return $cache[$id]; }