From eb0265df2e4f84af5e53da9b36bad8a15f65e6f0 Mon Sep 17 00:00:00 2001 From: liuruogu Date: Thu, 15 Sep 2022 00:46:51 +0000 Subject: [PATCH 01/19] * Do task #69018. --- module/product/control.php | 7 ++++++- module/product/view/browse.html.php | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/module/product/control.php b/module/product/control.php index 72c732df21..5e1c8290de 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -309,6 +309,11 @@ class product extends control $productName = ($this->app->rawModule == 'projectstory' and empty($productID)) ? $this->lang->product->all : $this->products[$productID]; + $project = $this->loadModel('project')->getByID($projectID); + + if(empty($project->hasProduct)) unset($this->config->product->search['fields']['product']); + var_dump(empty($project->hasProduct)); + /* Assign. */ $this->view->title = $productName . $this->lang->colon . $this->lang->product->browse; $this->view->position[] = $productName; @@ -347,7 +352,7 @@ class product extends control $this->view->storyType = $storyType; $this->view->from = $this->app->tab; $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'story', $showModule) : array(); - $this->view->project = $this->loadModel('project')->getByID($projectID); + $this->view->project = $project; $this->display(); } diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index e99aeab382..0e88c43143 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -59,6 +59,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
+ hasProduct)):?>
+
Date: Thu, 15 Sep 2022 00:48:26 +0000 Subject: [PATCH 02/19] * Do task #69012. --- module/weekly/model.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/module/weekly/model.php b/module/weekly/model.php index 400c59ac5d..d45302657b 100755 --- a/module/weekly/model.php +++ b/module/weekly/model.php @@ -47,14 +47,9 @@ class weeklyModel extends model $weeks = $this->getWeekPairs($begin, $end); $current = zget($weeks, $date, current($weeks)); - $selectHtml = ''; - - if(!empty($project->hasProduct)) - { - $selectHtml .= "
"; - $selectHtml .= html::a('###', $this->lang->weekly->common . $this->lang->colon . $project->name, '', "class='btn'"); - $selectHtml .= '
'; - } + $selectHtml = "
"; + $selectHtml .= html::a('###', $this->lang->weekly->common . $this->lang->colon . $project->name, '', "class='btn'"); + $selectHtml .= '
'; $selectHtml .= "
"; $selectHtml .= "
"; From 4eaf187aab5ed02f1973f3660b119358c6610630 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 15 Sep 2022 08:58:12 +0800 Subject: [PATCH 03/19] * Finish task #69010. --- module/execution/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index 32b6aaa4e0..a86ab95200 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1604,7 +1604,7 @@ class executionModel extends model ->beginIF($limit)->limit($limit)->fi() ->fetchAll('id'); - if(isset($project->model) and $project->model == 'waterfall') + if(isset($project->model) and $project->model == 'waterfall' and $project->hasProduct) { $executionList = array(); $executionProducts = $this->dao->select('t1.project,t1.product')->from(TABLE_PROJECTPRODUCT)->alias('t1') From 3b97ed9213fec8f845492e73e62ec2010f83deb8 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 15 Sep 2022 09:30:46 +0800 Subject: [PATCH 04/19] * Fix bug of upgrade the exist projects. --- db/update17.6.1.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/update17.6.1.sql b/db/update17.6.1.sql index 6c2f458e73..9846b7562f 100644 --- a/db/update17.6.1.sql +++ b/db/update17.6.1.sql @@ -1,2 +1,2 @@ ALTER TABLE `zt_product` ADD `shadow` tinyint(1) unsigned NOT NULL AFTER `code`; -ALTER TABLE `zt_project` ADD `hasProduct` tinyint(1) unsigned NOT NULL AFTER `code`; +ALTER TABLE `zt_project` ADD `hasProduct` tinyint(1) unsigned NOT NULL DEFAULT 1 AFTER `code`; From ea6264562239f96a264590cb6c759b2b64c05cb1 Mon Sep 17 00:00:00 2001 From: liuruogu Date: Thu, 15 Sep 2022 01:43:27 +0000 Subject: [PATCH 05/19] * Do task #69018. --- module/product/control.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 5e1c8290de..b78a354694 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -295,6 +295,9 @@ class product extends control unset($this->config->product->search['fields']['stage']); } + $project = $this->loadModel('project')->getByID($projectID); + if(empty($project->hasProduct)) unset($this->config->product->search['fields']['product']); + /* Build search form. */ $rawModule = $this->app->rawModule; $rawMethod = $this->app->rawMethod; @@ -309,11 +312,6 @@ class product extends control $productName = ($this->app->rawModule == 'projectstory' and empty($productID)) ? $this->lang->product->all : $this->products[$productID]; - $project = $this->loadModel('project')->getByID($projectID); - - if(empty($project->hasProduct)) unset($this->config->product->search['fields']['product']); - var_dump(empty($project->hasProduct)); - /* Assign. */ $this->view->title = $productName . $this->lang->colon . $this->lang->product->browse; $this->view->position[] = $productName; From 8d46cc5019d7e26850f10a276f26594658f143c6 Mon Sep 17 00:00:00 2001 From: liuruogu Date: Thu, 15 Sep 2022 02:01:00 +0000 Subject: [PATCH 06/19] * Do task #69018. --- module/execution/control.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/execution/control.php b/module/execution/control.php index dea8b3e57b..34e0e6c9cb 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -842,6 +842,10 @@ class execution extends control $branchOption[$branchID] = $name; } } + + $projectID = $execution->project; + $project = $this->loadModel('project')->getByID($projectID); + if(empty($project->hasProduct)) unset($this->config->product->search['fields']['product']); $this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'executionStory', $executionID); /* Header and position. */ From 04cd8275fedd39d2af0f34bba04278ac1533a95d Mon Sep 17 00:00:00 2001 From: liuruogu Date: Thu, 15 Sep 2022 02:42:40 +0000 Subject: [PATCH 07/19] * Finish task #69016. --- module/project/control.php | 8 ++++++++ module/project/lang/de.php | 2 ++ module/project/lang/en.php | 2 ++ module/project/lang/fr.php | 2 ++ module/project/lang/vi.php | 2 ++ module/project/lang/zh-cn.php | 2 ++ module/project/view/view.html.php | 2 ++ 7 files changed, 20 insertions(+) diff --git a/module/project/control.php b/module/project/control.php index c104de1407..f9600dee6d 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -851,6 +851,14 @@ class project extends control $this->executeHooks($projectID); + if(empty($project->hasProduct)) + { + $projectProduct = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetch()->product; + $this->lang->project->moduleMenu['link'] = sprintf($this->lang->project->moduleMenu['link'], $projectProduct); + $this->lang->project->menu->settings['subMenu']->tree = $this->lang->project->moduleMenu; + unset($this->lang->project->menu->settings['subMenu']->products); + } + $this->view->title = $this->lang->project->view; $this->view->position = $this->lang->project->view; $this->view->projectID = $projectID; diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 2b4f15db07..011cacffef 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -341,3 +341,5 @@ $lang->project->confirmUnlinkMember = "Do you want to remove this user from pro $lang->project->action = new stdclass(); $lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; + +$lang->project->moduleMenu = array('link' => 'Module|tree|browse|product=%s&view=story'); diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 45db2db3bd..1532a58fb9 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -341,3 +341,5 @@ $lang->project->confirmUnlinkMember = "Do you want to remove this user from proj $lang->project->action = new stdclass(); $lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; + +$lang->project->moduleMenu = array('link' => 'Module|tree|browse|product=%s&view=story'); diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 96d872c13d..6ae69a832f 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -341,3 +341,5 @@ $lang->project->confirmUnlinkMember = "Do you want to remove this user from pro $lang->project->action = new stdclass(); $lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; + +$lang->project->moduleMenu = array('link' => 'Module|tree|browse|product=%s&view=story'); diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index 162e4ca1fe..968c5d2417 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -241,3 +241,5 @@ $lang->project->childLongTime = "There are long-term projects in the child p $lang->project->action = new stdclass(); $lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; + +$lang->project->moduleMenu = array('link' => 'Module|tree|browse|product=%s&view=story'); diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 3dc85712a6..1d776a176c 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -341,3 +341,5 @@ $lang->project->confirmUnlinkMember = "您确定从该项目中移除该用户 $lang->project->action = new stdclass(); $lang->project->action->managed = '$date, 由 $actor 维护。$extra' . "\n"; + +$lang->project->moduleMenu = array('link' => '模块|tree|browse|product=%s&view=story'); diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 2ae7484bee..74cf8a203d 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -152,6 +152,7 @@
+ hasProduct)):?>
project->manageProducts;?> @@ -187,6 +188,7 @@
+
execution->lblStats;?>
From 042a9a97c323fea5b3f4934856f507a39a684f3e Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 15 Sep 2022 13:05:14 +0800 Subject: [PATCH 08/19] * Display the project type on the edit page of the project module. --- module/project/view/edit.html.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 3e149cddab..72fd514b16 100755 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -74,6 +74,13 @@ code, "class='form-control' required");?> + + project->type;?> + + project->projectTypeList, $project->hasProduct);?> + hasProduct);?> + + project->PM;?> PM, "class='form-control chosen'" . (strpos($requiredFields, 'PM') !== false ? ' required' : ''));?> From 93b221c6a69aa30647ec8ee188b9be70abc404e8 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 15 Sep 2022 13:06:23 +0800 Subject: [PATCH 09/19] * Display the products and the plans on the edit page of the project module if the project has product. --- module/project/view/edit.html.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 72fd514b16..553c93c3a4 100755 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -132,6 +132,7 @@ + hasProduct):?> project->manageProducts;?> @@ -182,6 +183,7 @@
+ model == 'kanban'):?> execution->team;?> From fefdfe5b4956a18361308026cb93e13ca6c47c22 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 15 Sep 2022 13:07:43 +0800 Subject: [PATCH 10/19] * Adjust the vertical align. --- module/project/css/create.css | 1 + module/project/css/edit.css | 1 + module/project/view/create.html.php | 2 +- module/project/view/edit.html.php | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/project/css/create.css b/module/project/css/create.css index 0c06d2fff2..26fcedbac7 100644 --- a/module/project/css/create.css +++ b/module/project/css/create.css @@ -28,3 +28,4 @@ #dataform th {vertical-align: top; padding-top: 13px;} .futureBox {vertical-align: top !important; padding-top: 13px !important;} #linkPlan {padding-top: 25px !important;} +#projectType {padding-top: 7px !important;} diff --git a/module/project/css/edit.css b/module/project/css/edit.css index 57332fa1c0..d04f70ba45 100644 --- a/module/project/css/edit.css +++ b/module/project/css/edit.css @@ -7,3 +7,4 @@ #dataform th {vertical-align: top; padding-top: 13px;} #linkPlan {padding-top: 25px !important;} #productsBox .row .col-sm-4.required::after {right: -5px;} +#projectType {padding-top: 7px !important;} diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index 6a984bc8a8..61b5c47d72 100755 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -73,7 +73,7 @@ - project->type;?> + project->type;?> project->projectTypeList, 1);?> diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 553c93c3a4..30c80ce565 100755 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -75,7 +75,7 @@ - project->type;?> + project->type;?> project->projectTypeList, $project->hasProduct);?> hasProduct);?> From 04824e964b59ec287c29e46fbd583711cd060e0f Mon Sep 17 00:00:00 2001 From: liuruogu Date: Thu, 15 Sep 2022 05:12:30 +0000 Subject: [PATCH 11/19] * Finish task #69016. --- module/common/lang/menu.php | 6 ++++-- module/project/control.php | 9 +-------- module/project/lang/de.php | 2 -- module/project/lang/en.php | 2 -- module/project/lang/fr.php | 2 -- module/project/lang/vi.php | 2 -- module/project/lang/zh-cn.php | 2 -- module/project/model.php | 12 ++++++++++++ 8 files changed, 17 insertions(+), 20 deletions(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 856fe405a8..c6f2c848eb 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -209,7 +209,7 @@ $lang->scrum->menu->devops = array('link' => "{$lang->repo->common}|repo|brow $lang->scrum->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s"); $lang->scrum->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse|project=%s", 'subModule' => 'projectrelease'); $lang->scrum->menu->dynamic = array('link' => "$lang->dynamic|project|dynamic|project=%s"); -$lang->scrum->menu->settings = array('link' => "$lang->settings|project|view|project=%s", 'subModule' => 'stakeholder', 'alias' => 'edit,manageproducts,group,managemembers,manageview,managepriv,whitelist,addwhitelist,team'); +$lang->scrum->menu->settings = array('link' => "$lang->settings|project|view|project=%s", 'subModule' => 'tree,stakeholder', 'alias' => 'edit,manageproducts,group,managemembers,manageview,managepriv,whitelist,addwhitelist,team'); $lang->scrum->dividerMenu = ',execution,programplan,doc,settings,'; @@ -241,6 +241,7 @@ $lang->scrum->menu->settings['subMenu']->members = array('link' => "{$lang-> $lang->scrum->menu->settings['subMenu']->whitelist = array('link' => "{$lang->whitelist}|project|whitelist|project=%s", 'subModule' => 'personnel'); $lang->scrum->menu->settings['subMenu']->stakeholder = array('link' => "{$lang->stakeholder->common}|stakeholder|browse|project=%s", 'subModule' => 'stakeholder'); $lang->scrum->menu->settings['subMenu']->group = array('link' => "{$lang->priv}|project|group|project=%s", 'alias' => 'group,manageview,managepriv'); +$lang->scrum->menu->settings['subMenu']->module = array('link' => "{$lang->module}|tree|browse|product=%s&view=story"); /* Waterfall menu. */ $lang->waterfall->menu = new stdclass(); @@ -295,7 +296,7 @@ $lang->kanbanProject = new stdclass(); $lang->kanbanProject->menu = new stdclass(); $lang->kanbanProject->menu->index = array('link' => "{$lang->kanban->common}|project|index|project=%s"); $lang->kanbanProject->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s"); -$lang->kanbanProject->menu->settings = array('link' => "$lang->settings|project|view|project=%s", 'subModule' => 'stakeholder', 'alias' => 'edit,manageproducts,group,managemembers,manageview,managepriv,whitelist,addwhitelist,team'); +$lang->kanbanProject->menu->settings = array('link' => "$lang->settings|project|view|project=%s", 'subModule' => 'tree,stakeholder', 'alias' => 'edit,manageproducts,group,managemembers,manageview,managepriv,whitelist,addwhitelist,team'); $lang->kanbanProject->dividerMenu = ''; @@ -309,6 +310,7 @@ $lang->kanbanProject->menu->settings['subMenu']->view = array('link' => " $lang->kanbanProject->menu->settings['subMenu']->products = array('link' => "{$lang->product->common}|project|manageProducts|project=%s", 'alias' => 'manageproducts'); $lang->kanbanProject->menu->settings['subMenu']->members = array('link' => "{$lang->team->common}|project|team|project=%s", 'alias' => 'managemembers,team'); $lang->kanbanProject->menu->settings['subMenu']->whitelist = array('link' => "{$lang->whitelist}|project|whitelist|project=%s", 'subModule' => 'personnel'); +$lang->kanbanProject->menu->settings['subMenu']->module = array('link' => "{$lang->module}|tree|browse|product=%s&view=story"); /* Execution menu. */ $lang->execution->homeMenu = new stdclass(); diff --git a/module/project/control.php b/module/project/control.php index f9600dee6d..0b0159be81 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -851,14 +851,6 @@ class project extends control $this->executeHooks($projectID); - if(empty($project->hasProduct)) - { - $projectProduct = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetch()->product; - $this->lang->project->moduleMenu['link'] = sprintf($this->lang->project->moduleMenu['link'], $projectProduct); - $this->lang->project->menu->settings['subMenu']->tree = $this->lang->project->moduleMenu; - unset($this->lang->project->menu->settings['subMenu']->products); - } - $this->view->title = $this->lang->project->view; $this->view->position = $this->lang->project->view; $this->view->projectID = $projectID; @@ -1992,6 +1984,7 @@ class project extends control { $projectID = $this->project->setMenu($projectID); $project = $this->project->getById($projectID); + if(isset($project->acl) and $project->acl == 'open') $this->locate($this->createLink('project', 'index', "projectID=$projectID")); echo $this->fetch('personnel', 'whitelist', "objectID=$projectID&module=$module&browseType=$objectType&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID&from=$from"); diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 011cacffef..2b4f15db07 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -341,5 +341,3 @@ $lang->project->confirmUnlinkMember = "Do you want to remove this user from pro $lang->project->action = new stdclass(); $lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; - -$lang->project->moduleMenu = array('link' => 'Module|tree|browse|product=%s&view=story'); diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 1532a58fb9..45db2db3bd 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -341,5 +341,3 @@ $lang->project->confirmUnlinkMember = "Do you want to remove this user from proj $lang->project->action = new stdclass(); $lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; - -$lang->project->moduleMenu = array('link' => 'Module|tree|browse|product=%s&view=story'); diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 6ae69a832f..96d872c13d 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -341,5 +341,3 @@ $lang->project->confirmUnlinkMember = "Do you want to remove this user from pro $lang->project->action = new stdclass(); $lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; - -$lang->project->moduleMenu = array('link' => 'Module|tree|browse|product=%s&view=story'); diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index 968c5d2417..162e4ca1fe 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -241,5 +241,3 @@ $lang->project->childLongTime = "There are long-term projects in the child p $lang->project->action = new stdclass(); $lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; - -$lang->project->moduleMenu = array('link' => 'Module|tree|browse|product=%s&view=story'); diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 1d776a176c..3dc85712a6 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -341,5 +341,3 @@ $lang->project->confirmUnlinkMember = "您确定从该项目中移除该用户 $lang->project->action = new stdclass(); $lang->project->action->managed = '$date, 由 $actor 维护。$extra' . "\n"; - -$lang->project->moduleMenu = array('link' => '模块|tree|browse|product=%s&view=story'); diff --git a/module/project/model.php b/module/project/model.php index 8aaa6a4bf7..683afe62ca 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2436,6 +2436,7 @@ class projectModel extends model $model = 'scrum'; $objectID = (empty($objectID) and $this->session->project) ? $this->session->project : $objectID; $project = $this->getByID($objectID); + if($project and $project->model == 'waterfall') $model = $project->model; if($project and $project->model == 'kanban') { @@ -2451,6 +2452,17 @@ class projectModel extends model $lang->project->dividerMenu = $lang->{$model}->dividerMenu; } + if(empty($project->hasProduct)) + { + unset($this->lang->project->menu->settings['subMenu']->products); + $projectProduct = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($objectID)->fetch()->product; + $this->lang->project->menu->settings['subMenu']->module['link'] = sprintf($this->lang->project->menu->settings['subMenu']->module['link'], $projectProduct); + } + else + { + unset($this->lang->project->menu->settings['subMenu']->module); + } + /* Reset project priv. */ $moduleName = $this->app->rawModule; $methodName = $this->app->rawMethod; From cc80ff7209d51a2c622894e949034e78f3e4ae91 Mon Sep 17 00:00:00 2001 From: liuruogu Date: Thu, 15 Sep 2022 05:14:16 +0000 Subject: [PATCH 12/19] * Finish task #69016. --- module/project/control.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/project/control.php b/module/project/control.php index 0b0159be81..c104de1407 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1984,7 +1984,6 @@ class project extends control { $projectID = $this->project->setMenu($projectID); $project = $this->project->getById($projectID); - if(isset($project->acl) and $project->acl == 'open') $this->locate($this->createLink('project', 'index', "projectID=$projectID")); echo $this->fetch('personnel', 'whitelist', "objectID=$projectID&module=$module&browseType=$objectType&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID&from=$from"); From 3a6bc7c7688b40df621f411932ba58515c660839 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 15 Sep 2022 13:44:54 +0800 Subject: [PATCH 13/19] * Finish task #68994. --- module/projectrelease/control.php | 2 ++ module/projectrelease/view/browse.html.php | 4 ++++ module/projectrelease/view/create.html.php | 2 +- module/projectrelease/view/view.html.php | 16 +++++++++------- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index 993f8fab5c..35ec467923 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -530,6 +530,7 @@ class projectrelease extends control $branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $release->branch => $branchName); $this->config->product->search['params']['branch']['values'] = $branches; } + if($this->view->project->model == 'waterfall' && empty($this->view->project->hasProduct)) unset($this->config->product->search['fields']['plan']); $this->loadModel('search')->setSearchParams($this->config->product->search); if($browseType == 'bySearch') @@ -651,6 +652,7 @@ class projectrelease extends control $branches = array('' => '', BRANCH_MAIN => $this->lang->branch->main, $release->branch => $branchName); $this->config->bug->search['params']['branch']['values'] = $branches; } + if($this->view->project->model == 'waterfall' && empty($this->view->project->hasProduct)) unset($this->config->bug->search['fields']['plan']); $this->loadModel('search')->setSearchParams($this->config->bug->search); $allBugs = array(); diff --git a/module/projectrelease/view/browse.html.php b/module/projectrelease/view/browse.html.php index f748053199..9dfc502561 100644 --- a/module/projectrelease/view/browse.html.php +++ b/module/projectrelease/view/browse.html.php @@ -46,7 +46,9 @@ release->id;?> release->name;?> + hasProduct):?> release->product;?> + executionCommon;?> release->build;?> release->date;?> @@ -68,7 +70,9 @@ echo html::a(inlink('view', "release=$release->id"), $release->name, '', "data-app='$from'") . $flagIcon; ?> + hasProduct):?> productName?> + executionName?> execution) ? $release->buildName : html::a($this->createLink('build', 'view', "buildID=$release->buildID"), $release->buildName);?> date;?> diff --git a/module/projectrelease/view/create.html.php b/module/projectrelease/view/create.html.php index 84426ac700..ceca9ba631 100644 --- a/module/projectrelease/view/create.html.php +++ b/module/projectrelease/view/create.html.php @@ -37,7 +37,7 @@ release->build;?> - + hasProduct) echo "class='hide'";?> > release->product;?>
diff --git a/module/projectrelease/view/view.html.php b/module/projectrelease/view/view.html.php index 70378c16b2..d59bada8f3 100644 --- a/module/projectrelease/view/view.html.php +++ b/module/projectrelease/view/view.html.php @@ -333,18 +333,20 @@
release->basicInfo?>
+ hasProduct):?> - productType != 'normal'):?> - - - - - + productType != 'normal'):?> - + + + + + + + From 00857783d71c41271e8afcb39cf5c6239858c0bf Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 15 Sep 2022 13:52:12 +0800 Subject: [PATCH 14/19] * Change the rule to create the shadow product's name. --- db/update17.6.1.sql | 2 ++ db/zentao.sql | 2 +- module/project/model.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/db/update17.6.1.sql b/db/update17.6.1.sql index 9846b7562f..05a415e445 100644 --- a/db/update17.6.1.sql +++ b/db/update17.6.1.sql @@ -1,2 +1,4 @@ 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; diff --git a/db/zentao.sql b/db/zentao.sql index b39793fd2a..e92a6e2223 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1096,7 +1096,7 @@ CREATE TABLE IF NOT EXISTS `zt_planstory` ( CREATE TABLE IF NOT EXISTS `zt_product` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `program` mediumint(8) unsigned NOT NULL, - `name` varchar(90) NOT NULL, + `name` varchar(110) NOT NULL, `code` varchar(45) NOT NULL, `shadow` tinyint(1) unsigned NOT NULL, `bind` enum('0','1') NOT NULL DEFAULT '0', diff --git a/module/project/model.php b/module/project/model.php index 683afe62ca..4b1e6e31c9 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1269,7 +1269,7 @@ class projectModel extends model { /* If parent not empty, link products or create products. */ $product = new stdclass(); - $product->name = !$project->hasProduct ? "{$project->name}_{$projectID}" : ($this->post->productName ? $this->post->productName : $project->name); + $product->name = !$project->hasProduct ? "SHADOW_{$project->name}_{$projectID}" : ($this->post->productName ? $this->post->productName : $project->name); $product->shadow = (int)empty($project->hasProduct); $product->bind = $this->post->parent ? 0 : 1; $product->program = $project->parent ? current(array_filter(explode(',', $program->path))) : 0; From 9b6274739668f7f951accdbb3407678b0cbc9de7 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 15 Sep 2022 14:24:08 +0800 Subject: [PATCH 15/19] * Finish task #69009. --- module/datatable/config.php | 2 ++ module/datatable/model.php | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/module/datatable/config.php b/module/datatable/config.php index 0c2c0fdbb0..3909fefff3 100644 --- a/module/datatable/config.php +++ b/module/datatable/config.php @@ -6,3 +6,5 @@ $config->datatable->moduleAlias['testtask-cases'] = 'testcase'; $config->datatable->moduleAlias['program-project'] = 'project'; $config->datatable->moduleAlias['project-bug'] = 'bug'; $config->datatable->moduleAlias['execution-bug'] = 'bug'; + +$config->datatable->noProductModule = ',review,'; diff --git a/module/datatable/model.php b/module/datatable/model.php index e69834e266..49267b9bf6 100644 --- a/module/datatable/model.php +++ b/module/datatable/model.php @@ -23,6 +23,12 @@ class datatableModel extends model public function getFieldList($module) { if(!isset($this->config->$module)) $this->loadModel($module); + if($this->session->hasProduct == 0 and (strpos($this->config->datatable->noProductModule, ",$module,") !== false)) + { + $productIndex = array_search('product', $this->config->$module->datatable->defaultField); + if($productIndex) unset($this->config->$module->datatable->defaultField[$productIndex]); + if(isset($this->config->$module->datatable->fieldList['product'])) unset($this->config->$module->datatable->fieldList['product']); + } if($this->session->currentProductType === 'normal') unset($this->config->$module->datatable->fieldList['branch']); foreach($this->config->$module->datatable->fieldList as $field => $items) { From f76ecb489766b4c425465c5b9a2c7f27303ea35a Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 15 Sep 2022 14:37:25 +0800 Subject: [PATCH 16/19] * Fix bug #27489. --- 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 16b4b7158b..986b2afe38 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -258,7 +258,7 @@ class story extends control setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, true); $execution = $this->dao->findById((int)$objectID)->from(TABLE_EXECUTION)->fetch(); $moduleName = $execution->type == 'project' ? 'projectstory' : 'execution'; - $param = $execution->type == 'project' ? "projectID=$objectID&productID=$productID" : "executionID=$objectID&orderBy=order_desc&browseType=unclosed"; + $param = $execution->type == 'project' ? "projectID=$objectID" : "executionID=$objectID&orderBy=order_desc&browseType=unclosed"; $response['locate'] = $this->createLink($moduleName, 'story', $param); } if($this->app->getViewType() == 'xhtml') $response['locate'] = $this->createLink('story', 'view', "storyID=$storyID", 'html'); From dcadbc9b34ec58d84b15322fcb58320bdf2c327e Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 15 Sep 2022 14:51:38 +0800 Subject: [PATCH 17/19] * Finish task #69008. --- module/product/view/track.html.php | 2 +- module/projectstory/control.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/module/product/view/track.html.php b/module/product/view/track.html.php index 7a515e738e..bc8829587a 100644 --- a/module/product/view/track.html.php +++ b/module/product/view/track.html.php @@ -28,7 +28,7 @@ URAndSR):?>
release->product;?> productName;?>
product->branch, $lang->product->branchName[$product->type]);?>
release->name;?>product->branch, $lang->product->branchName[$product->type]);?>
release->name;?> name;?>
> - app->rawModule == 'projectstory'): ?> + app->rawModule == 'projectstory' and $this->session->hasProduct): ?> + execution->featureBar['all'] as $key => $label):?> $label";?>