diff --git a/module/common/lang/en.php b/module/common/lang/en.php index f888e9ea3c..04ad7ed9f5 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -139,6 +139,7 @@ $lang->product->menu->view = 'Info|product|view|productID=%s'; $lang->product->menu->edit = 'Edit|product|edit|productID=%s'; $lang->product->menu->module = 'Modules|tree|browse|productID=%s&view=story'; $lang->product->menu->create = array('link' => 'New Product|product|create', 'float' => 'right'); +$lang->project->menu->project = array('link' => 'Project list|product|index|locate=false&status=all&productID=%s', 'float' => 'right'); $lang->story->menu = $lang->product->menu; $lang->productplan->menu = $lang->product->menu; $lang->release->menu = $lang->product->menu; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 3683f19938..e34c876f15 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -139,6 +139,7 @@ $lang->product->menu->view = '概况|product|view|productID=%s'; $lang->product->menu->edit = '编辑|product|edit|productID=%s'; $lang->product->menu->module = '模块|tree|browse|productID=%s&view=story'; $lang->product->menu->create = array('link' => '新增产品|product|create', 'float' => 'right'); +$lang->product->menu->project = array('link' => '项目列表|product|index|locate=false&status=all&productID=%s', 'float' => 'right'); $lang->story->menu = $lang->product->menu; $lang->productplan->menu = $lang->product->menu; $lang->release->menu = $lang->product->menu; diff --git a/module/product/control.php b/module/product/control.php index 66ff10992f..8edd23dfda 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -41,9 +41,15 @@ class product extends control * @access public * @return void */ - public function index() + public function index($locate = 'yes', $status = 'undone', $productID) { - $this->locate($this->createLink($this->moduleName, 'browse')); + if($locate == 'yes') $this->locate($this->createLink($this->moduleName, 'browse')); + + $this->app->loadLang('my'); + $this->view->projectStats = $this->loadModel('project')->getProjectStats($this->config->project->projectCounts, $status, $productID); + + $this->view->productID = $productID; + $this->display(); } /** diff --git a/module/product/js/index.js b/module/product/js/index.js new file mode 100644 index 0000000000..742a3b7329 --- /dev/null +++ b/module/product/js/index.js @@ -0,0 +1,7 @@ +$().ready(function() +{ + $('.projectline').each(function() + { + $(this).sparkline('html', {height:'25px'}); + }) +}) diff --git a/module/product/view/index.html.php b/module/product/view/index.html.php new file mode 100644 index 0000000000..4336e81df3 --- /dev/null +++ b/module/product/view/index.html.php @@ -0,0 +1,48 @@ + + * @package ZenTaoPMS + * @version $Id: index.html.php 2343 2011-11-21 05:24:56Z wwccss $ + */ +?> + + + +

+ project->unDoneProjects);?> + project->doneProjects);?> +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
project->name;?>project->code;?>project->end;?>project->status;?>project->totalEstimate;?>project->totalConsumed;?>project->totalLeft;?>project->progess;?>project->burn;?>
createLink('project', 'task', 'project=' . $project->id), $project->name, '_parent');?>code;?>end;?>project->statusList[$project->status];?>hours->totalEstimate;?>hours->totalConsumed;?>hours->totalLeft;?> + hours->progress;?> height='13' text-align: /> + hours->progress;?>% + burns);?>'>
+ diff --git a/module/project/model.php b/module/project/model.php index ce7c08a977..1bb2b1448d 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -253,15 +253,33 @@ class projectModel extends model * @access public * @return array */ - public function getList($status = 'all', $limit = 0) + public function getList($status = 'all', $limit = 0, $productID = 0) { - return $this->dao->select('*')->from(TABLE_PROJECT)->where('iscat')->eq(0) - ->beginIF($status == 'undone')->andWhere('status')->ne('done')->fi() - ->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi() - ->andWhere('deleted')->eq(0) - ->orderBy('status, code') - ->beginIF($limit)->limit($limit)->fi() - ->fetchAll('id'); + if($productID != 0) + { + return $this->dao->select('t2.*') + ->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2') + ->on('t1.project = t2.id') + ->where('t1.product')->eq($productID) + ->andWhere('t2.deleted')->eq(0) + ->andWhere('t2.iscat')->eq(0) + ->beginIF($status == 'undone')->andWhere('t2.status')->ne('done')->fi() + ->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi() + ->orderBy('status, code') + ->beginIF($limit)->limit($limit)->fi() + ->fetchAll('id'); + } + else + { + return $this->dao->select('*')->from(TABLE_PROJECT)->where('iscat')->eq(0) + ->beginIF($status == 'undone')->andWhere('status')->ne('done')->fi() + ->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi() + ->andWhere('deleted')->eq(0) + ->orderBy('status, code') + ->beginIF($limit)->limit($limit)->fi() + ->fetchAll('id'); + } } /** @@ -300,11 +318,11 @@ class projectModel extends model * @access public * @return array */ - public function getProjectStats($counts, $status = 'undone') + public function getProjectStats($counts, $status = 'undone', $productID = 0) { $this->loadModel('report'); - $projects = $this->getList($status); + $projects = $this->getList($status, 0, $productID); $stats = array(); $i = 1; diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index a2354982da..8bfbd4630d 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -60,7 +60,7 @@ $(function(){ testcase->stepID;?> testcase->stepDesc;?> - testcase->stepExpect;?> + testcase->stepExpect;?> actions;?>