diff --git a/module/block/control.php b/module/block/control.php index 09cc1ff2ea..ff20e88bd7 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1607,9 +1607,10 @@ class block extends control { $this->session->set('releaseList', $this->app->getURI(true)); $this->session->set('productPlanList', $this->app->getURI(true)); - $products = $this->loadModel('product')->getPairs(); +ksort($products); + $this->view->roadmaps = $this->product->getRoadmap(key($products), 0, 6); } /** @@ -1680,27 +1681,12 @@ class block extends control */ public function printScrumdynamicBlock() { - $projects = $this->loadModel('project')->getPairs(); - $products = $this->loadModel('product')->getPairs(); - $productID = array(); - foreach($products as $id => $name) $productID[] = ',' . $id . ','; - if(empty($projects) && empty($products)) - { - $actions = array(); - } - else - { - $actions = $this->dao->select('*')->from(TABLE_ACTION) - ->beginIF($projects && $products)->where('project')->in(array_keys($projects))->orWhere('product')->in($productID)->fi() - ->beginIF($projects && empty($products))->where('project')->in(array_keys($projects))->fi() - ->beginIF(empty($projects) && $products)->where('product')->in($productID)->fi() - ->orderBy('id_desc') - ->limit(30) - ->fetchAll(); - } + /* Load pager. */ + $this->app->loadClass('pager', $static = true); + $pager = new pager(0, 30, 1); - $this->view->actions = empty($actions) ? array() : $this->loadModel('action')->transformActions($actions); + $this->view->actions = $this->loadModel('action')->getDynamic('all', 'today', 'date_desc', $pager); $this->view->users = $this->loadModel('user')->getPairs('noletter'); } } diff --git a/module/block/lang/zh-cn.php b/module/block/lang/zh-cn.php index d59b2d4c88..0cfdd89c52 100644 --- a/module/block/lang/zh-cn.php +++ b/module/block/lang/zh-cn.php @@ -57,6 +57,8 @@ $lang->block->scrum = 'Scrum+'; $lang->block->allProject = '所有' . $lang->projectCommon; $lang->block->doingProject = '进行中的' . $lang->projectCommon; $lang->block->finishProject = '累积' . $lang->projectCommon; +$lang->block->estimatedHours = '预计工时'; +$lang->block->consumedHours = '已消耗'; $lang->block->params = new stdclass(); $lang->block->params->name = '参数名称'; diff --git a/module/block/model.php b/module/block/model.php index 726fa276af..52afe72590 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -865,15 +865,15 @@ class blockModel extends model return json_encode($params); } - /** + /** * Get scrum project list params. - *▫ + * * @param string $module * @access public - * @return void + * @return string */ - public function getScrumListParams($module = '') - { + public function getScrumListParams($module = '') + { $params = new stdclass(); $params->type['name'] = $this->lang->block->type; $params->type['options'] = $this->lang->block->typeList->scrum; @@ -885,4 +885,76 @@ class blockModel extends model return json_encode($params); } + + /** + * Get scrum overall list params. + * + * @param string $module + * @access public + * @return string + */ + public function getScrumoverallParams($module = '') + { + $params->num['name'] = $this->lang->block->num; + $params->num['control'] = 'input'; + + return json_encode($params); + } + + /** + * Get scrum roadmap list params. + * + * @param string $module + * @access public + * @return string + */ + public function getScrumroadmapParams($module = '') + { + $params->num['name'] = $this->lang->block->num; + $params->num['control'] = 'input'; + + return json_encode($params); + } + + /** + * Get scrum product list params. + * + * @param string $module + * @access public + * @return string + */ + public function getScrumproductParams($module = '') + { + $params->num['name'] = $this->lang->block->num; + $params->num['control'] = 'input'; + + return json_encode($params); + } + + /** + * Get scrum project list params. + * + * @param string $module + * @access public + * @return string + */ + public function getScrumprojectParams($module = '') + { + $params->num['name'] = $this->lang->block->num; + $params->num['control'] = 'input'; + + return json_encode($params); + } + + /** + * Get the total estimated man hours required. + * + * @param array $storyID + * @access public + * @return string + */ + public function getStorysEstimateHours($storyID) + { + return $this->dao->select('count(estimate) as estimate')->from(TABLE_STORY)->where('id')->in($storyID)->fetch('estimate'); + } } diff --git a/module/block/view/scrumroadmapblock.html.php b/module/block/view/scrumroadmapblock.html.php index 11eb6eae97..2872e54ab2 100644 --- a/module/block/view/scrumroadmapblock.html.php +++ b/module/block/view/scrumroadmapblock.html.php @@ -10,44 +10,37 @@ * @link http://www.zentao.net */ ?> +