From c8c64bd05da66bad50c4b373ee8028ed19cb9de4 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Tue, 9 Mar 2021 13:50:43 +0800 Subject: [PATCH] * Adjust code. --- module/block/control.php | 6 ++++-- module/block/view/projectstatisticblock.html.php | 2 +- module/doc/view/index.html.php | 2 +- module/project/model.php | 7 ++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index 86e867339e..1885c34ffc 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -845,7 +845,7 @@ class block extends control $this->app->loadLang('task'); $this->app->loadLang('story'); - /* Set program status and count. */ + /* Set project status and count. */ $status = isset($this->params->type) ? $this->params->type : 'all'; $count = isset($this->params->count) ? (int)$this->params->count : 15; @@ -873,8 +873,10 @@ class block extends control { if($project->model == 'scrum') { + $this->app->loadClass('pager', $static = true); + $pager = pager::init(0, 3, 1); $project->progress = $project->allStories == 0 ? 0 : round($project->doneStories / $project->allStories, 3) * 100; - $project->executions = $this->project->getStats($projectID, 'all', 0, 0, 30, 'id_asc'); + $project->executions = $this->project->getStats($projectID, 'all', 0, 0, 30, 'id_asc', $pager); } elseif($project->model == 'waterfall' and isset($this->config->maxVersion)) { diff --git a/module/block/view/projectstatisticblock.html.php b/module/block/view/projectstatisticblock.html.php index 4fe90823c0..e42dac008b 100644 --- a/module/block/view/projectstatisticblock.html.php +++ b/module/block/view/projectstatisticblock.html.php @@ -108,7 +108,7 @@ $(function()
  • id == $selected) echo "class='active' id='activeProject'";?> projectID='id;?>'> name;?> - id"), "", '', "class='btn-view' title={$lang->project->index}");?> + id"), "", '', "class='btn-view' title={$lang->project->index}");?>
  • diff --git a/module/doc/view/index.html.php b/module/doc/view/index.html.php index 461b631513..43ca8af252 100644 --- a/module/doc/view/index.html.php +++ b/module/doc/view/index.html.php @@ -141,7 +141,7 @@ - + id}")?>"> name;?> begin);?> diff --git a/module/project/model.php b/module/project/model.php index 9fcd06a1de..a21cb73dc2 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1337,13 +1337,14 @@ class projectModel extends model ->orderBy('date desc') ->fetchGroup('execution', 'name'); + $this->loadModel('execution'); foreach($burns as $executionID => $executionBurns) { /* If executionBurns > $itemCounts, split it, else call processBurnData() to pad burns. */ $begin = $executions[$executionID]->begin; $end = $executions[$executionID]->end; if(helper::isZeroDate($begin)) $begin = $executions[$executionID]->openedDate; - $executionBurns = $this->loadModel('execution')->processBurnData($executionBurns, $itemCounts, $begin, $end); + $executionBurns = $this->execution->processBurnData($executionBurns, $itemCounts, $begin, $end); /* Shorter names. */ foreach($executionBurns as $executionBurn) @@ -1384,8 +1385,8 @@ class projectModel extends model } /* In the case of the waterfall model, calculate the sub-stage. */ - $execution = $this->loadModel('execution')->getById($this->session->project); - if($execution and $execution->model == 'waterfall') + $project = $this->getByID($this->session->project); + if($project and $project->model == 'waterfall') { foreach($parents as $id => $execution) {