From 2422a4989d9392e8ffcdb23cce2c7dbdf7c546e8 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Wed, 10 Mar 2010 12:55:35 +0000 Subject: [PATCH] * upgrade the version. --- trunk/config/config.php | 2 +- trunk/module/convert/converter/bugfree.php | 22 +--------------------- trunk/module/install/control.php | 2 +- trunk/module/upgrade/model.php | 20 ++++++++++++++++++++ 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/trunk/config/config.php b/trunk/config/config.php index 933d0ff041..ba523b6220 100644 --- a/trunk/config/config.php +++ b/trunk/config/config.php @@ -22,7 +22,7 @@ * @link http://www.zentao.cn */ /* 基本参数设定。*/ -$config->version = '0.5 beta'; // 版本号,切勿修改。 +$config->version = '0.6 beta'; // 版本号,切勿修改。 $config->helpRoot = 'http://doc.zentao.cn/help/'; // 在线帮助的URI地址。 $config->encoding = 'UTF-8'; // 网站的编码。 $config->cookiePath = '/'; // cookie的有效路径。 diff --git a/trunk/module/convert/converter/bugfree.php b/trunk/module/convert/converter/bugfree.php index 981dd38147..c05330a011 100644 --- a/trunk/module/convert/converter/bugfree.php +++ b/trunk/module/convert/converter/bugfree.php @@ -61,7 +61,7 @@ class bugfreeConvertModel extends convertModel $result['bugs'] = $this->convertBug(); $result['actions'] = $this->convertAction(); $result['files'] = $this->convertFile(); - $this->fixModulePath(); + $this->loadModel('tree')->fixModulePath(); return $result; } @@ -155,26 +155,6 @@ class bugfreeConvertModel extends convertModel return count($modules); } - /* 修复模块路径。*/ - public function fixModulePath() - { - $modules = $this->dao->dbh($this->dbh)->select('*')->from(TABLE_MODULE)->where('view')->eq('bug')->fetchAll('id'); - foreach($modules as $moduleID => $module) - { - if($module->grade == 1) - { - $path = ",$moduleID,"; - } - else - { - if(!isset($modules[$module->parent])) continue; - $parentModule = $modules[$module->parent]; - $path = $parentModule->path . $moduleID . ','; - } - $this->dao->update(TABLE_MODULE)->set('path')->eq($path)->where('id')->eq($moduleID)->exec(); - } - } - /* 转换Bug。*/ public function convertBug() { diff --git a/trunk/module/install/control.php b/trunk/module/install/control.php index 2fea29dd24..953750ffca 100644 --- a/trunk/module/install/control.php +++ b/trunk/module/install/control.php @@ -23,7 +23,7 @@ */ class install extends control { - const VERSION = '0.5 beta'; + const VERSION = '0.6 beta'; /* 鏋勯犲嚱鏁帮紝妫鏌ユ槸鍚︽槸閫氳繃瀹夎鍏ュ彛璋冪敤銆*/ public function __construct() diff --git a/trunk/module/upgrade/model.php b/trunk/module/upgrade/model.php index d15a3d0f07..9df17c6016 100644 --- a/trunk/module/upgrade/model.php +++ b/trunk/module/upgrade/model.php @@ -34,10 +34,16 @@ class upgradeModel extends model { $this->upgradeFrom0_3To0_4(); $this->upgradeFrom0_4To0_5(); + $this->upgradeFrom0_5To0_6(); } elseif($fromVersion == '0_4') { $this->upgradeFrom0_4To0_5(); + $this->upgradeFrom0_5To0_6(); + } + elseif($fromVersion == '0_5') + { + $this->upgradeFrom0_5To0_6(); } } @@ -49,11 +55,18 @@ class upgradeModel extends model { $confirmContent .= file_get_contents($this->getUpgradeFile('0.3')); $confirmContent .= file_get_contents($this->getUpgradeFile('0.4')); + $confirmContent .= file_get_contents($this->getUpgradeFile('0.5')); } elseif($fromVersion == '0_4') { $confirmContent .= file_get_contents($this->getUpgradeFile('0.4')); + $confirmContent .= file_get_contents($this->getUpgradeFile('0.5')); } + elseif($fromVersion == '0_5') + { + $confirmContent .= file_get_contents($this->getUpgradeFile('0.5')); + } + return str_replace('zt_', $this->config->db->prefix, $confirmContent); } @@ -72,6 +85,13 @@ class upgradeModel extends model if(!$this->isError()) $this->updateVersion('0.5 beta'); } + /* 浠0.5鐗堟湰鍗囩骇鍒0.6鐗堟湰銆*/ + private function upgradeFrom0_5To0_6() + { + $this->execSQL($this->getUpgradeFile('0.5')); + if(!$this->isError()) $this->updateVersion('0.6 beta'); + } + /* 鏇存柊PMS鐨勭増鏈缃*/ public function updateVersion($version) {