From bc803e56c8f288467ca2e975f2b57a817d871f5e Mon Sep 17 00:00:00 2001 From: zhouxin Date: Wed, 1 Jun 2022 07:34:04 +0000 Subject: [PATCH] * Finish task #55676. --- module/datatable/config.php | 1 + module/execution/control.php | 1 + module/execution/view/story.html.php | 84 +++++++++++++------ module/story/config.php | 21 ++++- module/story/lang/en.php | 1 + module/story/lang/zh-cn.php | 1 + module/story/model.php | 116 ++++++++++++++++++++++++--- 7 files changed, 187 insertions(+), 38 deletions(-) diff --git a/module/datatable/config.php b/module/datatable/config.php index fb535f0f36..0c2c0fdbb0 100644 --- a/module/datatable/config.php +++ b/module/datatable/config.php @@ -1,5 +1,6 @@ datatable->moduleAlias['product-browse'] = 'story'; +$config->datatable->moduleAlias['execution-story'] = 'story'; $config->datatable->moduleAlias['execution-task'] = 'task'; $config->datatable->moduleAlias['testtask-cases'] = 'testcase'; $config->datatable->moduleAlias['program-project'] = 'project'; diff --git a/module/execution/control.php b/module/execution/control.php index dd82569951..cee16e5a2d 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -855,6 +855,7 @@ class execution extends control $this->view->branchGroups = $branchGroups; $this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable. $this->view->showBranch = $showBranch; + $this->view->storyStages = $this->product->batchGetStoryStage($stories); $this->display(); } diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index f0018a653a..3b1286ae7e 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -161,6 +161,9 @@
'>
+
+ +

@@ -172,25 +175,44 @@

-
- -
- + moduleName . ucfirst($this->methodName); + $useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable'); + $vars = "executionID={$execution->id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; + + if($useDatatable) include '../../common/view/datatable.html.php'; + $setting = $this->datatable->getSetting('execution'); + $widths = $this->datatable->setFixedFieldWidth($setting); + $columns = 0; + + $checkObject = new stdclass(); + $checkObject->execution = $execution->id; + + $totalEstimate = 0; + $canBatchEdit = common::hasPriv('story', 'batchEdit'); + $canBatchClose = common::hasPriv('story', 'batchClose'); + $canBatchChangeStage = common::hasPriv('story', 'batchChangeStage'); + $canBatchUnlink = common::hasPriv('execution', 'batchUnlinkStory'); + $canBatchToTask = common::hasPriv('story', 'batchToTask', $checkObject); + $canBatchAction = ($canBeChanged and ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink or $canBatchToTask)); + ?> + ';?> +
' id='storyList' data-fixed-left-width='' data-fixed-right-width=''> execution = $execution->id; - - $totalEstimate = 0; - $canBatchEdit = common::hasPriv('story', 'batchEdit'); - $canBatchClose = common::hasPriv('story', 'batchClose'); - $canBatchChangeStage = common::hasPriv('story', 'batchChangeStage'); - $canBatchUnlink = common::hasPriv('execution', 'batchUnlinkStory'); - $canBatchToTask = common::hasPriv('story', 'batchToTask', $checkObject); - $canBatchAction = ($canBeChanged and ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink or $canBatchToTask)); + foreach($setting as $key => $value) + { + if($value->show) + { + $this->datatable->printHead($value, $orderBy, $vars, $canBatchAction); + $columns ++; + } + } ?> - id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?> + + $story):?> @@ -223,6 +246,12 @@ $totalEstimate += $story->estimate; ?> + $value) + { + $this->story->printCell($value, $story, $users, '', $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', '', $execution, $showBranch, $productID); + } + ?> +
+ ';?>