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 b1e1f773e7..0fd38ba5db 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/js/story.js b/module/execution/js/story.js index d7d80f5096..53f1cab73d 100644 --- a/module/execution/js/story.js +++ b/module/execution/js/story.js @@ -1,5 +1,7 @@ $(function() { + if($('#storyList thead th.c-title').width() < 150) $('#storyList thead th.c-title').width(150); + $('#storyList').on('sort.sortable', function(e, data) { var list = ''; diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index f0018a653a..8f92741b8c 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -161,6 +161,9 @@
'>
+
+ +

@@ -172,48 +175,41 @@

-
- -
- + 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}"; ?> - - - - - - - - - - - - - - - - @@ -223,110 +219,16 @@ $totalEstimate += $story->estimate; ?> - - - - - - - - - - - processStatus('story', $story);?> - - - - - + $value) + { + $this->story->printCell($value, $story, $users, '', $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', '', $execution, $showBranch); + } + ?>
- -
- -
- - idAB);?> -
execution->orderAB);?>execution->pri;?>>priAB);?>execution->storyTitle);?>story->category);?> openedByAB);?> assignedToAB);?> story->estimateAB);?> statusAB);?> story->stageAB);?>story->taskCountAB;?>story->bugCountAB;?>story->caseCountAB;?>actions;?>
- - id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id&version=$story->version&from=execution¶m=$execution->id"), sprintf('%03d', $story->id), null, "data-app='execution'");?> - - id);?> - - pri?>' title='story->priList, $story->pri, $story->pri);?>'>story->priList, $story->pri, $story->pri);?> - config->execution->story->showBranch) ? $this->config->execution->story->showBranch : 1;?> - product][$story->branch]) and $showBranch) echo "product][$story->branch]}>" . $branchGroups[$story->product][$story->branch] . '';?> - module) and isset($modulePairs[$story->module])) echo "{$modulePairs[$story->module]} ";?> - parent > 0) echo "{$lang->story->childrenAB}";?> - title, null, "style='color: $story->color' data-app='execution'");?> - story->categoryList, $story->category);?>openedBy);?> text-center' title='assignedTo);?>'>loadModel('story')->printAssignedHtml($story,$users);?>estimate . $config->hourUnit;?> - - story->stageList[$story->stage];?> - createLink('story', 'bugs', "storyID=$story->id&executionID=$execution->id"); - $storyBugs[$story->id] > 0 ? print(html::a($bugsLink, $storyBugs[$story->id], '', 'class="iframe"')) : print(0); - ?> - - createLink('story', 'cases', "storyID=$story->id&executionID=$execution->id"); - $storyCases[$story->id] > 0 ? print(html::a($casesLink, $storyCases[$story->id], '', 'class="iframe"')) : print(0); - ?> - - id}&story={$story->id}&moduleID={$story->module}"; - - $story->reviewer = isset($story->reviewer) ? $story->reviewer : array(); - $story->notReview = isset($story->notReview) ? $story->notReview : array(); - - if(common::hasPriv('story', 'review')) - { - $reviewDisabled = in_array($app->user->account, $story->notReview) and ($story->status == 'draft' or $story->status == 'changed') ? '' : 'disabled'; - $story->from = 'execution'; - common::printIcon('story', 'review', "story={$story->id}&from=story", $story, 'list', 'search', '', $reviewDisabled, false, "data-group=execution"); - } - - if(common::hasPriv('story', 'recall')) - { - $recallDisabled = empty($story->reviewedBy) and strpos('draft,changed', $story->status) !== false and !empty($story->reviewer) ? '' : 'disabled'; - common::printIcon('story', 'recall', "story={$story->id}", $story, 'list', 'undo', 'hiddenwin', $recallDisabled, '', '', $lang->story->recall); - } - - $lang->task->create = $lang->execution->wbs; - $toTaskDisabled = strpos('draft,closed', $story->status) !== false ? 'disabled' : ''; - if(commonModel::isTutorialMode()) - { - $wizardParams = helper::safe64Encode($param); - echo html::a($this->createLink('tutorial', 'wizard', "module=task&method=create¶ms=$wizardParams"), "",'', "class='btn btn-task-create' title='{$lang->execution->wbs}' data-app='execution'"); - } - else - { - if($hasDBPriv) common::printIcon('task', 'create', $param, '', 'list', 'plus', '', 'btn-task-create ' . $toTaskDisabled); - } - - $lang->task->batchCreate = $lang->execution->batchWBS; - if($hasDBPriv) common::printIcon('task', 'batchCreate', "executionID={$execution->id}&story={$story->id}", '', 'list', 'pluses', '', $toTaskDisabled); - - $lang->testcase->batchCreate = $lang->testcase->create; - if($productID and $hasDBPriv and common::hasPriv('testcase', 'create')) - { - echo html::a($this->createLink('testcase', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&form=¶m=0&storyID=$story->id"), '', '', "class='btn' title='{$lang->testcase->create}' data-app='qa'"); - } - - if($canBeChanged and common::hasPriv('execution', 'storyEstimate', $execution)) - { - common::printIcon('execution', 'storyEstimate', "executionID=$execution->id&storyID=$story->id", '', 'list', 'estimate', '', 'iframe', true, "data-width='600px'"); - } - - if($canBeChanged and common::hasPriv('execution', 'unlinkStory', $execution)) - { - common::printIcon('execution', 'unlinkStory', "executionID=$execution->id&storyID=$story->id&confirm=no", '', 'list', 'unlink', 'hiddenwin'); - } - } - ?> -
+ ';?>