diff --git a/db/update17.6.1.sql b/db/update17.6.1.sql index f09f31bdc7..9860888136 100644 --- a/db/update17.6.1.sql +++ b/db/update17.6.1.sql @@ -2,5 +2,6 @@ ALTER TABLE `zt_product` ADD `shadow` tinyint(1) unsigned NOT NULL AFTER `code`; ALTER TABLE `zt_project` ADD `hasProduct` tinyint(1) unsigned NOT NULL DEFAULT 1 AFTER `code`; ALTER TABLE `zt_product` MODIFY `name` varchar(110) NOT NULL; +CREATE OR REPLACE VIEW `ztv_normalproduct` AS SELECT * FROM `zt_product` WHERE `shadow` = 0; ALTER TABLE `zt_repo` ADD `projects` varchar(255) NOT NULL AFTER `product`; diff --git a/db/updateproinstall.sql b/db/updateproinstall.sql index d393bed109..45f00324cf 100644 --- a/db/updateproinstall.sql +++ b/db/updateproinstall.sql @@ -487,6 +487,7 @@ CREATE OR REPLACE VIEW `ztv_daytaskfinish` AS select count(*) AS `taskfinish`,le CREATE OR REPLACE VIEW `ztv_daybugopen` AS select count(*) AS `bugopen`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'bug') and (`zt_action`.`action` = 'opened')) group by left(`zt_action`.`date`,10); CREATE OR REPLACE VIEW `ztv_daybugresolve` AS select count(*) AS `bugresolve`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'bug') and (`zt_action`.`action` = 'resolved')) group by left(`zt_action`.`date`,10); CREATE OR REPLACE VIEW `ztv_dayactions` AS select count(*) AS `actions`,left(`zt_action`.`date`,10) AS `day` from `zt_action` group by left(`zt_action`.`date`,10); +CREATE OR REPLACE VIEW `ztv_normalproduct` AS SELECT * FROM `zt_product` WHERE `shadow` = 0; REPLACE INTO `zt_report` (`code`, `name`, `module`, `sql`, `vars`, `langs`, `params`, `step`, `desc`, `addedBy`, `addedDate`) VALUES ('product-invest', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u6295\\u5165\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u6295\\u5165\\u8868\",\"en\":\"Product Investment\"}', ',product', 'select t1.id,t1.name,1 as projects, round(t3.consumed,2) as consumed from TABLE_PRODUCT as t1\r\n left join TABLE_PROJECTPRODUCT as t2 on t1.id=t2.product\r\n left join ztv_projectsummary as t3 on t2.project=t3.project\r\n left join TABLE_PROJECT as t4 on t2.project=t4.id\r\n left join TABLE_PROGRAM as t5 on t1.program=t5.id\r\n where t1.deleted=\'0\' and t4.deleted=\'0\' and t4.type=\'project\'\r\norder by t5.`order` asc, t1.line desc, t1.`order` asc', '', '{\"projects\":{\"zh-cn\":\"\\u9879\\u76ee\\u6570\",\"zh-tw\":\"\\u9879\\u76ee\\u6570\",\"en\":\"Projects\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"projects\",\"consumed\"],\"reportType\":[\"sum\",\"sum\"],\"sumAppend\":[\"projects\",\"consumed\"]}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u6bcf\\u4e2a\\u4ea7\\u54c1\\u7684\\u9879\\u76ee\\u603b\\u6570\\uff0c\\u5df2\\u7ecf\\u6d88\\u8017\\u7684\\u5de5\\u65f6\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u6bcf\\u500b\\u7522\\u54c1\\u7684\\u9805\\u76ee\\u7e3d\\u6578\\uff0c\\u5df2\\u7d93\\u6d88\\u8017\\u7684\\u5de5\\u6642\\u3002\",\"en\":\"Number of projects and consumed hours.\"}', 'admin', '2015-07-20 14:21:30'), diff --git a/db/zentao.sql b/db/zentao.sql index 8ba6af6771..4e0460e7f3 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -7008,6 +7008,7 @@ CREATE OR REPLACE VIEW `ztv_daytaskfinish` AS select count(*) AS `taskfinish`,le CREATE OR REPLACE VIEW `ztv_daybugopen` AS select count(*) AS `bugopen`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'bug') and (`zt_action`.`action` = 'opened')) group by left(`zt_action`.`date`,10); CREATE OR REPLACE VIEW `ztv_daybugresolve` AS select count(*) AS `bugresolve`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'bug') and (`zt_action`.`action` = 'resolved')) group by left(`zt_action`.`date`,10); CREATE OR REPLACE VIEW `ztv_dayactions` AS select count(*) AS `actions`,left(`zt_action`.`date`,10) AS `day` from `zt_action` group by left(`zt_action`.`date`,10); +CREATE OR REPLACE VIEW `ztv_normalproduct` AS SELECT * FROM `zt_product` WHERE `shadow` = 0; REPLACE INTO `zt_report` (`code`, `name`, `module`, `sql`, `vars`, `langs`, `params`, `step`, `desc`, `addedBy`, `addedDate`) VALUES ('product-progress', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u5b8c\\u6210\\u5ea6\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u5b8c\\u6210\\u5ea6\\u7d71\\u8a08\\u8868\",\"en\":\"Product Progress\"}', ',product', 'select t1.*,t2.name, (case when t1.status = \'closed\' or t1.stage = \'released\' then 1 else 0 end) as done, 1 as count from TABLE_STORY as t1 \r\nleft join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"count\",\"done\"],\"reportType\":[\"sum\",\"sum\"],\"sumAppend\":[\"count\",\"done\"],\"percent\":{\"1\":\"1\"},\"contrast\":{\"1\":\"count\"},\"showAlone\":{\"1\":\"1\"}}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u603b\\u6570(\\u72b6\\u6001\\u662f\\u5173\\u95ed\\uff0c\\u6216\\u8005\\u7814\\u53d1\\u9636\\u6bb5\\u662f\\u53d1\\u5e03)\\uff0c\\u5b8c\\u6210\\u7684\\u767e\\u5206\\u6bd4\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u7e3d\\u6578(\\u72c0\\u614b\\u662f\\u95dc\\u9589\\uff0c\\u6216\\u8005\\u7814\\u767c\\u968e\\u6bb5\\u662f\\u767c\\u5e03)\\uff0c\\u5b8c\\u6210\\u7684\\u767e\\u5206\\u6bd4\\u3002\",\"en\":\"Number of total stories,done stories(state is closed, or stage is released), percent of completion.\"}', 'admin', '2015-07-21 15:07:48'), diff --git a/module/bug/control.php b/module/bug/control.php index 935a039090..35430cbafe 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -2328,6 +2328,11 @@ class bug extends control $product = $this->loadModel('product')->getByID($productID); if($product->type == 'normal') $this->config->bug->exportFields = str_replace('branch,', '', $this->config->bug->exportFields); + if($this->app->tab == 'project' or $this->app->tab == 'execution') + { + if($product->shadow) $this->config->bug->exportFields = str_replace('product,', '', $this->config->bug->exportFields); + } + $fileName = $this->lang->bug->common; if($executionID) { diff --git a/module/bug/model.php b/module/bug/model.php index 6ba2f45fc1..5f13d0d3d5 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3639,7 +3639,7 @@ class bugModel extends model public function getRelatedObjects($object, $pairs = '') { /* Get bugs. */ - $bugs = $this->dao->select('*')->from(TABLE_BUG)->where($this->session->bugQueryCondition)->fetchAll('id'); + $bugs = $this->loadModel('port')->getQueryDatas('bug'); /* Get related objects id lists. */ $relatedObjectIdList = array(); diff --git a/module/execution/control.php b/module/execution/control.php index 60c0aef0dc..2fb7488ed9 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -983,9 +983,12 @@ class execution extends control $executionID = $execution->id; $products = $this->product->getProducts($execution->id); + $hasProduct = $this->dao->findByID($execution->project)->from(TABLE_PROJECT)->fetch('hasProduct'); + if($execution->project and !$hasProduct) unset($this->config->bug->search['fields']['product']); + $productPairs = array('0' => $this->lang->product->all); foreach($products as $productData) $productPairs[$productData->id] = $productData->name; - $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', $executionID, $branch); + if($hasProduct) $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', $executionID, $branch); /* Header and position. */ $title = $execution->name . $this->lang->colon . $this->lang->execution->bug; @@ -1133,8 +1136,12 @@ class execution extends control $products = $this->product->getProducts($executionID, 'all', '', false); if(count($products) == 1) $productID = key($products); + $execution = $this->execution->getByID($executionID); + + $hasProduct = $this->dao->findByID($execution->project)->from(TABLE_PROJECT)->fetch('hasProduct'); + $extra = $executionID; - $this->lang->modulePageNav = $this->product->select(array('0' => $this->lang->product->all) + $products, $productID, 'execution', 'testcase', $extra, $branchID); + if($hasProduct) $this->lang->modulePageNav = $this->product->select(array('0' => $this->lang->product->all) + $products, $productID, 'execution', 'testcase', $extra, $branchID); /* Load pager. */ $this->app->loadClass('pager', $static = true); @@ -1167,7 +1174,7 @@ class execution extends control $this->view->pager = $pager; $this->view->type = $type; $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->execution = $this->execution->getByID($executionID); + $this->view->execution = $execution; $this->view->moduleTree = $moduleTree; $this->view->modules = $modules; $this->view->moduleID = $moduleID; @@ -1318,6 +1325,7 @@ class execution extends control $this->view->position[] = html::a($this->createLink('execution', 'testtask', "executionID=$executionID"), $this->executions[$executionID]); $this->view->position[] = $this->lang->testtask->common; $this->view->execution = $execution; + $this->view->project = $this->loadModel('project')->getByID($execution->project); $this->view->executionID = $executionID; $this->view->executionName = $this->executions[$executionID]; $this->view->pager = $pager; diff --git a/module/execution/css/testtask.css b/module/execution/css/testtask.css index 7d167eb581..36c6fbf838 100644 --- a/module/execution/css/testtask.css +++ b/module/execution/css/testtask.css @@ -1,7 +1,7 @@ .table-group-btns {width: 200px;} .table-footer, .table-grouped {box-shadow: none !important;} -.table-footer {margin-left: 205px; margin-top: 10px;} +.table-footer {margin-top: 10px;} .table-grouped > thead>tr>th.c-id, .table-grouped > tbody>tr>td.c-id {padding-left: 15px;} .table-grouped > tbody>tr>td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} diff --git a/module/execution/model.php b/module/execution/model.php index 27cf2f9a4f..1c8c2d4dbf 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -347,7 +347,7 @@ class executionModel extends model ->setDefault('openedVersion', $this->config->version) ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', helper::now()) - ->setDefault('team', substr($this->post->name, 0, 30)) + ->setDefault('team', $this->post->name) ->setIF($this->post->heightType == 'auto', 'displayCards', 0) ->setIF(!isset($_POST['whitelist']), 'whitelist', '') ->setIF($this->config->systemMode == 'new', 'parent', $this->post->project) diff --git a/module/execution/view/testtask.html.php b/module/execution/view/testtask.html.php index 66cc3b0dbc..91b1c7ca1d 100644 --- a/module/execution/view/testtask.html.php +++ b/module/execution/view/testtask.html.php @@ -12,9 +12,13 @@ ?> testtask->confirmDelete)?> +hasProduct) and $project->hasProduct == '0');?> + + +