From 1b2f9f68e6314037e4115d9c33fd77a0df265291 Mon Sep 17 00:00:00 2001 From: wangyuting2 <851424971@qq.com> Date: Thu, 4 Aug 2022 13:46:52 +0800 Subject: [PATCH 1/5] * Adjust assetlib caselib approval menu. --- module/caselib/model.php | 4 +++- module/project/model.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/caselib/model.php b/module/caselib/model.php index 011c9e1c01..70e2e2cedb 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -152,17 +152,19 @@ class caselibModel extends model /** * Get library list. * + * @param string $type * @param string $orderBy * @param object $pager * @access public * @return array */ - public function getList($orderBy = 'id_desc', $pager = null) + public function getList($type = 'all', $orderBy = 'id_desc', $pager = null) { return $this->dao->select('*')->from(TABLE_TESTSUITE) ->where('product')->eq(0) ->andWhere('deleted')->eq(0) ->andWhere('type')->eq('library') + ->beginIF($type == 'review')->andWhere("FIND_IN_SET('{$this->app->user->account}', `reviewers`)")->fi() ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); diff --git a/module/project/model.php b/module/project/model.php index 0521a29b04..e5595054e1 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -192,7 +192,7 @@ class projectModel extends model $project = $this->dao->select('*')->from(TABLE_PROJECT) ->where('id')->eq($projectID) - ->beginIF($this->config->system == 'new')->andWhere('`type`')->in($type)->fi() + ->beginIF($this->config->systemMode == 'new')->andWhere('`type`')->in($type)->fi() ->fetch(); if(!$project) return false; From 8871dc9f69cfbd4da76b8f9d224d95db3a338b21 Mon Sep 17 00:00:00 2001 From: daitingting Date: Thu, 4 Aug 2022 06:03:39 +0000 Subject: [PATCH 2/5] * Update approval at last. --- module/upgrade/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index ee5c5cebda..9e13d417ca 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -532,8 +532,8 @@ class upgradeModel extends model $this->processBugLinkBug(); case '17_4': $this->processCreatedInfo(); - $this->updateApproval(); $this->processCreatedBy(); + $this->updateApproval(); } $this->deletePatch(); From f477e3cf1c43799238ee6993edc1d5a990a1469c Mon Sep 17 00:00:00 2001 From: wangyuting2 <851424971@qq.com> Date: Thu, 4 Aug 2022 14:48:32 +0800 Subject: [PATCH 3/5] * Add execution bug approval menu. --- module/execution/lang/de.php | 3 +++ module/execution/lang/en.php | 3 +++ module/execution/lang/fr.php | 3 +++ module/execution/lang/vi.php | 3 +++ module/execution/lang/zh-cn.php | 3 +++ module/execution/view/bug.html.php | 17 +++++++++++------ 6 files changed, 26 insertions(+), 6 deletions(-) diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index d7b76b33d7..533067b2de 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -512,6 +512,9 @@ $lang->execution->featureBar['all']['doing'] = $lang->execution->statusList[ $lang->execution->featureBar['all']['suspended'] = $lang->execution->statusList['suspended']; $lang->execution->featureBar['all']['closed'] = $lang->execution->statusList['closed']; +$lang->execution->featureBar['bug']['all'] = 'All'; +$lang->execution->featureBar['bug']['unresolved'] = 'Active'; + $lang->execution->featureBar['build']['all'] = 'Build List'; $lang->execution->myExecutions = 'Ich bin beteiligt.'; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index a87ac46f06..95cee9100c 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -512,6 +512,9 @@ $lang->execution->featureBar['all']['doing'] = $lang->execution->statusList[ $lang->execution->featureBar['all']['suspended'] = $lang->execution->statusList['suspended']; $lang->execution->featureBar['all']['closed'] = $lang->execution->statusList['closed']; +$lang->execution->featureBar['bug']['all'] = 'All'; +$lang->execution->featureBar['bug']['unresolved'] = 'Active'; + $lang->execution->featureBar['build']['all'] = 'Build List'; $lang->execution->myExecutions = 'Mine'; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index df78e79283..2b6a23c200 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -512,6 +512,9 @@ $lang->execution->featureBar['all']['doing'] = $lang->execution->statusList[ $lang->execution->featureBar['all']['suspended'] = $lang->execution->statusList['suspended']; $lang->execution->featureBar['all']['closed'] = $lang->execution->statusList['closed']; +$lang->execution->featureBar['bug']['all'] = 'All'; +$lang->execution->featureBar['bug']['unresolved'] = 'Active'; + $lang->execution->featureBar['build']['all'] = 'Build List'; $lang->execution->myExecutions = "J'étais impliqué"; diff --git a/module/execution/lang/vi.php b/module/execution/lang/vi.php index 242f3d7b1a..154243765a 100644 --- a/module/execution/lang/vi.php +++ b/module/execution/lang/vi.php @@ -418,6 +418,9 @@ $lang->execution->featureBar['all']['doing'] = $lang->execution->statusList[ $lang->execution->featureBar['all']['suspended'] = $lang->execution->statusList['suspended']; $lang->execution->featureBar['all']['closed'] = $lang->execution->statusList['closed']; +$lang->execution->featureBar['bug']['all'] = 'All'; +$lang->execution->featureBar['bug']['unresolved'] = 'Active'; + $lang->execution->featureBar['build']['all'] = 'Build List'; $lang->execution->myExecutions = 'Tôi tham gia'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 730eecadd9..b87eef4444 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -512,6 +512,9 @@ $lang->execution->featureBar['all']['doing'] = $lang->execution->statusList[ $lang->execution->featureBar['all']['suspended'] = $lang->execution->statusList['suspended']; $lang->execution->featureBar['all']['closed'] = $lang->execution->statusList['closed']; +$lang->execution->featureBar['bug']['all'] = '所有'; +$lang->execution->featureBar['bug']['unresolved'] = '未解决'; + $lang->execution->featureBar['build']['all'] = '所有版本'; $lang->execution->myExecutions = '我参与的'; diff --git a/module/execution/view/bug.html.php b/module/execution/view/bug.html.php index 31459d2b9a..0dcf920a7a 100644 --- a/module/execution/view/bug.html.php +++ b/module/execution/view/bug.html.php @@ -31,12 +31,17 @@
- Build:{$build->name}" : ''; - $module = $type != 'bysearch' ? "¶m=$param" : ''; - echo html::a($this->inlink('bug', "executionID={$execution->id}&productID={$productID}&branch={$branchID}&orderBy=status,id_desc&build=$buildID&type=all$module"), "{$lang->bug->allBugs}" . ($type == 'all' ? " {$pager->recTotal}$buildName" : ''), '', "id='allTab' class='btn btn-link" . ('all' == $type ? ' btn-active-text' : '') . "'"); - echo html::a($this->inlink('bug', "executionID={$execution->id}&productID={$productID}&branch={$branchID}&orderBy=status,id_desc&build=$buildID&type=unresolved$module"), "{$lang->bug->unResolved}" . ($type == 'unresolved' ? " {$pager->recTotal}$buildName" : ''), '', "id='unresolvedTab' class='btn btn-link" . ('unresolved' == $type ? ' btn-active-text' : '') . "'"); - ?> + + execution->featureBar['bug'] as $featureType => $label):?> + + $label";?> + + {$pager->recTotal}";?> + Build:{$build->name}" : '';?> + + + id&productID={$productID}&branch={$branchID}&orderBy=status,id_desc&build=$buildID&type={$featureType}$module"), $label, '', "class='btn btn-link $active' id='{$featureType}Tab'");?> + bug->search;?>
From a292bc743815e944ef55bfe6790d7557ec4975e2 Mon Sep 17 00:00:00 2001 From: daitingting Date: Thu, 4 Aug 2022 07:38:54 +0000 Subject: [PATCH 4/5] * Add createdBy,createdDate fields in build table. --- db/update17.4.sql | 5 +++++ db/zentao.sql | 2 ++ module/bug/model.php | 16 +++++++++------- module/build/model.php | 2 ++ module/convert/model.php | 12 +++++++----- module/release/model.php | 18 ++++++++++-------- module/upgrade/model.php | 4 ++-- 7 files changed, 37 insertions(+), 22 deletions(-) diff --git a/db/update17.4.sql b/db/update17.4.sql index 1ea0ae3fb6..9f41c86c8e 100644 --- a/db/update17.4.sql +++ b/db/update17.4.sql @@ -7,10 +7,15 @@ ALTER TABLE `zt_release` ADD `createdDate` datetime NOT NULL AFTER `createdBy`; ALTER TABLE `zt_testtask` ADD `createdBy` varchar(30) NOT NULL AFTER `subStatus`; ALTER TABLE `zt_testtask` ADD `createdDate` datetime NOT NULL AFTER `createdBy`; +ALTER TABLE `zt_build` ADD `createdBy` varchar(30) NOT NULL AFTER `desc`; +ALTER TABLE `zt_build` ADD `createdDate` datetime NOT NULL AFTER `createdBy`; + INSERT IGNORE INTO `zt_workflowfield` (`module`, `field`, `type`, `length`, `name`, `control`, `expression`, `options`, `default`, `rules`, `placeholder`, `order`, `searchOrder`, `exportOrder`, `canExport`, `canSearch`, `isValue`, `readonly`, `buildin`, `role`, `desc`, `createdBy`, `createdDate`, `editedBy`, `editedDate`) VALUES ('testtask', 'createdBy', 'varchar', '30', '由谁创建', 'select', '', 'user', '', '', '', 393, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), ('testtask', 'createdDate', 'datetime', '', '创建时间', 'datetime', '', '', '', '', '', 394, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), ('productplan', 'createdBy', 'varchar', '30', '由谁创建', 'select', '', 'user', '', '', '', 11, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), ('productplan', 'createdDate', 'datetime', '', '创建时间', 'datetime', '', '', '', '', '', 12, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), +('build', 'createdBy', 'varchar', '30', '由谁创建', 'select', '', 'user', '', '', '', 15, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), +('build', 'createdDate', 'datetime', '', '创建时间', 'datetime', '', '', '', '', '', 16, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), ('release', 'createdBy', 'varchar', '30', '由谁创建', 'select', '', 'user', '', '', '', 14, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), ('release', 'createdDate', 'datetime', '', '创建时间', 'datetime', '', '', '', '', '', 15, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'); diff --git a/db/zentao.sql b/db/zentao.sql index 4f9bd2e718..5c15858844 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -331,6 +331,8 @@ CREATE TABLE IF NOT EXISTS `zt_build` ( `bugs` text NOT NULL, `builder` char(30) NOT NULL default '', `desc` mediumtext NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`), KEY `product` (`product`), diff --git a/module/bug/model.php b/module/bug/model.php index b3dce795ad..cf2ee943ea 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1124,13 +1124,15 @@ class bugModel extends model if(dao::isError()) return false; $buildData = new stdclass(); - $buildData->product = (int)$oldBug->product; - $buildData->branch = (int)$oldBug->branch; - $buildData->project = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($bug->buildExecution)->fetch('project'); - $buildData->execution = $bug->buildExecution; - $buildData->name = $bug->buildName; - $buildData->date = date('Y-m-d'); - $buildData->builder = $this->app->user->account; + $buildData->product = (int)$oldBug->product; + $buildData->branch = (int)$oldBug->branch; + $buildData->project = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($bug->buildExecution)->fetch('project'); + $buildData->execution = $bug->buildExecution; + $buildData->name = $bug->buildName; + $buildData->date = date('Y-m-d'); + $buildData->builder = $this->app->user->account; + $buildData->createdBy = $this->app->user->account; + $buildData->createdDate = helper::now(); $this->dao->insert(TABLE_BUILD)->data($buildData)->autoCheck() ->check('name', 'unique', "product = {$buildData->product} AND branch = {$buildData->branch} AND deleted = '0'") ->exec(); diff --git a/module/build/model.php b/module/build/model.php index 11815e9c3c..9debed159f 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -313,6 +313,8 @@ class buildModel extends model ->setDefault('branch', 0) ->cleanInt('product,branch') ->add('execution', (int)$executionID) + ->add('createdBy', $this->app->user->account) + ->add('createdDate', helper::now()) ->stripTags($this->config->build->editor->create['id'], $this->config->allowedTags) ->remove('resolvedBy,allchecker,files,labels,uid') ->get(); diff --git a/module/convert/model.php b/module/convert/model.php index 152fe6578b..dbb5055f98 100644 --- a/module/convert/model.php +++ b/module/convert/model.php @@ -947,11 +947,13 @@ class convertModel extends model $productID = $projectProduct[$projectID]; $build = new stdclass(); - $build->product = $productID; - $build->project = $projectID; - $build->name = $data->vname; - $build->date = substr($data->RELEASEDATE, 0, 10); - $build->builder = $this->app->user->account; + $build->product = $productID; + $build->project = $projectID; + $build->name = $data->vname; + $build->date = substr($data->RELEASEDATE, 0, 10); + $build->builder = $this->app->user->account; + $build->createdBy = $this->app->user->account; + $build->createdDate = helper::now(); $this->dao->dbh($this->dbh)->insert(TABLE_BUILD)->data($build)->exec(); $buildID = $this->dao->dbh($this->dbh)->lastInsertID(); diff --git a/module/release/model.php b/module/release/model.php index eb57ae9c8e..157919bc46 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -169,14 +169,16 @@ class releaseModel extends model else { $build = new stdclass(); - $build->project = $projectID; - $build->product = (int)$productID; - $build->branch = (int)$branch; - $build->name = $release->name; - $build->date = $release->date; - $build->builder = $this->app->user->account; - $build->desc = $release->desc; - $build->execution = 0; + $build->project = $projectID; + $build->product = (int)$productID; + $build->branch = (int)$branch; + $build->name = $release->name; + $build->date = $release->date; + $build->builder = $this->app->user->account; + $build->desc = $release->desc; + $build->execution = 0; + $build->createdBy = $this->app->user->account; + $build->createdDate = helper::now(); $build = $this->loadModel('file')->processImgURL($build, $this->config->release->editor->create['id']); $this->app->loadLang('build'); diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 9e13d417ca..239a413eae 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -6753,8 +6753,8 @@ class upgradeModel extends model */ public function processCreatedInfo() { - $objectTypes = array('productplan', 'release', 'testtask'); - $tables = array('productplan' => TABLE_PRODUCTPLAN, 'release' => TABLE_RELEASE, 'testtask' => TABLE_TESTTASK); + $objectTypes = array('productplan', 'release', 'testtask', 'build'); + $tables = array('productplan' => TABLE_PRODUCTPLAN, 'release' => TABLE_RELEASE, 'testtask' => TABLE_TESTTASK, 'build' => TABLE_BUILD); $actions = $this->dao->select('objectType, objectID, actor, date')->from(TABLE_ACTION)->where('objectType')->in($objectTypes)->andWhere('action')->eq('opened')->fetchGroup('objectType'); foreach($actions as $objectType => $objectActions) From 73810a1e2603a293c0e2199a1af3b53c24767105 Mon Sep 17 00:00:00 2001 From: daitingting Date: Thu, 4 Aug 2022 08:14:08 +0000 Subject: [PATCH 5/5] * Fix bug #25943. --- module/action/model.php | 4 ++-- module/index/js/index.js | 4 ++-- module/my/view/dynamic.html.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 695c954c7d..83d07be706 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -858,7 +858,7 @@ class actionModel extends model $this->app->loadLang('mr'); $desc = sprintf($this->lang->mr->createAction, $mrCreatedDate, $mrActor, $mrLink); } - elseif($this->config->edition == 'max' and strpos($this->config->action->assetType, $action->objectType) !== false and $action->action == 'approved') + elseif($this->config->edition == 'max' and strpos($this->config->action->assetType, ",{$action->objectType},") !== false and $action->action == 'approved') { $desc = empty($this->lang->action->approve->{$action->extra}) ? '' : $this->lang->action->approve->{$action->extra}; } @@ -1469,7 +1469,7 @@ class actionModel extends model } if($this->config->edition == 'max' - and strpos($this->config->action->assetType, $action->objectType) !== false + and strpos($this->config->action->assetType, ",{$action->objectType},") !== false and empty($action->project) and empty($action->product) and empty($action->execution)) { if($action->objectType == 'doc') diff --git a/module/index/js/index.js b/module/index/js/index.js index d1a2c7a9b3..5ffb7866d8 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -754,8 +754,8 @@ $.extend( var searchModule = types[0]; var searchMethod = typeof(types[1]) == 'undefined' ? 'view' : types[1]; var searchLink = createLink(searchModule, searchMethod, "id=" + objectValue); - var assetType = 'story,issue,risk,opportunity,doc'; - if(assetType.indexOf(searchModule) > -1) + var assetType = ',story,issue,risk,opportunity,doc,'; + if(assetType.indexOf(',' + searchModule + ',') > -1) { var link = createLink('index', 'ajaxGetViewMethod' , 'objectID=' + objectValue + '&objectType=' + searchModule); $.get(link, function(data) diff --git a/module/my/view/dynamic.html.php b/module/my/view/dynamic.html.php index c6359d310a..3575889ffe 100644 --- a/module/my/view/dynamic.html.php +++ b/module/my/view/dynamic.html.php @@ -65,7 +65,7 @@ objectType == 'meeting') $tab = $action->project ? "data-app='project'" : "data-app='my'";?> edition == 'max' and strpos($config->action->assetType, $action->objectType) !== false) and empty($action->objectName)) + if(($config->edition == 'max' and strpos($config->action->assetType, ",{$action->objectType},") !== false) and empty($action->objectName)) { echo '#' . $action->objectID; }