Merge branch 'sprint/197_zhouxin_55674' into 'sprint/197'
Sprint/197 zhouxin 55674 See merge request easycorp/zentaopms!3691
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$config->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';
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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 = '';
|
||||
|
||||
@@ -161,6 +161,9 @@
|
||||
</div>
|
||||
<div class="main-col">
|
||||
<div id='queryBox' data-module='executionStory' class='cell <?php if($type =='bysearch') echo 'show';?>'></div>
|
||||
<div class="table-header fixed-right">
|
||||
<nav class="btn-toolbar pull-right setting"></nav>
|
||||
</div>
|
||||
<?php if(empty($stories)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
@@ -172,48 +175,41 @@
|
||||
</div>
|
||||
<?php else:?>
|
||||
<form class='main-table table-story skip-iframe-modal' method='post' id='executionStoryForm'>
|
||||
<div class="table-header fixed-right">
|
||||
<nav class="btn-toolbar pull-right"></nav>
|
||||
</div>
|
||||
<table class='table tablesorter has-sort-head' id='storyList'>
|
||||
<?php
|
||||
$datatableId = $this->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));
|
||||
?>
|
||||
<?php if(!$useDatatable) echo '<div class="table-responsive">';?>
|
||||
<table class='table tablesorter has-sort-head<?php if($useDatatable) echo ' datatable';?>' id='storyList' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>'>
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
$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));
|
||||
foreach($setting as $key => $value)
|
||||
{
|
||||
if($value->show)
|
||||
{
|
||||
$this->datatable->printHead($value, $orderBy, $vars, $canBatchAction);
|
||||
$columns ++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php $vars = "executionID={$execution->id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<th class='c-id {sorter:false}'>
|
||||
<?php if($canBatchAction):?>
|
||||
<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>
|
||||
<?php if($canOrder):?>
|
||||
<th class='c-sort {sorter:false}'><?php common::printOrderLink('order', $orderBy, $vars, $lang->execution->orderAB);?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-pri {sorter:false}' title=<?php echo $lang->execution->pri;?>><?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th class='c-name {sorter:false}'><?php common::printOrderLink('title', $orderBy, $vars, $lang->execution->storyTitle);?></th>
|
||||
<th class='c-category {sorter:false}'><?php common::printOrderLink('category', $orderBy, $vars, $lang->story->category);?></th>
|
||||
<th class='c-user {sorter:false}'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
|
||||
<th class='c-assignedTo {sorter:false} text-center'> <?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->assignedToAB);?></th>
|
||||
<th class='c-estimate {sorter:false} text-right'> <?php common::printOrderLink('estimate', $orderBy, $vars, $lang->story->estimateAB);?></th>
|
||||
<th class='c-status {sorter:false}'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
|
||||
<th class='c-stage {sorter:false}'> <?php common::printOrderLink('stage', $orderBy, $vars, $lang->story->stageAB);?></th>
|
||||
<th title='<?php echo $lang->story->taskCount?>' class='c-count'><?php echo $lang->story->taskCountAB;?></th>
|
||||
<th title='<?php echo $lang->story->bugCount?>' class='c-count'><?php echo $lang->story->bugCountAB;?></th>
|
||||
<th title='<?php echo $lang->story->caseCount?>' class='c-count'><?php echo $lang->story->caseCountAB;?></th>
|
||||
<th class='c-actions-7 text-center {sorter:false}'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id='storyTableList' class='sortable'>
|
||||
@@ -223,110 +219,16 @@
|
||||
$totalEstimate += $story->estimate;
|
||||
?>
|
||||
<tr id="story<?php echo $story->id;?>" data-id='<?php echo $story->id;?>' data-order='<?php echo $story->order ?>' data-estimate='<?php echo $story->estimate?>' data-cases='<?php echo zget($storyCases, $story->id, 0)?>'>
|
||||
<td class='cell-id'>
|
||||
<?php if($canBatchAction):?>
|
||||
<?php echo html::checkbox('storyIdList', array($story->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'");?>
|
||||
<?php else:?>
|
||||
<?php printf('%03d', $story->id);?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<?php if($canOrder):?>
|
||||
<td class='sort-handler c-sort'><i class='icon-move'></i></td>
|
||||
<?php endif;?>
|
||||
<td class='c-pri'><span class='label-pri <?php echo 'label-pri-' . $story->pri?>' title='<?php echo zget($lang->story->priList, $story->pri, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri);?></span></td>
|
||||
<td class='c-name' title="<?php echo $story->title?>">
|
||||
<?php if($showBranch) $showBranch = isset($this->config->execution->story->showBranch) ? $this->config->execution->story->showBranch : 1;?>
|
||||
<?php if(isset($branchGroups[$story->product][$story->branch]) and $showBranch) echo "<span class='label label-outline label-badge' title={$branchGroups[$story->product][$story->branch]}>" . $branchGroups[$story->product][$story->branch] . '</span>';?>
|
||||
<?php if(!empty($story->module) and isset($modulePairs[$story->module])) echo "<span class='label label-gray label-badge'>{$modulePairs[$story->module]}</span> ";?>
|
||||
<?php if($story->parent > 0) echo "<span class='label'>{$lang->story->childrenAB}</span>";?>
|
||||
<?php echo html::a($storyLink,$story->title, null, "style='color: $story->color' data-app='execution'");?>
|
||||
</td>
|
||||
<td class='c-category' title='<?php echo zget($lang->story->categoryList, $story->category);?>'><?php echo zget($lang->story->categoryList, $story->category);?></td>
|
||||
<td class='c-user' title='<?php echo zget($users, $story->openedBy);?>'><?php echo zget($users, $story->openedBy);?></td>
|
||||
<td class='c-assignedTo <?php if(zget($users, $story->assignedTo) == 'Closed') echo 'closed-story'?> text-center' title='<?php echo zget($users, $story->assignedTo);?>'><?php $this->loadModel('story')->printAssignedHtml($story,$users);?></td>
|
||||
<td class='c-estimate text-right' title="<?php echo $story->estimate . ' ' . $lang->hourCommon;?>"><?php echo $story->estimate . $config->hourUnit;?></td>
|
||||
<?php $status = $this->processStatus('story', $story);?>
|
||||
<td class='c-status' title='<?php echo $status;?>'>
|
||||
<span class='status-story status-<?php echo $story->status;?>'><?php echo $status;?></span>
|
||||
</td>
|
||||
<td class='c-stage'><?php echo $lang->story->stageList[$story->stage];?></td>
|
||||
<td class='linkbox c-count'>
|
||||
<?php
|
||||
$tasksLink = $this->createLink('story', 'tasks', "storyID=$story->id&executionID=$execution->id");
|
||||
$storyTasks[$story->id] > 0 ? print(html::a($tasksLink, $storyTasks[$story->id], '', 'class="iframe"')) : print(0);
|
||||
?>
|
||||
<td class='c-count'>
|
||||
<?php
|
||||
$bugsLink = $this->createLink('story', 'bugs', "storyID=$story->id&executionID=$execution->id");
|
||||
$storyBugs[$story->id] > 0 ? print(html::a($bugsLink, $storyBugs[$story->id], '', 'class="iframe"')) : print(0);
|
||||
?>
|
||||
</td>
|
||||
<td class='c-count'>
|
||||
<?php
|
||||
$casesLink = $this->createLink('story', 'cases', "storyID=$story->id&executionID=$execution->id");
|
||||
$storyCases[$story->id] > 0 ? print(html::a($casesLink, $storyCases[$story->id], '', 'class="iframe"')) : print(0);
|
||||
?>
|
||||
</td>
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
$hasDBPriv = common::hasDBPriv($execution, 'execution');
|
||||
if($canBeChanged)
|
||||
{
|
||||
$param = "executionID={$execution->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"), "<i class='icon-plus'></i>",'', "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"), '<i class="icon-testcase-create icon-sitemap"></i>', '', "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');
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php foreach($setting as $key => $value)
|
||||
{
|
||||
$this->story->printCell($value, $story, $users, '', $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', '', $execution, $showBranch);
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if(!$useDatatable) echo '</div>';?>
|
||||
<div class='table-footer'>
|
||||
<?php if($canBatchAction):?>
|
||||
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
|
||||
@@ -491,6 +393,9 @@ function handleLinkButtonClick()
|
||||
var xxcUrl = "xxc:openInApp/zentao-integrated/" + encodeURIComponent(window.location.href.replace(/.display=card/, '').replace(/\.xhtml/, '.html'));
|
||||
window.open(xxcUrl);
|
||||
}
|
||||
<?php if(!empty($useDatatable)):?>
|
||||
$(function(){$('#executionStoryForm').table();})
|
||||
<?php endif;?>
|
||||
</script>
|
||||
<?php if(commonModel::isTutorialMode()): ?>
|
||||
<style>
|
||||
|
||||
+19
-2
@@ -50,14 +50,32 @@ $config->story->custom->createFields = $config->story->list->customCreateFi
|
||||
$config->story->custom->batchCreateFields = 'module,plan,spec,pri,estimate,review,%s';
|
||||
$config->story->custom->batchEditFields = 'branch,module,plan,estimate,pri,source,stage,closedBy,closedReason';
|
||||
|
||||
global $lang, $app;
|
||||
$config->story->datatable = new stdclass();
|
||||
$config->story->datatable->defaultField = array('id', 'pri', 'title', 'plan', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'taskCount', 'actions');
|
||||
if($app->tab == 'execution')
|
||||
{
|
||||
$config->story->datatable->defaultField = array('id','order', 'pri', 'title', 'plan', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'taskCount', 'actions');
|
||||
}
|
||||
else
|
||||
{
|
||||
$config->story->datatable->defaultField = array('id', 'pri', 'title', 'plan', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'taskCount', 'actions');
|
||||
}
|
||||
|
||||
$config->story->datatable->fieldList['id']['title'] = 'idAB';
|
||||
$config->story->datatable->fieldList['id']['fixed'] = 'left';
|
||||
$config->story->datatable->fieldList['id']['width'] = '60';
|
||||
$config->story->datatable->fieldList['id']['required'] = 'yes';
|
||||
|
||||
if($app->tab == 'execution')
|
||||
{
|
||||
$config->story->datatable->fieldList['order']['title'] = 'order';
|
||||
$config->story->datatable->fieldList['order']['fixed'] = 'left';
|
||||
$config->story->datatable->fieldList['order']['width'] = '60';
|
||||
$config->story->datatable->fieldList['order']['sort'] = 'no';
|
||||
$config->story->datatable->fieldList['order']['required'] = 'no';
|
||||
$config->story->datatable->fieldList['order']['name'] = $this->lang->story->order;
|
||||
}
|
||||
|
||||
$config->story->datatable->fieldList['pri']['title'] = 'priAB';
|
||||
$config->story->datatable->fieldList['pri']['fixed'] = 'left';
|
||||
$config->story->datatable->fieldList['pri']['width'] = '50';
|
||||
@@ -194,7 +212,6 @@ $config->story->datatable->fieldList['version']['fixed'] = 'no';
|
||||
$config->story->datatable->fieldList['version']['width'] = '60';
|
||||
$config->story->datatable->fieldList['version']['required'] = 'no';
|
||||
|
||||
global $lang, $app;
|
||||
$config->story->datatable->fieldList['taskCount']['title'] = 'T';
|
||||
$config->story->datatable->fieldList['taskCount']['fixed'] = 'no';
|
||||
$config->story->datatable->fieldList['taskCount']['width'] = '30';
|
||||
|
||||
@@ -67,6 +67,7 @@ $lang->story->toTask = 'Convert to Task';
|
||||
$lang->story->batchToTask = 'Batch Convert to Task';
|
||||
$lang->story->convertRelations = 'Convert Relations';
|
||||
$lang->story->undetermined = 'undetermined';
|
||||
$lang->story->order = 'Order';
|
||||
|
||||
$lang->story->editAction = "Edit {$lang->SRCommon}";
|
||||
$lang->story->changeAction = "Change {$lang->SRCommon}";
|
||||
|
||||
@@ -67,6 +67,7 @@ $lang->story->toTask = '转任务';
|
||||
$lang->story->batchToTask = '批量转任务';
|
||||
$lang->story->convertRelations = '换算关系';
|
||||
$lang->story->undetermined = '待定';
|
||||
$lang->story->order = '排序';
|
||||
|
||||
$lang->story->editAction = "编辑{$lang->SRCommon}";
|
||||
$lang->story->changeAction = "变更{$lang->SRCommon}";
|
||||
|
||||
+105
-11
@@ -3806,7 +3806,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function buildOperateMenu($story, $type = 'view')
|
||||
public function buildOperateMenu($story, $type = 'view', $execution = '')
|
||||
{
|
||||
$menu = '';
|
||||
$params = "storyID=$story->id";
|
||||
@@ -3884,6 +3884,63 @@ class storyModel extends model
|
||||
$menu .= $this->buildMenu('story', 'delete', $params, $story, 'button', 'trash', 'hiddenwin', 'showinonlybody', true);
|
||||
}
|
||||
|
||||
if($type == 'execution')
|
||||
{
|
||||
$hasDBPriv = common::hasDBPriv($execution, 'execution');
|
||||
$canBeChanged = common::canModify('execution', $execution);
|
||||
if($canBeChanged)
|
||||
{
|
||||
$param = "executionID={$execution->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($this->app->user->account, $story->notReview) and ($story->status == 'draft' or $story->status == 'changed') ? '' : 'disabled';
|
||||
$story->from = 'execution';
|
||||
$menu .= 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';
|
||||
$menu .= common::printIcon('story', 'recall', "story={$story->id}", $story, 'list', 'undo', 'hiddenwin', $recallDisabled, '', '', $this->lang->story->recall);
|
||||
}
|
||||
|
||||
$this->lang->task->create = $this->lang->execution->wbs;
|
||||
$toTaskDisabled = strpos('draft,closed', $story->status) !== false ? 'disabled' : '';
|
||||
if(commonModel::isTutorialMode())
|
||||
{
|
||||
$wizardParams = helper::safe64Encode($param);
|
||||
$menu .= html::a(helper::createLink('tutorial', 'wizard', "module=task&method=create¶ms=$wizardParams"), "<i class='icon-plus'></i>",'', "class='btn btn-task-create' title='{$this->lang->execution->wbs}' data-app='execution'");
|
||||
}
|
||||
else
|
||||
{
|
||||
if($hasDBPriv) $menu .= common::printIcon('task', 'create', $param, '', 'list', 'plus', '', 'btn-task-create ' . $toTaskDisabled);
|
||||
}
|
||||
|
||||
$this->lang->task->batchCreate = $this->lang->execution->batchWBS;
|
||||
if($hasDBPriv) $menu .= common::printIcon('task', 'batchCreate', "executionID={$execution->id}&story={$story->id}", '', 'list', 'pluses', '', $toTaskDisabled);
|
||||
|
||||
$this->lang->testcase->batchCreate = $this->lang->testcase->create;
|
||||
if($hasDBPriv and common::hasPriv('testcase', 'create'))
|
||||
{
|
||||
$menu .= html::a(helper::createLink('testcase', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&form=¶m=0&storyID=$story->id"), '<i class="icon-testcase-create icon-sitemap"></i>', '', "class='btn' title='{$this->lang->testcase->create}' data-app='qa'");
|
||||
}
|
||||
|
||||
if($canBeChanged and common::hasPriv('execution', 'storyEstimate', $execution))
|
||||
{
|
||||
$menu .= 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))
|
||||
{
|
||||
$menu .= common::printIcon('execution', 'unlinkStory', "executionID=$execution->id&storyID=$story->id&confirm=no", '', 'list', 'unlink', 'hiddenwin');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
@@ -4047,10 +4104,17 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks = array(), $storyBugs = array(), $storyCases = array(), $mode = 'datatable', $storyType = 'story')
|
||||
public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks = array(), $storyBugs = array(), $storyCases = array(), $mode = 'datatable', $storyType = 'story', $execution = '', $isShowBranch = '')
|
||||
{
|
||||
$module = $this->app->rawModule == 'product' ? 'story' : $this->app->rawModule;
|
||||
$canView = common::hasPriv($module, 'view');
|
||||
$tab = $this->app->tab;
|
||||
$storyLink = $tab == 'execution' ? helper::createLink('story', 'view', "storyID=$story->id&version=$story->version&from=execution¶m=$execution->id") : helper::createLink($module, 'view', "storyID=$story->id");
|
||||
$account = $this->app->user->account;
|
||||
|
||||
/* Check the product is closed. */
|
||||
$canBeChanged = common::canBeChanged('story', $story);
|
||||
$canOrder = common::hasPriv('execution', 'storySort');
|
||||
|
||||
$canBatchEdit = common::hasPriv('story', 'batchEdit');
|
||||
$canBatchClose = common::hasPriv('story', 'batchClose');
|
||||
@@ -4061,15 +4125,25 @@ class storyModel extends model
|
||||
$canBatchChangePlan = common::hasPriv('story', 'batchChangePlan');
|
||||
$canBatchAssignTo = common::hasPriv('story', 'batchAssignTo');
|
||||
$canBatchUnlinkStory = common::hasPriv('projectstory', 'batchUnlinkStory');
|
||||
$canBatchUnlink = common::hasPriv('execution', 'batchUnlinkStory');
|
||||
|
||||
$canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo or $canBatchUnlinkStory);
|
||||
if($tab == 'execution')
|
||||
{
|
||||
$checkObject = new stdclass();
|
||||
$checkObject->execution = $execution->id;
|
||||
$canBatchToTask = common::hasPriv('story', 'batchToTask', $checkObject);
|
||||
}
|
||||
|
||||
$module = $this->app->rawModule == 'projectstory' ? 'projectstory' : 'story';
|
||||
$canView = common::hasPriv($module, 'view');
|
||||
$tab = $this->app->rawModule == 'projectstory' ? 'project' : 'product';
|
||||
$storyLink = helper::createLink($module, 'view', "storyID=$story->id");
|
||||
$account = $this->app->user->account;
|
||||
$id = $col->id;
|
||||
if($tab == 'execution')
|
||||
{
|
||||
$canBatchAction = ($canBeChanged and ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink or $canBatchToTask));
|
||||
}
|
||||
else
|
||||
{
|
||||
$canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo or $canBatchUnlinkStory);
|
||||
}
|
||||
|
||||
$id = $col->id;
|
||||
if($col->show)
|
||||
{
|
||||
$class = "c-{$id}";
|
||||
@@ -4140,6 +4214,10 @@ class storyModel extends model
|
||||
{
|
||||
$class .= ' text-center';
|
||||
}
|
||||
elseif($id == 'order')
|
||||
{
|
||||
$class = 'sort-handler c-sort';
|
||||
}
|
||||
|
||||
echo "<td class='" . $class . "' title='$title' style='$style'>";
|
||||
if($this->config->edition != 'open') $this->loadModel('flow')->printFlowCell('story', $story, $id);
|
||||
@@ -4155,16 +4233,23 @@ class storyModel extends model
|
||||
printf('%03d', $story->id);
|
||||
}
|
||||
break;
|
||||
case 'order':
|
||||
echo "<i class='icon-move'>";
|
||||
break;
|
||||
case 'pri':
|
||||
echo "<span class='label-pri label-pri-" . $story->pri . "' title='" . zget($this->lang->story->priList, $story->pri, $story->pri) . "'>";
|
||||
echo zget($this->lang->story->priList, $story->pri, $story->pri);
|
||||
echo "</span>";
|
||||
break;
|
||||
case 'title':
|
||||
if($this->app->tab == 'project')
|
||||
if($tab == 'project')
|
||||
{
|
||||
$showBranch = isset($this->config->projectstory->story->showBranch) ? $this->config->projectstory->story->showBranch : 1;
|
||||
}
|
||||
elseif($tab == 'execution')
|
||||
{
|
||||
if($isShowBranch) $showBranch = isset($this->config->execution->story->showBranch) ? $this->config->execution->story->showBranch : 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$showBranch = isset($this->config->product->browse->showBranch) ? $this->config->product->browse->showBranch : 1;
|
||||
@@ -4291,7 +4376,16 @@ class storyModel extends model
|
||||
echo $story->version;
|
||||
break;
|
||||
case 'actions':
|
||||
echo $this->buildOperateMenu($story, 'browse');
|
||||
if($tab == 'execution')
|
||||
{
|
||||
$menuType = 'execution';
|
||||
}
|
||||
else
|
||||
{
|
||||
$menuType = 'browse';
|
||||
$execution = '';
|
||||
}
|
||||
echo $this->buildOperateMenu($story, $menuType, $execution);
|
||||
break;
|
||||
}
|
||||
echo '</td>';
|
||||
|
||||
Reference in New Issue
Block a user