From 9c29107a6b0255b5cb5541f6d159bb5a90abbfb1 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Mon, 22 Mar 2021 15:27:44 +0800 Subject: [PATCH] * Fix bug. --- config/zentaopms.php | 2 +- module/product/control.php | 6 ++---- module/product/view/project.html.php | 16 ++++++++-------- module/productplan/control.php | 11 +++++------ module/productplan/view/browse.html.php | 2 +- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/config/zentaopms.php b/config/zentaopms.php index fe30eda702..7e0e797960 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -193,8 +193,8 @@ if(!defined('TABLE_SEARCHINDEX')) define('TABLE_SEARCHINDEX', $config->db->prefi if(!defined('TABLE_SEARCHDICT')) define('TABLE_SEARCHDICT', $config->db->prefix . 'searchdict'); $config->objectTables['product'] = TABLE_PRODUCT; -$config->objectTables['story'] = TABLE_STORY; $config->objectTables['productplan'] = TABLE_PRODUCTPLAN; +$config->objectTables['story'] = TABLE_STORY; $config->objectTables['release'] = TABLE_RELEASE; $config->objectTables['program'] = TABLE_PROJECT; $config->objectTables['project'] = TABLE_PROJECT; diff --git a/module/product/control.php b/module/product/control.php index d2a8e899f5..b4d340a9ef 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -77,11 +77,9 @@ class product extends control */ public function project($status = 'all', $productID = 0, $branch = 0, $involved = 0) { - $this->product->setMenu($productID, $branch); - - $this->app->loadLang('my'); $this->app->loadLang('execution'); - $this->app->loadLang('program'); + + $this->product->setMenu($productID, $branch); /* Get PM id list. */ $accounts = array(); diff --git a/module/product/view/project.html.php b/module/product/view/project.html.php index e3012756ad..fa90e09500 100644 --- a/module/product/view/project.html.php +++ b/module/product/view/project.html.php @@ -34,13 +34,13 @@ idAB;?> project->name;?> project->common;?> - project->PM;?> - project->begin;?> - project->end;?> - project->status;?> - project->budget;?> - project->estimate;?> - project->consume;?> + project->PM;?> + project->begin;?> + project->end;?> + project->status;?> + project->budget;?> + project->estimate;?> + project->consume;?> project->progress;?> @@ -61,7 +61,7 @@ - budget != 0 ? zget($lang->program->currencySymbol, $project->budgetUnit) . number_format($project->budget, 2) : $this->lang->project->future;?> + budget != 0 ? number_format($project->budget, 2) . zget($lang->project->currencySymbol, $project->budgetUnit) : $this->lang->project->future;?> hours->totalEstimate . ' ' . $lang->execution->workHourUnit;?> hours->totalConsumed . ' ' . $lang->execution->workHourUnit;?> diff --git a/module/productplan/control.php b/module/productplan/control.php index 4434236d2d..f148bc55f9 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -22,16 +22,17 @@ class productplan extends control */ public function commonAction($productID, $branch = 0) { - $this->loadModel('product')->setMenu($productID, $branch); + $product = $this->loadModel('product')->getById($productID); + if(empty($product)) $this->locate($this->createLink('product', 'create')); $this->app->loadConfig('execution'); - $product = $this->product->getById($productID); - if(empty($product)) $this->locate($this->createLink('product', 'create')); + $this->product->setMenu($productID, $branch); + $this->session->set('currentProductType', $product->type); + $this->view->product = $product; $this->view->branch = $branch; $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID); $this->view->position[] = html::a($this->createLink('product', 'browse', "productID={$productID}&branch=$branch"), $product->name); - $this->product->setMenu($productID, $branch); } /** @@ -206,8 +207,6 @@ class productplan extends control */ public function browse($productID = 0, $branch = 0, $browseType = 'all', $orderBy = 'begin_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1 ) { - $this->app->loadLang('project'); - /* Load pager. */ $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index 963ec5c705..fa62be5ef6 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -56,7 +56,7 @@ productplan->title);?> session->currentProductType != 'normal'):?> - product->branch);?> + productplan->branch);?> productplan->begin);?> productplan->end);?>