/** * @see ProjectInterface::mark_as_reactivated() * @return bool */ public function mark_as_reactivated() { if ($this->project_id and $this->project) { $project_has_project_status_pk = ProjectHasProjectStatus_Access::list_entries_by_project_id($this->project_id); $project_has_project_status = new ProjectHasProjectStatus_Access($project_has_project_status_pk[count($project_has_project_status_pk) - 1]); if ($project_has_project_status->delete() == true) { $project_log = new ProjectLog(null); $project_log->create($this->project_id, "Project Reactivated", false, true); $project_log->link_status(0); return true; } else { return false; } } else { return false; } }
/** * @see ProjectItemInterface::create_log_entry() * @return bool */ public function create_log_entry() { global $transaction; if ($this->project_id and $this->item_id) { $transaction_id = $transaction->begin(); if ($this->project_log_id) { $project_log_id = $this->project_log_id; } else { $project_log = new ProjectLog(null); if (($project_log_id = $project_log->create($this->project_id, null, false, false, md5(rand(0, 32768)))) == false) { if ($transaction_id != null) { $transaction->rollback($transaction_id); } return false; } $this->project_log_id = $project_log_id; } $project_log_has_item = new ProjectLogHasItem($project_log_id); if ($project_log_has_item->link_item($this->item_id) == false) { if ($transaction_id != null) { $transaction->rollback($transaction_id); } return false; } else { if ($transaction_id != null) { $transaction->commit($transaction_id); } return true; } } else { return false; } }
/** * @param string $get_array * @return string * @throws ProjectSetNextStatusException * @throws ProjectSecurityAccessDeniedException * @throws ProjectIDMissingException */ public static function proceed_project($get_array, $comment) { global $project_security; if ($get_array) { $_GET = unserialize($get_array); } if ($_GET['project_id']) { $project = new Project($_GET['project_id']); if ($project_security->is_access(3, false) == true) { if ($comment and $comment != "undefined") { $project_log = new ProjectLog(null); if ($project_log->create($_GET['project_id'], $comment) == null) { throw new ProjectSetNextStatusException(); } } $project->set_next_status(); } else { throw new ProjectSecurityAccessDeniedException(); } } else { throw new ProjectIDMissingException(); } }
/** * @param array $get_array * @param string $comment * @param string $important * @return string * @throws ProjectSecurityAccessDeniedException * @throws ProjectIDMissingException */ public static function create_handler($get_array, $comment, $important) { global $project_security; if ($get_array) { $_GET = unserialize($get_array); } if ($_GET['project_id']) { if ($project_security->is_access(3, false) == true) { if ($important == "1") { $important = true; } else { $important = false; } $project_log = new ProjectLog(null); $project_log->create($_GET['project_id'], $comment, false, $important); } else { throw new ProjectSecurityAccessDeniedException(); } } else { throw new ProjectIDMissingException(); } }