Merge branch 'tsj_fixbug' of https://gitlab.zcorp.cc/easycorp/zentaopms into tsj_fixbug

This commit is contained in:
tianshujie
2023-03-16 17:12:34 +08:00
16 changed files with 45 additions and 35 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ class hostSubmitEntry extends baseEntry
{
if(in_array($image->status, array('failed', 'completed'))) $image->status = $image->status == 'completed' ? 'restore_completed' : 'restore_failed';
}
else if($imageInfo->from == 'snapshot' && $imageInfo->status == 'creating')
else if($imageInfo->from == 'snapshot')
{
if($image->status == 'failed')
{
-5
View File
@@ -101,8 +101,6 @@ class router extends baseRouter
global $lang;
if(!is_object($lang)) $lang = new language();
$appName = '';
/* Set productCommon and projectCommon for flow. */
if($moduleName == 'common') $this->setCommonLang();
@@ -367,9 +365,6 @@ class router extends baseRouter
public function loadModuleConfig($moduleName, $appName = '')
{
global $config;
$appName = '';
if($config and (!isset($config->$moduleName) or !is_object($config->$moduleName))) $config->$moduleName = new stdclass();
/* 初始化数组。Init the variables. */
+2 -2
View File
@@ -453,7 +453,7 @@ class actionModel extends model
elseif($actionName == 'unlinkedfromexecution')
{
$name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name');
if($name) $action->extra = common::hasPriv('project', 'story') ? html::a(helper::createLink('project', 'story', "projectID=$action->extra"), "#$action->extra " . $name) : "#$action->extra " . $name;
if($name) $action->extra = common::hasPriv('execution', 'view') ? html::a(helper::createLink('execution', 'view', "executionID=$action->extra"), "#$action->extra " . $name) : "#$action->extra " . $name;
}
elseif($actionName == 'unlinkedfromproject')
{
@@ -949,7 +949,7 @@ class actionModel extends model
else
{
if($actionType == 'restoredsnapshot' && in_array($action->objectType, array('vm', 'zanode')) && $value == 'defaultSnap') $value = $this->lang->$objectType->snapshot->defaultSnapName;
$desc = str_replace('$' . $key, $value, $desc);
}
}
+1 -1
View File
@@ -217,7 +217,7 @@ $config->bug->datatable->fieldList['project']['fixed'] = 'no';
$config->bug->datatable->fieldList['project']['width'] = '120';
$config->bug->datatable->fieldList['project']['required'] = 'no';
$config->bug->datatable->fieldList['project']['control'] = 'hidden';
$config->bug->datatable->fieldList['project']['dataSource'] = array('module' => 'product', 'method' => 'getProjectPairsByProduct', 'params' => '$productID');
$config->bug->datatable->fieldList['project']['dataSource'] = array('module' => 'product', 'method' => 'getProjectPairsByProduct', 'params' => '$productID&');
$config->bug->datatable->fieldList['execution']['title'] = 'execution';
$config->bug->datatable->fieldList['execution']['fixed'] = 'no';
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
$lang->dev->common = 'Entwicklung';
$lang->dev->api = 'API';
$lang->dev->db = 'Datenbank';
$lang->dev->api = 'API Document';
$lang->dev->db = 'Data Dictionary';
$lang->dev->editor = 'Bearbeiter';
$lang->dev->translate = 'Translate';
$lang->dev->dbList = 'Datenbank';
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
$lang->dev->common = 'Develop';
$lang->dev->api = 'API';
$lang->dev->db = 'Database';
$lang->dev->api = 'API Document';
$lang->dev->db = 'Data Dictionary';
$lang->dev->editor = 'Editor';
$lang->dev->translate = 'Translate';
$lang->dev->dbList = 'Database';
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
$lang->dev->common = 'Develop';
$lang->dev->api = 'API';
$lang->dev->db = 'Database';
$lang->dev->api = 'API Document';
$lang->dev->db = 'Data Dictionary';
$lang->dev->editor = 'Editor';
$lang->dev->translate = 'Translate';
$lang->dev->dbList = 'Database';
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
$lang->dev->common = '二次开发';
$lang->dev->api = 'API';
$lang->dev->db = '数据库';
$lang->dev->api = '接口文档';
$lang->dev->db = '数据字典';
$lang->dev->editor = '编辑器';
$lang->dev->translate = '翻译';
$lang->dev->dbList = '数据库';
+2 -1
View File
@@ -271,6 +271,7 @@
<?php foreach($stories as $key => $story):?>
<?php
$totalEstimate += $story->estimate;
$story->from = $this->app->tab;
?>
<tr id="story<?php echo $story->id;?>" data-id='<?php echo $story->id;?>' data-order='<?php echo $story->order ?>' data-estimate='<?php echo $story->estimate?>' data-cases='<?php echo zget($storyCases, $story->id, 0)?>'>
<?php foreach($setting as $key => $value)
@@ -286,7 +287,7 @@
<?php if(!empty($story->children)):?>
<?php $i = 0;?>
<?php foreach($story->children as $key => $child):?>
<?php $child->from = 'execution';?>
<?php $child->from = $this->app->tab;?>
<?php $class = $i == 0 ? ' table-child-top' : '';?>
<?php $class .= ($i + 1 == count($story->children)) ? ' table-child-bottom' : '';?>
<tr class='table-children<?php echo $class;?> parent-<?php echo $story->id;?>' data-id='<?php echo $child->id?>' data-status='<?php echo $child->status?>' data-estimate='<?php echo $child->estimate?>' data-cases='<?php echo zget($storyCases, $story->id, 0);?>'>
+1 -1
View File
@@ -39,7 +39,7 @@ class mr extends control
->andWhere('synced')->eq(1)
->orderBy('id')
->count();
if($repoCount == 0) $this->locate($this->repo->createLink('create'));
if($repoCount == 0) $this->locate($this->loadModel('repo')->createLink('create'));
$repoID = $this->loadModel('repo')->saveState($repoID, $objectID);
$repo = $this->repo->getRepoByID($repoID);
+1 -1
View File
@@ -28,7 +28,7 @@ class productplan extends control
$this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
$this->app->loadConfig('execution');
$this->product->setMenu($productID, $branch);
if(!$product->shadow) $this->product->setMenu($productID, $branch);
$this->session->set('currentProductType', $product->type);
$branches = $this->loadModel('branch')->getList($productID, 0, 'all');
+3 -1
View File
@@ -1591,6 +1591,7 @@ class storyModel extends model
->setDefault('reviewedDate', $date)
->stripTags($this->config->story->editor->review['id'], $this->config->allowedTags)
->setIF(!$this->post->assignedTo, 'assignedTo', '')
->setIF(!empty($_POST['assignedTo']), 'assignedDate', $now)
->removeIF($this->post->result != 'reject', 'closedReason, duplicateStory, childStories')
->removeIF($this->post->result == 'reject' and $this->post->closedReason != 'duplicate', 'duplicateStory')
->removeIF($this->post->result == 'reject' and $this->post->closedReason != 'subdivided', 'childStories')
@@ -5277,9 +5278,10 @@ class storyModel extends model
echo $story->version;
break;
case 'actions':
if($tab == 'execution' || ($tab == 'project' && isset($_SESSION['multiple']) && empty($_SESSION['multiple'])))
if($tab == 'execution' or ($tab == 'project' and isset($_SESSION['multiple']) and empty($_SESSION['multiple'])))
{
$menuType = 'execution';
if($storyType == 'requirement') $menuType = 'browse';
}
else
{
+1
View File
@@ -125,6 +125,7 @@ class taskModel extends model
->setIF(is_numeric($this->post->left), 'left', (float)$this->post->left)
->setDefault('openedBy', $this->app->user->account)
->setDefault('openedDate', helper::now())
->setDefault('vision', $this->config->vision)
->cleanINT('execution,story,module')
->stripTags($this->config->task->editor->create['id'], $this->config->allowedTags)
->join('mailto', ',')
+3 -2
View File
@@ -998,6 +998,7 @@ class treeModel extends model
if($linkObject)
{
$branch = zget($extra, 'branchID', 0);
/* Get object paths of this execution. */
if(strpos(',story,case,', ",$linkObject,") !== false)
{
@@ -1009,7 +1010,7 @@ class treeModel extends model
->orWhere('t4.project')->eq($executionID)->markRight(1)
->andWhere('t3.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->beginIF(isset($extra['branchID']))->andWhere('t2.branch')->eq(zget($extra, 'branchID', 0))->fi()
->beginIF(isset($extra['branchID']) and $branch !== 'all')->andWhere('t2.branch')->eq($branch)->fi()
->fetchPairs();
}
elseif($linkObject == 'bug' and strpos(',project,execution,', ",{$this->app->tab},") !== false)
@@ -1018,7 +1019,7 @@ class treeModel extends model
->leftJoin(TABLE_MODULE)->alias('t2')->on('t1.module = t2.id')
->where('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->andWhere('t1.branch')->eq(zget($extra, 'branchID', 0))
->beginIF(isset($extra['branchID']) and $branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi()
->andWhere("t1.{$this->app->tab}")->eq($executionID)
->fetchPairs();
}
+20 -10
View File
@@ -124,7 +124,8 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id');
$deptID = $this->app->user->admin ? 0 : $this->app->user->dept;
$users = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id');
/* Modify story title. */
$this->loadModel('story');
@@ -167,7 +168,8 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id');
$deptID = $this->app->user->admin ? 0 : $this->app->user->dept;
$users = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id');
/* Set the menu. */
$this->view->userList = $this->user->setUserList($users, $userID);
@@ -208,7 +210,8 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id');
$deptID = $this->app->user->admin ? 0 : $this->app->user->dept;
$users = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id');
/* Set menu. */
$this->view->userList = $this->user->setUserList($users, $userID);
@@ -248,7 +251,8 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id');
$deptID = $this->app->user->admin ? 0 : $this->app->user->dept;
$users = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id');
/* Set menu. */
$this->view->userList = $this->user->setUserList($users, $userID);
@@ -299,7 +303,8 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id');
$deptID = $this->app->user->admin ? 0 : $this->app->user->dept;
$users = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id');
/* Append id for secend sort. */
$sort = common::appendOrder($orderBy);
@@ -355,7 +360,8 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id');
$deptID = $this->app->user->admin ? 0 : $this->app->user->dept;
$users = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id');
/* Load pager. */
$this->app->loadClass('pager', $static = true);
@@ -395,7 +401,8 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id');
$deptID = $this->app->user->admin ? 0 : $this->app->user->dept;
$users = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id');
/* Load pager. */
$this->app->loadClass('pager', $static = true);
@@ -435,7 +442,8 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id');
$deptID = $this->app->user->admin ? 0 : $this->app->user->dept;
$users = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id');
/* Load pager. */
$this->app->loadClass('pager', $static = true);
@@ -468,7 +476,8 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id');
$deptID = $this->app->user->admin ? 0 : $this->app->user->dept;
$users = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id');
$this->view->title = "USER #$user->id $user->account/" . $this->lang->user->profile;
$this->view->position[] = $this->lang->user->common;
@@ -1204,7 +1213,8 @@ class user extends control
{
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id');
$deptID = $this->app->user->admin ? 0 : $this->app->user->dept;
$users = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id');
/* set menus. */
$this->view->userList = $this->user->setUserList($users, $userID);
+2 -2
View File
@@ -193,7 +193,7 @@ class zahostModel extends model
*/
public function getImageList($hostID, $browseType = 'all', $param = 0, $orderBy = 'id', $pager = null)
{
$imageList = json_decode(file_get_contents($this->config->zahost->imageListUrl));
$imageList = json_decode(commonModel::http($this->config->zahost->imageListUrl, array(), array()));
$downloadedImageList = $this->dao->select('*')->from(TABLE_IMAGE)
->where('host')->eq($hostID)
@@ -256,7 +256,7 @@ class zahostModel extends model
*/
public function createImage($hostID, $imageName)
{
$imageList = json_decode(file_get_contents($this->config->zahost->imageListUrl));
$imageList = json_decode(commonModel::http($this->config->zahost->imageListUrl, array(), array()));
$imageData = new stdclass;
foreach($imageList as $item) if($item->name == $imageName) $imageData = $item;