* Finis task #54352.
This commit is contained in:
@@ -3,3 +3,4 @@ $config->datatable->moduleAlias['product-browse'] = 'story';
|
||||
$config->datatable->moduleAlias['execution-task'] = 'task';
|
||||
$config->datatable->moduleAlias['testtask-cases'] = 'testcase';
|
||||
$config->datatable->moduleAlias['program-project'] = 'project';
|
||||
$config->datatable->moduleAlias['execution-bug'] = 'bug';
|
||||
|
||||
@@ -880,6 +880,7 @@ class execution extends control
|
||||
$this->loadModel('bug');
|
||||
$this->loadModel('user');
|
||||
$this->loadModel('product');
|
||||
$this->loadModel('datatable');
|
||||
|
||||
/* Save session. */
|
||||
$this->session->set('bugList', $this->app->getURI(true), 'execution');
|
||||
@@ -921,22 +922,60 @@ class execution extends control
|
||||
$actionURL = $this->createLink('execution', 'bug', "executionID=$executionID&productID=$productID&orderBy=$orderBy&build=$build&type=bysearch&queryID=myQueryID");
|
||||
$this->execution->buildBugSearchForm($products, $queryID, $actionURL);
|
||||
|
||||
$showBranch = false;
|
||||
$branchOption = array();
|
||||
$branchTagOption = array();
|
||||
if($product and $product->type != 'normal')
|
||||
{
|
||||
/* Display of branch label. */
|
||||
$showBranch = $this->loadModel('branch')->showBranch($productID);
|
||||
|
||||
/* Display status of branch. */
|
||||
$branches = $this->loadModel('branch')->getList($productID, 0, 'all');
|
||||
foreach($branches as $branchInfo)
|
||||
{
|
||||
$branchOption[$branchInfo->id] = $branchInfo->name;
|
||||
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
|
||||
}
|
||||
}
|
||||
|
||||
/* Get story and task id list. */
|
||||
$storyIdList = $taskIdList = array();
|
||||
foreach($bugs as $bug)
|
||||
{
|
||||
if($bug->story) $storyIdList[$bug->story] = $bug->story;
|
||||
if($bug->task) $taskIdList[$bug->task] = $bug->task;
|
||||
if($bug->toTask) $taskIdList[$bug->toTask] = $bug->toTask;
|
||||
}
|
||||
$storyList = $storyIdList ? $this->loadModel('story')->getByList($storyIdList) : array();
|
||||
$taskList = $taskIdList ? $this->loadModel('task')->getByList($taskIdList) : array();
|
||||
|
||||
$showModule = !empty($this->config->datatable->bugBrowse->showModule) ? $this->config->datatable->bugBrowse->showModule : '';
|
||||
|
||||
/* Assign. */
|
||||
$this->view->title = $title;
|
||||
$this->view->position = $position;
|
||||
$this->view->bugs = $bugs;
|
||||
$this->view->tabID = 'bug';
|
||||
$this->view->build = $this->loadModel('build')->getById($build);
|
||||
$this->view->buildID = $this->view->build ? $this->view->build->id : 0;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->users = $users;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->branchID = empty($this->view->build->branch) ? $branchID : $this->view->build->branch;
|
||||
$this->view->memberPairs = $memberPairs;
|
||||
$this->view->type = $type;
|
||||
$this->view->param = $param;
|
||||
$this->view->defaultProduct = (empty($productID) and !empty($products)) ? current(array_keys($products)) : $productID;
|
||||
$this->view->title = $title;
|
||||
$this->view->position = $position;
|
||||
$this->view->bugs = $bugs;
|
||||
$this->view->tabID = 'bug';
|
||||
$this->view->build = $this->loadModel('build')->getById($build);
|
||||
$this->view->buildID = $this->view->build ? $this->view->build->id : 0;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->users = $users;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->branchID = empty($this->view->build->branch) ? $branchID : $this->view->build->branch;
|
||||
$this->view->memberPairs = $memberPairs;
|
||||
$this->view->type = $type;
|
||||
$this->view->param = $param;
|
||||
$this->view->defaultProduct = (empty($productID) and !empty($products)) ? current(array_keys($products)) : $productID;
|
||||
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID);
|
||||
$this->view->branchOption = $branchOption;
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->modulePairs = $showModule ? $this->loadModel('tree')->getModulePairs($productID, 'bug', $showModule) : array();
|
||||
$this->view->plans = $this->loadModel('productplan')->getPairs($productID);
|
||||
$this->view->stories = $storyList;
|
||||
$this->view->tasks = $taskList;
|
||||
$this->view->projectPairs = $this->loadModel('project')->getPairsByProgram();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
$(function()
|
||||
{
|
||||
if($('#bugList thead th.c-title').width() < 150) $('#bugList thead th.c-title').width(150);
|
||||
});
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/datatable.fix.html.php';?>
|
||||
<style>
|
||||
#subHeader #dropMenu .col-left .list-group {margin-bottom: 0px; padding-top: 10px;}
|
||||
#subHeader #dropMenu .col-left {padding-bottom: 0px;}
|
||||
@@ -53,113 +54,83 @@
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<?php
|
||||
$datatableId = $this->moduleName . ucfirst($this->methodName);
|
||||
$useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable');
|
||||
?>
|
||||
<?php if($this->app->getViewType() == 'xhtml'):?>
|
||||
<form class='main-table' method='post' id='executionBugForm'>
|
||||
<?php else:?>
|
||||
<form class='main-table' method='post' id='executionBugForm' data-ride="table">
|
||||
<form class='main-table' method='post' id='executionBugForm' <?php if(!$useDatatable) echo "data-ride='table'";?>>
|
||||
<?php endif;?>
|
||||
<table class='table has-sort-head' id='bugList'>
|
||||
<?php $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo');?>
|
||||
<?php $vars = "executionID={$execution->id}&productID={$productID}&orderBy=%s&build=$buildID&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<div class="table-header fixed-right">
|
||||
<nav class="btn-toolbar pull-right setting"></nav>
|
||||
</div>
|
||||
<?php
|
||||
$vars = "executionID={$execution->id}&productID={$productID}&orderBy=%s&build=$buildID&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
|
||||
if($useDatatable) include '../../common/view/datatable.html.php';
|
||||
else include '../../common/view/tablesorter.html.php';
|
||||
|
||||
$setting = $this->datatable->getSetting('execution');
|
||||
$widths = $this->datatable->setFixedFieldWidth($setting);
|
||||
$columns = 0;
|
||||
|
||||
$canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo');
|
||||
?>
|
||||
<?php if(!$useDatatable) echo '<div class="table-responsive">';?>
|
||||
<table class='table has-sort-head<?php if($useDatatable) echo ' datatable';?>' id='bugList' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>'>
|
||||
<thead>
|
||||
<tr>
|
||||
<?php if($this->app->getViewType() == 'xhtml'):?>
|
||||
<th class='c-id'>
|
||||
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
|
||||
</th>
|
||||
<th class='c-pri'><?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th><?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
|
||||
<th class='c-status'><?php common::printOrderLink('status', $orderBy, $vars, $lang->bug->statusAB);?></th>
|
||||
<?php
|
||||
foreach($setting as $value)
|
||||
{
|
||||
if($value->id == 'title' || $value->id == 'id' || $value->id == 'pri' || $value->id == 'status')
|
||||
{
|
||||
if($storyType == 'requirement' and (in_array($value->id, array('plan', 'stage')))) $value->show = false;
|
||||
|
||||
$this->datatable->printHead($value, $orderBy, $vars, $canBatchAssignTo);
|
||||
$columns ++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php else:?>
|
||||
<th class='c-id'>
|
||||
<?php if($canBatchAssignTo):?>
|
||||
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
|
||||
<label></label>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
|
||||
</th>
|
||||
<th class='c-severity' title=<?php echo $lang->bug->severity;?>><?php common::printOrderLink('severity', $orderBy, $vars, $lang->bug->severityAB);?></th>
|
||||
<th class='c-pri' title=<?php echo $lang->execution->pri;?>><?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th><?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
|
||||
<th class='c-user'><?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
|
||||
<th class='c-date text-center'><?php common::printOrderLink('deadline', $orderBy, $vars, $lang->bug->deadlineAB);?></th>
|
||||
<th class='c-user'><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->assignedToAB);?></th>
|
||||
<th class='c-user'><?php common::printOrderLink('resolvedBy', $orderBy, $vars, $lang->bug->resolvedBy);?></th>
|
||||
<th class='c-resolution'><?php common::printOrderLink('resolution', $orderBy, $vars, $lang->bug->resolutionAB);?></th>
|
||||
<th class='c-actions-5'><?php echo $lang->actions;?></th>
|
||||
<?php
|
||||
foreach($setting as $value)
|
||||
{
|
||||
if($value->show)
|
||||
{
|
||||
if(common::checkNotCN() and $value->id == 'severity') $value->name = $lang->bug->severity;
|
||||
if(common::checkNotCN() and $value->id == 'pri') $value->name = $lang->bug->pri;
|
||||
if(common::checkNotCN() and $value->id == 'confirmed') $value->name = $lang->bug->confirmed;
|
||||
$this->datatable->printHead($value, $orderBy, $vars, $canBatchAssignTo);
|
||||
$columns ++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$hasCustomSeverity = false;
|
||||
foreach($lang->bug->severityList as $severityKey => $severityValue)
|
||||
{
|
||||
if(!empty($severityKey) and (string)$severityKey != (string)$severityValue)
|
||||
{
|
||||
$hasCustomSeverity = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tbody>
|
||||
<?php foreach($bugs as $bug):?>
|
||||
<?php
|
||||
$canBeChanged = common::canBeChanged('bug', $bug);
|
||||
$arrtibute = $canBeChanged ? '' : 'disabled';
|
||||
$viewLink = helper::createLink('bug', 'view', "bugID=$bug->id");
|
||||
?>
|
||||
<tr>
|
||||
<tr data-id='<?php echo $bug->id?>'>
|
||||
<?php if($this->app->getViewType() == 'xhtml'):?>
|
||||
<?php $status = $this->processStatus('bug', $bug);?>
|
||||
<td class='cell-id'>
|
||||
<?php printf('%03d', $bug->id);?>
|
||||
</td>
|
||||
<td><span class='label-pri <?php echo 'label-pri-' . $bug->pri?>' title='<?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?></span></td>
|
||||
<td class='text-left' title="<?php echo $bug->title?>"><?php echo html::a($viewLink, $bug->title, null, "style='color: $bug->color' data-app={$this->app->tab}");?></td>
|
||||
<td class='c-status' title='<?php echo $status;?>'>
|
||||
<span class='status-bug status-<?php echo $bug->status;?>'><?php echo $status;?></span>
|
||||
</td>
|
||||
<?php else:?>
|
||||
<td class='cell-id'>
|
||||
<?php if($canBatchAssignTo):?>
|
||||
<?php echo html::checkbox('bugIDList', array($bug->id => ''), '', $arrtibute) . html::a($viewLink, sprintf('%03d', $bug->id), '', "data-app={$this->app->tab}");?>
|
||||
<?php else:?>
|
||||
<?php printf('%03d', $bug->id);?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if($hasCustomSeverity):?>
|
||||
<span class='<?php echo 'label-severity-custom';?>' title='<?php echo zget($lang->bug->severityList, $bug->severity);?>' data-severity='<?php echo $bug->severity;?>'><?php echo zget($lang->bug->severityList, $bug->severity, $bug->severity);?></span>
|
||||
<?php else:?>
|
||||
<span class='<?php echo 'label-severity';?>' title='<?php echo zget($lang->bug->severityList, $bug->severity);?>' data-severity='<?php echo $bug->severity;?>'></span>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td><span class='label-pri <?php echo 'label-pri-' . $bug->pri?>' title='<?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?></span></td>
|
||||
<td class='text-left text-ellipsis' title="<?php echo $bug->title?>"><?php echo html::a($viewLink, $bug->title, null, "style='color: $bug->color' data-app={$this->app->tab}");?></td>
|
||||
<td><?php echo zget($users, $bug->openedBy, $bug->openedBy);?></td>
|
||||
<td class="text-center <?php echo (isset($bug->delay) and $bug->status == 'active') ? 'delayed' : '';?>"><?php if(substr($bug->deadline, 0, 4) > 0) echo substr($bug->deadline, 5, 6);?></td>
|
||||
<td class='c-assignedTo has-btn text-left'><?php $this->bug->printAssignedHtml($bug, $users);?></td>
|
||||
<td><?php echo zget($users, $bug->resolvedBy, $bug->resolvedBy);?></td>
|
||||
<td><?php echo zget($lang->bug->resolutionList, $bug->resolution);?></td>
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
if($canBeChanged)
|
||||
<?php
|
||||
foreach($setting as $value)
|
||||
{
|
||||
$params = "bugID=$bug->id";
|
||||
common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'ok', '', 'iframe', true);
|
||||
common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true);
|
||||
common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params,executionID=$bug->execution", $bug, 'list', 'copy');
|
||||
common::printIcon('bug', 'edit', $params, $bug, 'list');
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
if($value->id == 'title' || $value->id == 'id' || $value->id == 'pri' || $value->id == 'status')
|
||||
{
|
||||
$this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, array($execution), $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table');
|
||||
}
|
||||
}?>
|
||||
<?php else:?>
|
||||
<?php foreach($setting as $value) $this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table', $projectPairs);?>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if(!$useDatatable) echo '</div>';?>
|
||||
<div class='table-footer'>
|
||||
<?php if($canBatchAssignTo):?>
|
||||
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
|
||||
@@ -206,6 +177,9 @@
|
||||
<?php js::set('replaceID', 'bugList');?>
|
||||
<?php js::set('browseType', $type);?>
|
||||
<script>
|
||||
<?php if(!empty($useDatatable)):?>
|
||||
$(function(){$('#executionBugForm').table();})
|
||||
<?php endif;?>
|
||||
function handleLinkButtonClick()
|
||||
{
|
||||
var xxcUrl = "xxc:openInApp/zentao-integrated/" + encodeURIComponent(window.location.href.replace(/.display=card/, '').replace(/\.xhtml/, '.html'));
|
||||
|
||||
Reference in New Issue
Block a user