This commit is contained in:
滔哥
2017-10-23 16:51:01 +08:00
12 changed files with 45 additions and 73 deletions
+8 -5
View File
@@ -2310,8 +2310,9 @@ class bugModel extends model
* @access public
* @return void
*/
public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array())
public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array(), $mode = 'datatable')
{
$canView = common::hasPriv('bug', 'view');
$bugLink = inlink('view', "bugID=$bug->id");
$account = $this->app->user->account;
$id = $col->id;
@@ -2319,15 +2320,17 @@ class bugModel extends model
{
$class = '';
if($id == 'status') $class .= ' bug-' . $bug->status;
if($id == 'title') $class .= ' text-left';
if($id == 'title') $class .= ' text-left';
if($id == 'id') $class .= ' cell-id';
if($id == 'assignedTo' && $bug->assignedTo == $account) $class .= ' red';
if($id == 'deadline' && isset($bug->delay)) $class .= ' delayed';
echo "<td class='" . $class . "'" . ($id=='title' ? " title='{$bug->title}'" : '') . ">";
switch ($id)
switch($id)
{
case 'id':
echo html::a($bugLink, sprintf('%03d', $bug->id));
if($mode == 'table') echo "<input type='checkbox' name='bugIDList[{$bug->id}]' value='{$bug->id}'/> ";
echo $canView ? html::a($bugLink, sprintf('%03d', $bug->id)) : sprintf('%03d', $bug->id);
break;
case 'severity':
echo "<span class='severity" . zget($this->lang->bug->severityList, $bug->severity, $bug->severity) . "'>";
@@ -2344,7 +2347,7 @@ class bugModel extends model
echo "<span class='$class'>[{$this->lang->bug->confirmedList[$bug->confirmed]}]</span> ";
if($bug->branch)echo "<span class='label label-info label-badge'>{$branches[$bug->branch]}</span> ";
if($modulePairs and $bug->module)echo "<span class='label label-info label-badge'>{$modulePairs[$bug->module]}</span> ";
echo html::a($bugLink, $bug->title, null, "style='color: $bug->color'");
echo $canView ? html::a($bugLink, $bug->title, null, "style='color: $bug->color'") : "<span style='color: $bug->color'>{$bug->title}</span>";
break;
case 'branch':
echo $branches[$bug->branch];
+1 -1
View File
@@ -193,7 +193,7 @@ js::set('branch', $branch);
<tbody>
<?php foreach($bugs as $bug):?>
<tr class='text-center' data-id='<?php echo $bug->id?>'>
<?php foreach ($setting as $key => $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs, $projects, $plans, $stories, $tasks);?>
<?php foreach ($setting as $key => $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs, $projects, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table');?>
</tr>
<?php endforeach;?>
</tbody>
+1 -1
View File
@@ -130,7 +130,7 @@
<tbody>
<?php foreach($stories as $story):?>
<tr class='text-center' data-id='<?php echo $story->id?>'>
<?php foreach($setting as $key => $value) $this->story->printCell($value, $story, $users, $branches, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases);?>
<?php foreach($setting as $key => $value) $this->story->printCell($value, $story, $users, $branches, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table');?>
</tr>
<?php endforeach;?>
</tbody>
@@ -1,44 +0,0 @@
<?php
/**
* The datatable data view file of project module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package project
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/datatable.html.php';
$setting = $this->datatable->getSetting('project');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
extract($widths);
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='taskList' data-checkable='true' data-fixed-left-width='<?php echo $leftWidth?>' data-fixed-right-width='<?php echo $rightWidth?>' data-custom-menu='true' data-checkbox-name='taskIDList[]'>
<thead>
<tr><?php
foreach ($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns++;
}
}
?></tr>
</thead>
<tbody>
<?php foreach($tasks as $task):?>
<tr class='text-center' data-id='<?php echo $task->id?>'>
<?php foreach ($setting as $key => $value) $this->task->printCell($value, $task, $users, $browseType, $branchGroups, $modulePairs);?>
</tr>
<?php if($task->children) foreach($task->children as $child):?>
<tr class='text-center table-children parent-<?php echo $task->id;?>' data-id='<?php echo $child->id?>'>
<?php foreach ($setting as $key => $value) $this->task->printCell($value, $child, $users, $browseType, $branchGroups, $modulePairs);?>
</tr>
<?php endforeach;?>
<?php endforeach;?>
</tbody>
+2 -2
View File
@@ -68,12 +68,12 @@ js::set('browseType', $browseType);
<tbody>
<?php foreach($tasks as $task):?>
<tr class='text-center' data-id='<?php echo $task->id?>'>
<?php foreach ($setting as $key => $value) $this->task->printCell($value, $task, $users, $browseType, $branchGroups, $modulePairs);?>
<?php foreach ($setting as $key => $value) $this->task->printCell($value, $task, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table');?>
</tr>
<?php if(!empty($task->children)):?>
<?php foreach($task->children as $child):?>
<tr class='text-center table-children parent-<?php echo $task->id;?>' data-id='<?php echo $child->id?>'>
<?php foreach ($setting as $key => $value) $this->task->printCell($value, $child, $users, $browseType, $branchGroups, $modulePairs);?>
<?php foreach ($setting as $key => $value) $this->task->printCell($value, $child, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table');?>
</tr>
<?php endforeach;?>
<?php endif;?>
+8 -5
View File
@@ -2247,8 +2247,9 @@ class storyModel extends model
* @access public
* @return void
*/
public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks, $storyBugs, $storyCases)
public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks = array(), $storyBugs = array(), $storyCases = array(), $mode = 'datatable')
{
$canView = common::hasPriv('story', 'view');
$storyLink = helper::createLink('story', 'view', "storyID=$story->id");
$account = $this->app->user->account;
$id = $col->id;
@@ -2256,7 +2257,8 @@ class storyModel extends model
{
$class = '';
if($id == 'status') $class .= ' story-' . $story->status;
if($id == 'title') $class .= ' text-left';
if($id == 'title') $class .= ' text-left';
if($id == 'id') $class .= ' cell-id';
if($id == 'assignedTo' && $story->assignedTo == $account) $class .= ' red';
$title = '';
@@ -2264,10 +2266,11 @@ class storyModel extends model
if($id == 'plan') $title = $story->planTitle;
echo "<td class='" . $class . "' title='$title'>";
switch ($id)
switch($id)
{
case 'id':
echo html::a($storyLink, sprintf('%03d', $story->id));
if($mode == 'table') echo "<input type='checkbox' name='storyIDList[{$story->id}]' value='{$story->id}' /> ";
echo $canView ? html::a($storyLink, sprintf('%03d', $story->id)) : sprintf('%03d', $story->id);
break;
case 'pri':
echo "<span class='pri" . zget($this->lang->story->priList, $story->pri, $story->pri) . "'>";
@@ -2277,7 +2280,7 @@ class storyModel extends model
case 'title':
if($story->branch) echo "<span class='label label-info label-badge'>{$branches[$story->branch]}</span> ";
if($modulePairs and $story->module) echo "<span class='label label-info label-badge'>{$modulePairs[$story->module]}</span> ";
echo html::a($storyLink, $story->title, null, "style='color: $story->color'");
echo $canView ? html::a($storyLink, $story->title, '', "style='color: $story->color'") : "<span style='color: $story->color'>{$story->title}</span>";
break;
case 'plan':
echo $story->planTitle;
+7 -4
View File
@@ -1811,8 +1811,9 @@ class taskModel extends model
* @access public
* @return void
*/
public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array())
public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array(), $mode = 'datatable')
{
$canView = common::hasPriv('task', 'view');
$taskLink = helper::createLink('task', 'view', "taskID=$task->id");
$account = $this->app->user->account;
$id = $col->id;
@@ -1820,15 +1821,17 @@ class taskModel extends model
{
$class = '';
if($id == 'status') $class .= ' task-' . $task->status;
if($id == 'id') $class .= ' cell-id';
if($id == 'name' or $id == 'story') $class .= ' text-left';
if($id == 'deadline' and isset($task->delay)) $class .= ' delayed';
if($id == 'assignedTo' && $task->assignedTo == $account) $class .= ' red';
echo "<td class='" . $class . "'" . ($id=='name' ? " title='{$task->name}'":'') . ">";
switch ($id)
switch($id)
{
case 'id':
echo html::a($taskLink, sprintf('%03d', $task->id));
if($mode == 'table') echo "<input type='checkbox' name='taskIDList[{$task->id}]' value='{$task->id}'/> ";
echo $canView ? html::a($taskLink, sprintf('%03d', $task->id)) : sprintf('%03d', $task->id);
break;
case 'pri':
echo "<span class='pri" . zget($this->lang->task->priList, $task->pri, $task->pri) . "'>";
@@ -1838,7 +1841,7 @@ class taskModel extends model
case 'name':
if(!empty($task->product) && isset($branchGroups[$task->product][$task->branch])) echo "<span class='label label-info label-badge'>" . $branchGroups[$task->product][$task->branch] . '</span> ';
if($modulePairs and $task->module) echo "<span class='label label-info label-badge'>" . $modulePairs[$task->module] . '</span> ';
echo html::a($taskLink, $task->name, null, "style='color: $task->color'");
echo $canView ? html::a($taskLink, $task->name, null, "style='color: $task->color'") : "<span style='color: $task->color'>$task->name</span>";
if($task->fromBug) echo html::a(helper::createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '_blank', "class='bug'");
if(!empty($task->children)) echo '<span class="task-toggle" data-id="'.$task->id.'">&nbsp;&nbsp;<i class="icon icon-minus"></i>&nbsp;&nbsp;</span>';
break;
+1
View File
@@ -503,6 +503,7 @@ class testcase extends control
$caseFails = $this->dao->select('COUNT(*) AS count')->from(TABLE_TESTRESULT)->where('caseResult')->eq('fail')->andwhere('`case`')->eq($caseID)
->beginIF($from == 'testtask')->andwhere('`run`')->eq($taskID)->fi()
->fetch('count');
$case->caseFails = $caseFails;
$this->view->position[] = $this->lang->testcase->common;
$this->view->position[] = $this->lang->testcase->view;
+8 -5
View File
@@ -1232,8 +1232,9 @@ class testcaseModel extends model
* @access public
* @return void
*/
public function printCell($col, $case, $users, $branches, $modulePairs = array(), $browseType = '')
public function printCell($col, $case, $users, $branches, $modulePairs = array(), $browseType = '', $mode = 'datatable')
{
$canView = common::hasPriv('testcase', 'view');
$caseLink = helper::createLink('testcase', 'view', "caseID=$case->id&version=$case->version");
$account = $this->app->user->account;
$id = $col->id;
@@ -1241,14 +1242,16 @@ class testcaseModel extends model
{
$class = '';
if($id == 'status') $class .= $case->status;
if($id == 'title') $class .= ' text-left';
if($id == 'title') $class .= ' text-left';
if($id == 'id') $class .= ' cell-id';
if($id == 'lastRunResult') $class .= $case->lastRunResult;
echo "<td class='" . $class . "'" . ($id=='title' ? " title='{$case->title}'":'') . ">";
switch ($id)
switch($id)
{
case 'id':
echo html::a($caseLink, sprintf('%03d', $case->id));
if($mode == 'table') echo "<input type='checkbox' name='caseIDList[]' value='{$case->id}'/> ";
echo $canView ? html::a($caseLink, sprintf('%03d', $case->id)) : sprintf('%03d', $case->id);
break;
case 'pri':
echo "<span class='pri" . zget($this->lang->testcase->priList, $case->pri, $case->pri) . "'>";
@@ -1258,7 +1261,7 @@ class testcaseModel extends model
case 'title':
if($case->branch) echo "<span class='label label-info label-badge'>{$branches[$case->branch]}</span> ";
if($modulePairs and $case->module) echo "<span class='label label-info label-badge'>{$modulePairs[$case->module]}</span> ";
echo html::a($caseLink, $case->title, null, "style='color: $case->color'");
echo $canView ? html::a($caseLink, $case->title, null, "style='color: $case->color'") : "<span style='color: $case->color'>$case->title</span>";
break;
case 'branch':
echo $branches[$case->branch];
+1 -1
View File
@@ -69,7 +69,7 @@ js::set('branch', $branch);
<tbody>
<?php foreach($cases as $case):?>
<tr class='text-center' data-id='<?php echo $case->id?>'>
<?php foreach($setting as $key => $value) $this->testcase->printCell($value, $case, $users, $branches, $modulePairs, $browseType);?>
<?php foreach($setting as $key => $value) $this->testcase->printCell($value, $case, $users, $branches, $modulePairs, $browseType, $useDatatable ? 'datatable' : 'table');?>
</tr>
<?php endforeach;?>
</tbody>
+7 -4
View File
@@ -1118,8 +1118,9 @@ class testtaskModel extends model
* @access public
* @return void
*/
public function printCell($col, $run, $users, $task, $branches)
public function printCell($col, $run, $users, $task, $branches, $mode = 'datatable')
{
$canView = common::hasPriv('testcase', 'view');
$caseLink = helper::createLink('testcase', 'view', "caseID=$run->case&version=$run->version&from=testtask&taskID=$run->task");
$account = $this->app->user->account;
$id = $col->id;
@@ -1127,7 +1128,8 @@ class testtaskModel extends model
{
$class = '';
if($id == 'status') $class .= $run->status;
if($id == 'title') $class .= ' text-left';
if($id == 'title') $class .= ' text-left';
if($id == 'id') $class .= ' cell-id';
if($id == 'lastRunResult') $class .= " $run->lastRunResult";
if($id == 'assignedTo' && $run->assignedTo == $account) $class .= ' red';
@@ -1135,7 +1137,8 @@ class testtaskModel extends model
switch ($id)
{
case 'id':
echo html::a($caseLink, sprintf('%03d', $run->case));
if($mode == 'table') echo "<input type='checkbox' name='caseIDList[]' value='{$run->case}'/> ";
echo $canView ? html::a($caseLink, sprintf('%03d', $run->case)) : sprintf('%03d', $run->case);
break;
case 'pri':
echo "<span class='pri" . zget($this->lang->testcase->priList, $run->pri, $run->pri) . "'>";
@@ -1144,7 +1147,7 @@ class testtaskModel extends model
break;
case 'title':
if($run->branch) echo "<span class='label label-info label-badge'>{$branches[$run->branch]}</span>";
echo html::a($caseLink, $run->title);
echo $canView ? html::a($caseLink, $run->title) : $run->title;
break;
case 'branch':
echo $branches[$run->branch];
+1 -1
View File
@@ -71,7 +71,7 @@ var moduleID = '<?php echo $moduleID;?>';
<tbody>
<?php foreach($runs as $run):?>
<tr class='text-center' data-id='<?php echo $run->case?>'>
<?php foreach($setting as $key => $value) $this->testtask->printCell($value, $run, $users, $task, $branches);?>
<?php foreach($setting as $key => $value) $this->testtask->printCell($value, $run, $users, $task, $branches, $useDatatable ? 'datatable' : 'table');?>
</tr>
<?php endforeach;?>
</tbody>