public function __get($property) { if ($property == 'status_type') { return org_openpsa_projects_workflow::get_status_type($this->status); } else { if ($property == 'status_comment' || $property == 'status_time') { if (is_null($this->_status)) { $this->_status = $this->_get_status(); } return $this->_status[$property]; } } return parent::__get($property); }
/** * Helper functions that gets the number of tasks for the different status types * * @return array The task status overview */ function get_task_count() { $numbers = array('not_started' => 0, 'ongoing' => 0, 'on_hold' => 0, 'closed' => 0, 'rejected' => 0); $task_mc = org_openpsa_projects_task_dba::new_collector('project', $this->id); $task_mc->add_constraint('orgOpenpsaObtype', '=', ORG_OPENPSA_OBTYPE_TASK); $statuses = $task_mc->get_values('status'); foreach ($statuses as $status) { $type = org_openpsa_projects_workflow::get_status_type($status); $numbers[$type]++; } return $numbers; }