diff --git a/db/update17.4.sql b/db/update17.4.sql index 7c5362f489..9b07b51e62 100644 --- a/db/update17.4.sql +++ b/db/update17.4.sql @@ -13,11 +13,16 @@ 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 dbf19c45eb..53848908fd 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/action/model.php b/module/action/model.php index 12289ca4c0..92c83c05b4 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/bug/model.php b/module/bug/model.php index f4e2b71060..9f955ded2b 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1146,13 +1146,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/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/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/execution/lang/de.php b/module/execution/lang/de.php index 0261d10f35..375cb05ff8 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -514,6 +514,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 3d8cbb0fdf..0b0ed597ad 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -514,6 +514,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 6352bcc766..bec2096bbb 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -514,6 +514,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 363002d338..3d7ff4c33a 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -514,6 +514,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;?>
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; } diff --git a/module/project/model.php b/module/project/model.php index d8fdf168ae..de931c67f5 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; 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 f6249c9ae5..ce9d6384ba 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -534,8 +534,8 @@ class upgradeModel extends model case '17_4': $this->changeTableEngine(); $this->processCreatedInfo(); - $this->updateApproval(); $this->processCreatedBy(); + $this->updateApproval(); break; } @@ -6777,8 +6777,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)