This commit is contained in:
Yagami
2019-11-22 13:10:19 +08:00
6 changed files with 114 additions and 51 deletions
+5 -12
View File
@@ -127,7 +127,7 @@ class router extends baseRouter
}
}
$productCommon = $projectCommon = $storyCommon = 0;
$productCommon = $projectCommon = $storyCommon = $hourCommon = 0;
if(!empty($this->config->isINT)) $projectCommon = 1;
if($productProject)
{
@@ -135,21 +135,14 @@ class router extends baseRouter
list($productCommon, $projectCommon) = explode('_', $productProject);
}
if($storyRequirement)
{
$storyCommon = $storyRequirement->value;
$lang->storyCommon = isset($this->config->storyCommonList[$this->clientLang][(int)$storyCommon]) ? $this->config->storyCommonList[$this->clientLang][(int)$storyCommon] : $this->config->storyCommonList['en'][(int)$storyCommon];
}
if($hourPoint)
{
$hourCommon = $hourPoint->value;
$lang->hourCommon = isset($this->config->hourPointCommonList[$this->clientLang][(int)$hourCommon]) ? $this->config->hourPointCommonList[$this->clientLang][(int)$hourCommon] : $this->config->hourPointCommonList['en'][(int)$hourCommon];
}
if($storyRequirement) $storyCommon = $storyRequirement->value;
if($hourPoint) $hourCommon = $hourPoint->value;
/* Set productCommon and projectCommon. Default english lang. */
$lang->productCommon = isset($this->config->productCommonList[$this->clientLang][(int)$productCommon]) ? $this->config->productCommonList[$this->clientLang][(int)$productCommon] : $this->config->productCommonList['en'][(int)$productCommon];
$lang->projectCommon = isset($this->config->projectCommonList[$this->clientLang][(int)$projectCommon]) ? $this->config->projectCommonList[$this->clientLang][(int)$projectCommon] : $this->config->projectCommonList['en'][(int)$projectCommon];
$lang->storyCommon = isset($this->config->storyCommonList[$this->clientLang][(int)$storyCommon]) ? $this->config->storyCommonList[$this->clientLang][(int)$storyCommon] : $this->config->storyCommonList['en'][(int)$storyCommon];
$lang->hourCommon = isset($this->config->hourPointCommonList[$this->clientLang][(int)$hourCommon]) ? $this->config->hourPointCommonList[$this->clientLang][(int)$hourCommon] : $this->config->hourPointCommonList['en'][(int)$hourCommon];
}
parent::loadLang($moduleName, $appName);
+14 -6
View File
@@ -2,11 +2,15 @@ $(function()
{
var blockTitle = '';
var preValue = '';
var $title;
$(document).on('change', '#blockParams #paramstype', function()
{
$title = $('#blockParams').find('#title');
var value = $(this).find('option:selected').html();
if($title.val().indexOf(blockTitle + ' - ' + preValue) >= 0) $title.val(blockTitle + ' - ' + value);
var title = $title.val();
var value = $(this).find('option:selected').text();
if (title.indexOf(' - ' + preValue) >= 0) {
$title.val(blockTitle + ' - ' + value);
}
preValue = value;
});
@@ -27,11 +31,15 @@ $(function()
$blockParams.find('input:first').focus();
if($blockParams.find('#actionLink').size() > 0) $form.attr('action', $blockParams.find('#actionLink').val());
blockTitle = $blockParams.find('#title').val();
if($('#blockParams #paramstype').length > 0)
$title = $blockParams.find('#title');
if($title.length && $('#blockParams #paramstype').length)
{
preValue = $('#blockParams #paramstype').find('option:selected').html();
$blockParams.find('#title').val(blockTitle + ' - ' + preValue);
blockTitle = $title.val();
preValue = $('#blockParams #paramstype').find('option:selected').text();
var preIndex = blockTitle.indexOf(' - ' + preValue);
if (preIndex > -1) {
blockTitle = blockTitle.substring(0, preIndex);
}
}
};
+3
View File
@@ -1419,6 +1419,9 @@ EOD;
if(isset($this->app->user))
{
if(!defined('IN_UPGRADE')) $this->session->user->view = $this->loadModel('user')->grantUserView();
$this->app->user = $this->session->user;
if(!commonModel::hasPriv($module, $method)) $this->deny($module, $method);
}
else
+1 -1
View File
@@ -25,7 +25,7 @@
<td><?php echo zget($users, $case->lastRunner);?></td>
<td><?php echo substr($case->lastRunDate, 2);?></td>
<td><?php echo zget($lang->testcase->resultList, $case->lastRunResult);?></td>
<?php $status = $this->processStatus('testcase', $case);?>
<?php $status = zget($lang->testtask->statusList, $case->status);?>
<td title='<?php echo $status;?>'>
<span class="status-case status-<?php echo $case->status?>"><?php echo $status;?></span>
</td>
+90 -31
View File
@@ -535,9 +535,11 @@ class upgradeModel extends model
$this->saveLogs('Execute 11_6_5');
$this->execSQL($this->getUpgradeFile('11.6.5'));
$this->fixGroupAcl();
$this->appendExec('11_6_5');
case '11_6_6':
$this->fixBugTypeList();
$this->adjustPriv11_6_6();
$this->rmEditorAndTranslateDir();
$this->setConceptSetted();
$this->appendExec('11_6_5');
}
$this->deletePatch();
@@ -687,6 +689,7 @@ class upgradeModel extends model
case '11_6_2' :
case '11_6_3' :
case '11_6_4' : $confirmContent .= file_get_contents($this->getUpgradeFile('11.6.4'));
case '11_6_5' : $confirmContent .= file_get_contents($this->getUpgradeFile('11.6.5'));
}
return str_replace('zt_', $this->config->db->prefix, $confirmContent);
}
@@ -3458,35 +3461,6 @@ class upgradeModel extends model
return true;
}
/**
* Save Logs.
*
* @param string $log
* @access public
* @return void
*/
public function saveLogs($log)
{
$logFile = $this->app->getTmpRoot() . 'log/upgrade.' . date('Ymd') . '.log.php';
$log = date('Y-m-d H:i:s') . ' ' . trim($log) . "\n";
if(!file_exists($logFile)) $log = "<?php\ndie();\n?" . ">\n" . $log;
static $fh;
if(empty($fh)) $fh = fopen($logFile, 'a');
fwrite($fh, $log);
}
/**
* Append execute for pro and biz.
*
* @param string $fromVersion
* @access public
* @return void
*/
public function appendExec($zentaoVersion)
{
}
/**
* Fix bug typeList.
*
@@ -3495,6 +3469,8 @@ class upgradeModel extends model
*/
public function fixBugTypeList()
{
$this->saveLogs('Run Method ' . __FUNCTION__);
foreach($this->config->upgrade->discardedBugTypes as $langCode => $types)
{
$bugs = $this->dao->select('type')->from(TABLE_BUG)->where('type')->in(array_keys($types))->fetchAll('type');
@@ -3530,4 +3506,87 @@ class upgradeModel extends model
}
return true;
}
/**
* Remove editor and translate.
*
* @access public
* @return bool
*/
public function rmEditorAndTranslateDir()
{
$this->saveLogs('Run Method ' . __FUNCTION__);
$zfile = $this->app->loadClass('zfile');
$moduleRoot = $this->app->getModuleRoot();
$editorDir = $moduleRoot . 'editor';
if(is_dir($editor)) $zfile->removeDir($editorDir);
$translateDir = $moduleRoot . 'translate';
if(is_dir($translateDir)) $zfile->removeDir($translateDir);
return true;
}
/**
* Set concept setted.
*
* @access public
* @return bool
*/
public function setConceptSetted()
{
$this->saveLogs('Run Method ' . __FUNCTION__);
$conceptSetted = $this->dao->select('*')->from(TABLE_CONFIG)->where('owner')->eq('system')->andWhere('module')->eq('common')->andWhere('`key`')->eq('conceptSetted')->fetchAll();
if(empty($conceptSetted))
{
$setting = new stdclass();
$setting->owner = 'system';
$setting->module = 'custom';
$setting->key = 'storyRequirement';
$setting->value = '0';
$this->dao->replace(TABLE_CONFIG)->data($setting)->exec();
$setting->key = 'hourPoint';
$setting->value = '0';
$this->dao->replace(TABLE_CONFIG)->data($setting)->exec();
$setting->module = 'common';
$setting->key = 'conceptSetted';
$setting->value = '1';
$this->dao->replace(TABLE_CONFIG)->data($setting)->exec();
}
return true;
}
/**
* Save Logs.
*
* @param string $log
* @access public
* @return void
*/
public function saveLogs($log)
{
$logFile = $this->app->getTmpRoot() . 'log/upgrade.' . date('Ymd') . '.log.php';
$log = date('Y-m-d H:i:s') . ' ' . trim($log) . "\n";
if(!file_exists($logFile)) $log = "<?php\ndie();\n?" . ">\n" . $log;
static $fh;
if(empty($fh)) $fh = fopen($logFile, 'a');
fwrite($fh, $log);
}
/**
* Append execute for pro and biz.
*
* @param string $fromVersion
* @access public
* @return void
*/
public function appendExec($zentaoVersion)
{
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long