diff --git a/module/execution/model.php b/module/execution/model.php index 4c95ecb9c5..1b35aaf0fc 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -4645,9 +4645,9 @@ class executionModel extends model $execution->parent = (isset($executionList[$execution->parent]) && $execution->parent && $execution->grade > 1) ? 'pid' . (string)$execution->parent : ''; $execution->isParent = !empty($execution->isParent) or !empty($execution->tasks); $execution->actions = array(); - if(isset($this->config->projectExecution->dtable->actionsRule[$execution->projectModel])) + if(isset($this->config->project->execution->dtable->actionsRule[$execution->projectModel])) { - foreach($this->config->projectExecution->dtable->actionsRule[$execution->projectModel] as $actionKey) + foreach($this->config->project->execution->dtable->actionsRule[$execution->projectModel] as $actionKey) { $action = array(); $actions = explode('|', $actionKey); @@ -4703,7 +4703,7 @@ class executionModel extends model foreach($tasks as $task) { - foreach($this->config->projectExecution->dtable->actionsRule['task'] as $action) + foreach($this->config->project->execution->dtable->actionsRule['task'] as $action) { $rawAction = str_replace('Task', '', $action); if(!commonModel::hasPriv('task', $rawAction)) continue; @@ -4727,6 +4727,8 @@ class executionModel extends model $task->progress = ($task->consumed + $task->left) == 0 ? 0 : round($task->consumed / ($task->consumed + $task->left), 2) * 100; $task->begin = $task->estStarted; $task->end = $task->deadline; + $task->realBegan = $task->realStarted; + $task->realEnd = $task->finishedDate; $task->PM = $task->assignedTo; if($task->PM) { diff --git a/module/project/ui/execution.html.php b/module/project/ui/execution.html.php index c8f372ea72..db280009ab 100644 --- a/module/project/ui/execution.html.php +++ b/module/project/ui/execution.html.php @@ -54,28 +54,29 @@ if($canBatchAction) } /* Generate data table fields. */ -$fnGenerateCols = function() use ($config, $project) +$fieldList = $config->project->execution->dtable->fieldList; + +/* waterfall & waterfallplus model with different edit link. */ +if(in_array($project->model, array('waterfall', 'waterfallplus'))) { - $fieldList = $config->projectExecution->dtable->fieldList; + $fieldList['actions']['actionsMap']['edit']['data-size'] = 'md'; + $fieldList['actions']['actionsMap']['edit']['url'] = createLink('programplan', 'edit', "stageID={rawID}&projectID={projectID}"); +} +if(!$this->cookie->showStage && !$this->cookie->showTask) +{ + $fieldList['name']['type'] = 'title'; + if(!in_array($project->model, array('waterfall', 'waterfallplus', 'ipd'))) unset($fieldList['name']['nestedToggle']); +} +if(!$project->hasProduct) unset($fieldList['productName']); - /* waterfall & waterfallplus model with different edit link. */ - if(in_array($project->model, array('waterfall', 'waterfallplus'))) - { - $fieldList['actions']['actionsMap']['edit']['data-size'] = 'md'; - $fieldList['actions']['actionsMap']['edit']['url'] = createLink('programplan', 'edit', "stageID={rawID}&projectID={projectID}"); - } - if(!$this->cookie->showStage && !$this->cookie->showTask) - { - $fieldList['name']['type'] = 'title'; - if(!in_array($project->model, array('waterfall', 'waterfallplus', 'ipd'))) unset($fieldList['name']['nestedToggle']); - } +$fieldList = $this->loadModel('datatable')->getSetting('project', 'execution'); +$fieldList['name']['name'] = 'nameCol'; +$fieldList['actions']['width'] = '160'; - if(!$project->hasProduct) unset($fieldList['productName']); +foreach(array_keys($fieldList['actions']['actionsMap']) as $actionKey) unset($fieldList['actions']['actionsMap'][$actionKey]['text']); - return array_values($fieldList); -}; +$config->project->execution->dtable->fieldList = $fieldList; -foreach(array_keys($config->projectExecution->dtable->fieldList['actions']['actionsMap']) as $actionKey) unset($config->projectExecution->dtable->fieldList['actions']['actionsMap'][$actionKey]['text']); $executions = $this->execution->generateRow($executionStats, $users, $avatarList); /* zin: Define the feature bar on main menu. */ @@ -175,10 +176,10 @@ $canCreateExecution = $canModifyProject && $isStage ? common::hasPriv('programp dtable ( set::userMap($users), - set::cols($fnGenerateCols()), + set::cols($fieldList), set::data($executions), + set::customCols(true), set::checkable($canBatchAction), - set::fixedLeftWidth('44%'), set::onRenderCell(jsRaw('window.onRenderCell')), set::canRowCheckable(jsRaw("function(rowID){return this.getRowInfo(rowID).data.id.indexOf('pid') > -1;}")), set::checkInfo(jsRaw("function(checkedIDList){ return window.footerSummary(this, checkedIDList);}")),