diff --git a/module/block/control.php b/module/block/control.php index 1b826ea93b..97df201fb7 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1687,17 +1687,31 @@ class block extends control */ public function printExecutionBlock() { - $this->app->loadClass('pager', $static = true); if(!empty($this->params->type) and preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) return; + $count = isset($this->params->count) ? (int)$this->params->count : 0; $status = isset($this->params->type) ? $this->params->type : 'all'; - $pager = pager::init(0, $count, 1); + + $this->app->loadLang('execution'); + $this->app->loadClass('pager', true); + $pager = pager::init(0, $count, 1); $projectPairs = array(); if($this->config->systemMode == 'new') $projectPairs = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('type')->eq('project')->fetchPairs('id', 'name'); - $projectID = $this->view->block->module == 'my' ? 0 : (int)$this->session->project; - $this->view->executionStats = $this->loadModel('project')->getStats($projectID, $status, 0, 0, 30, 'id_asc', $pager); + $projectID = $this->view->block->module == 'my' ? 0 : (int)$this->session->project; + $executions = $this->loadModel('project')->getStats($projectID, $status, 0, 0, 30, 'id_asc', $pager); + + foreach($executions as $index => $execution) + { + if(!empty($execution->children)) + { + foreach($execution->children as $child) $executions[] = $child; + unset($executions[$index]); + } + } + + $this->view->executionStats = $executions; $this->view->projectPairs = $projectPairs; } diff --git a/module/block/view/executionblock.html.php b/module/block/view/executionblock.html.php index 5f1e4e89d4..c85a231180 100644 --- a/module/block/view/executionblock.html.php +++ b/module/block/view/executionblock.html.php @@ -41,8 +41,6 @@ children)) continue; - $appid = isset($_GET['entry']) ? "class='app-btn text-center' data-id='{$this->get->entry}'" : "class='text-center'"; $viewLink = $this->createLink('execution', 'task', 'executionID=' . $execution->id); if($config->systemMode == 'new') $execution->name = zget($projectPairs, $execution->project, '') . ' / ' . $execution->name;