From 8c8b846ed4dbac8ecdcafc6c8781c2409300f61d Mon Sep 17 00:00:00 2001 From: zhaoke Date: Thu, 16 Mar 2023 10:18:30 +0800 Subject: [PATCH 01/16] * modify the getImageList method in the zahost model, fix bug #32867. --- module/zahost/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/zahost/model.php b/module/zahost/model.php index 8244095ee8..3aa0029f42 100644 --- a/module/zahost/model.php +++ b/module/zahost/model.php @@ -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; From 01a2c74a7f3a4ed8726f3b7386571063e7087b2e Mon Sep 17 00:00:00 2001 From: zhaoke Date: Thu, 16 Mar 2023 10:43:14 +0800 Subject: [PATCH 02/16] * Remove snapshot when create failed. --- api/v1/entries/hostsubmit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1/entries/hostsubmit.php b/api/v1/entries/hostsubmit.php index 9aea53faf2..157d329ac1 100644 --- a/api/v1/entries/hostsubmit.php +++ b/api/v1/entries/hostsubmit.php @@ -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') { From b283c3089562c55b46044f5dd976681a926fe3e2 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 16 Mar 2023 02:47:20 +0000 Subject: [PATCH 03/16] * Fix bug #32995. --- module/story/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/control.php b/module/story/control.php index fed1d8bf72..917a8e9f7c 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1283,7 +1283,7 @@ class story extends control $method = 'view'; $params = "storyID=$storyID&version=0¶m=0&storyType=$storyType"; } - return print(js::locate($this->createLink($module, $method, $params), 'parent')); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink($module, $method, $params))); } $this->commonAction($storyID); From 34de9a5fe4eb4be9122aacf29f642a2f81e1ee3d Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 16 Mar 2023 05:10:56 +0000 Subject: [PATCH 04/16] * Fix bug #32958. --- module/tree/model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/tree/model.php b/module/tree/model.php index 436ee6b15c..a365ecd635 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -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 $branchID !== '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(); } From 94d4b5419be170c56466fa547b56c25451efea48 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 16 Mar 2023 05:16:26 +0000 Subject: [PATCH 05/16] * Fix bug #32958. --- module/tree/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/tree/model.php b/module/tree/model.php index a365ecd635..23662f0bf8 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -1010,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']) and $branchID !== 'all')->andWhere('t2.branch')->eq($branch)->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) From a168008406a31adc1a73be1f0701ec963c6dcbbe Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 16 Mar 2023 05:29:54 +0000 Subject: [PATCH 06/16] * Fix bug #33001. --- module/action/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index d0133ef7fd..8dc16c0131 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -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); } } From 1ae540dbe780deed6af7d123f06f958794507433 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 16 Mar 2023 05:49:21 +0000 Subject: [PATCH 07/16] * Fix bug #33003. --- module/user/control.php | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/module/user/control.php b/module/user/control.php index 4870995750..dbc1c72280 100755 --- a/module/user/control.php +++ b/module/user/control.php @@ -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); From c7bd19144f0d7313a537a4bb8295a4393b5d69f7 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 16 Mar 2023 06:27:23 +0000 Subject: [PATCH 08/16] * Fix bug #32991. --- module/story/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/story/model.php b/module/story/model.php index ecefa374c6..62b9f45c64 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -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') From d0792c47f9f5bf3a4d344bad65f9fc00242a5b58 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 16 Mar 2023 14:32:31 +0800 Subject: [PATCH 09/16] * Fix bug #33008. --- module/productplan/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index cda8b66494..c91f6428ca 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -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'); From 73295587771db91ccc9a7ea8188350c2fdd60917 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 16 Mar 2023 14:46:48 +0800 Subject: [PATCH 10/16] * fix sonar error. --- framework/router.class.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/framework/router.class.php b/framework/router.class.php index 11d4224ba6..edfc99616f 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -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. */ From df52363be3634826b1fe66105ecc3b8fe6ce8492 Mon Sep 17 00:00:00 2001 From: zenggang Date: Thu, 16 Mar 2023 07:10:56 +0000 Subject: [PATCH 11/16] * Fix bug#33020 --- module/mr/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/mr/control.php b/module/mr/control.php index 7d2e34b035..503fd7c6cc 100644 --- a/module/mr/control.php +++ b/module/mr/control.php @@ -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); From 5b3bef53c97948c7956f14aa565bab2250e937cf Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 16 Mar 2023 07:35:29 +0000 Subject: [PATCH 12/16] * Fix bug #33018. --- module/task/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/task/model.php b/module/task/model.php index 085e38fa20..7326235312 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -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', ',') From 131dcf5f24ddb4a2434940e2ed2541fb49f8097f Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 16 Mar 2023 15:54:11 +0800 Subject: [PATCH 13/16] * Fix bug #32960. --- module/execution/view/story.html.php | 3 ++- module/story/model.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index c0deffdee0..8412190f4c 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -271,6 +271,7 @@ $story):?> estimate; + $story->from = $this->app->tab; ?> $value) @@ -286,7 +287,7 @@ children)):?> children as $key => $child):?> - from = 'execution';?> + from = $this->app->tab;?> children)) ? ' table-child-bottom' : '';?> diff --git a/module/story/model.php b/module/story/model.php index ecefa374c6..0d6ad1c629 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -5276,7 +5276,7 @@ class storyModel extends model echo $story->version; break; case 'actions': - if($tab == 'execution' || ($tab == 'project' && isset($_SESSION['multiple']) && empty($_SESSION['multiple']))) + if($tab == 'execution') { $menuType = 'execution'; } From 876f2bcc9e6c3fe7a6dab9d745c977019cc29032 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 16 Mar 2023 16:21:50 +0800 Subject: [PATCH 14/16] * Fix bug for export bug. --- module/bug/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/bug/config.php b/module/bug/config.php index d9c707e2f2..16921034e9 100755 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -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'; From 15c0a07a93ab15e33190badf5de8381b05a84d0c Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 16 Mar 2023 16:22:37 +0800 Subject: [PATCH 15/16] * Code for bug #32960. --- module/story/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/story/model.php b/module/story/model.php index 0d6ad1c629..7d8f7626c5 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -5276,9 +5276,10 @@ class storyModel extends model echo $story->version; break; case 'actions': - if($tab == 'execution') + if($tab == 'execution' or ($tab == 'project' and isset($_SESSION['multiple']) and empty($_SESSION['multiple']))) { $menuType = 'execution'; + if($storyType == 'requirement') $menuType = 'browse'; } else { From 3e36d0bbae29a56d38dd9ad91fe84c3cde379b04 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 16 Mar 2023 16:37:16 +0800 Subject: [PATCH 16/16] * Modify user priv language. --- module/dev/lang/de.php | 4 ++-- module/dev/lang/en.php | 4 ++-- module/dev/lang/fr.php | 4 ++-- module/dev/lang/zh-cn.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/module/dev/lang/de.php b/module/dev/lang/de.php index 2d3d7cc520..e648dff8e1 100644 --- a/module/dev/lang/de.php +++ b/module/dev/lang/de.php @@ -1,7 +1,7 @@ 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'; diff --git a/module/dev/lang/en.php b/module/dev/lang/en.php index fc609d9902..95bff27d80 100644 --- a/module/dev/lang/en.php +++ b/module/dev/lang/en.php @@ -1,7 +1,7 @@ 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'; diff --git a/module/dev/lang/fr.php b/module/dev/lang/fr.php index fc609d9902..95bff27d80 100644 --- a/module/dev/lang/fr.php +++ b/module/dev/lang/fr.php @@ -1,7 +1,7 @@ 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'; diff --git a/module/dev/lang/zh-cn.php b/module/dev/lang/zh-cn.php index 0e5e117fd5..c01ab55b44 100644 --- a/module/dev/lang/zh-cn.php +++ b/module/dev/lang/zh-cn.php @@ -1,7 +1,7 @@ dev->common = '二次开发'; -$lang->dev->api = 'API'; -$lang->dev->db = '数据库'; +$lang->dev->api = '接口文档'; +$lang->dev->db = '数据字典'; $lang->dev->editor = '编辑器'; $lang->dev->translate = '翻译'; $lang->dev->dbList = '数据库';