From eb0265df2e4f84af5e53da9b36bad8a15f65e6f0 Mon Sep 17 00:00:00 2001 From: liuruogu Date: Thu, 15 Sep 2022 00:46:51 +0000 Subject: [PATCH] * 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)):?>
+