/** * Return completed task lists * * @access public * @param void * @return array */ function getCompletedTaskLists() { if (logged_user()->isMemberOfOwnerCompany()) { return $this->getAllCompletedTaskLists(); } if (is_null($this->completed_task_lists)) { $this->completed_task_lists = ProjectTaskLists::findAll(array('conditions' => array('`project_id` = ? AND `completed_on` > ? AND `is_private` = ?', $this->getId(), EMPTY_DATETIME, 0), 'order' => '`order`')); // findAll } // if return $this->completed_task_lists; }
/** * Return all tasklists connected with this milestone * * @access public * @param void * @return array */ function getTaskLists() { return ProjectTaskLists::findAll(array('conditions' => '`milestone_id` = ' . DB::escape($this->getId()), 'order' => 'created_on')); // findAll }
/** * Return array of milestones for the month specified that the user has * access to. * * @access public * @param int $year * @param int $month * @return array */ function getTaskListsByMonth($year, $month) { $from_date = DateTimeValueLib::make(0, 0, 0, $month, 1, $year); $to_date = new DateTimeValue(strtotime('+1 month -1 day', $from_date->getTimestamp())); if (logged_user()->isMemberOfOwnerCompany()) { $conditions = array('`project_id` = ? AND (`due_date` >= ? AND `due_date` < ?)', $this->getId(), $from_date, $to_date); } else { $conditions = array('`project_id` = ? AND (`due_date` >= ? AND `due_date` < ?) AND `is_private` = ?', $this->getId(), $from_date, $to_date, 0); } return ProjectTaskLists::findAll(array( 'conditions' => $conditions, 'order' => 'due_date' )); // findAll } // getMilestonesByMonth