From cc1591feccb1764c67f7bd98e05148e024d49539 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Sat, 20 Feb 2021 14:30:19 +0800 Subject: [PATCH] * Finish task#36020. --- module/product/control.php | 20 ++++++++++---------- module/product/model.php | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 29b1483caf..8bcaeb106a 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -79,7 +79,7 @@ class product extends control public function project($status = 'all', $productID = 0, $branch = 0, $PRJMine = 0) { $this->product->setMenu($this->products, $productID, $branch); - $this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID); + $this->lang->product->switcherMenu = $this->product->getSwitcher($productID); $this->lang->product->mainMenuAction = $this->product->getProductMainAction(); $this->app->loadLang('my'); @@ -355,7 +355,7 @@ class product extends control /* Set menu. */ $this->app->loadLang('custom'); $this->lang->product->menu = $this->lang->product->viewMenu; - $this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID); + $this->lang->product->switcherMenu = $this->product->getSwitcher($productID); $this->lang->product->mainMenuAction = $this->product->getProductMainAction(); @@ -613,7 +613,7 @@ class product extends control $moduleIndex = array_search('product', $this->lang->noMenuModule); if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]); $this->lang->product->menu = $this->lang->product->viewMenu; - $this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID); + $this->lang->product->switcherMenu = $this->product->getSwitcher($productID); $this->lang->product->mainMenuAction = $this->product->getProductMainAction(); $product->desc = $this->loadModel('file')->setImgSize($product->desc); @@ -672,7 +672,7 @@ class product extends control public function roadmap($productID, $branch = 0) { $this->lang->product->menu = $this->lang->product->viewMenu; - $this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, '', $branch); + $this->lang->product->switcherMenu = $this->product->getSwitcher($productID, '', $branch); $this->lang->product->mainMenuAction = $this->product->getProductMainAction(); $this->product->setMenu($this->products, $productID, $branch); @@ -745,7 +745,7 @@ class product extends control $this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $this->products[$productID]); $this->view->position[] = $this->lang->product->dynamic; - $this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, $type); + $this->lang->product->switcherMenu = $this->product->getSwitcher($productID, $type); $this->lang->product->mainMenuAction = $this->product->getProductMainAction(); $this->view->userIdPairs = $this->loadModel('user')->getPairs('noletter|nodeleted|noclosed|useid'); @@ -778,7 +778,7 @@ class product extends control if(!$product) die(js::locate('product', 'all')); $this->lang->product->menu = $this->lang->product->viewMenu; - $this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID); + $this->lang->product->switcherMenu = $this->product->getSwitcher($productID); $this->lang->product->mainMenuAction = $this->product->getProductMainAction(); $product->desc = $this->loadModel('file')->setImgSize($product->desc); @@ -959,7 +959,7 @@ class product extends control */ public function all($browseType = 'noclosed', $orderBy = 'order_asc') { - $this->lang->product->mainMenuAction = html::a('javascript:history.go(-1);', ' ' . $this->lang->goback, '', "class='btn btn-link'"); + if($this->session->moreProductLink) $this->lang->product->mainMenuAction = html::a($this->session->moreProductLink, ' ' . $this->lang->goback, '', "class='btn btn-link'"); /* Load module and set session. */ $this->loadModel('program'); @@ -1003,7 +1003,7 @@ class product extends control public function whitelist($productID = 0, $module = 'product', $objectType = 'product', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { $this->lang->product->menu = $this->lang->product->viewMenu; - $this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, '', 0); + $this->lang->product->switcherMenu = $this->product->getSwitcher($productID, '', 0); $this->lang->product->mainMenuAction = $this->product->getProductMainAction(); $this->product->setMenu($this->products, $productID, 0); $this->lang->modulePageNav = ''; @@ -1022,8 +1022,8 @@ class product extends control */ public function addWhitelist($productID = 0, $deptID = 0, $branch = '') { - $this->lang->product->menu = $this->lang->product->viewMenu; - $this->lang->product->switcherMenu = $this->loadModel('product')->getSwitcher($productID, '', $branch); + $this->lang->product->menu = $this->lang->product->viewMenu; + $this->lang->product->switcherMenu = $this->product->getSwitcher($productID, '', $branch); $this->lang->product->mainMenuAction = $this->product->getProductMainAction(); $this->product->setMenu($this->products, $productID, $branch); $moduleIndex = array_search('product', $this->lang->noMenuModule); diff --git a/module/product/model.php b/module/product/model.php index 63b4988cf9..1544094cb4 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -440,6 +440,7 @@ class productModel extends model { $currentModule = $this->app->moduleName; $currentMethod = $this->app->methodName; + $this->session->set('moreProductLink', $this->app->getURI(true)); $this->loadModel('project'); $currentProductName = $this->lang->product->common;