From 227d6c8211cb8a4870d6e8ba31d0c0b19fc4c937 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Mon, 2 Nov 2020 14:31:21 +0800 Subject: [PATCH] * Adjust code detail. --- module/bug/control.php | 4 ++-- module/common/lang/zh-cn.php | 6 +++--- module/group/lang/resource.php | 8 ++++---- module/product/control.php | 5 +++-- module/product/model.php | 16 +++++++++++++--- module/program/view/pgmbrowsebylist.html.php | 2 +- module/project/model.php | 1 - module/testcase/control.php | 2 +- module/testreport/control.php | 2 +- module/testsuite/control.php | 8 ++++---- module/testtask/control.php | 8 ++++---- 11 files changed, 36 insertions(+), 26 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index cf3abb961a..baaa43cc58 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -31,7 +31,7 @@ class bug extends control $this->loadModel('action'); $this->loadModel('story'); $this->loadModel('task'); - $this->view->products = $this->products = $this->product->getPairs('nocode'); + $this->view->products = $this->products = $this->product->getProductsByProject($this->session->PRJ); if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=bug"))); } @@ -439,7 +439,7 @@ class bug extends control $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); if(empty($moduleOptionMenu)) die(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); - $productList = $this->product->getOrderedProducts('all'); + $productList = $this->product->getOrderedProducts('all', 40, $this->session->PRJ); foreach($productList as $product) $products[$product->id] = $product->name; /* Set custom. */ diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index ec2bc8f9c5..0a9fdc2929 100755 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -130,7 +130,7 @@ if($config->URAndSR) /* 主导航菜单。*/ $lang->mainNav = new stdclass(); $lang->mainNav->my = ' 地盘|my|index|'; -$lang->mainNav->program = ' 项目集|program|pgmindex|'; +$lang->mainNav->program = ' 项目集|program|pgmbrowse|'; $lang->mainNav->product = ' 产品|product|index|'; $lang->mainNav->project = ' 项目|program|prjbrowse|'; $lang->mainNav->system = ' 组织|custom|estimate|'; @@ -142,11 +142,11 @@ $lang->dividerMenu = ',admin,'; /* Program set menu. */ $lang->program = new stdclass(); $lang->program->menu = new stdclass(); -$lang->program->menu->index = '主页|program|pgmindex|'; +//$lang->program->menu->index = '主页|program|pgmindex|'; $lang->program->menu->browse = array('link' => '项目集|program|pgmbrowse|', 'alias' => 'pgmcreate,pgmedit,pgmgroup,pgmmanagepriv,pgmmanageview,pgmmanagemembers'); $lang->program->viewMenu = new stdclass(); -$lang->program->viewMenu->view = array('link' => '概况|program|pgmview|program=%s'); +//$lang->program->viewMenu->view = array('link' => '概况|program|pgmview|program=%s'); $lang->program->viewMenu->product = array('link' => '产品|program|pgmproduct|program=%s'); $lang->program->viewMenu->project = array('link' => "项目|program|pgmproject|program=%s"); $lang->program->viewMenu->personnel = array('link' => "人员|personnel|accessible|program=%s"); diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index fe8e3eb9e3..0dd6e63922 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -161,12 +161,12 @@ $lang->todo->methodOrder[80] = 'batchClose'; /* Program. */ $lang->resource->program = new stdclass(); $lang->resource->program->createGuide = 'createGuide'; -$lang->resource->program->PGMIndex = 'PGMIndex'; +//$lang->resource->program->PGMIndex = 'PGMIndex'; $lang->resource->program->PGMBrowse = 'PGMBrowse'; $lang->resource->program->PGMProduct = 'PGMProduct'; $lang->resource->program->PGMCreate = 'PGMCreate'; $lang->resource->program->PGMEdit = 'PGMEdit'; -$lang->resource->program->PGMView = 'PGMView'; +//$lang->resource->program->PGMView = 'PGMView'; $lang->resource->program->PGMClose = 'PGMClose'; $lang->resource->program->PGMActivate = 'PGMActivate'; $lang->resource->program->PGMDelete = 'PGMDelete'; @@ -200,12 +200,12 @@ $lang->resource->program->unbindWhielist = 'unbindWhielist'; $lang->resource->program->PRJManageProducts = 'PRJManageProducts'; $lang->program->methodOrder[0] = 'createGuide'; -$lang->program->methodOrder[5] = 'PGMIndex'; +//$lang->program->methodOrder[5] = 'PGMIndex'; $lang->program->methodOrder[10] = 'PGMBrowse'; $lang->program->methodOrder[15] = 'PGMProduct'; $lang->program->methodOrder[20] = 'PGMCreate'; $lang->program->methodOrder[25] = 'PGMEdit'; -$lang->program->methodOrder[30] = 'PGMView'; +//$lang->program->methodOrder[30] = 'PGMView'; $lang->program->methodOrder[35] = 'PGMClose'; $lang->program->methodOrder[40] = 'PGMActivate'; $lang->program->methodOrder[45] = 'PGMDelete'; diff --git a/module/product/control.php b/module/product/control.php index 669c1b090c..d6adb1d68b 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -700,11 +700,12 @@ class product extends control $this->view->module = $module; $this->view->method = $method; $this->view->extra = $extra; - $products = $this->product->getProductsByProject($this->session->PRJ); + $products = $this->product->getProductsByProject($this->session->PRJ); $product = $this->product->getByID($productID); + $this->view->products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in(array_keys($products))->orderBy('`order` desc')->fetchAll('id'); - $this->view->programID = $product->program; + $this->view->programID = $this->session->PRJ; $this->display(); } diff --git a/module/product/model.php b/module/product/model.php index c5588ab604..c797e6cf39 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -138,7 +138,7 @@ class productModel extends model if($isMobile) $output = "{$currentProduct->name}
"; if($currentProduct->type == 'normal') unset($this->lang->product->menu->branch); - if($currentProduct->type != 'normal') + if($currentProduct->type != 'normal' && $currentModule != 'programplan') { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$currentProduct->type]); $this->lang->product->menu->branch = str_replace('@branch@', $this->lang->product->branchName[$currentProduct->type], $this->lang->product->branch); @@ -358,9 +358,19 @@ class productModel extends model * @access public * @return array */ - public function getOrderedProducts($status, $num = 0) + public function getOrderedProducts($status, $num = 0, $projectID = 0) { - $products = $this->getList($this->session->program, $status); + $products = array(); + if($projectID) + { + $pairs = $this->getProductsByProject($this->session->PRJ); + $products = $this->getByIdList(array_keys($pairs)); + } + else + { + $products = $this->getList('', $status, $num); + } + if(empty($products)) return $products; $lines = $this->loadModel('tree')->getLinePairs($useShort = true); diff --git a/module/program/view/pgmbrowsebylist.html.php b/module/program/view/pgmbrowsebylist.html.php index a2d5b6dd61..203081020a 100644 --- a/module/program/view/pgmbrowsebylist.html.php +++ b/module/program/view/pgmbrowsebylist.html.php @@ -50,7 +50,7 @@