* convert to unix format.
This commit is contained in:
+240
-240
@@ -1,240 +1,240 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of convert currentModule of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class convert extends control
|
||||
{
|
||||
/**
|
||||
* Index page of convert.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->convert->saveState();
|
||||
$this->view->header->title = $this->lang->convert->common;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Select the source system.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function selectSource()
|
||||
{
|
||||
$this->view->header->title = $this->lang->convert->common . $this->lang->colon;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set configs of converter.
|
||||
*
|
||||
* This is the extrance of every system. It will call the set function of corresponding module.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
if(!$this->post->source)
|
||||
{
|
||||
echo js::alert($this->lang->convert->mustSelectSource);
|
||||
die(js::locate('back'));
|
||||
}
|
||||
list($sourceName, $version) = explode('_', $this->post->source);
|
||||
$setFunc = "set$sourceName";
|
||||
$this->view->header->title = $this->lang->convert->setting;
|
||||
$this->view->source = $sourceName;
|
||||
$this->view->version = $version;
|
||||
$this->view->setting = $this->fetch('convert', $setFunc, "version=$version");
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* The setting page of bugfree.
|
||||
*
|
||||
* @param string $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setBugFree($version)
|
||||
{
|
||||
$this->view->source = 'BugFree';
|
||||
$this->view->version = $version;
|
||||
$this->view->tablePrefix = $version > 1 ? 'bf_' : '';
|
||||
$this->view->dbName = $version > 1 ? 'bugfree2' : 'BugFree';
|
||||
$this->view->dbCharset = 'utf8';
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* The setting page of Redmine.
|
||||
*
|
||||
* @param string $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setRedmine($version)
|
||||
{
|
||||
$this->view->source = 'Redmine';
|
||||
$this->view->version = $version;
|
||||
$this->view->dbName = 'redmine';
|
||||
$this->view->dbCharset = 'utf8';
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check config. Same as setConfig.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkConfig()
|
||||
{
|
||||
$checkFunc = 'check' . $this->post->source;
|
||||
$this->view->header->title = $this->lang->convert->checkConfig;
|
||||
$this->view->source = $this->post->source;
|
||||
$this->view->checkResult = $this->fetch('convert', $checkFunc, "version={$this->post->version}");
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check settings of bugfree.
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkBugFree($version)
|
||||
{
|
||||
helper::import('./converter/bugfree.php');
|
||||
$converter = new bugfreeConvertModel();
|
||||
|
||||
/* Check it. */
|
||||
$checkInfo['db'] = $converter->connectDB();
|
||||
//if(is_object($checkInfo['db'])) $checkInfo['table'] = $converter->checkTables();
|
||||
$checkInfo['path'] = $converter->checkPath();
|
||||
|
||||
/* Compute the checking result. */
|
||||
$result = 'pass';
|
||||
if(!is_object($checkInfo['db']) or !$checkInfo['path']) $result = 'fail';
|
||||
|
||||
/* Assign. */
|
||||
$this->view->version = $version;
|
||||
$this->view->source = 'bugfree';
|
||||
$this->view->result = $result;
|
||||
$this->view->checkInfo = $checkInfo;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check settings of Redmine.
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkRedmine($version)
|
||||
{
|
||||
helper::import('./converter/redmine.php');
|
||||
$converter = new redmineConvertModel();
|
||||
|
||||
/* Check it. */
|
||||
$checkInfo['db'] = $converter->connectDB();
|
||||
$checkInfo['path'] = $converter->checkPath();
|
||||
|
||||
$this->view->trackers = $this->dao->dbh($converter->sourceDBH)->select('id, name')->from('trackers')->fetchAll('id', $autoCompany = false);
|
||||
$this->view->statuses = $this->dao->dbh($converter->sourceDBH)->select('id, name')->from('issue_statuses')->fetchAll('id', $autoCompany = false);
|
||||
$this->view->pries = $this->dao->dbh($converter->sourceDBH)->select('id, name')->from('enumerations')->where('type')->eq('IssuePriority')->fetchAll('id', $autoCompany = false);
|
||||
/* Compute the checking result. */
|
||||
$result = 'pass';
|
||||
if(!is_object($checkInfo['db']) or !$checkInfo['path']) $result = 'fail';
|
||||
|
||||
$this->app->loadLang('bug');
|
||||
$this->app->loadLang('story');
|
||||
$this->app->loadLang('task');
|
||||
$this->view->aimTypeList['bug'] = 'bug';
|
||||
$this->view->aimTypeList['task'] = 'task';
|
||||
$this->view->aimTypeList['story'] = 'story';
|
||||
|
||||
/* Assign. */
|
||||
$this->view->version = $version;
|
||||
$this->view->source = 'Redmine';
|
||||
$this->view->result = $result;
|
||||
$this->view->checkInfo = $checkInfo;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the converting.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
$convertFunc = 'convert' . $this->post->source;
|
||||
$this->view->header->title = $this->lang->convert->execute;
|
||||
$this->view->source = $this->post->source;
|
||||
$this->view->version = $this->post->version;
|
||||
|
||||
$this->view->executeResult = $this->fetch('convert', $convertFunc, "version={$this->post->version}");
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert bugfree.
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function convertBugFree($version)
|
||||
{
|
||||
helper::import('./converter/bugfree.php');
|
||||
helper::import("./converter/bugfree$version.php");
|
||||
$className = "bugfree{$version}ConvertModel";
|
||||
$converter = new $className();
|
||||
$this->view->version = $version;
|
||||
$this->view->result = $converter->execute($version);
|
||||
$this->view->info = bugfreeConvertModel::$info;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* convert redmine
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function convertRedmine($version)
|
||||
{
|
||||
helper::import('./converter/redmine.php');
|
||||
helper::import("./converter/redmine$version.php");
|
||||
$className = "redmine11ConvertModel";
|
||||
$redmine->aimTypes = $this->post->aimTypes;
|
||||
$redmine->statusTypes['bug'] = $this->post->statusTypesOfBug;
|
||||
$redmine->statusTypes['story'] = $this->post->statusTypesOfStory;
|
||||
$redmine->statusTypes['task'] = $this->post->statusTypesOfTask;
|
||||
$redmine->priTypes['bug'] = $this->post->priTypesOfBug;
|
||||
$redmine->priTypes['story'] = $this->post->priTypesOfStory;
|
||||
$redmine->priTypes['task'] = $this->post->priTypesOfTask;
|
||||
|
||||
$converter = new $className($redmine);
|
||||
$this->view->version = $version;
|
||||
$this->view->result = $converter->execute($version);
|
||||
$this->view->info = redmineConvertModel::$info;
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* The control file of convert currentModule of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class convert extends control
|
||||
{
|
||||
/**
|
||||
* Index page of convert.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->convert->saveState();
|
||||
$this->view->header->title = $this->lang->convert->common;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Select the source system.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function selectSource()
|
||||
{
|
||||
$this->view->header->title = $this->lang->convert->common . $this->lang->colon;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set configs of converter.
|
||||
*
|
||||
* This is the extrance of every system. It will call the set function of corresponding module.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setConfig()
|
||||
{
|
||||
if(!$this->post->source)
|
||||
{
|
||||
echo js::alert($this->lang->convert->mustSelectSource);
|
||||
die(js::locate('back'));
|
||||
}
|
||||
list($sourceName, $version) = explode('_', $this->post->source);
|
||||
$setFunc = "set$sourceName";
|
||||
$this->view->header->title = $this->lang->convert->setting;
|
||||
$this->view->source = $sourceName;
|
||||
$this->view->version = $version;
|
||||
$this->view->setting = $this->fetch('convert', $setFunc, "version=$version");
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* The setting page of bugfree.
|
||||
*
|
||||
* @param string $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setBugFree($version)
|
||||
{
|
||||
$this->view->source = 'BugFree';
|
||||
$this->view->version = $version;
|
||||
$this->view->tablePrefix = $version > 1 ? 'bf_' : '';
|
||||
$this->view->dbName = $version > 1 ? 'bugfree2' : 'BugFree';
|
||||
$this->view->dbCharset = 'utf8';
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* The setting page of Redmine.
|
||||
*
|
||||
* @param string $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setRedmine($version)
|
||||
{
|
||||
$this->view->source = 'Redmine';
|
||||
$this->view->version = $version;
|
||||
$this->view->dbName = 'redmine';
|
||||
$this->view->dbCharset = 'utf8';
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check config. Same as setConfig.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkConfig()
|
||||
{
|
||||
$checkFunc = 'check' . $this->post->source;
|
||||
$this->view->header->title = $this->lang->convert->checkConfig;
|
||||
$this->view->source = $this->post->source;
|
||||
$this->view->checkResult = $this->fetch('convert', $checkFunc, "version={$this->post->version}");
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check settings of bugfree.
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkBugFree($version)
|
||||
{
|
||||
helper::import('./converter/bugfree.php');
|
||||
$converter = new bugfreeConvertModel();
|
||||
|
||||
/* Check it. */
|
||||
$checkInfo['db'] = $converter->connectDB();
|
||||
//if(is_object($checkInfo['db'])) $checkInfo['table'] = $converter->checkTables();
|
||||
$checkInfo['path'] = $converter->checkPath();
|
||||
|
||||
/* Compute the checking result. */
|
||||
$result = 'pass';
|
||||
if(!is_object($checkInfo['db']) or !$checkInfo['path']) $result = 'fail';
|
||||
|
||||
/* Assign. */
|
||||
$this->view->version = $version;
|
||||
$this->view->source = 'bugfree';
|
||||
$this->view->result = $result;
|
||||
$this->view->checkInfo = $checkInfo;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check settings of Redmine.
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkRedmine($version)
|
||||
{
|
||||
helper::import('./converter/redmine.php');
|
||||
$converter = new redmineConvertModel();
|
||||
|
||||
/* Check it. */
|
||||
$checkInfo['db'] = $converter->connectDB();
|
||||
$checkInfo['path'] = $converter->checkPath();
|
||||
|
||||
$this->view->trackers = $this->dao->dbh($converter->sourceDBH)->select('id, name')->from('trackers')->fetchAll('id', $autoCompany = false);
|
||||
$this->view->statuses = $this->dao->dbh($converter->sourceDBH)->select('id, name')->from('issue_statuses')->fetchAll('id', $autoCompany = false);
|
||||
$this->view->pries = $this->dao->dbh($converter->sourceDBH)->select('id, name')->from('enumerations')->where('type')->eq('IssuePriority')->fetchAll('id', $autoCompany = false);
|
||||
/* Compute the checking result. */
|
||||
$result = 'pass';
|
||||
if(!is_object($checkInfo['db']) or !$checkInfo['path']) $result = 'fail';
|
||||
|
||||
$this->app->loadLang('bug');
|
||||
$this->app->loadLang('story');
|
||||
$this->app->loadLang('task');
|
||||
$this->view->aimTypeList['bug'] = 'bug';
|
||||
$this->view->aimTypeList['task'] = 'task';
|
||||
$this->view->aimTypeList['story'] = 'story';
|
||||
|
||||
/* Assign. */
|
||||
$this->view->version = $version;
|
||||
$this->view->source = 'Redmine';
|
||||
$this->view->result = $result;
|
||||
$this->view->checkInfo = $checkInfo;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the converting.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
$convertFunc = 'convert' . $this->post->source;
|
||||
$this->view->header->title = $this->lang->convert->execute;
|
||||
$this->view->source = $this->post->source;
|
||||
$this->view->version = $this->post->version;
|
||||
|
||||
$this->view->executeResult = $this->fetch('convert', $convertFunc, "version={$this->post->version}");
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert bugfree.
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function convertBugFree($version)
|
||||
{
|
||||
helper::import('./converter/bugfree.php');
|
||||
helper::import("./converter/bugfree$version.php");
|
||||
$className = "bugfree{$version}ConvertModel";
|
||||
$converter = new $className();
|
||||
$this->view->version = $version;
|
||||
$this->view->result = $converter->execute($version);
|
||||
$this->view->info = bugfreeConvertModel::$info;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* convert redmine
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function convertRedmine($version)
|
||||
{
|
||||
helper::import('./converter/redmine.php');
|
||||
helper::import("./converter/redmine$version.php");
|
||||
$className = "redmine11ConvertModel";
|
||||
$redmine->aimTypes = $this->post->aimTypes;
|
||||
$redmine->statusTypes['bug'] = $this->post->statusTypesOfBug;
|
||||
$redmine->statusTypes['story'] = $this->post->statusTypesOfStory;
|
||||
$redmine->statusTypes['task'] = $this->post->statusTypesOfTask;
|
||||
$redmine->priTypes['bug'] = $this->post->priTypesOfBug;
|
||||
$redmine->priTypes['story'] = $this->post->priTypesOfStory;
|
||||
$redmine->priTypes['task'] = $this->post->priTypesOfTask;
|
||||
|
||||
$converter = new $className($redmine);
|
||||
$this->view->version = $version;
|
||||
$this->view->result = $converter->execute($version);
|
||||
$this->view->info = redmineConvertModel::$info;
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,88 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* The baisc model file of bugfree convert of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class bugfreeConvertModel extends convertModel
|
||||
{
|
||||
public $map = array();
|
||||
public $filePath = '';
|
||||
static public $info = array();
|
||||
|
||||
/**
|
||||
* Connect to db auto.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
parent::connectDB();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check table.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkTables()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the install path.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkPath()
|
||||
{
|
||||
$this->setPath();
|
||||
return file_exists($this->filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the path of attachments.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function setPath()
|
||||
{
|
||||
$this->filePath = realpath($this->post->installPath) . $this->app->getPathFix() . 'BugFile' . $this->app->getPathFix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Excute the convert.
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function execute($version)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear rows added in converting.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
foreach($this->session->state as $table => $maxID)
|
||||
{
|
||||
$this->dao->dbh($this->dbh)->delete()->from($table)->where('id')->gt($maxID)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* The baisc model file of bugfree convert of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class bugfreeConvertModel extends convertModel
|
||||
{
|
||||
public $map = array();
|
||||
public $filePath = '';
|
||||
static public $info = array();
|
||||
|
||||
/**
|
||||
* Connect to db auto.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
parent::connectDB();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check table.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkTables()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the install path.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkPath()
|
||||
{
|
||||
$this->setPath();
|
||||
return file_exists($this->filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the path of attachments.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function setPath()
|
||||
{
|
||||
$this->filePath = realpath($this->post->installPath) . $this->app->getPathFix() . 'BugFile' . $this->app->getPathFix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Excute the convert.
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function execute($version)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear rows added in converting.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
foreach($this->session->state as $table => $maxID)
|
||||
{
|
||||
$this->dao->dbh($this->dbh)->delete()->from($table)->where('id')->gt($maxID)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,318 +1,318 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of bugfree version 1 convert of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class bugfree1ConvertModel extends bugfreeConvertModel
|
||||
{
|
||||
/**
|
||||
* Execute the convert.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
$this->clear();
|
||||
$this->convertGroup();
|
||||
$result['users'] = $this->convertUser();
|
||||
$result['projects'] = $this->convertProject();
|
||||
$result['modules'] = $this->convertModule();
|
||||
$result['bugs'] = $this->convertBug();
|
||||
$result['actions'] = $this->convertAction();
|
||||
$result['files'] = $this->convertFile();
|
||||
$this->dao->dbh($this->dbh);
|
||||
$this->loadModel('tree')->fixModulePath();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert groups.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function convertGroup()
|
||||
{
|
||||
$groups = $this->dao->dbh($this->sourceDBH)
|
||||
->select("groupID AS id, groupName AS name, groupUser AS users")
|
||||
->from('BugGroup')
|
||||
->fetchAll('id', $autoCompany = false);
|
||||
foreach($groups as $groupID => $group)
|
||||
{
|
||||
/* Explode into array. */
|
||||
$groupUsers = explode(',', $group->users);
|
||||
unset($group->id);
|
||||
unset($group->users);
|
||||
|
||||
/* Insert the group. */
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_GROUP)->data($group)->exec();
|
||||
$zentaoGroupID = $this->dao->lastInsertId();
|
||||
|
||||
/* Insert account. */
|
||||
foreach($groupUsers as $account)
|
||||
{
|
||||
if(empty($account)) continue;
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_USERGROUP)->set('`group`')->eq($zentaoGroupID)->set('account')->eq($account)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert user.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted user count
|
||||
*/
|
||||
public function convertUser()
|
||||
{
|
||||
/* Get users exist in the system. */
|
||||
$activeUsers = $this->dao
|
||||
->dbh($this->sourceDBH)
|
||||
->select("username AS account, userpassword AS password, realname, email")
|
||||
->from('BugUser')
|
||||
->orderBy('userID ASC')
|
||||
->fetchAll('account', $autoCompany = false);
|
||||
|
||||
/* Get users in histories. */
|
||||
$allUsers = $this->dao->select("distinct(username) AS account")->from('BugHistory')->fetchPairs('', '', $autoCompany = false);
|
||||
|
||||
/* Merge them. */
|
||||
foreach($allUsers as $key => $account)
|
||||
{
|
||||
if(isset($activeUsers[$account]))
|
||||
{
|
||||
$allUsers[$key] = $activeUsers[$account];
|
||||
}
|
||||
else
|
||||
{
|
||||
$allUsers[$key] = array('account' => $account, 'realname' => $account, 'deleted' => '1');
|
||||
}
|
||||
}
|
||||
foreach($activeUsers as $account => $user) if(!isset($allUsers[$account])) $allUsers[$account] = $user;
|
||||
|
||||
/* Insert into zentao. */
|
||||
$convertCount = 0;
|
||||
foreach($allUsers as $account => $user)
|
||||
{
|
||||
if(!$this->dao->dbh($this->dbh)->findByAccount($account)->from(TABLE_USER)->fetch('account'))
|
||||
{
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_USER)->data($user)->exec();
|
||||
$convertCount ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$info['users'][] = sprintf($this->lang->convert->errorUserExists, $account);
|
||||
}
|
||||
}
|
||||
return $convertCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert project in bugfree to product in zentao.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted project count
|
||||
*/
|
||||
public function convertProject()
|
||||
{
|
||||
$projects = $this->dao->dbh($this->sourceDBH)->select("projectID AS id, projectName AS name")->from('BugProject')->fetchAll('id', $autoCompany = false);
|
||||
foreach($projects as $projectID => $project)
|
||||
{
|
||||
unset($project->id);
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_PRODUCT)->data($project)->exec();
|
||||
$this->map['product'][$projectID] = $this->dao->lastInsertID();
|
||||
}
|
||||
return count($projects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert modules.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted modules count
|
||||
*/
|
||||
public function convertModule()
|
||||
{
|
||||
$this->map['module'][0] = 0;
|
||||
$modules = $this->dao
|
||||
->dbh($this->sourceDBH)
|
||||
->select(
|
||||
'moduleID AS id,
|
||||
projectID AS root,
|
||||
moduleName AS name,
|
||||
moduleGrade AS grade,
|
||||
parentID AS parent,
|
||||
"bug" AS type')
|
||||
->from('BugModule')
|
||||
->orderBy('id ASC')
|
||||
->fetchAll('id', $autoCompany = false);
|
||||
foreach($modules as $moduleID => $module)
|
||||
{
|
||||
$module->root = $this->map['product'][$module->root];
|
||||
unset($module->id);
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_MODULE)->data($module)->exec();
|
||||
$this->map['module'][$moduleID] = $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
/* Update parents. */
|
||||
foreach($modules as $oldModuleID => $module)
|
||||
{
|
||||
$newModuleID = $this->map['module'][$oldModuleID];
|
||||
$newParentID = $this->map['module'][$module->parent];
|
||||
$this->dao->dbh($this->dbh)->update(TABLE_MODULE)->set('parent')->eq($newParentID)->where('id')->eq($newModuleID)->exec();
|
||||
}
|
||||
return count($modules);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert bugs.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted bugs count.
|
||||
*/
|
||||
public function convertBug()
|
||||
{
|
||||
$bugs = $this->dao
|
||||
->dbh($this->sourceDBH)
|
||||
->select('
|
||||
bugID AS id,
|
||||
projectID AS product,
|
||||
moduleID AS module,
|
||||
bugTitle AS title,
|
||||
bugSeverity AS severity,
|
||||
bugType AS type,
|
||||
bugOS AS os,
|
||||
bugStatus AS status,
|
||||
mailto,
|
||||
openedBy, openedDate, openedBuild,
|
||||
assignedTo, assignedDate,
|
||||
resolvedBy, resolution, resolvedBuild, resolvedDate,
|
||||
closedBy, closedDate,
|
||||
lastEditedBy, lastEditedDate,
|
||||
linkID as duplicateBug
|
||||
')
|
||||
->from('BugInfo')
|
||||
->orderBy('bugID')
|
||||
->fetchAll('id', $autoCompany = false);
|
||||
foreach($bugs as $bugID => $bug)
|
||||
{
|
||||
/* Adjust some fields of bug. */
|
||||
$bugID = (int)$bugID;
|
||||
unset($bug->id);
|
||||
if($bug->assignedTo == 'Closed') $bug->assignedTo = 'closed';
|
||||
$bug->type = strtolower($bug->type);
|
||||
$bug->os = strtolower($bug->os);
|
||||
$bug->browser = 'all';
|
||||
$bug->resolution = str_replace(' ','', strtolower($bug->resolution));
|
||||
$bug->product = $this->map['product'][$bug->product];
|
||||
$bug->module = $this->map['module'][$bug->module];
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_BUG)->data($bug)->exec();
|
||||
$this->map['bug'][$bugID] = $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
/* Update duplicated bugs. */
|
||||
foreach($this->map['bug'] as $oldBugID => $newBugID)
|
||||
{
|
||||
$this->dao->dbh($this->dbh)->update(TABLE_BUG)->set('duplicateBug')->eq($newBugID)->where('duplicateBug')->eq($oldBugID)->exec();
|
||||
}
|
||||
return count($bugs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert actions.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted actions count.
|
||||
*/
|
||||
public function convertAction()
|
||||
{
|
||||
$actions = $this->dao
|
||||
->dbh($this->sourceDBH)
|
||||
->select("
|
||||
'bug' AS objectType,
|
||||
bugID AS objectID,
|
||||
userName AS actor,
|
||||
action,
|
||||
fullInfo AS comment,
|
||||
actionDate AS date")
|
||||
->from('BugHistory')
|
||||
->orderBy('bugID, historyID')
|
||||
->fetchGroup('objectID', '', $autoCompany = false);
|
||||
$convertCount = 0;
|
||||
foreach($actions as $bugID => $bugActions)
|
||||
{
|
||||
/* Get the related bugID. */
|
||||
$bugID = (int)$bugID;
|
||||
$zentaoBugID = $this->map['bug'][$bugID];
|
||||
|
||||
/* Process actions. */
|
||||
foreach($bugActions as $key => $action)
|
||||
{
|
||||
$action->objectID = $zentaoBugID;
|
||||
if($key == 0)
|
||||
{
|
||||
$this->dao->dbh($this->dbh)->update(TABLE_BUG)->set('steps')->eq(nl2br($action->comment))->where('id')->eq($zentaoBugID)->exec();
|
||||
$action->comment = '';
|
||||
}
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_ACTION)->data($action)->exec();
|
||||
$convertCount ++;
|
||||
}
|
||||
}
|
||||
return $convertCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert files.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted files count.
|
||||
*/
|
||||
public function convertFile()
|
||||
{
|
||||
$this->setPath();
|
||||
$files = $this->dao->dbh($this->sourceDBH)
|
||||
->select("
|
||||
fileName AS pathname,
|
||||
fileTitle AS title,
|
||||
fileType AS extension,
|
||||
fileSize AS size,
|
||||
'bug' AS objectType,
|
||||
bugID AS objectID,
|
||||
addUser AS addedBy,
|
||||
addDate AS addedDate
|
||||
")
|
||||
->from('BugFile')
|
||||
->orderBy('fileID')
|
||||
->fetchAll('', $autoCompany = false);
|
||||
foreach($files as $file)
|
||||
{
|
||||
$file->objectID = $this->map['bug'][(int)$file->objectID];
|
||||
if(strpos($file->size, 'KB')) $file->size = (int)(str_replace('KB', '', $file->size) * 1024);
|
||||
if(strpos($file->size, 'MB')) $file->size = (int)(str_replace('MB', '', $file->size) * 1024 * 1024);
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_FILE)->data($file)->exec();
|
||||
|
||||
/* Copy files. */
|
||||
$soureFile = $this->filePath . $file->pathname;
|
||||
if(!file_exists($soureFile))
|
||||
{
|
||||
self::$info['files'][] = sprintf($this->lang->convert->errorFileNotExits, $soureFile);
|
||||
continue;
|
||||
}
|
||||
$targetFile = $this->app->getAppRoot() . "www/data/upload/{$this->app->company->id}/" . $file->pathname;
|
||||
$targetPath = dirname($targetFile);
|
||||
if(!is_dir($targetPath)) mkdir($targetPath, 0777, true);
|
||||
if(!copy($soureFile, $targetFile))
|
||||
{
|
||||
self::$info['files'][] = sprintf($this->lang->convert->errorCopyFailed, $targetFile);
|
||||
}
|
||||
}
|
||||
return count($files);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* The model file of bugfree version 1 convert of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class bugfree1ConvertModel extends bugfreeConvertModel
|
||||
{
|
||||
/**
|
||||
* Execute the convert.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
$this->clear();
|
||||
$this->convertGroup();
|
||||
$result['users'] = $this->convertUser();
|
||||
$result['projects'] = $this->convertProject();
|
||||
$result['modules'] = $this->convertModule();
|
||||
$result['bugs'] = $this->convertBug();
|
||||
$result['actions'] = $this->convertAction();
|
||||
$result['files'] = $this->convertFile();
|
||||
$this->dao->dbh($this->dbh);
|
||||
$this->loadModel('tree')->fixModulePath();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert groups.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function convertGroup()
|
||||
{
|
||||
$groups = $this->dao->dbh($this->sourceDBH)
|
||||
->select("groupID AS id, groupName AS name, groupUser AS users")
|
||||
->from('BugGroup')
|
||||
->fetchAll('id', $autoCompany = false);
|
||||
foreach($groups as $groupID => $group)
|
||||
{
|
||||
/* Explode into array. */
|
||||
$groupUsers = explode(',', $group->users);
|
||||
unset($group->id);
|
||||
unset($group->users);
|
||||
|
||||
/* Insert the group. */
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_GROUP)->data($group)->exec();
|
||||
$zentaoGroupID = $this->dao->lastInsertId();
|
||||
|
||||
/* Insert account. */
|
||||
foreach($groupUsers as $account)
|
||||
{
|
||||
if(empty($account)) continue;
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_USERGROUP)->set('`group`')->eq($zentaoGroupID)->set('account')->eq($account)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert user.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted user count
|
||||
*/
|
||||
public function convertUser()
|
||||
{
|
||||
/* Get users exist in the system. */
|
||||
$activeUsers = $this->dao
|
||||
->dbh($this->sourceDBH)
|
||||
->select("username AS account, userpassword AS password, realname, email")
|
||||
->from('BugUser')
|
||||
->orderBy('userID ASC')
|
||||
->fetchAll('account', $autoCompany = false);
|
||||
|
||||
/* Get users in histories. */
|
||||
$allUsers = $this->dao->select("distinct(username) AS account")->from('BugHistory')->fetchPairs('', '', $autoCompany = false);
|
||||
|
||||
/* Merge them. */
|
||||
foreach($allUsers as $key => $account)
|
||||
{
|
||||
if(isset($activeUsers[$account]))
|
||||
{
|
||||
$allUsers[$key] = $activeUsers[$account];
|
||||
}
|
||||
else
|
||||
{
|
||||
$allUsers[$key] = array('account' => $account, 'realname' => $account, 'deleted' => '1');
|
||||
}
|
||||
}
|
||||
foreach($activeUsers as $account => $user) if(!isset($allUsers[$account])) $allUsers[$account] = $user;
|
||||
|
||||
/* Insert into zentao. */
|
||||
$convertCount = 0;
|
||||
foreach($allUsers as $account => $user)
|
||||
{
|
||||
if(!$this->dao->dbh($this->dbh)->findByAccount($account)->from(TABLE_USER)->fetch('account'))
|
||||
{
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_USER)->data($user)->exec();
|
||||
$convertCount ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$info['users'][] = sprintf($this->lang->convert->errorUserExists, $account);
|
||||
}
|
||||
}
|
||||
return $convertCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert project in bugfree to product in zentao.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted project count
|
||||
*/
|
||||
public function convertProject()
|
||||
{
|
||||
$projects = $this->dao->dbh($this->sourceDBH)->select("projectID AS id, projectName AS name")->from('BugProject')->fetchAll('id', $autoCompany = false);
|
||||
foreach($projects as $projectID => $project)
|
||||
{
|
||||
unset($project->id);
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_PRODUCT)->data($project)->exec();
|
||||
$this->map['product'][$projectID] = $this->dao->lastInsertID();
|
||||
}
|
||||
return count($projects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert modules.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted modules count
|
||||
*/
|
||||
public function convertModule()
|
||||
{
|
||||
$this->map['module'][0] = 0;
|
||||
$modules = $this->dao
|
||||
->dbh($this->sourceDBH)
|
||||
->select(
|
||||
'moduleID AS id,
|
||||
projectID AS root,
|
||||
moduleName AS name,
|
||||
moduleGrade AS grade,
|
||||
parentID AS parent,
|
||||
"bug" AS type')
|
||||
->from('BugModule')
|
||||
->orderBy('id ASC')
|
||||
->fetchAll('id', $autoCompany = false);
|
||||
foreach($modules as $moduleID => $module)
|
||||
{
|
||||
$module->root = $this->map['product'][$module->root];
|
||||
unset($module->id);
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_MODULE)->data($module)->exec();
|
||||
$this->map['module'][$moduleID] = $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
/* Update parents. */
|
||||
foreach($modules as $oldModuleID => $module)
|
||||
{
|
||||
$newModuleID = $this->map['module'][$oldModuleID];
|
||||
$newParentID = $this->map['module'][$module->parent];
|
||||
$this->dao->dbh($this->dbh)->update(TABLE_MODULE)->set('parent')->eq($newParentID)->where('id')->eq($newModuleID)->exec();
|
||||
}
|
||||
return count($modules);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert bugs.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted bugs count.
|
||||
*/
|
||||
public function convertBug()
|
||||
{
|
||||
$bugs = $this->dao
|
||||
->dbh($this->sourceDBH)
|
||||
->select('
|
||||
bugID AS id,
|
||||
projectID AS product,
|
||||
moduleID AS module,
|
||||
bugTitle AS title,
|
||||
bugSeverity AS severity,
|
||||
bugType AS type,
|
||||
bugOS AS os,
|
||||
bugStatus AS status,
|
||||
mailto,
|
||||
openedBy, openedDate, openedBuild,
|
||||
assignedTo, assignedDate,
|
||||
resolvedBy, resolution, resolvedBuild, resolvedDate,
|
||||
closedBy, closedDate,
|
||||
lastEditedBy, lastEditedDate,
|
||||
linkID as duplicateBug
|
||||
')
|
||||
->from('BugInfo')
|
||||
->orderBy('bugID')
|
||||
->fetchAll('id', $autoCompany = false);
|
||||
foreach($bugs as $bugID => $bug)
|
||||
{
|
||||
/* Adjust some fields of bug. */
|
||||
$bugID = (int)$bugID;
|
||||
unset($bug->id);
|
||||
if($bug->assignedTo == 'Closed') $bug->assignedTo = 'closed';
|
||||
$bug->type = strtolower($bug->type);
|
||||
$bug->os = strtolower($bug->os);
|
||||
$bug->browser = 'all';
|
||||
$bug->resolution = str_replace(' ','', strtolower($bug->resolution));
|
||||
$bug->product = $this->map['product'][$bug->product];
|
||||
$bug->module = $this->map['module'][$bug->module];
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_BUG)->data($bug)->exec();
|
||||
$this->map['bug'][$bugID] = $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
/* Update duplicated bugs. */
|
||||
foreach($this->map['bug'] as $oldBugID => $newBugID)
|
||||
{
|
||||
$this->dao->dbh($this->dbh)->update(TABLE_BUG)->set('duplicateBug')->eq($newBugID)->where('duplicateBug')->eq($oldBugID)->exec();
|
||||
}
|
||||
return count($bugs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert actions.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted actions count.
|
||||
*/
|
||||
public function convertAction()
|
||||
{
|
||||
$actions = $this->dao
|
||||
->dbh($this->sourceDBH)
|
||||
->select("
|
||||
'bug' AS objectType,
|
||||
bugID AS objectID,
|
||||
userName AS actor,
|
||||
action,
|
||||
fullInfo AS comment,
|
||||
actionDate AS date")
|
||||
->from('BugHistory')
|
||||
->orderBy('bugID, historyID')
|
||||
->fetchGroup('objectID', '', $autoCompany = false);
|
||||
$convertCount = 0;
|
||||
foreach($actions as $bugID => $bugActions)
|
||||
{
|
||||
/* Get the related bugID. */
|
||||
$bugID = (int)$bugID;
|
||||
$zentaoBugID = $this->map['bug'][$bugID];
|
||||
|
||||
/* Process actions. */
|
||||
foreach($bugActions as $key => $action)
|
||||
{
|
||||
$action->objectID = $zentaoBugID;
|
||||
if($key == 0)
|
||||
{
|
||||
$this->dao->dbh($this->dbh)->update(TABLE_BUG)->set('steps')->eq(nl2br($action->comment))->where('id')->eq($zentaoBugID)->exec();
|
||||
$action->comment = '';
|
||||
}
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_ACTION)->data($action)->exec();
|
||||
$convertCount ++;
|
||||
}
|
||||
}
|
||||
return $convertCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert files.
|
||||
*
|
||||
* @access public
|
||||
* @return int converted files count.
|
||||
*/
|
||||
public function convertFile()
|
||||
{
|
||||
$this->setPath();
|
||||
$files = $this->dao->dbh($this->sourceDBH)
|
||||
->select("
|
||||
fileName AS pathname,
|
||||
fileTitle AS title,
|
||||
fileType AS extension,
|
||||
fileSize AS size,
|
||||
'bug' AS objectType,
|
||||
bugID AS objectID,
|
||||
addUser AS addedBy,
|
||||
addDate AS addedDate
|
||||
")
|
||||
->from('BugFile')
|
||||
->orderBy('fileID')
|
||||
->fetchAll('', $autoCompany = false);
|
||||
foreach($files as $file)
|
||||
{
|
||||
$file->objectID = $this->map['bug'][(int)$file->objectID];
|
||||
if(strpos($file->size, 'KB')) $file->size = (int)(str_replace('KB', '', $file->size) * 1024);
|
||||
if(strpos($file->size, 'MB')) $file->size = (int)(str_replace('MB', '', $file->size) * 1024 * 1024);
|
||||
$this->dao->dbh($this->dbh)->insert(TABLE_FILE)->data($file)->exec();
|
||||
|
||||
/* Copy files. */
|
||||
$soureFile = $this->filePath . $file->pathname;
|
||||
if(!file_exists($soureFile))
|
||||
{
|
||||
self::$info['files'][] = sprintf($this->lang->convert->errorFileNotExits, $soureFile);
|
||||
continue;
|
||||
}
|
||||
$targetFile = $this->app->getAppRoot() . "www/data/upload/{$this->app->company->id}/" . $file->pathname;
|
||||
$targetPath = dirname($targetFile);
|
||||
if(!is_dir($targetPath)) mkdir($targetPath, 0777, true);
|
||||
if(!copy($soureFile, $targetFile))
|
||||
{
|
||||
self::$info['files'][] = sprintf($this->lang->convert->errorCopyFailed, $targetFile);
|
||||
}
|
||||
}
|
||||
return count($files);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,88 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* The baisc model file of bugfree convert of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Yangyang Shi <shiyangyang@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class redmineConvertModel extends convertModel
|
||||
{
|
||||
public $map = array();
|
||||
public $filePath = '';
|
||||
static public $info = array();
|
||||
|
||||
/**
|
||||
* Connect to db auto.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
parent::connectDB();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check table.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkTables()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the install path.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkPath()
|
||||
{
|
||||
$this->setPath();
|
||||
return file_exists($this->filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the path of attachments.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function setPath()
|
||||
{
|
||||
$this->filePath = realpath($this->post->installPath) . $this->app->getPathFix() . 'files' . $this->app->getPathFix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Excute the convert.
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function execute($version)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear rows added in converting.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
foreach($this->session->state as $table => $maxID)
|
||||
{
|
||||
$this->dao->dbh($this->dbh)->delete()->from($table)->where('id')->gt($maxID)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* The baisc model file of bugfree convert of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Yangyang Shi <shiyangyang@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class redmineConvertModel extends convertModel
|
||||
{
|
||||
public $map = array();
|
||||
public $filePath = '';
|
||||
static public $info = array();
|
||||
|
||||
/**
|
||||
* Connect to db auto.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
parent::connectDB();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check table.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkTables()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the install path.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkPath()
|
||||
{
|
||||
$this->setPath();
|
||||
return file_exists($this->filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the path of attachments.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function setPath()
|
||||
{
|
||||
$this->filePath = realpath($this->post->installPath) . $this->app->getPathFix() . 'files' . $this->app->getPathFix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Excute the convert.
|
||||
*
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function execute($version)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear rows added in converting.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
foreach($this->session->state as $table => $maxID)
|
||||
{
|
||||
$this->dao->dbh($this->dbh)->delete()->from($table)->where('id')->gt($maxID)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+109
-109
@@ -1,109 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* The convert module English file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->convert->common = 'Import';
|
||||
$lang->convert->next = 'Next';
|
||||
$lang->convert->pre = 'Back';
|
||||
$lang->convert->reload = 'Reload';
|
||||
$lang->convert->error = 'Error ';
|
||||
|
||||
$lang->convert->start = 'Begin import';
|
||||
$lang->convert->desc = <<<EOT
|
||||
<p>Welcome to use this convert wizard which will help you to import other system data to ZenTaoPMS.</p>
|
||||
<strong>Importing is dangerous. Be sure to backup your database and other data files and sure nobody is using pms when importing.</strong>
|
||||
EOT;
|
||||
|
||||
$lang->convert->selectSource = 'Select source system and version';
|
||||
$lang->convert->source = 'Source system';
|
||||
$lang->convert->version = 'Version';
|
||||
$lang->convert->mustSelectSource = "Must select a source system";
|
||||
|
||||
$lang->convert->direction = 'Please select the direction of issue in Redmine';
|
||||
$lang->convert->questionTypeOfRedmine = 'Types of issue in Redmine';
|
||||
$lang->convert->aimTypeOfZentao = 'Aim type in Zentao';
|
||||
|
||||
$lang->convert->directionList['bug'] = 'Bug';
|
||||
$lang->convert->directionList['task'] = 'Task';
|
||||
$lang->convert->directionList['story'] = 'Story';
|
||||
|
||||
$lang->convert->sourceList['BugFree'] = array('bugfree_1' => '1.x', 'bugfree_2' => '2.x');
|
||||
$lang->convert->sourceList['Redmine'] = array('Redmine_1_1' => '1.1');
|
||||
|
||||
$lang->convert->setting = 'Setting';
|
||||
$lang->convert->checkConfig = 'Check setting';
|
||||
|
||||
$lang->convert->ok = 'Check passed(√)';
|
||||
$lang->convert->fail = 'Check failed(×)';
|
||||
|
||||
$lang->convert->settingDB = 'Set database';
|
||||
$lang->convert->dbHost = 'Database server';
|
||||
$lang->convert->dbPort = 'Server port';
|
||||
$lang->convert->dbUser = 'Database user';
|
||||
$lang->convert->dbPassword = 'Database password';
|
||||
$lang->convert->dbName = '%s database';
|
||||
$lang->convert->dbCharset = '%s charset';
|
||||
$lang->convert->dbPrefix = '%s table prefix';
|
||||
$lang->convert->installPath = '%s installed path';
|
||||
|
||||
$lang->convert->checkDB = 'Database';
|
||||
$lang->convert->checkTable = 'Table';
|
||||
$lang->convert->checkPath = 'Installed path';
|
||||
|
||||
$lang->convert->execute = 'Execute import';
|
||||
$lang->convert->item = 'Imported items';
|
||||
$lang->convert->count = 'Count';
|
||||
$lang->convert->info = 'Info';
|
||||
|
||||
$lang->convert->bugfree->users = 'User';
|
||||
$lang->convert->bugfree->projects = 'Project';
|
||||
$lang->convert->bugfree->modules = 'Module';
|
||||
$lang->convert->bugfree->bugs = 'Bug';
|
||||
$lang->convert->bugfree->cases = 'Case';
|
||||
$lang->convert->bugfree->results = 'Result';
|
||||
$lang->convert->bugfree->actions = 'History';
|
||||
$lang->convert->bugfree->files = 'File';
|
||||
|
||||
$lang->convert->redmine->users = 'Users';
|
||||
$lang->convert->redmine->groups = 'Groups';
|
||||
$lang->convert->redmine->products = 'Products';
|
||||
$lang->convert->redmine->projects = 'Projects';
|
||||
$lang->convert->redmine->stories = 'Stories';
|
||||
$lang->convert->redmine->tasks = 'Tasks';
|
||||
$lang->convert->redmine->bugs = 'Bugs';
|
||||
$lang->convert->redmine->productPlans = 'ProductPlans';
|
||||
$lang->convert->redmine->teams = 'Teams';
|
||||
$lang->convert->redmine->releases = 'Releases';
|
||||
$lang->convert->redmine->builds = 'Builds';
|
||||
$lang->convert->redmine->docLibs = 'DocLibs';
|
||||
$lang->convert->redmine->docs = 'Docs';
|
||||
$lang->convert->redmine->files = 'files';
|
||||
|
||||
$lang->convert->errorConnectDB = 'Connect to database server failed.';
|
||||
$lang->convert->errorFileNotExits = 'File %s not exits.';
|
||||
$lang->convert->errorUserExists = 'User %s exits already.';
|
||||
$lang->convert->errorGroupExists = 'Group %s exits already.';
|
||||
$lang->convert->errorBuildExists = 'Build %s exits already.';
|
||||
$lang->convert->errorReleaseExists = 'Release %s exits already.';
|
||||
$lang->convert->errorCopyFailed = 'file %s copy failed.';
|
||||
|
||||
$lang->convert->setParam = 'Please set params';
|
||||
|
||||
$lang->convert->aimType = 'Issue types goto';
|
||||
$lang->convert->statusType->bug = 'Status types goto(status of Bug)';
|
||||
$lang->convert->statusType->story = 'Status types goto(status of story)';
|
||||
$lang->convert->statusType->task = 'Status types goto(status of task)';
|
||||
$lang->convert->priType->bug = 'Priority types goto(priority of Bug)';
|
||||
$lang->convert->priType->story = 'Priority types goto(priority of story)';
|
||||
$lang->convert->priType->task = 'Priority types goto(priority of task)';
|
||||
|
||||
$lang->convert->issue->redmine = 'Redmine';
|
||||
$lang->convert->issue->zentao = 'ZenTao';
|
||||
$lang->convert->issue->goto = 'Goto';
|
||||
<?php
|
||||
/**
|
||||
* The convert module English file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->convert->common = 'Import';
|
||||
$lang->convert->next = 'Next';
|
||||
$lang->convert->pre = 'Back';
|
||||
$lang->convert->reload = 'Reload';
|
||||
$lang->convert->error = 'Error ';
|
||||
|
||||
$lang->convert->start = 'Begin import';
|
||||
$lang->convert->desc = <<<EOT
|
||||
<p>Welcome to use this convert wizard which will help you to import other system data to ZenTaoPMS.</p>
|
||||
<strong>Importing is dangerous. Be sure to backup your database and other data files and sure nobody is using pms when importing.</strong>
|
||||
EOT;
|
||||
|
||||
$lang->convert->selectSource = 'Select source system and version';
|
||||
$lang->convert->source = 'Source system';
|
||||
$lang->convert->version = 'Version';
|
||||
$lang->convert->mustSelectSource = "Must select a source system";
|
||||
|
||||
$lang->convert->direction = 'Please select the direction of issue in Redmine';
|
||||
$lang->convert->questionTypeOfRedmine = 'Types of issue in Redmine';
|
||||
$lang->convert->aimTypeOfZentao = 'Aim type in Zentao';
|
||||
|
||||
$lang->convert->directionList['bug'] = 'Bug';
|
||||
$lang->convert->directionList['task'] = 'Task';
|
||||
$lang->convert->directionList['story'] = 'Story';
|
||||
|
||||
$lang->convert->sourceList['BugFree'] = array('bugfree_1' => '1.x', 'bugfree_2' => '2.x');
|
||||
$lang->convert->sourceList['Redmine'] = array('Redmine_1_1' => '1.1');
|
||||
|
||||
$lang->convert->setting = 'Setting';
|
||||
$lang->convert->checkConfig = 'Check setting';
|
||||
|
||||
$lang->convert->ok = 'Check passed(√)';
|
||||
$lang->convert->fail = 'Check failed(×)';
|
||||
|
||||
$lang->convert->settingDB = 'Set database';
|
||||
$lang->convert->dbHost = 'Database server';
|
||||
$lang->convert->dbPort = 'Server port';
|
||||
$lang->convert->dbUser = 'Database user';
|
||||
$lang->convert->dbPassword = 'Database password';
|
||||
$lang->convert->dbName = '%s database';
|
||||
$lang->convert->dbCharset = '%s charset';
|
||||
$lang->convert->dbPrefix = '%s table prefix';
|
||||
$lang->convert->installPath = '%s installed path';
|
||||
|
||||
$lang->convert->checkDB = 'Database';
|
||||
$lang->convert->checkTable = 'Table';
|
||||
$lang->convert->checkPath = 'Installed path';
|
||||
|
||||
$lang->convert->execute = 'Execute import';
|
||||
$lang->convert->item = 'Imported items';
|
||||
$lang->convert->count = 'Count';
|
||||
$lang->convert->info = 'Info';
|
||||
|
||||
$lang->convert->bugfree->users = 'User';
|
||||
$lang->convert->bugfree->projects = 'Project';
|
||||
$lang->convert->bugfree->modules = 'Module';
|
||||
$lang->convert->bugfree->bugs = 'Bug';
|
||||
$lang->convert->bugfree->cases = 'Case';
|
||||
$lang->convert->bugfree->results = 'Result';
|
||||
$lang->convert->bugfree->actions = 'History';
|
||||
$lang->convert->bugfree->files = 'File';
|
||||
|
||||
$lang->convert->redmine->users = 'Users';
|
||||
$lang->convert->redmine->groups = 'Groups';
|
||||
$lang->convert->redmine->products = 'Products';
|
||||
$lang->convert->redmine->projects = 'Projects';
|
||||
$lang->convert->redmine->stories = 'Stories';
|
||||
$lang->convert->redmine->tasks = 'Tasks';
|
||||
$lang->convert->redmine->bugs = 'Bugs';
|
||||
$lang->convert->redmine->productPlans = 'ProductPlans';
|
||||
$lang->convert->redmine->teams = 'Teams';
|
||||
$lang->convert->redmine->releases = 'Releases';
|
||||
$lang->convert->redmine->builds = 'Builds';
|
||||
$lang->convert->redmine->docLibs = 'DocLibs';
|
||||
$lang->convert->redmine->docs = 'Docs';
|
||||
$lang->convert->redmine->files = 'files';
|
||||
|
||||
$lang->convert->errorConnectDB = 'Connect to database server failed.';
|
||||
$lang->convert->errorFileNotExits = 'File %s not exits.';
|
||||
$lang->convert->errorUserExists = 'User %s exits already.';
|
||||
$lang->convert->errorGroupExists = 'Group %s exits already.';
|
||||
$lang->convert->errorBuildExists = 'Build %s exits already.';
|
||||
$lang->convert->errorReleaseExists = 'Release %s exits already.';
|
||||
$lang->convert->errorCopyFailed = 'file %s copy failed.';
|
||||
|
||||
$lang->convert->setParam = 'Please set params';
|
||||
|
||||
$lang->convert->aimType = 'Issue types goto';
|
||||
$lang->convert->statusType->bug = 'Status types goto(status of Bug)';
|
||||
$lang->convert->statusType->story = 'Status types goto(status of story)';
|
||||
$lang->convert->statusType->task = 'Status types goto(status of task)';
|
||||
$lang->convert->priType->bug = 'Priority types goto(priority of Bug)';
|
||||
$lang->convert->priType->story = 'Priority types goto(priority of story)';
|
||||
$lang->convert->priType->task = 'Priority types goto(priority of task)';
|
||||
|
||||
$lang->convert->issue->redmine = 'Redmine';
|
||||
$lang->convert->issue->zentao = 'ZenTao';
|
||||
$lang->convert->issue->goto = 'Goto';
|
||||
|
||||
+109
-109
@@ -1,109 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* The convert module zh-cn file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->convert->common = '从其他系统导入';
|
||||
$lang->convert->next = '下一步';
|
||||
$lang->convert->pre = '返回';
|
||||
$lang->convert->reload = '刷新';
|
||||
$lang->convert->error = '错误 ';
|
||||
|
||||
$lang->convert->start = '开始转换';
|
||||
$lang->convert->desc = <<<EOT
|
||||
<p>欢迎使用系统转换向导,本程序会帮助您将其他系统的数据转换到禅道项目管理系统中。</p>
|
||||
<strong>转换存在一定的风险,转换之前,我们强烈建议您备份数据库及相应的数据文件,并保证转换的时候,没有其他人进行操作。</strong>
|
||||
EOT;
|
||||
|
||||
$lang->convert->selectSource = '选择来源系统及版本';
|
||||
$lang->convert->source = '来源系统';
|
||||
$lang->convert->version = '版本';
|
||||
$lang->convert->mustSelectSource = "必须选择一个来源。";
|
||||
|
||||
$lang->convert->direction = '请选择项目问题转换方向';
|
||||
$lang->convert->questionTypeOfRedmine = 'Redmine中问题类型';
|
||||
$lang->convert->aimTypeOfZentao = '转化为Zentao中的类型';
|
||||
|
||||
$lang->convert->directionList['bug'] = 'Bug';
|
||||
$lang->convert->directionList['task'] = '任务';
|
||||
$lang->convert->directionList['story'] = '需求';
|
||||
|
||||
$lang->convert->sourceList['BugFree'] = array('bugfree_1' => '1.x', 'bugfree_2' => '2.x');
|
||||
$lang->convert->sourceList['Redmine'] = array('Redmine_1.1' => '1.1');
|
||||
|
||||
$lang->convert->setting = '设置';
|
||||
$lang->convert->checkConfig = '检查配置';
|
||||
|
||||
$lang->convert->ok = '检查通过(√)';
|
||||
$lang->convert->fail = '检查失败(×)';
|
||||
|
||||
$lang->convert->settingDB = '设置数据库';
|
||||
$lang->convert->dbHost = '数据库服务器';
|
||||
$lang->convert->dbPort = '服务器端口';
|
||||
$lang->convert->dbUser = '数据库用户名';
|
||||
$lang->convert->dbPassword = '数据库密码';
|
||||
$lang->convert->dbName = '%s使用的库';
|
||||
$lang->convert->dbCharset = '%s数据库编码';
|
||||
$lang->convert->dbPrefix = '%s表前缀';
|
||||
$lang->convert->installPath = '%s安装的根目录';
|
||||
|
||||
$lang->convert->checkDB = '数据库';
|
||||
$lang->convert->checkTable = '表';
|
||||
$lang->convert->checkPath = '安装路径';
|
||||
|
||||
$lang->convert->execute = '执行转换';
|
||||
$lang->convert->item = '转换项';
|
||||
$lang->convert->count = '转换数量';
|
||||
$lang->convert->info = '转换信息';
|
||||
|
||||
$lang->convert->bugfree->users = '用户';
|
||||
$lang->convert->bugfree->projects = '项目';
|
||||
$lang->convert->bugfree->modules = '模块';
|
||||
$lang->convert->bugfree->bugs = 'Bug';
|
||||
$lang->convert->bugfree->cases = '测试用例';
|
||||
$lang->convert->bugfree->results = '测试结果';
|
||||
$lang->convert->bugfree->actions = '历史记录';
|
||||
$lang->convert->bugfree->files = '附件';
|
||||
|
||||
$lang->convert->redmine->users = '用户';
|
||||
$lang->convert->redmine->groups = '用户分组';
|
||||
$lang->convert->redmine->products = '产品';
|
||||
$lang->convert->redmine->projects = '项目';
|
||||
$lang->convert->redmine->stories = '需求';
|
||||
$lang->convert->redmine->tasks = '任务';
|
||||
$lang->convert->redmine->bugs = 'Bug';
|
||||
$lang->convert->redmine->productPlans = '产品计划';
|
||||
$lang->convert->redmine->teams = '团队';
|
||||
$lang->convert->redmine->releases = '发布';
|
||||
$lang->convert->redmine->builds = 'Build';
|
||||
$lang->convert->redmine->docLibs = '文档库';
|
||||
$lang->convert->redmine->docs = '文档';
|
||||
$lang->convert->redmine->files = '附件';
|
||||
|
||||
$lang->convert->errorConnectDB = '数据库连接失败 ';
|
||||
$lang->convert->errorFileNotExits = '文件 %s 不存在';
|
||||
$lang->convert->errorUserExists = '用户 %s 已存在';
|
||||
$lang->convert->errorGroupExists = '分组 %s 已存在';
|
||||
$lang->convert->errorBuildExists = 'Build %s 已存在';
|
||||
$lang->convert->errorReleaseExists = '发布 %s 已存在';
|
||||
$lang->convert->errorCopyFailed = '文件 %s 拷贝失败';
|
||||
|
||||
$lang->convert->setParam = '请设置转换参数';
|
||||
|
||||
$lang->convert->aimType = '问题类型转换';
|
||||
$lang->convert->statusType->bug = '状态类型转换(Bug状态)';
|
||||
$lang->convert->statusType->story = '状态类型转换(Story状态)';
|
||||
$lang->convert->statusType->task = '状态类型转换(Task状态)';
|
||||
$lang->convert->priType->bug = '优先级类型转换(Bug状态)';
|
||||
$lang->convert->priType->story = '优先级类型转换(Story状态)';
|
||||
$lang->convert->priType->task = '优先级类型转换(Task状态)';
|
||||
|
||||
$lang->convert->issue->redmine = 'Redmine';
|
||||
$lang->convert->issue->zentao = '禅道';
|
||||
$lang->convert->issue->goto = '转换为';
|
||||
<?php
|
||||
/**
|
||||
* The convert module zh-cn file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->convert->common = '从其他系统导入';
|
||||
$lang->convert->next = '下一步';
|
||||
$lang->convert->pre = '返回';
|
||||
$lang->convert->reload = '刷新';
|
||||
$lang->convert->error = '错误 ';
|
||||
|
||||
$lang->convert->start = '开始转换';
|
||||
$lang->convert->desc = <<<EOT
|
||||
<p>欢迎使用系统转换向导,本程序会帮助您将其他系统的数据转换到禅道项目管理系统中。</p>
|
||||
<strong>转换存在一定的风险,转换之前,我们强烈建议您备份数据库及相应的数据文件,并保证转换的时候,没有其他人进行操作。</strong>
|
||||
EOT;
|
||||
|
||||
$lang->convert->selectSource = '选择来源系统及版本';
|
||||
$lang->convert->source = '来源系统';
|
||||
$lang->convert->version = '版本';
|
||||
$lang->convert->mustSelectSource = "必须选择一个来源。";
|
||||
|
||||
$lang->convert->direction = '请选择项目问题转换方向';
|
||||
$lang->convert->questionTypeOfRedmine = 'Redmine中问题类型';
|
||||
$lang->convert->aimTypeOfZentao = '转化为Zentao中的类型';
|
||||
|
||||
$lang->convert->directionList['bug'] = 'Bug';
|
||||
$lang->convert->directionList['task'] = '任务';
|
||||
$lang->convert->directionList['story'] = '需求';
|
||||
|
||||
$lang->convert->sourceList['BugFree'] = array('bugfree_1' => '1.x', 'bugfree_2' => '2.x');
|
||||
$lang->convert->sourceList['Redmine'] = array('Redmine_1.1' => '1.1');
|
||||
|
||||
$lang->convert->setting = '设置';
|
||||
$lang->convert->checkConfig = '检查配置';
|
||||
|
||||
$lang->convert->ok = '检查通过(√)';
|
||||
$lang->convert->fail = '检查失败(×)';
|
||||
|
||||
$lang->convert->settingDB = '设置数据库';
|
||||
$lang->convert->dbHost = '数据库服务器';
|
||||
$lang->convert->dbPort = '服务器端口';
|
||||
$lang->convert->dbUser = '数据库用户名';
|
||||
$lang->convert->dbPassword = '数据库密码';
|
||||
$lang->convert->dbName = '%s使用的库';
|
||||
$lang->convert->dbCharset = '%s数据库编码';
|
||||
$lang->convert->dbPrefix = '%s表前缀';
|
||||
$lang->convert->installPath = '%s安装的根目录';
|
||||
|
||||
$lang->convert->checkDB = '数据库';
|
||||
$lang->convert->checkTable = '表';
|
||||
$lang->convert->checkPath = '安装路径';
|
||||
|
||||
$lang->convert->execute = '执行转换';
|
||||
$lang->convert->item = '转换项';
|
||||
$lang->convert->count = '转换数量';
|
||||
$lang->convert->info = '转换信息';
|
||||
|
||||
$lang->convert->bugfree->users = '用户';
|
||||
$lang->convert->bugfree->projects = '项目';
|
||||
$lang->convert->bugfree->modules = '模块';
|
||||
$lang->convert->bugfree->bugs = 'Bug';
|
||||
$lang->convert->bugfree->cases = '测试用例';
|
||||
$lang->convert->bugfree->results = '测试结果';
|
||||
$lang->convert->bugfree->actions = '历史记录';
|
||||
$lang->convert->bugfree->files = '附件';
|
||||
|
||||
$lang->convert->redmine->users = '用户';
|
||||
$lang->convert->redmine->groups = '用户分组';
|
||||
$lang->convert->redmine->products = '产品';
|
||||
$lang->convert->redmine->projects = '项目';
|
||||
$lang->convert->redmine->stories = '需求';
|
||||
$lang->convert->redmine->tasks = '任务';
|
||||
$lang->convert->redmine->bugs = 'Bug';
|
||||
$lang->convert->redmine->productPlans = '产品计划';
|
||||
$lang->convert->redmine->teams = '团队';
|
||||
$lang->convert->redmine->releases = '发布';
|
||||
$lang->convert->redmine->builds = 'Build';
|
||||
$lang->convert->redmine->docLibs = '文档库';
|
||||
$lang->convert->redmine->docs = '文档';
|
||||
$lang->convert->redmine->files = '附件';
|
||||
|
||||
$lang->convert->errorConnectDB = '数据库连接失败 ';
|
||||
$lang->convert->errorFileNotExits = '文件 %s 不存在';
|
||||
$lang->convert->errorUserExists = '用户 %s 已存在';
|
||||
$lang->convert->errorGroupExists = '分组 %s 已存在';
|
||||
$lang->convert->errorBuildExists = 'Build %s 已存在';
|
||||
$lang->convert->errorReleaseExists = '发布 %s 已存在';
|
||||
$lang->convert->errorCopyFailed = '文件 %s 拷贝失败';
|
||||
|
||||
$lang->convert->setParam = '请设置转换参数';
|
||||
|
||||
$lang->convert->aimType = '问题类型转换';
|
||||
$lang->convert->statusType->bug = '状态类型转换(Bug状态)';
|
||||
$lang->convert->statusType->story = '状态类型转换(Story状态)';
|
||||
$lang->convert->statusType->task = '状态类型转换(Task状态)';
|
||||
$lang->convert->priType->bug = '优先级类型转换(Bug状态)';
|
||||
$lang->convert->priType->story = '优先级类型转换(Story状态)';
|
||||
$lang->convert->priType->task = '优先级类型转换(Task状态)';
|
||||
|
||||
$lang->convert->issue->redmine = 'Redmine';
|
||||
$lang->convert->issue->zentao = '禅道';
|
||||
$lang->convert->issue->goto = '转换为';
|
||||
|
||||
+109
-109
@@ -1,109 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* The convert module zh-tw file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青島易軟天創網絡科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id: zh-tw.php 2568 2012-02-09 06:56:35Z shiyangyangwork@yahoo.cn $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->convert->common = '從其他系統導入';
|
||||
$lang->convert->next = '下一步';
|
||||
$lang->convert->pre = '返回';
|
||||
$lang->convert->reload = '刷新';
|
||||
$lang->convert->error = '錯誤 ';
|
||||
|
||||
$lang->convert->start = '開始轉換';
|
||||
$lang->convert->desc = <<<EOT
|
||||
<p>歡迎使用系統轉換嚮導,本程序會幫助您將其他系統的數據轉換到禪道項目管理系統中。</p>
|
||||
<strong>轉換存在一定的風險,轉換之前,我們強烈建議您備份資料庫及相應的數據檔案,並保證轉換的時候,沒有其他人進行操作。</strong>
|
||||
EOT;
|
||||
|
||||
$lang->convert->selectSource = '選擇來源系統及版本';
|
||||
$lang->convert->source = '來源系統';
|
||||
$lang->convert->version = '版本';
|
||||
$lang->convert->mustSelectSource = "必須選擇一個來源。";
|
||||
|
||||
$lang->convert->direction = '請選擇項目問題轉換方向';
|
||||
$lang->convert->questionTypeOfRedmine = 'Redmine中問題類型';
|
||||
$lang->convert->aimTypeOfZentao = '轉化為Zentao中的類型';
|
||||
|
||||
$lang->convert->directionList['bug'] = 'Bug';
|
||||
$lang->convert->directionList['task'] = '任務';
|
||||
$lang->convert->directionList['story'] = '需求';
|
||||
|
||||
$lang->convert->sourceList['BugFree'] = array('bugfree_1' => '1.x', 'bugfree_2' => '2.x');
|
||||
$lang->convert->sourceList['Redmine'] = array('Redmine_1.1' => '1.1');
|
||||
|
||||
$lang->convert->setting = '設置';
|
||||
$lang->convert->checkConfig = '檢查配置';
|
||||
|
||||
$lang->convert->ok = '檢查通過(√)';
|
||||
$lang->convert->fail = '檢查失敗(×)';
|
||||
|
||||
$lang->convert->settingDB = '設置資料庫';
|
||||
$lang->convert->dbHost = '資料庫伺服器';
|
||||
$lang->convert->dbPort = '伺服器連接埠';
|
||||
$lang->convert->dbUser = '資料庫用戶名';
|
||||
$lang->convert->dbPassword = '資料庫密碼';
|
||||
$lang->convert->dbName = '%s使用的庫';
|
||||
$lang->convert->dbCharset = '%s資料庫編碼';
|
||||
$lang->convert->dbPrefix = '%s表首碼';
|
||||
$lang->convert->installPath = '%s安裝的根目錄';
|
||||
|
||||
$lang->convert->checkDB = '資料庫';
|
||||
$lang->convert->checkTable = '表';
|
||||
$lang->convert->checkPath = '安裝路徑';
|
||||
|
||||
$lang->convert->execute = '執行轉換';
|
||||
$lang->convert->item = '轉換項';
|
||||
$lang->convert->count = '轉換數量';
|
||||
$lang->convert->info = '轉換信息';
|
||||
|
||||
$lang->convert->bugfree->users = '用戶';
|
||||
$lang->convert->bugfree->projects = '項目';
|
||||
$lang->convert->bugfree->modules = '模組';
|
||||
$lang->convert->bugfree->bugs = 'Bug';
|
||||
$lang->convert->bugfree->cases = '測試用例';
|
||||
$lang->convert->bugfree->results = '測試結果';
|
||||
$lang->convert->bugfree->actions = '歷史記錄';
|
||||
$lang->convert->bugfree->files = '附件';
|
||||
|
||||
$lang->convert->redmine->users = '用戶';
|
||||
$lang->convert->redmine->groups = '用戶分組';
|
||||
$lang->convert->redmine->products = '產品';
|
||||
$lang->convert->redmine->projects = '項目';
|
||||
$lang->convert->redmine->stories = '需求';
|
||||
$lang->convert->redmine->tasks = '任務';
|
||||
$lang->convert->redmine->bugs = 'Bug';
|
||||
$lang->convert->redmine->productPlans = '產品計劃';
|
||||
$lang->convert->redmine->teams = '團隊';
|
||||
$lang->convert->redmine->releases = '發佈';
|
||||
$lang->convert->redmine->builds = 'Build';
|
||||
$lang->convert->redmine->docLibs = '文檔庫';
|
||||
$lang->convert->redmine->docs = '文檔';
|
||||
$lang->convert->redmine->files = '附件';
|
||||
|
||||
$lang->convert->errorConnectDB = '資料庫連接失敗 ';
|
||||
$lang->convert->errorFileNotExits = '檔案 %s 不存在';
|
||||
$lang->convert->errorUserExists = '用戶 %s 已存在';
|
||||
$lang->convert->errorGroupExists = '分組 %s 已存在';
|
||||
$lang->convert->errorBuildExists = 'Build %s 已存在';
|
||||
$lang->convert->errorReleaseExists = '發佈 %s 已存在';
|
||||
$lang->convert->errorCopyFailed = '檔案 %s 拷貝失敗';
|
||||
|
||||
$lang->convert->setParam = '請設置轉換參數';
|
||||
|
||||
$lang->convert->aimType = '問題類型轉換';
|
||||
$lang->convert->statusType->bug = '狀態類型轉換(Bug狀態)';
|
||||
$lang->convert->statusType->story = '狀態類型轉換(Story狀態)';
|
||||
$lang->convert->statusType->task = '狀態類型轉換(Task狀態)';
|
||||
$lang->convert->priType->bug = '優先順序類型轉換(Bug狀態)';
|
||||
$lang->convert->priType->story = '優先順序類型轉換(Story狀態)';
|
||||
$lang->convert->priType->task = '優先順序類型轉換(Task狀態)';
|
||||
|
||||
$lang->convert->issue->redmine = 'Redmine';
|
||||
$lang->convert->issue->zentao = '禪道';
|
||||
$lang->convert->issue->goto = '轉換為';
|
||||
<?php
|
||||
/**
|
||||
* The convert module zh-tw file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青島易軟天創網絡科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id: zh-tw.php 2568 2012-02-09 06:56:35Z shiyangyangwork@yahoo.cn $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->convert->common = '從其他系統導入';
|
||||
$lang->convert->next = '下一步';
|
||||
$lang->convert->pre = '返回';
|
||||
$lang->convert->reload = '刷新';
|
||||
$lang->convert->error = '錯誤 ';
|
||||
|
||||
$lang->convert->start = '開始轉換';
|
||||
$lang->convert->desc = <<<EOT
|
||||
<p>歡迎使用系統轉換嚮導,本程序會幫助您將其他系統的數據轉換到禪道項目管理系統中。</p>
|
||||
<strong>轉換存在一定的風險,轉換之前,我們強烈建議您備份資料庫及相應的數據檔案,並保證轉換的時候,沒有其他人進行操作。</strong>
|
||||
EOT;
|
||||
|
||||
$lang->convert->selectSource = '選擇來源系統及版本';
|
||||
$lang->convert->source = '來源系統';
|
||||
$lang->convert->version = '版本';
|
||||
$lang->convert->mustSelectSource = "必須選擇一個來源。";
|
||||
|
||||
$lang->convert->direction = '請選擇項目問題轉換方向';
|
||||
$lang->convert->questionTypeOfRedmine = 'Redmine中問題類型';
|
||||
$lang->convert->aimTypeOfZentao = '轉化為Zentao中的類型';
|
||||
|
||||
$lang->convert->directionList['bug'] = 'Bug';
|
||||
$lang->convert->directionList['task'] = '任務';
|
||||
$lang->convert->directionList['story'] = '需求';
|
||||
|
||||
$lang->convert->sourceList['BugFree'] = array('bugfree_1' => '1.x', 'bugfree_2' => '2.x');
|
||||
$lang->convert->sourceList['Redmine'] = array('Redmine_1.1' => '1.1');
|
||||
|
||||
$lang->convert->setting = '設置';
|
||||
$lang->convert->checkConfig = '檢查配置';
|
||||
|
||||
$lang->convert->ok = '檢查通過(√)';
|
||||
$lang->convert->fail = '檢查失敗(×)';
|
||||
|
||||
$lang->convert->settingDB = '設置資料庫';
|
||||
$lang->convert->dbHost = '資料庫伺服器';
|
||||
$lang->convert->dbPort = '伺服器連接埠';
|
||||
$lang->convert->dbUser = '資料庫用戶名';
|
||||
$lang->convert->dbPassword = '資料庫密碼';
|
||||
$lang->convert->dbName = '%s使用的庫';
|
||||
$lang->convert->dbCharset = '%s資料庫編碼';
|
||||
$lang->convert->dbPrefix = '%s表首碼';
|
||||
$lang->convert->installPath = '%s安裝的根目錄';
|
||||
|
||||
$lang->convert->checkDB = '資料庫';
|
||||
$lang->convert->checkTable = '表';
|
||||
$lang->convert->checkPath = '安裝路徑';
|
||||
|
||||
$lang->convert->execute = '執行轉換';
|
||||
$lang->convert->item = '轉換項';
|
||||
$lang->convert->count = '轉換數量';
|
||||
$lang->convert->info = '轉換信息';
|
||||
|
||||
$lang->convert->bugfree->users = '用戶';
|
||||
$lang->convert->bugfree->projects = '項目';
|
||||
$lang->convert->bugfree->modules = '模組';
|
||||
$lang->convert->bugfree->bugs = 'Bug';
|
||||
$lang->convert->bugfree->cases = '測試用例';
|
||||
$lang->convert->bugfree->results = '測試結果';
|
||||
$lang->convert->bugfree->actions = '歷史記錄';
|
||||
$lang->convert->bugfree->files = '附件';
|
||||
|
||||
$lang->convert->redmine->users = '用戶';
|
||||
$lang->convert->redmine->groups = '用戶分組';
|
||||
$lang->convert->redmine->products = '產品';
|
||||
$lang->convert->redmine->projects = '項目';
|
||||
$lang->convert->redmine->stories = '需求';
|
||||
$lang->convert->redmine->tasks = '任務';
|
||||
$lang->convert->redmine->bugs = 'Bug';
|
||||
$lang->convert->redmine->productPlans = '產品計劃';
|
||||
$lang->convert->redmine->teams = '團隊';
|
||||
$lang->convert->redmine->releases = '發佈';
|
||||
$lang->convert->redmine->builds = 'Build';
|
||||
$lang->convert->redmine->docLibs = '文檔庫';
|
||||
$lang->convert->redmine->docs = '文檔';
|
||||
$lang->convert->redmine->files = '附件';
|
||||
|
||||
$lang->convert->errorConnectDB = '資料庫連接失敗 ';
|
||||
$lang->convert->errorFileNotExits = '檔案 %s 不存在';
|
||||
$lang->convert->errorUserExists = '用戶 %s 已存在';
|
||||
$lang->convert->errorGroupExists = '分組 %s 已存在';
|
||||
$lang->convert->errorBuildExists = 'Build %s 已存在';
|
||||
$lang->convert->errorReleaseExists = '發佈 %s 已存在';
|
||||
$lang->convert->errorCopyFailed = '檔案 %s 拷貝失敗';
|
||||
|
||||
$lang->convert->setParam = '請設置轉換參數';
|
||||
|
||||
$lang->convert->aimType = '問題類型轉換';
|
||||
$lang->convert->statusType->bug = '狀態類型轉換(Bug狀態)';
|
||||
$lang->convert->statusType->story = '狀態類型轉換(Story狀態)';
|
||||
$lang->convert->statusType->task = '狀態類型轉換(Task狀態)';
|
||||
$lang->convert->priType->bug = '優先順序類型轉換(Bug狀態)';
|
||||
$lang->convert->priType->story = '優先順序類型轉換(Story狀態)';
|
||||
$lang->convert->priType->task = '優先順序類型轉換(Task狀態)';
|
||||
|
||||
$lang->convert->issue->redmine = 'Redmine';
|
||||
$lang->convert->issue->zentao = '禪道';
|
||||
$lang->convert->issue->goto = '轉換為';
|
||||
|
||||
+94
-94
@@ -1,94 +1,94 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class convertModel extends model
|
||||
{
|
||||
/**
|
||||
* Connect to db.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function connectDB()
|
||||
{
|
||||
$dsn = "mysql:host={$this->post->dbHost}; port={$this->post->dbPort};dbname={$this->post->dbName}";
|
||||
try
|
||||
{
|
||||
$dbh = new PDO($dsn, $this->post->dbUser, $this->post->dbPassword);
|
||||
$dbh->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
|
||||
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$dbh->exec("SET NAMES {$this->post->dbCharset}");
|
||||
$this->sourceDBH = $dbh;
|
||||
return $dbh;
|
||||
}
|
||||
catch (PDOException $exception)
|
||||
{
|
||||
return $exception->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check database exits or not.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function dbExists()
|
||||
{
|
||||
$sql = "SHOW DATABASES like '{$this->post->db->name}'";
|
||||
return $this->dbh->query($sql)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check table exits or not.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function tableExists($table)
|
||||
{
|
||||
$sql = "SHOW tables like '$table'";
|
||||
return $this->dbh->query($sql)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the max id of every table. Thus when we convert again, when can delete id larger then the saved max id.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function saveState()
|
||||
{
|
||||
/* Get user defined tables. */
|
||||
$constants = get_defined_constants(true);
|
||||
$userConstants = $constants['user'];
|
||||
|
||||
/* These tables needn't save. */
|
||||
unset($userConstants['TABLE_BURN']);
|
||||
unset($userConstants['TABLE_GROUPPRIV']);
|
||||
unset($userConstants['TABLE_PROJECTPRODUCT']);
|
||||
unset($userConstants['TABLE_PROJECTSTORY']);
|
||||
unset($userConstants['TABLE_STORYSPEC']);
|
||||
unset($userConstants['TABLE_TEAM']);
|
||||
unset($userConstants['TABLE_USERGROUP']);
|
||||
|
||||
/* Get max id of every table. */
|
||||
foreach($userConstants as $key => $value)
|
||||
{
|
||||
if(strpos($key, 'TABLE') === false) continue;
|
||||
if($key == 'TABLE_COMPANY') continue;
|
||||
$state[$value] = (int)$this->dao->select('MAX(id) AS id')->from($value)->fetch('id');
|
||||
}
|
||||
$this->session->set('state', $state);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* The model file of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class convertModel extends model
|
||||
{
|
||||
/**
|
||||
* Connect to db.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function connectDB()
|
||||
{
|
||||
$dsn = "mysql:host={$this->post->dbHost}; port={$this->post->dbPort};dbname={$this->post->dbName}";
|
||||
try
|
||||
{
|
||||
$dbh = new PDO($dsn, $this->post->dbUser, $this->post->dbPassword);
|
||||
$dbh->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
|
||||
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$dbh->exec("SET NAMES {$this->post->dbCharset}");
|
||||
$this->sourceDBH = $dbh;
|
||||
return $dbh;
|
||||
}
|
||||
catch (PDOException $exception)
|
||||
{
|
||||
return $exception->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check database exits or not.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function dbExists()
|
||||
{
|
||||
$sql = "SHOW DATABASES like '{$this->post->db->name}'";
|
||||
return $this->dbh->query($sql)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check table exits or not.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function tableExists($table)
|
||||
{
|
||||
$sql = "SHOW tables like '$table'";
|
||||
return $this->dbh->query($sql)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the max id of every table. Thus when we convert again, when can delete id larger then the saved max id.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function saveState()
|
||||
{
|
||||
/* Get user defined tables. */
|
||||
$constants = get_defined_constants(true);
|
||||
$userConstants = $constants['user'];
|
||||
|
||||
/* These tables needn't save. */
|
||||
unset($userConstants['TABLE_BURN']);
|
||||
unset($userConstants['TABLE_GROUPPRIV']);
|
||||
unset($userConstants['TABLE_PROJECTPRODUCT']);
|
||||
unset($userConstants['TABLE_PROJECTSTORY']);
|
||||
unset($userConstants['TABLE_STORYSPEC']);
|
||||
unset($userConstants['TABLE_TEAM']);
|
||||
unset($userConstants['TABLE_USERGROUP']);
|
||||
|
||||
/* Get max id of every table. */
|
||||
foreach($userConstants as $key => $value)
|
||||
{
|
||||
if(strpos($key, 'TABLE') === false) continue;
|
||||
if($key == 'TABLE_COMPANY') continue;
|
||||
$state[$value] = (int)$this->dao->select('MAX(id) AS id')->from($value)->fetch('id');
|
||||
}
|
||||
$this->session->set('state', $state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* The html template file of check config method of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<form method='post' action='<?php echo inlink('execute');?>'>
|
||||
<table align='center' class='w-p65 f-14px'>
|
||||
<caption><?php echo $lang->convert->checkConfig . $lang->colon . strtoupper($source);?></caption>
|
||||
<?php echo $checkResult;?>
|
||||
</table>
|
||||
<?php
|
||||
echo html::hidden('dbHost', $this->post->dbHost);
|
||||
echo html::hidden('dbPort', $this->post->dbPort);
|
||||
echo html::hidden('dbUser', $this->post->dbUser);
|
||||
echo html::hidden('dbPassword', $this->post->dbPassword);
|
||||
echo html::hidden('dbName', $this->post->dbName);
|
||||
echo html::hidden('dbCharset', $this->post->dbCharset);
|
||||
echo html::hidden('dbPrefix', $this->post->dbPrefix);
|
||||
echo html::hidden('installPath',$this->post->installPath);
|
||||
?>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* The html template file of check config method of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<form method='post' action='<?php echo inlink('execute');?>'>
|
||||
<table align='center' class='w-p65 f-14px'>
|
||||
<caption><?php echo $lang->convert->checkConfig . $lang->colon . strtoupper($source);?></caption>
|
||||
<?php echo $checkResult;?>
|
||||
</table>
|
||||
<?php
|
||||
echo html::hidden('dbHost', $this->post->dbHost);
|
||||
echo html::hidden('dbPort', $this->post->dbPort);
|
||||
echo html::hidden('dbUser', $this->post->dbUser);
|
||||
echo html::hidden('dbPassword', $this->post->dbPassword);
|
||||
echo html::hidden('dbName', $this->post->dbName);
|
||||
echo html::hidden('dbCharset', $this->post->dbCharset);
|
||||
echo html::hidden('dbPrefix', $this->post->dbPrefix);
|
||||
echo html::hidden('installPath',$this->post->installPath);
|
||||
?>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* The html template file of execute method of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<table align='center' class='f-14px'>
|
||||
<caption><?php echo $lang->convert->execute . $lang->colon . strtoupper($source);?></caption>
|
||||
<?php echo $executeResult;?>
|
||||
</table>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* The html template file of execute method of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<table align='center' class='f-14px'>
|
||||
<caption><?php echo $lang->convert->execute . $lang->colon . strtoupper($source);?></caption>
|
||||
<?php echo $executeResult;?>
|
||||
</table>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* The html template file of index method of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package ZenTaoPMS
|
||||
* @version $Id$
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<table align='center' class='table-5'>
|
||||
<caption><?php echo $lang->convert->common;?></caption>
|
||||
<tr><td><?php echo nl2br($lang->convert->desc);?></td></tr>
|
||||
<tr><td><h3 class='a-center'><?php echo html::a($this->createLink('convert', 'selectsource'), $lang->convert->start);?></h3></td></tr>
|
||||
</table>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* The html template file of index method of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package ZenTaoPMS
|
||||
* @version $Id$
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<table align='center' class='table-5'>
|
||||
<caption><?php echo $lang->convert->common;?></caption>
|
||||
<tr><td><?php echo nl2br($lang->convert->desc);?></td></tr>
|
||||
<tr><td><h3 class='a-center'><?php echo html::a($this->createLink('convert', 'selectsource'), $lang->convert->start);?></h3></td></tr>
|
||||
</table>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* The html template file of select source method of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<form method='post' action='<?php echo inlink('setConfig');?>'>
|
||||
<table align='center' class='table-5 f-14px'>
|
||||
<caption><?php echo $lang->convert->selectSource;?></caption>
|
||||
<tr>
|
||||
<th class='w-p20'><?php echo $lang->convert->source;?></th>
|
||||
<th><?php echo $lang->convert->version;?></th>
|
||||
</tr>
|
||||
<?php foreach($lang->convert->sourceList as $name => $versions):?>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $name;?></th>
|
||||
<td><?php echo html::radio('source', $versions);?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* The html template file of select source method of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<form method='post' action='<?php echo inlink('setConfig');?>'>
|
||||
<table align='center' class='table-5 f-14px'>
|
||||
<caption><?php echo $lang->convert->selectSource;?></caption>
|
||||
<tr>
|
||||
<th class='w-p20'><?php echo $lang->convert->source;?></th>
|
||||
<th><?php echo $lang->convert->version;?></th>
|
||||
</tr>
|
||||
<?php foreach($lang->convert->sourceList as $name => $versions):?>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $name;?></th>
|
||||
<td><?php echo html::radio('source', $versions);?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* The html template file of setconfig method of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<form method='post' action='<?php echo inlink('checkconfig');?>'>
|
||||
<table align='center' class='table-5 f-14px'>
|
||||
<caption><?php echo $lang->convert->setting . $lang->colon . strtoupper($source);?></caption>
|
||||
<?php echo $setting;?>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php echo html::hidden('source', $source) . html::hidden('version', $version);?>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* The html template file of setconfig method of convert module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package convert
|
||||
* @version $Id$
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<form method='post' action='<?php echo inlink('checkconfig');?>'>
|
||||
<table align='center' class='table-5 f-14px'>
|
||||
<caption><?php echo $lang->convert->setting . $lang->colon . strtoupper($source);?></caption>
|
||||
<?php echo $setting;?>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php echo html::hidden('source', $source) . html::hidden('version', $version);?>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user