Finish task#3255 禅道中所有列表页面都增加自定义显示字段的功能,cost:12 left:0

This commit is contained in:
wangyidong
2017-10-19 11:17:25 +08:00
parent fe16db7484
commit 19dc3cdae5
23 changed files with 228 additions and 769 deletions
+2 -2
View File
@@ -165,7 +165,7 @@ $config->bug->search['params']['lastEditedDate']= array('operator' => '=',
$config->bug->search['params']['deadline'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->bug->datatable = new stdclass();
$config->bug->datatable->defaultField = array('id', 'severity', 'pri', 'title', 'status', 'openedBy', 'openedDate', 'assignedTo', 'resolvedBy', 'resolution', 'resolvedDate', 'actions');
$config->bug->datatable->defaultField = array('id', 'severity', 'pri', 'title', 'status', 'openedBy', 'openedDate', 'assignedTo', 'resolvedBy', 'resolution', 'actions');
$config->bug->datatable->fieldList['id']['title'] = 'idAB';
$config->bug->datatable->fieldList['id']['fixed'] = 'left';
@@ -174,7 +174,7 @@ $config->bug->datatable->fieldList['id']['required'] = 'yes';
$config->bug->datatable->fieldList['severity']['title'] = 'severityAB';
$config->bug->datatable->fieldList['severity']['fixed'] = 'left';
$config->bug->datatable->fieldList['severity']['width'] = '50';
$config->bug->datatable->fieldList['severity']['width'] = '40';
$config->bug->datatable->fieldList['severity']['required'] = 'no';
$config->bug->datatable->fieldList['pri']['title'] = 'P';
+27 -6
View File
@@ -168,16 +168,37 @@ js::set('branch', $branch);
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/browsedata.html.php';
$vars = "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
include $file2Include;
if($useDatatable) include '../../common/view/datatable.html.php';
$setting = $this->datatable->getSetting('bug');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='bugList' data-checkable='true' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='bugIDList[]'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns ++;
}
}
?>
</tr>
</thead>
<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);?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<?php
$columns = $this->cookie->windowWidth >= $this->config->wideSize ? 13 : 11;
if($browseType == 'needconfirm') $columns = 8;
?>
<td colspan='<?php echo $columns;?>'>
<?php if(!empty($bugs)):?>
<div class='table-actions clearfix'>
-114
View File
@@ -1,114 +0,0 @@
<?php
/**
* The browse data view file of bug 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 bug
* @version $Id$
* @link http://www.zentao.net
*/
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed table-selectable' id='bugList'>
<thead>
<tr>
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-severity'> <?php common::printOrderLink('severity', $orderBy, $vars, $lang->bug->severityAB);?></th>
<th class='w-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
<th class='w-100px'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->bug->statusAB);?></th>
<th class='w-80px'> <?php common::printOrderLink('deadline', $orderBy, $vars, $lang->bug->deadline);?></th>
<?php if($browseType == 'needconfirm'):?>
<th class='w-200px'><?php common::printOrderLink('story', $orderBy, $vars, $lang->bug->story);?></th>
<th class='w-50px'><?php echo $lang->actions;?></th>
<?php else:?>
<th class='w-user'><?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<th class='w-date'><?php common::printOrderLink('openedDate', $orderBy, $vars, $lang->bug->openedDateAB);?></th>
<?php endif;?>
<th class='w-user'><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->assignedToAB);?></th>
<th class='w-user'><?php common::printOrderLink('resolvedBy', $orderBy, $vars, $lang->bug->resolvedByAB);?></th>
<th class='w-resolution'><?php common::printOrderLink('resolution', $orderBy, $vars, $lang->bug->resolutionAB);?></th>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<th class='w-date'><?php common::printOrderLink('resolvedDate', $orderBy, $vars, $lang->bug->resolvedDateAB);?></th>
<?php endif;?>
<th class='w-140px {sorter:false}'><?php echo $lang->actions;?></th>
<?php endif;?>
</tr>
</thead>
<?php if($bugs):?>
<tbody>
<?php foreach($bugs as $bug):?>
<?php $bugLink = inlink('view', "bugID=$bug->id");?>
<tr class='text-center'>
<td class='cell-id bug-<?php echo $bug->status;?> strong text-left'>
<input type='checkbox' name='bugIDList[<?php echo $bug->id ?>]' value='<?php echo $bug->id;?>'/>
<?php echo html::a($bugLink, sprintf('%03d', $bug->id));?>
</td>
<td><span class='<?php echo 'severity' . zget($lang->bug->severityList, $bug->severity, $bug->severity);?>'><?php echo zget($lang->bug->severityList, $bug->severity, $bug->severity);?></span></td>
<td><span class='<?php echo 'pri' . zget($lang->bug->priList, $bug->pri, $bug->pri);?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri);?></span></td>
<?php $class = 'confirm' . $bug->confirmed;?>
<td class='text-left' title="<?php echo $bug->title?>">
<?php
echo "<span class='$class'>[{$lang->bug->confirmedList[$bug->confirmed]}]</span> ";
if($bug->branch)echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>{$branches[$bug->branch]}</span> ";
if($modulePairs and $bug->module)echo "<span title='{$lang->bug->module}' class='label label-info label-badge'>{$modulePairs[$bug->module]}</span> ";
echo html::a($bugLink, $bug->title, null, "style='color: $bug->color'");
?>
</td>
<td class='bug-<?php echo $bug->status?>'>
<?php
if($bug->needconfirm)
{
echo "(<span class='warning'>{$lang->story->changed}</span> ";
echo html::a($this->createLink('bug', 'confirmStoryChange', "bugID=$bug->id"), $lang->confirm, 'hiddenwin');
echo ")";
}
else
{
echo $lang->bug->statusList[$bug->status];
}
?>
</td>
<td class="<?php if(isset($bug->delay)) echo 'delayed';?>"><?php if(substr($bug->deadline, 0, 4) > 0) echo substr($bug->deadline, 5, 6)?></td>
<?php if($browseType == 'needconfirm'):?>
<td class='text-left' title="<?php echo $bug->storyTitle?>"><?php echo html::a($this->createLink('story', 'view', "stoyID=$bug->story"), $bug->storyTitle, '_blank');?></td>
<td><?php $lang->bug->confirmStoryChange = $lang->confirm; common::printIcon('bug', 'confirmStoryChange', "bugID=$bug->id", '', 'list', '', 'hiddenwin')?></td>
<?php else:?>
<td><?php echo zget($users, $bug->openedBy, $bug->openedBy);?></td>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<td><?php echo substr($bug->openedDate, 5, 11)?></td>
<?php endif;?>
<td <?php if($bug->assignedTo == $this->app->user->account) echo 'class="red"';?>><?php echo zget($users, $bug->assignedTo, $bug->assignedTo);?></td>
<td><?php echo zget($users, $bug->resolvedBy, $bug->resolvedBy)?></td>
<td><?php echo zget($lang->bug->resolutionList, $bug->resolution);?></td>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<td><?php echo substr($bug->resolvedDate, 5, 11)?></td>
<?php endif;?>
<td class='text-right'>
<?php
$params = "bugID=$bug->id";
common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'search', '', 'iframe', true);
common::printIcon('bug', 'assignTo', $params, $bug, 'list', '', '', 'iframe', true);
common::printIcon('bug', 'resolve', $params, $bug, 'list', '', '', 'iframe', true);
common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true);
common::printIcon('bug', 'edit', $params, $bug, 'list');
common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=bugID=$bug->id", $bug, 'list', 'copy');
?>
</td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
<?php endif;?>
-29
View File
@@ -1,29 +0,0 @@
<?php
/**
* The datatable data view file of bug 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 bug
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/datatable.html.php';
$setting = $this->datatable->getSetting('bug');
$widths = $this->datatable->setFixedFieldWidth($setting);
extract($widths);
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='bugList' data-checkable='true' data-fixed-left-width='<?php echo $leftWidth?>' data-fixed-right-width='<?php echo $rightWidth?>' data-custom-menu='true' data-checkbox-name='bugIDList[]'>
<thead>
<tr><?php foreach ($setting as $key => $value) $this->datatable->printHead($value, $orderBy, $vars);?></tr>
</thead>
<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);?>
</tr>
<?php endforeach;?>
</tbody>
+6 -5
View File
@@ -62,11 +62,12 @@ class datatable extends control
$this->loadModel('testcase');
$this->app->loadConfig('testtask');
$this->config->testcase->datatable->defaultField = $this->config->testtask->datatable->defaultField;
$this->config->testcase->datatable->fieldList['assignedTo']['title'] = 'assignedTo';
$this->config->testcase->datatable->fieldList['assignedTo']['fixed'] = 'no';
$this->config->testcase->datatable->fieldList['assignedTo']['width'] = '80';
$this->config->testcase->datatable->fieldList['assignedTo']['required'] = 'no';
$this->config->testcase->datatable->fieldList['actions']['width'] = '100';
$this->config->testcase->datatable->fieldList['actions']['width'] = '100';
}
if($module == 'testcase')
{
$this->loadModel('testcase');
unset($this->config->testcase->datatable->fieldList['assignedTo']);
}
$this->view->module = $module;
+7 -1
View File
@@ -72,6 +72,7 @@ class datatableModel extends model
$set->fixed = $fieldList[$id]['fixed'];
$set->title = $fieldList[$id]['title'];
$set->sort = isset($fieldList[$id]['sort']) ? $fieldList[$id]['sort'] : 'yes';
$set->name = isset($fieldList[$id]['name']) ? $fieldList[$id]['name'] : '';
$setting[$key] = $set;
}
}
@@ -123,7 +124,12 @@ class datatableModel extends model
$id = $col->id;
if($col->show)
{
echo "<th data-flex='" . ($col->fixed == 'no' ? 'true': 'false') . "' data-width='{$col->width}' style='width:" . (is_numeric($col->width) ? "{$col->width}px" : $col->width) . "' class='w-$id'>";
$fixed = $col->fixed == 'no' ? 'true': 'false';
$width = is_numeric($col->width) ? "{$col->width}px" : $col->width;
$sorter = (isset($col->sort) and $col->sort == 'no') ? '' : '{sorter:false}';
$title = isset($col->name) ? "title='$col->name'" : '';
echo "<th data-flex='$fixed' data-width='$width' style='width:$width' class='w-$id $sorter' $title>";
if($id == 'actions')
{
echo $this->lang->actions;
+4 -2
View File
@@ -62,7 +62,8 @@
<div class='clearfix col<?php echo ($required ? ' require' : '') . (' fixed-' . $fixed) ?>' data-key='<?php echo $key?>' data-fixed='<?php echo $fixed?>' data-width='<?php echo $col['width']?>'>
<i class='icon-ok'></i> &nbsp;<span class='title'><span class='title-bar'><strong><?php echo $col['title']?></strong><i class='icon-move'></i></span></span> <?php if($required) echo "<span class='text-muted'>({$lang->datatable->required})</span>"?>
<div class='actions pull-right'>
<span><span class='text-muted'><?php echo $lang->datatable->width?></span> <input type='text' class='form-control' value='<?php echo $col['width']?>'><?php echo $autoWidth ? '&nbsp;' : 'px' ?></span>
<?php if(isset($col['name'])) echo html::hidden('name', $col['name'])?>
<span><span class='text-muted'><?php echo $lang->datatable->width?></span> <input type='text' id='width' class='form-control' value='<?php echo $col['width']?>'><?php echo $autoWidth ? '&nbsp;' : 'px' ?></span>
<button type='button' class='btn btn-link show-hide<?php echo $required ? ' disabled' : '' ?>'><span class='label-show'><?php echo $lang->datatable->show?></span><span class='text-muted'>/</span><span class='label-hide'><?php echo $lang->datatable->hide?></span></button>
</div>
</div>
@@ -179,8 +180,9 @@ $(function()
var setting = $('.col').map(function(index)
{
var $col = $(this);
var sets = {id: $col.data('key'), order: index + 1, show: !$col.hasClass('disabled'), width: $col.find('input').val(), fixed: $col.data('fixed')};
var sets = {id: $col.data('key'), order: index + 1, show: !$col.hasClass('disabled'), width: $col.find('input#width').val(), fixed: $col.data('fixed')};
if(sets.width !== 'auto') sets.width += 'px';
if($col.find('#name').size() > 0) sets.name = $col.find('#name').val();
return sets;
}).get();
+29 -3
View File
@@ -104,13 +104,39 @@
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/browsedata.html.php';
$vars = "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
include $file2Include;
if($useDatatable) include '../../common/view/datatable.html.php';
if(!$useDatatable) include '../../common/view/tablesorter.html.php';
$setting = $this->datatable->getSetting('product');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='storyList' data-checkable='true' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='storyIDList[]'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns ++;
}
}
?>
</tr>
</thead>
<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);?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='13'>
<td colspan='<?php echo $columns?>'>
<div class='table-actions clearfix'>
<?php if(count($stories)):?>
<?php echo html::selectButton();?>
-103
View File
@@ -1,103 +0,0 @@
<?php
/**
* The browse data view file of product 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 product
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/tablesorter.html.php';?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed table-selectable' id='storyList'>
<thead>
<tr>
<th class='w-id {sorter:false}'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-pri {sorter:false}'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th class='w-p30 {sorter:false}'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->story->title);?></th>
<th class='w-90px {sorter:false}'><?php common::printOrderLink('plan', $orderBy, $vars, $lang->story->planAB);?></th>
<th class='w-user {sorter:false}'><?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
<th class='w-user {sorter:false}'><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->assignedToAB);?></th>
<th class='w-hour {sorter:false}'><?php common::printOrderLink('estimate', $orderBy, $vars, $lang->story->estimateAB);?></th>
<th class='w-50px {sorter:false}'><?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
<th class='w-70px {sorter:false}'><?php common::printOrderLink('stage', $orderBy, $vars, $lang->story->stageAB);?></th>
<th title='<?php echo $lang->story->taskCount?>' class='w-30px'><?php echo $lang->story->taskCountAB;?></th>
<th title='<?php echo $lang->story->bugCount?>' class='w-30px'><?php echo $lang->story->bugCountAB;?></th>
<th title='<?php echo $lang->story->caseCount?>' class='w-30px'><?php echo $lang->story->caseCountAB;?></th>
<th class='w-140px {sorter:false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<?php if($stories):?>
<tbody>
<?php foreach($stories as $key => $story):?>
<?php
$viewLink = $this->createLink('story', 'view', "storyID=$story->id");
$canView = common::hasPriv('story', 'view');
?>
<tr class='text-center'>
<td class='cell-id'>
<input type='checkbox' name='storyIDList[<?php echo $story->id;?>]' value='<?php echo $story->id;?>' />
<?php echo $canView ? html::a($viewLink, sprintf('%03d', $story->id)): sprintf('%03d', $story->id);?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->story->priList, $story->pri, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri)?></span></td>
<td class='text-left' title="<?php echo $story->title?>"><nobr>
<?php if($story->branch) echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>{$branches[$story->branch]}</span>"?>
<?php if($modulePairs and $story->module) echo "<span title='{$lang->story->module}' class='label label-info label-badge'>{$modulePairs[$story->module]}</span> "?>
<?php echo html::a($viewLink, $story->title, null, "style='color: $story->color'");?>
</nobr></td>
<td title="<?php echo $story->planTitle?>"><?php echo $story->planTitle;?></td>
<td><?php echo zget($users, $story->openedBy, $story->openedBy);?></td>
<td><?php echo zget($users, $story->assignedTo, $story->assignedTo);?></td>
<td><?php echo $story->estimate;?></td>
<td class='story-<?php echo $story->status;?>'><?php echo $lang->story->statusList[$story->status];?></td>
<td>
<?php
echo "<div" . (isset($storyStages[$story->id]) ? " class='popoverStage' data-toggle='popover' data-placement='bottom' data-target='\$next'" : '') . "'>";
echo $lang->story->stageList[$story->stage];
if(isset($storyStages[$story->id])) echo "<span class='pl-5px'><i class='icon icon-caret-down'></i></span>";
echo '</div>';
if(isset($storyStages[$story->id]))
{
echo "<div class='popover'>";
foreach($storyStages[$story->id] as $storyBranch => $storyStage) echo $branches[$storyBranch] . ": " . $lang->story->stageList[$storyStage->stage] . '<br />';
echo "</div>";
}
?>
</td>
<td class='linkbox'>
<?php
$tasksLink = $this->createLink('story', 'tasks', "storyID=$story->id");
$storyTasks[$story->id] > 0 ? print(html::a($tasksLink, $storyTasks[$story->id], '', 'class="iframe"')) : print(0);
?>
</td>
<td class='linkbox'>
<?php
$bugsLink = $this->createLink('story', 'bugs', "storyID=$story->id");
$storyBugs[$story->id] > 0 ? print(html::a($bugsLink, $storyBugs[$story->id], '', 'class="iframe"')) : print(0);
?>
</td>
<td class='linkbox'>
<?php
$casesLink = $this->createLink('story', 'cases', "storyID=$story->id");
$storyCases[$story->id] > 0 ? print(html::a($casesLink, $storyCases[$story->id], '', 'class="iframe"')) : print(0);
?>
</td>
<td class='text-right'>
<?php
$vars = "story={$story->id}";
common::printIcon('story', 'change', $vars, $story, 'list', 'random');
common::printIcon('story', 'review', $vars, $story, 'list', 'review');
common::printIcon('story', 'close', $vars, $story, 'list', 'off', '', 'iframe', true);
common::printIcon('story', 'edit', $vars, $story, 'list', 'pencil');
if($this->config->global->flow != 'onlyStory')
{
common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=&param=0&$vars", $story, 'list', 'sitemap');
}
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<?php endif;?>
@@ -1,29 +0,0 @@
<?php
/**
* The datatable data view file of product 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 product
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/datatable.html.php';
$setting = $this->datatable->getSetting('product');
$widths = $this->datatable->setFixedFieldWidth($setting);
extract($widths);
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='storyList' data-checkable='true' data-fixed-left-width='<?php echo $leftWidth?>' data-fixed-right-width='<?php echo $rightWidth?>' data-custom-menu='true' data-checkbox-name='storyIDList[]'>
<thead>
<tr><?php foreach($setting as $key => $value) $this->datatable->printHead($value, $orderBy, $vars);?></tr>
</thead>
<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);?>
</tr>
<?php endforeach;?>
</tbody>
@@ -1,39 +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 endforeach;?>
</tbody>
+25 -2
View File
@@ -45,10 +45,33 @@ js::set('browseType', $browseType);
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/taskdata.html.php';
$vars = "projectID=$project->id&status=$status&parma=$param&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage";
include $file2Include;
if($useDatatable) include '../../common/view/datatable.html.php';
$setting = $this->datatable->getSetting('project');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='taskList' data-checkable='true' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['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 endforeach;?>
</tbody>
<tfoot>
<tr>
<?php if(!isset($columns)) $columns = ($this->cookie->windowWidth > $this->config->wideSize ? 15 : 13) - ($project->type == 'sprint' ? 0 : 1);?>
-130
View File
@@ -1,130 +0,0 @@
<?php
/**
* The task 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/tablesorter.html.php';?>
<?php $columns = 12; ?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed table-selectable' id='taskList'>
<thead>
<tr>
<th class='w-id {sorter:false}'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-pri {sorter:false}'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th class='{sorter:false}'> <?php common::printOrderLink('name', $orderBy, $vars, $lang->task->name);?></th>
<th class='w-100px {sorter:false}'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
<th class='w-70px {sorter:false}'> <?php common::printOrderLink('deadline', $orderBy, $vars, $lang->task->deadlineAB);?></th>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<?php $columns++; ?>
<th class='w-id {sorter:false}'> <?php common::printOrderLink('openedDate', $orderBy, $vars, $lang->task->openedDateAB);?></th>
<?php endif;?>
<th class='w-user {sorter:false}'> <?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->task->assignedToAB);?></th>
<th class='w-user {sorter:false}'> <?php common::printOrderLink('finishedBy', $orderBy, $vars, $lang->task->finishedByAB);?></th>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<?php $columns++; ?>
<th class='w-50px {sorter:false}'> <?php common::printOrderLink('finishedDate', $orderBy, $vars, $lang->task->finishedDateAB);?></th>
<?php endif;?>
<th class='w-35px {sorter:false}'> <?php common::printOrderLink('estimate', $orderBy, $vars, $lang->task->estimateAB);?></th>
<th class='w-50px {sorter:false}'> <?php common::printOrderLink('consumed', $orderBy, $vars, $lang->task->consumedAB);?></th>
<th class='w-40px nobr {sorter:false}'> <?php common::printOrderLink('left', $orderBy, $vars, $lang->task->leftAB);?></th>
<th class='w-50px' title='<?php echo $lang->task->progessTips?>'><?php echo $lang->task->progess;?></th>
<?php if($project->type == 'sprint'): ?>
<th class='w-100px {sorter:false}'><?php common::printOrderLink('story', $orderBy, $vars, $lang->task->story); ?></th>
<?php $columns++; ?>
<?php endif;?>
<th class='w-150px {sorter:false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<?php if($tasks):?>
<tbody>
<?php foreach($tasks as $task):?>
<?php $class = $task->assignedTo == $app->user->account ? 'style=color:red' : ''; ?>
<tr class='text-center'>
<td class='cell-id'>
<input type='checkbox' name='taskIDList[<?php echo $task->id;?>]' value='<?php echo $task->id;?>'/>
<?php if(!common::printLink('task', 'view', "task=$task->id", sprintf('%03d', $task->id))) printf('%03d', $task->id);?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->task->priList, $task->pri, $task->pri)?>'><?php echo $task->pri == '0' ? '' : zget($lang->task->priList, $task->pri, $task->pri);?></span></td>
<td class='text-left' title="<?php echo $task->name?>">
<?php if(isset($branchGroups[$task->product][$task->branch])) echo "<span title='{$lang->product->branchName[$task->productType]}' class='label label-branch label-badge'>" . $branchGroups[$task->product][$task->branch] . '</span>';?>
<?php if($modulePairs and $task->module) echo "<span title='{$lang->task->module}' class='label label-info label-badge'>" . $modulePairs[$task->module] . '</span>';?>
<?php
if(!common::printLink('task', 'view', "task=$task->id", $task->name, null, "style='color: $task->color'")) echo $task->name;
if($task->fromBug) echo html::a($this->createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '_blank', "class='bug'");
?>
</td>
<td class="<?php echo $task->status;?>">
<?php
$storyChanged = ($task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion);
if($storyChanged)
{
echo "(<span class='warning'>{$lang->story->changed}</span> ";
echo html::a($this->createLink('task', 'confirmStoryChange', "taskID=$task->id"), $lang->confirm, 'hiddenwin');
echo ")";
}
else
{
echo $lang->task->statusList[$task->status];
}
?>
</td>
<td class="<?php if(isset($task->delay)) echo 'delayed';?>"><?php if(substr($task->deadline, 0, 4) > 0) echo substr($task->deadline, 5, 6);?></td>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<td><?php echo substr($task->openedDate, 5, 6);?></td>
<?php endif;?>
<td <?php echo $class;?>><?php echo $task->assignedTo == 'closed' ? 'Closed' : zget($users, $task->assignedTo, $task->assignedTo);?></td>
<td><?php echo zget($users, $task->finishedBy, $task->finishedBy);?></td>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
<td><?php echo substr($task->finishedDate, 5, 6);?></td>
<?php endif;?>
<td><?php echo $task->estimate;?></td>
<td><?php echo $task->consumed;?></td>
<td><?php echo $task->left;?></td>
<td><?php echo $task->progess?>%</td>
<?php
if($project->type == 'sprint')
{
echo '<td class="text-left" title="' . $task->storyTitle . '">';
if($task->storyID)
{
if(!common::printLink('story', 'view', "storyid=$task->storyID", $task->storyTitle)) print $task->storyTitle;
}
echo '</td>';
}
?>
<td class='text-right'>
<?php
common::printIcon('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $task, 'list', '', '', 'iframe', true);
common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', '', '', 'iframe', true);
common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'list', 'time', '', 'iframe', true);
if($browseType == 'needconfirm')
{
$lang->task->confirmStoryChange = $lang->confirm;
common::printIcon('task', 'confirmStoryChange', "taskid=$task->id", '', 'list', '', 'hiddenwin');
}
common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', '', '', 'iframe', true);
common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true);
common::printIcon('task', 'edit', "taskID=$task->id", $task, 'list');
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<?php endif?>
+26 -22
View File
@@ -47,7 +47,7 @@ $config->story->custom->batchCreateFields = 'module,plan,spec,pri,estimate,revie
$config->story->custom->batchEditFields = 'branch,module,plan,estimate,pri,source,stage,closedBy,closedReason';
$config->story->datatable = new stdclass();
$config->story->datatable->defaultField = array('id', 'pri', 'title', 'plan', 'source', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'taskCount', 'bugCount', 'caseCount', 'actions');
$config->story->datatable->defaultField = array('id', 'pri', 'title', 'plan', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'taskCount', 'bugCount', 'caseCount', 'actions');
$config->story->datatable->fieldList['id']['title'] = 'idAB';
$config->story->datatable->fieldList['id']['fixed'] = 'left';
@@ -91,37 +91,19 @@ $config->story->datatable->fieldList['sourceNote']['required'] = 'no';
$config->story->datatable->fieldList['status']['title'] = 'statusAB';
$config->story->datatable->fieldList['status']['fixed'] = 'no';
$config->story->datatable->fieldList['status']['width'] = '80';
$config->story->datatable->fieldList['status']['width'] = '50';
$config->story->datatable->fieldList['status']['required'] = 'no';
$config->story->datatable->fieldList['estimate']['title'] = 'estimateAB';
$config->story->datatable->fieldList['estimate']['fixed'] = 'no';
$config->story->datatable->fieldList['estimate']['width'] = '80';
$config->story->datatable->fieldList['estimate']['width'] = '50';
$config->story->datatable->fieldList['estimate']['required'] = 'no';
$config->story->datatable->fieldList['stage']['title'] = 'stageAB';
$config->story->datatable->fieldList['stage']['fixed'] = 'no';
$config->story->datatable->fieldList['stage']['width'] = '90';
$config->story->datatable->fieldList['stage']['width'] = '70';
$config->story->datatable->fieldList['stage']['required'] = 'no';
$config->story->datatable->fieldList['taskCount']['title'] = 'taskCount';
$config->story->datatable->fieldList['taskCount']['fixed'] = 'no';
$config->story->datatable->fieldList['taskCount']['width'] = '90';
$config->story->datatable->fieldList['taskCount']['required'] = 'no';
$config->story->datatable->fieldList['taskCount']['sort'] = 'no';
$config->story->datatable->fieldList['bugCount']['title'] = 'bugCount';
$config->story->datatable->fieldList['bugCount']['fixed'] = 'no';
$config->story->datatable->fieldList['bugCount']['width'] = '90';
$config->story->datatable->fieldList['bugCount']['required'] = 'no';
$config->story->datatable->fieldList['bugCount']['sort'] = 'no';
$config->story->datatable->fieldList['caseCount']['title'] = 'caseCount';
$config->story->datatable->fieldList['caseCount']['fixed'] = 'no';
$config->story->datatable->fieldList['caseCount']['width'] = '90';
$config->story->datatable->fieldList['caseCount']['required'] = 'no';
$config->story->datatable->fieldList['caseCount']['sort'] = 'no';
$config->story->datatable->fieldList['openedBy']['title'] = 'openedByAB';
$config->story->datatable->fieldList['openedBy']['fixed'] = 'no';
$config->story->datatable->fieldList['openedBy']['width'] = '80';
@@ -187,6 +169,28 @@ $config->story->datatable->fieldList['version']['fixed'] = 'no';
$config->story->datatable->fieldList['version']['width'] = '60';
$config->story->datatable->fieldList['version']['required'] = 'no';
global $lang;
$config->story->datatable->fieldList['taskCount']['title'] = 'T';
$config->story->datatable->fieldList['taskCount']['fixed'] = 'no';
$config->story->datatable->fieldList['taskCount']['width'] = '30';
$config->story->datatable->fieldList['taskCount']['required'] = 'no';
$config->story->datatable->fieldList['taskCount']['sort'] = 'no';
$config->story->datatable->fieldList['taskCount']['name'] = $lang->story->taskCount;
$config->story->datatable->fieldList['bugCount']['title'] = 'B';
$config->story->datatable->fieldList['bugCount']['fixed'] = 'no';
$config->story->datatable->fieldList['bugCount']['width'] = '30';
$config->story->datatable->fieldList['bugCount']['required'] = 'no';
$config->story->datatable->fieldList['bugCount']['sort'] = 'no';
$config->story->datatable->fieldList['bugCount']['name'] = $lang->story->bugCount;
$config->story->datatable->fieldList['caseCount']['title'] = 'C';
$config->story->datatable->fieldList['caseCount']['fixed'] = 'no';
$config->story->datatable->fieldList['caseCount']['width'] = '30';
$config->story->datatable->fieldList['caseCount']['required'] = 'no';
$config->story->datatable->fieldList['caseCount']['sort'] = 'no';
$config->story->datatable->fieldList['caseCount']['name'] = $lang->story->caseCount;
$config->story->datatable->fieldList['actions']['title'] = 'actions';
$config->story->datatable->fieldList['actions']['fixed'] = 'right';
$config->story->datatable->fieldList['actions']['width'] = '140';
+1 -1
View File
@@ -58,7 +58,7 @@ if($config->global->flow == 'onlyTask')
}
$config->task->datatable = new stdclass();
$config->task->datatable->defaultField = array('id', 'pri', 'name', 'status', 'deadline', 'openedDate', 'assignedTo', 'finishedBy', 'finishedDate', 'estimate', 'consumed', 'left', 'story', 'actions');
$config->task->datatable->defaultField = array('id', 'pri', 'name', 'status', 'deadline', 'openedDate', 'assignedTo', 'finishedBy', 'estimate', 'consumed', 'left', 'story', 'actions');
$config->task->datatable->fieldList['id']['title'] = 'idAB';
$config->task->datatable->fieldList['id']['fixed'] = 'left';
+38 -30
View File
@@ -91,9 +91,14 @@ $config->testcase->datatable->fieldList['title']['fixed'] = 'left';
$config->testcase->datatable->fieldList['title']['width'] = 'auto';
$config->testcase->datatable->fieldList['title']['required'] = 'yes';
$config->testcase->datatable->fieldList['branch']['title'] = 'branch';
$config->testcase->datatable->fieldList['branch']['fixed'] = 'left';
$config->testcase->datatable->fieldList['branch']['width'] = '100';
$config->testcase->datatable->fieldList['branch']['required'] = 'no';
$config->testcase->datatable->fieldList['type']['title'] = 'type';
$config->testcase->datatable->fieldList['type']['fixed'] = 'no';
$config->testcase->datatable->fieldList['type']['width'] = '90';
$config->testcase->datatable->fieldList['type']['width'] = '80';
$config->testcase->datatable->fieldList['type']['required'] = 'no';
$config->testcase->datatable->fieldList['stage']['title'] = 'stage';
@@ -101,11 +106,6 @@ $config->testcase->datatable->fieldList['stage']['fixed'] = 'no';
$config->testcase->datatable->fieldList['stage']['width'] = '110';
$config->testcase->datatable->fieldList['stage']['required'] = 'no';
$config->testcase->datatable->fieldList['status']['title'] = 'statusAB';
$config->testcase->datatable->fieldList['status']['fixed'] = 'no';
$config->testcase->datatable->fieldList['status']['width'] = '80';
$config->testcase->datatable->fieldList['status']['required'] = 'no';
$config->testcase->datatable->fieldList['precondition']['title'] = 'precondition';
$config->testcase->datatable->fieldList['precondition']['fixed'] = 'no';
$config->testcase->datatable->fieldList['precondition']['width'] = '120';
@@ -116,6 +116,11 @@ $config->testcase->datatable->fieldList['keywords']['fixed'] = 'no';
$config->testcase->datatable->fieldList['keywords']['width'] = '100';
$config->testcase->datatable->fieldList['keywords']['required'] = 'no';
$config->testcase->datatable->fieldList['assignedTo']['title'] = 'assignedTo';
$config->testcase->datatable->fieldList['assignedTo']['fixed'] = 'no';
$config->testcase->datatable->fieldList['assignedTo']['width'] = '80';
$config->testcase->datatable->fieldList['assignedTo']['required'] = 'no';
$config->testcase->datatable->fieldList['openedBy']['title'] = 'openedByAB';
$config->testcase->datatable->fieldList['openedBy']['fixed'] = 'no';
$config->testcase->datatable->fieldList['openedBy']['width'] = '80';
@@ -143,7 +148,7 @@ $config->testcase->datatable->fieldList['lastRunner']['required'] = 'no';
$config->testcase->datatable->fieldList['lastRunDate']['title'] = 'lastRunDate';
$config->testcase->datatable->fieldList['lastRunDate']['fixed'] = 'no';
$config->testcase->datatable->fieldList['lastRunDate']['width'] = '90';
$config->testcase->datatable->fieldList['lastRunDate']['width'] = '120';
$config->testcase->datatable->fieldList['lastRunDate']['required'] = 'no';
$config->testcase->datatable->fieldList['lastRunResult']['title'] = 'lastRunResult';
@@ -151,6 +156,11 @@ $config->testcase->datatable->fieldList['lastRunResult']['fixed'] = 'no';
$config->testcase->datatable->fieldList['lastRunResult']['width'] = '80';
$config->testcase->datatable->fieldList['lastRunResult']['required'] = 'no';
$config->testcase->datatable->fieldList['status']['title'] = 'statusAB';
$config->testcase->datatable->fieldList['status']['fixed'] = 'no';
$config->testcase->datatable->fieldList['status']['width'] = '100';
$config->testcase->datatable->fieldList['status']['required'] = 'no';
$config->testcase->datatable->fieldList['lastEditedBy']['title'] = 'lastEditedBy';
$config->testcase->datatable->fieldList['lastEditedBy']['fixed'] = 'no';
$config->testcase->datatable->fieldList['lastEditedBy']['width'] = '80';
@@ -171,31 +181,29 @@ $config->testcase->datatable->fieldList['story']['fixed'] = 'no';
$config->testcase->datatable->fieldList['story']['width'] = '90';
$config->testcase->datatable->fieldList['story']['required'] = 'no';
$config->testcase->datatable->fieldList['bugs']['title'] = 'B';
$config->testcase->datatable->fieldList['bugs']['fixed'] = 'no';
$config->testcase->datatable->fieldList['bugs']['width'] = '30';
$config->testcase->datatable->fieldList['bugs']['required'] = 'no';
$config->testcase->datatable->fieldList['bugs']['sort'] = 'no';
$config->testcase->datatable->fieldList['bugs']['name'] = $lang->testcase->bugs;
$config->testcase->datatable->fieldList['results']['title'] = 'R';
$config->testcase->datatable->fieldList['results']['fixed'] = 'no';
$config->testcase->datatable->fieldList['results']['width'] = '30';
$config->testcase->datatable->fieldList['results']['required'] = 'no';
$config->testcase->datatable->fieldList['results']['sort'] = 'no';
$config->testcase->datatable->fieldList['results']['name'] = $lang->testcase->results;
$config->testcase->datatable->fieldList['stepNumber']['title'] = 'S';
$config->testcase->datatable->fieldList['stepNumber']['fixed'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['width'] = '30';
$config->testcase->datatable->fieldList['stepNumber']['required'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['sort'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['name'] = $lang->testcase->stepNumber;
$config->testcase->datatable->fieldList['actions']['title'] = 'actions';
$config->testcase->datatable->fieldList['actions']['fixed'] = 'right';
$config->testcase->datatable->fieldList['actions']['width'] = '140';
$config->testcase->datatable->fieldList['actions']['required'] = 'yes';
$config->testcase->datatable->fieldList['actions']['sort'] = 'no';
$config->testcase->datatable->fieldList['branch']['title'] = 'branch';
$config->testcase->datatable->fieldList['branch']['fixed'] = 'left';
$config->testcase->datatable->fieldList['branch']['width'] = '100';
$config->testcase->datatable->fieldList['branch']['required'] = 'no';
$config->testcase->datatable->fieldList['bugs']['title'] = 'bugs';
$config->testcase->datatable->fieldList['bugs']['fixed'] = 'no';
$config->testcase->datatable->fieldList['bugs']['width'] = '80';
$config->testcase->datatable->fieldList['bugs']['required'] = 'no';
$config->testcase->datatable->fieldList['bugs']['sort'] = 'no';
$config->testcase->datatable->fieldList['results']['title'] = 'results';
$config->testcase->datatable->fieldList['results']['fixed'] = 'no';
$config->testcase->datatable->fieldList['results']['width'] = '80';
$config->testcase->datatable->fieldList['results']['required'] = 'no';
$config->testcase->datatable->fieldList['results']['sort'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['title'] = 'stepNumber';
$config->testcase->datatable->fieldList['stepNumber']['fixed'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['width'] = '80';
$config->testcase->datatable->fieldList['stepNumber']['required'] = 'no';
$config->testcase->datatable->fieldList['stepNumber']['sort'] = 'no';
+29 -4
View File
@@ -43,14 +43,39 @@ js::set('branch', $branch);
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/browsedata.html.php';
$vars = "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
include $file2Include;
if($useDatatable) include '../../common/view/datatable.html.php';
if(!$useDatatable) include '../../common/view/tablesorter.html.php';
$setting = $this->datatable->getSetting('testcase');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='caseList' data-checkable='true' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='caseIDList[]'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns ++;
}
}
?>
</tr>
</thead>
<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);?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<?php $mergeColums = $browseType == 'needconfirm' ? 5 : 13;?>
<td colspan='<?php echo $mergeColums?>'>
<td colspan='<?php echo $columns?>'>
<?php if($cases):?>
<div class='table-actions clearfix'>
<?php echo html::selectButton();?>
-99
View File
@@ -1,99 +0,0 @@
<?php
/**
* The browse data view file of testcase 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 testcase
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/tablesorter.html.php';?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed table-selectable' id='caseList'>
<thead>
<tr>
<th class='w-id {sorter:false}'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-pri {sorter:false}'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th class='{sorter:false}'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->testcase->title);?></th>
<?php if($browseType == 'needconfirm'):?>
<th class='{sorter:false}'> <?php common::printOrderLink('story', $orderBy, $vars, $lang->testcase->story);?></th>
<th class='w-50px {sorter:false}'> <?php echo $lang->actions;?></th>
<?php else:?>
<th class='w-type {sorter:false}'> <?php common::printOrderLink('type', $orderBy, $vars, $lang->typeAB);?></th>
<th class='w-user {sorter:false}'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
<th class='w-80px {sorter:false}'> <?php common::printOrderLink('lastRunner', $orderBy, $vars, $lang->testtask->lastRunAccount);?></th>
<th class='w-120px {sorter:false}'> <?php common::printOrderLink('lastRunDate', $orderBy, $vars, $lang->testtask->lastRunTime);?></th>
<th class='w-80px {sorter:false}'> <?php common::printOrderLink('lastRunResult', $orderBy, $vars, $lang->testtask->lastRunResult);?></th>
<th class='w-100px {sorter:false}'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
<th class='w-30px' title='<?php echo $lang->testcase->bugs?>'> <?php echo $lang->testcase->bugsAB;?></th>
<th class='w-30px' title='<?php echo $lang->testcase->results?>'> <?php echo $lang->testcase->resultsAB;?></th>
<th class='w-30px' title='<?php echo $lang->testcase->stepNumber?>'> <?php echo $lang->testcase->stepNumberAB;?></th>
<th class='<?php echo ($config->testcase->needReview or !empty($config->testcase->forceReview)) ? 'w-170px' : 'w-150px'?> {sorter:false}'><?php echo $lang->actions;?></th>
<?php endif;?>
</tr>
</thead>
<?php if($cases):?>
<tbody>
<?php foreach($cases as $case):?>
<tr class='text-center'>
<?php $viewLink = inlink('view', "caseID=$case->id&version=$case->version");?>
<td class='cell-id'>
<input type='checkbox' name='caseIDList[]' value='<?php echo $case->id;?>'/>
<?php echo html::a($viewLink, sprintf('%03d', $case->id));?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $case->pri, $case->pri)?>'><?php echo zget($lang->testcase->priList, $case->pri, $case->pri);?></span></td>
<td class='text-left' title="<?php echo $case->title?>">
<?php if($case->branch) echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>{$branches[$case->branch]}</span> "?>
<?php if($modulePairs and $case->module) echo "<span title='{$lang->testcase->module}' class='label label-info label-badge'>{$modulePairs[$case->module]}</span> "?>
<?php echo html::a($viewLink, $case->title, null, "style='color: $case->color'");?>
</td>
<?php if($browseType == 'needconfirm'):?>
<td class='text-left'><?php echo html::a($this->createLink('story', 'view', "storyID=$case->story"), $case->storyTitle, '_blank');?></td>
<td><?php $lang->testcase->confirmStoryChange = $lang->confirm; common::printIcon('testcase', 'confirmStoryChange', "caseID=$case->id", '', 'list', '', 'hiddenwin');?></td>
<?php else:?>
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
<td><?php echo $users[$case->openedBy];?></td>
<td><?php echo $users[$case->lastRunner];?></td>
<td><?php if(!helper::isZeroDate($case->lastRunDate)) echo date(DT_MONTHTIME1, strtotime($case->lastRunDate));?></td>
<td class='<?php echo $case->lastRunResult;?>'><?php if($case->lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?></td>
<td class='<?php if(isset($run)) echo $run->status;?> testcase-<?php echo $case->status?>'>
<?php
if($case->needconfirm)
{
echo "(<span class='warning'>{$lang->story->changed}</span> ";
echo html::a($this->createLink('testcase', 'confirmStoryChange', "caseID=$case->id"), $lang->confirm, 'hiddenwin');
echo ")";
}
else
{
echo $lang->testcase->statusList[$case->status];
}
?>
</td>
<td><?php echo (common::hasPriv('testcase', 'bugs') and $case->bugs) ? html::a(inlink('bugs', "runID=0&caseID={$case->id}"), $case->bugs, '', "class='iframe'") : $case->bugs;?></td>
<td><?php echo (common::hasPriv('testtask', 'results') and $case->results) ? html::a($this->createLink('testtask', 'results', "runID=0&caseID={$case->id}"), $case->results, '', "class='iframe'") : $case->results;?></td>
<td><?php echo $case->stepNumber;?></td>
<td class='text-right'>
<?php
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $case, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $case, 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'");
if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe');
common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list');
common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'list', 'copy');
if(common::hasPriv('testcase', 'delete', $case))
{
$deleteURL = $this->createLink('testcase', 'delete', "caseID=$case->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"caseList\",confirmDelete)", '<i class="icon-remove"></i>', '', "title='{$lang->testcase->delete}' class='btn-icon'");
}
common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=", $case, 'list', 'bug', '', 'iframe',false,"data-width='95%'");
?>
</td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
<?php endif;?>
@@ -1,29 +0,0 @@
<?php
/**
* The datatable data view file of testcase 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 testcase
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/datatable.html.php';
$setting = $this->datatable->getSetting('testcase');
$widths = $this->datatable->setFixedFieldWidth($setting);
extract($widths);
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='caseList' data-checkable='true' data-fixed-left-width='<?php echo $leftWidth?>' data-fixed-right-width='<?php echo $rightWidth?>' data-custom-menu='true' data-checkbox-name='caseIDList[]'>
<thead>
<tr><?php foreach($setting as $key => $value) $this->datatable->printHead($value, $orderBy, $vars);?></tr>
</thead>
<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);?>
</tr>
<?php endforeach;?>
</tbody>
+1 -1
View File
@@ -15,4 +15,4 @@ $config->testtask->editor->block = array('id' => 'comment', 'tools' => 'simple
$config->testtask->editor->activate= array('id' => 'comment', 'tools' => 'simpleTools');
$config->testtask->datatable = new stdclass();
$config->testtask->datatable->defaultField = array('id', 'pri', 'title', 'type', 'assignedTo', 'lastRunner', 'lastRunDate', 'lastRunResult', 'status', 'bugs', 'results', 'actions');
$config->testtask->datatable->defaultField = array('id', 'pri', 'title', 'type', 'assignedTo', 'lastRunner', 'lastRunDate', 'lastRunResult', 'status', 'bugs', 'results', 'stepNumber','actions');
+33 -3
View File
@@ -37,17 +37,47 @@ var moduleID = '<?php echo $moduleID;?>';
$vars = "taskID=$task->id&browseType=$browseType&param=$param&orderBy=%s&recToal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$file2Include = $useDatatable ? dirname(__FILE__) . '/datatabledata.html.php' : dirname(__FILE__) . '/casesdata.html.php';
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
$canBatchAssign = common::hasPriv('testtask', 'batchAssign');
$canBatchRun = common::hasPriv('testtask', 'batchRun');
$hasCheckbox = ($canBatchEdit or $canBatchAssign or $canBatchRun);
include $file2Include;
if($useDatatable) include '../../common/view/datatable.html.php';
if(!$useDatatable) include '../../common/view/tablesorter.html.php';
$this->config->testcase->datatable->defaultField = $this->config->testtask->datatable->defaultField;
$this->config->testcase->datatable->fieldList['actions']['width'] = '100';
$setting = $this->datatable->getSetting('testtask');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='caseList' data-checkable='<?php echo $hasCheckbox?>' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='caseIDList[]'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns ++;
}
}
?>
</tr>
</thead>
<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);?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='13'>
<td colspan='<?php echo $columns?>'>
<?php if($runs):?>
<div class='table-actions clearfix'>
<?php if($hasCheckbox) echo html::selectButton();?>
-79
View File
@@ -1,79 +0,0 @@
<?php
/**
* The cases data view file of testtask 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 testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/tablesorter.html.php';?>
<?php $vars = "taskID=$task->id&browseType=$browseType&param=$param&orderBy=%s&recToal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed table-selectable' id='caseList'>
<thead>
<tr class='colhead'>
<th class='w-id {sorter: false}'><nobr><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></nobr></th>
<th class='w-pri {sorter: false}'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th class='{sorter: false}'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->testcase->title);?></th>
<th class='w-type {sorter: false}'> <?php common::printOrderLink('type', $orderBy, $vars, $lang->testcase->type);?></th>
<th class='w-user {sorter: false}'> <?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->testtask->assignedTo);?></th>
<th class='w-user {sorter: false}'> <?php common::printOrderLink('lastRunner', $orderBy, $vars, $lang->testtask->lastRunAccount);?></th>
<th class='w-100px {sorter: false}'> <?php common::printOrderLink('lastRunDate', $orderBy, $vars, $lang->testtask->lastRunTime);?></th>
<th class='w-80px {sorter: false}'> <?php common::printOrderLink('lastRunResult', $orderBy, $vars, $lang->testtask->lastRunResult);?></th>
<th class='w-status {sorter: false}'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
<th class='w-30px' title='<?php echo $lang->testcase->bugs?>'> <?php echo $lang->testcase->bugsAB;?></th>
<th class='w-30px' title='<?php echo $lang->testcase->results?>'> <?php echo $lang->testcase->resultsAB;?></th>
<th class='w-30px' title='<?php echo $lang->testcase->stepNumber?>'> <?php echo $lang->testcase->stepNumberAB;?></th>
<th class='w-120px {sorter: false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<?php
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
$canBatchAssign = common::hasPriv('testtask', 'batchAssign');
$canBatchRun = common::hasPriv('testtask', 'batchRun');
?>
<?php if($runs):?>
<tbody>
<?php foreach($runs as $run):?>
<tr class='text-center'>
<td class='cell-id'>
<?php if($canBatchEdit or $canBatchAssign or $canBatchRun):?>
<input type='checkbox' name='caseIDList[]' value='<?php echo $run->case;?>'/>
<?php endif;?>
<?php printf('%03d', $run->case);?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $run->pri, $run->pri)?>'><?php echo zget($lang->testcase->priList, $run->pri, $run->pri)?></span></td>
<td class='text-left nobr'>
<?php if($run->branch) echo "<span class='label label-info label-badge'>{$branches[$run->branch]}</span>"?>
<?php echo html::a($this->createLink('testcase', 'view', "caseID=$run->case&version=$run->version&from=testtask&taskID=$run->task"), $run->title);?>
</td>
<td><?php echo $lang->testcase->typeList[$run->type];?></td>
<td><?php $assignedTo = $users[$run->assignedTo]; echo substr($assignedTo, strpos($assignedTo, ':') + 1);?></td>
<td><?php $lastRunner = $users[$run->lastRunner]; echo substr($lastRunner, strpos($lastRunner, ':') + 1);?></td>
<td><?php if(!helper::isZeroDate($run->lastRunDate)) echo date(DT_MONTHTIME1, strtotime($run->lastRunDate));?></td>
<td class='<?php echo $run->lastRunResult;?>'><?php if($run->lastRunResult) echo $lang->testcase->resultList[$run->lastRunResult];?></td>
<td class='<?php echo $run->status;?>'><?php echo ($run->version < $run->caseVersion) ? "<span class='warning'>{$lang->testcase->changed}</span>" : $lang->testtask->statusList[$run->status];?></td>
<td><?php echo (common::hasPriv('testcase', 'bugs') and $run->bugs) ? html::a($this->createLink('testcase', 'bugs', "runID={$run->id}&caseID={$run->case}"), $run->bugs, '', "class='iframe'") : $run->bugs;?></td>
<td><?php echo (common::hasPriv('testtask', 'results') and $run->results) ? html::a($this->createLink('testtask', 'results', "runID={$run->id}&caseID={$run->case}"), $run->results, '', "class='iframe'") : $run->results;?></td>
<td><?php echo $run->stepNumber;?></td>
<td class='text-center'>
<?php
common::printIcon('testtask', 'runCase', "id=$run->id", $run, 'list', '', '', 'runCase iframe', false, "data-width='95%'");
common::printIcon('testtask', 'results', "id=$run->id", $run, 'list', '', '', 'iframe', '', "data-width='90%'");
if(common::hasPriv('testtask', 'unlinkCase', $run))
{
$unlinkURL = $this->createLink('testtask', 'unlinkCase', "caseID=$run->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"caseList\",confirmUnlink)", '<i class="icon-unlink"></i>', '', "title='{$lang->testtask->unlinkCase}' class='btn-icon'");
}
common::printIcon('testcase', 'createBug', "product=$productID&branch=$task->branch&extra=projectID=$task->project,buildID=$task->build,caseID=$run->case,version=$run->version,runID=$run->id,testtask=$taskID", $run, 'list', 'bug', '', 'iframe', '', "data-width='90%'");
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<?php endif;?>
@@ -1,36 +0,0 @@
<?php
/**
* The datatable data view file of testtask 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 testtask
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/datatable.html.php';
$this->config->testcase->datatable->defaultField = $this->config->testtask->datatable->defaultField;
$this->config->testcase->datatable->fieldList['assignedTo']['title'] = 'assignedTo';
$this->config->testcase->datatable->fieldList['assignedTo']['fixed'] = 'no';
$this->config->testcase->datatable->fieldList['assignedTo']['width'] = '80';
$this->config->testcase->datatable->fieldList['assignedTo']['required'] = 'no';
$this->config->testcase->datatable->fieldList['actions']['width'] = '100';
$setting = $this->datatable->getSetting('testtask');
$widths = $this->datatable->setFixedFieldWidth($setting);
extract($widths);
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed datatable' id='caseList' data-checkable='<?php echo $hasCheckbox?>' data-fixed-left-width='<?php echo $leftWidth?>' data-fixed-right-width='<?php echo $rightWidth?>' data-custom-menu='true' data-checkbox-name='caseIDList[]'>
<thead>
<tr><?php foreach($setting as $key => $value) $this->datatable->printHead($value, $orderBy, $vars);?></tr>
</thead>
<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);?>
</tr>
<?php endforeach;?>
</tbody>