function convert_object_to_ticket() { $process_mode = $_GET['process']; $message = ''; if (empty($process_mode)) { switch ($this->active_object->getType()) { case 'Milestone': $message = 'This action will convert the Project: "' . $this->active_object->getName() . '" to Ticket.'; break; case 'Page': $message = 'This action will convert the Page: "' . $this->active_object->getName() . '" to Ticket.'; break; } } else { $error = ''; $ticket_id = $this->active_object->convertToTicket($this->logged_user, $error); if (!empty($ticket_id)) { $this->redirectToUrl(assemble_url('project_ticket', array('project_id' => $this->active_project->getId(), 'ticket_id' => $ticket_id))); } } $this->smarty->assign(array('message' => $message, 'redirect_url' => assemble_url('project_object_convert_to_ticket', array('project_id' => $this->active_object->getProjectId(), 'object_id' => $this->active_object->getId(), 'process' => '1')))); }