コード例 #1
0
 function convert_object_to_page()
 {
     $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 Page.';
                 break;
             case 'Ticket':
                 $message = 'This action will convert the Ticket: "' . $this->active_object->getName() . '" to Page.';
                 break;
         }
     } else {
         $error = '';
         $page_id = $this->active_object->convertToPage($this->logged_user, $error);
         if (!empty($page_id)) {
             $this->redirectToUrl(assemble_url('project_page', array('project_id' => $this->active_project->getId(), 'page_id' => $page_id)));
         }
     }
     $this->smarty->assign(array('message' => $message, 'redirect_url' => assemble_url('project_object_convert_to_page', array('project_id' => $this->active_object->getProjectId(), 'object_id' => $this->active_object->getId(), 'process' => '1'))));
 }