* @package upgrade * @version $Id$ * @link http://www.zentao.net */ class upgrade extends control { /** * The index page. * * @access public * @return void */ public function index() { $this->display(); } /** * Select the version of old zentao. * * @access public * @return void */ public function selectVersion() { $version = str_replace(array(' ', '.'), array('', '_'), $this->config->installedVersion); $version = strtolower($version); $this->view->title = $this->lang->upgrade->common . $this->lang->colon . $this->lang->upgrade->selectVersion; $this->view->position[] = $this->lang->upgrade->common; $this->view->version = $version; $this->display(); } /** * Confirm the version. * * @access public * @return void */ public function confirm() { $this->view->title = $this->lang->upgrade->confirm; $this->view->position[] = $this->lang->upgrade->common; $this->view->confirm = $this->upgrade->getConfirm($this->post->fromVersion); $this->view->fromVersion = $this->post->fromVersion; $this->display(); } /** * Execute the upgrading. * * @access public * @return void */ public function execute() { $this->upgrade->execute($this->post->fromVersion); $this->view->title = $this->lang->upgrade->result; $this->view->position[] = $this->lang->upgrade->common; if(!$this->upgrade->isError()) { $this->view->result = 'success'; } else { $this->view->result = 'fail'; $this->view->errors = $this->upgrade->getError(); } $this->display(); } }