* fix for upgrade.

This commit is contained in:
wangyidong
2017-12-22 09:05:34 +08:00
parent cc8bf62fe5
commit 60ebe9fa2e
20 changed files with 87 additions and 40 deletions

View File

@@ -1 +1 @@
9.6.3
9.7.stable

View File

@@ -16,7 +16,7 @@ if(!class_exists('config')){class config{}}
if(!function_exists('getWebRoot')){function getWebRoot(){}}
/* 基本设置。Basic settings. */
$config->version = '9.6.3'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it.
$config->version = '9.7'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it.
$config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP.
$config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time.
$config->timezone = 'Asia/Shanghai'; // 时区设置。 The time zone setting, for more see http://www.php.net/manual/en/timezones.php.

View File

@@ -77,7 +77,8 @@ $lang->bug->confirmBug = 'Confirm';
$lang->bug->batchConfirm = 'Batch Confirm';
$lang->bug->edit = 'Edit';
$lang->bug->batchEdit = 'Batch Edit';
$lang->bug->batchChangeModule = 'Batch Modify';
$lang->bug->batchChangeModule = 'Batch Modify Module';
$lang->bug->batchChangeBranch = 'Batch Modify Branch';
$lang->bug->batchClose = 'Batch Close';
$lang->bug->assignTo = 'Assign';
$lang->bug->batchAssignTo = 'Batch Assign';
@@ -367,6 +368,9 @@ $lang->bug->mySelects['resolvedbyme'] = $lang->bug->resolvedByMe;
$lang->bug->featureBar['browse']['unclosed'] = $lang->bug->unclosed;
$lang->bug->featureBar['browse']['all'] = $lang->bug->allBugs;
$lang->bug->featureBar['browse']['my'] = $lang->bug->my;
$lang->bug->featureBar['browse']['unconfirmed'] = $lang->bug->confirmedList[0];
$lang->bug->featureBar['browse']['assigntonull'] = $lang->bug->assignToNull;

View File

@@ -78,6 +78,7 @@ $lang->bug->batchConfirm = '批量确认';
$lang->bug->edit = '编辑';
$lang->bug->batchEdit = '批量编辑';
$lang->bug->batchChangeModule = '批量修改模块';
$lang->bug->batchChangeBranch = '批量修改分支';
$lang->bug->batchClose = '批量关闭';
$lang->bug->assignTo = '指派';
$lang->bug->batchAssignTo = '批量指派';
@@ -361,11 +362,16 @@ $lang->bug->placeholder = new stdclass();
$lang->bug->placeholder->chooseBuilds = '选择相关版本...';
$lang->bug->placeholder->newBuildName = '新版本名称';
$lang->bug->featureBar['browse']['unclosed'] = $lang->bug->unclosed;
$lang->bug->featureBar['browse']['all'] = $lang->bug->allBugs;
$lang->bug->featureBar['browse']['assigntome'] = $lang->bug->assignToMe;
$lang->bug->featureBar['browse']['openedbyme'] = $lang->bug->openedByMe;
$lang->bug->featureBar['browse']['resolvedbyme'] = $lang->bug->resolvedByMe;
$lang->bug->featureBar['browse']['unconfirmed'] = $lang->bug->confirmedList[0];
$lang->bug->featureBar['browse']['assigntonull'] = $lang->bug->assignToNull;
$lang->bug->featureBar['browse']['unresolved'] = $lang->bug->unResolved;

View File

@@ -337,6 +337,7 @@ $lang->user->menu = $lang->company->menu;
$lang->admin = new stdclass();
$lang->admin->menu = new stdclass();
$lang->admin->menu->index = array('link' => 'Home|admin|index', 'alias' => 'register,certifytemail,certifyztmobile,ztcompany');
$lang->admin->menu->custom = array('link' => 'Custom|custom|set', 'subModule' => 'custom');
$lang->admin->menu->mail = array('link' => 'Email|mail|index', 'subModule' => 'mail');
$lang->admin->menu->backup = array('link' => 'Backup|backup|index', 'subModule' => 'backup');
@@ -346,7 +347,6 @@ $lang->admin->menu->trashes = array('link' => 'Recycle|action|trash', 'subModu
$lang->admin->menu->dev = array('link' => 'Develop|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor');
$lang->admin->menu->api = array('link' => 'API|webhook|browse', 'alias' => 'create,edit', 'subModule' => 'entry,webhook');
$lang->admin->menu->sso = 'RangerTeam|admin|sso';
//$lang->admin->menu->extension = array('link' => 'Extension|extension|browse', 'subModule' => 'extension');
$lang->convert = new stdclass();
$lang->upgrade = new stdclass();

View File

@@ -483,6 +483,7 @@ $lang->resource->bug->saveTemplate = 'saveTemplate';
$lang->resource->bug->deleteTemplate = 'deleteTemplate';
$lang->resource->bug->setPublic = 'setPublic';
$lang->resource->bug->batchChangeModule = 'batchChangeModule';
$lang->resource->bug->batchChangeBranch = 'batchChangeBranch';
$lang->bug->methodOrder[0] = 'index';
$lang->bug->methodOrder[5] = 'browse';
@@ -511,6 +512,7 @@ $lang->bug->methodOrder[110] = 'setPublic';
$lang->bug->methodOrder[115] = 'linkBugs';
$lang->bug->methodOrder[120] = 'unlinkBug';
$lang->bug->methodOrder[125] = 'batchChangeModule';
$lang->bug->methodOrder[130] = 'batchChangeBranch';
/* Test case. */
$lang->resource->testcase = new stdclass();
@@ -534,6 +536,7 @@ $lang->resource->testcase->showImport = 'showImport';
$lang->resource->testcase->confirmChange = 'confirmChange';
$lang->resource->testcase->confirmStoryChange = 'confirmStoryChange';
$lang->resource->testcase->batchChangeModule = 'batchChangeModule';
$lang->resource->testcase->batchChangeBranch = 'batchChangeBranch';
$lang->resource->testcase->bugs = 'bugs';
$lang->resource->testcase->review = 'review';
$lang->resource->testcase->batchReview = 'batchReview';
@@ -556,9 +559,10 @@ $lang->testcase->methodOrder[55] = 'confirmStoryChange';
$lang->testcase->methodOrder[60] = 'batchEdit';
$lang->testcase->methodOrder[65] = 'batchDelete';
$lang->testcase->methodOrder[70] = 'batchChangeModule';
$lang->testcase->methodOrder[75] = 'linkCases';
$lang->testcase->methodOrder[80] = 'unlinkCase';
$lang->testcase->methodOrder[85] = 'bugs';
$lang->testcase->methodOrder[75] = 'batchChangeBranch';
$lang->testcase->methodOrder[80] = 'linkCases';
$lang->testcase->methodOrder[85] = 'unlinkCase';
$lang->testcase->methodOrder[90] = 'bugs';
$lang->testcase->methodOrder[95] = 'review';
$lang->testcase->methodOrder[100] = 'batchReview';
$lang->testcase->methodOrder[105] = 'batchConfirmStoryChange';

View File

@@ -30,13 +30,24 @@ $lang->misc->zentao->about['official'] = "Official Website";
$lang->misc->zentao->about['changelog'] = "Change Log";
$lang->misc->zentao->about['license'] = "License";
$lang->misc->zentao->support['vip'] = "VIP Technical Support";
$lang->misc->zentao->support['manual'] = "User Manual";
$lang->misc->zentao->cowin['reportbug'] = "Report Bug ";
$lang->misc->zentao->cowin['feedback'] = "Feedback";
$lang->misc->zentao->cowin['cowinmore'] = "More";
$lang->misc->zentao->service['servicemore']= 'More';
$lang->misc->mobile = "Mobile Access";

View File

@@ -44,6 +44,7 @@ $lang->misc->zentao->cowin['reportbug'] = "汇报Bug";
$lang->misc->zentao->cowin['feedback'] = "反馈需求";
$lang->misc->zentao->cowin['recommend'] = "推荐给朋友";
$lang->misc->zentao->service['zentaotrain']= '禅道使用培训';
$lang->misc->zentao->service['idc'] = '禅道在线托管';
$lang->misc->zentao->service['custom'] = '禅道定制开发';

View File

@@ -120,6 +120,9 @@ $lang->product->mySelects['resolvedbyme'] = $lang->product->reviewedByMe;
$lang->product->featureBar['browse']['unclosed'] = $lang->product->unclosed;
$lang->product->featureBar['browse']['unplan'] = $lang->product->unplan;
$lang->product->featureBar['browse']['allstory'] = $lang->product->allStory;
$lang->product->featureBar['browse']['my'] = $lang->product->my;
$lang->product->featureBar['browse']['closedbyme'] = $lang->product->closedByMe;
$lang->product->featureBar['browse']['draftstory'] = $lang->product->draftStory;

View File

@@ -83,6 +83,7 @@ $lang->product->closedStory = '已关闭';
$lang->product->unclosed = '未关闭';
$lang->product->unplan = '未计划';
$lang->product->allStory = '全部需求';
$lang->product->allProduct = '全部' . $lang->productCommon;
$lang->product->allProductsOfProject = '全部关联' . $lang->productCommon;
@@ -112,12 +113,17 @@ $lang->product->storySummary = "本页共 <strong>%s</strong> 个需求,预
$lang->product->checkedSummary = "选中 <strong>%total%</strong> 个需求,预计 <strong>%estimate%</strong> 个工时,用例覆盖率<strong>%rate%</strong>。";
$lang->product->noMatched = '找不到包含"%s"的' . $lang->productCommon;
$lang->product->featureBar['browse']['unclosed'] = $lang->product->unclosed;
$lang->product->featureBar['browse']['unplan'] = $lang->product->unplan;
$lang->product->featureBar['browse']['allstory'] = $lang->product->allStory;
$lang->product->featureBar['browse']['assignedtome'] = $lang->product->assignedToMe;
$lang->product->featureBar['browse']['openedbyme'] = $lang->product->openedByMe;
$lang->product->featureBar['browse']['reviewedbyme'] = $lang->product->reviewedByMe;
$lang->product->featureBar['browse']['closedbyme'] = $lang->product->closedByMe;
$lang->product->featureBar['browse']['draftstory'] = $lang->product->draftStory;
$lang->product->featureBar['browse']['activestory'] = $lang->product->activeStory;

View File

@@ -3,7 +3,7 @@ $config->release = new stdclass();
$config->release->create = new stdclass();
$config->release->edit = new stdclass();
$config->release->create->requiredFields = 'name,date';
$config->release->edit->requiredFields = 'name,date';
$config->release->edit->requiredFields = 'name,date,build';
$config->release->editor = new stdclass();
$config->release->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');

View File

@@ -172,7 +172,7 @@ class releaseModel extends model
$this->dao->update(TABLE_RELEASE)->data($release)
->autoCheck()
->batchCheck($this->config->release->edit->requiredFields, 'notempty')
->check('name', 'unique', "id != $releaseID AND product = {$release->product} AND branch = $branch AND deleted = '0'")
->check('name', 'unique', "id != '$releaseID' AND product = '{$release->product}' AND branch = '$branch' AND deleted = '0'")
->where('id')->eq((int)$releaseID)
->exec();
if(!dao::isError())

View File

@@ -78,6 +78,7 @@ $lang->testcase->batchReview = "Batch Review";
$lang->testcase->edit = "Edit";
$lang->testcase->batchEdit = "Batch Edit ";
$lang->testcase->batchChangeModule = "Batch Change Module";
$lang->testcase->batchChangeBranch = "Batch Change Branch";
$lang->testcase->delete = "Delete";
$lang->testcase->batchDelete = "Batch Delete ";
$lang->testcase->batchConfirmStoryChange = "Batch Confirm Story Change";

View File

@@ -78,6 +78,7 @@ $lang->testcase->batchReview = "批量评审";
$lang->testcase->edit = "编辑";
$lang->testcase->batchEdit = "批量编辑 ";
$lang->testcase->batchChangeModule = "批量修改模块";
$lang->testcase->batchChangeBranch = "批量修改分支";
$lang->testcase->delete = "删除";
$lang->testcase->batchDelete = "批量删除 ";
$lang->testcase->batchConfirmStoryChange = "批量确认变更";

View File

@@ -129,3 +129,4 @@ $lang->upgrade->fromVersions['9_5_1'] = '9.5.1';
$lang->upgrade->fromVersions['9_6'] = '9.6';
$lang->upgrade->fromVersions['9_6_1'] = '9.6.1';
$lang->upgrade->fromVersions['9_6_2'] = '9.6.2';
$lang->upgrade->fromVersions['9_6_3'] = '9.6.3';

View File

@@ -129,3 +129,4 @@ $lang->upgrade->fromVersions['9_5_1'] = '9.5.1';
$lang->upgrade->fromVersions['9_6'] = '9.6';
$lang->upgrade->fromVersions['9_6_1'] = '9.6.1';
$lang->upgrade->fromVersions['9_6_2'] = '9.6.2';
$lang->upgrade->fromVersions['9_6_3'] = '9.6.3';

View File

@@ -195,6 +195,12 @@ class upgradeModel extends model
$this->fixDatatableColsConfig();
case '9_6_1':
$this->addLimitedGroup();
case '9_6_2':
case '9_6_3':
$this->execSQL($this->getUpgradeFile('9.6.3'));
$this->changeLimitedName();
$this->adjustPriv9_7();
$this->changeStoryWidth();
}
$this->deletePatch();
@@ -294,6 +300,9 @@ class upgradeModel extends model
case '9_5': $confirmContent .= file_get_contents($this->getUpgradeFile('9.5'));
case '9_5_1': $confirmContent .= file_get_contents($this->getUpgradeFile('9.5.1'));
case '9_6': $confirmContent .= file_get_contents($this->getUpgradeFile('9.6'));
case '9_6_1':
case '9_6_2':
case '9_6_3': $confirmContent .= file_get_contents($this->getUpgradeFile('9.6.3'));
}
return str_replace('zt_', $this->config->db->prefix, $confirmContent);
}

View File

@@ -626,31 +626,6 @@ class user extends control
}
}
/**
* Check Tmp dir.
*
* @access public
* @return void
*/
public function checkTmp()
{
if(!is_dir($this->app->tmpRoot)) mkdir($this->app->tmpRoot, 0755, true);
if(!is_dir($this->app->cacheRoot)) mkdir($this->app->cacheRoot, 0755, true);
if(!is_dir($this->app->logRoot)) mkdir($this->app->logRoot, 0755, true);
if(!is_dir($this->app->logRoot)) return false;
$file = $this->app->logRoot . DS . 'demo.txt';
if($fp = @fopen($file, 'a+'))
{
@fclose($fp);
@unlink($file);
}
else
{
return false;
}
return true;
}
/**
* User login, identify him and authorize him.
@@ -663,7 +638,7 @@ class user extends control
*/
public function login($referer = '', $from = '')
{
if($this->checkTmp() === false)
if($this->user->checkTmp() === false)
{
echo "<html><head><meta charset='utf-8'></head>";
echo "<body><table align='center' style='width:700px; margin-top:100px; border:1px solid gray; font-size:14px;'><tr><td style='padding:8px'>";

View File

@@ -1188,4 +1188,30 @@ class userModel extends model
return $strength;
}
/**
* Check Tmp dir.
*
* @access public
* @return void
*/
public function checkTmp()
{
if(!is_dir($this->app->tmpRoot)) mkdir($this->app->tmpRoot, 0755, true);
if(!is_dir($this->app->cacheRoot)) mkdir($this->app->cacheRoot, 0755, true);
if(!is_dir($this->app->logRoot)) mkdir($this->app->logRoot, 0755, true);
if(!is_dir($this->app->logRoot)) return false;
$file = $this->app->logRoot . DS . 'demo.txt';
if($fp = @fopen($file, 'a+'))
{
@fclose($fp);
@unlink($file);
}
else
{
return false;
}
return true;
}
}

View File

@@ -193,11 +193,9 @@ foreach(glob($moduleRoot . '*') as $modulePath)
$lines = file($langFile);
foreach($mainLines as $lineNO => $line)
{
if(strpos($line, '$lang') === false)
{
//if($line != $lines[$lineNO]) echo $moduleName . ' ' . $langKey . ' ' . $lineNO . "\n";
}
else
if(!isset($lines[$lineNO]) OR empty(trim($lines[$lineNO]))) continue;
if(empty(trim($line))) continue;
if(strpos($line, '$lang') === 0)
{
if(strpos($line, '=') !== false)
{