Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
sgm0422
2017-10-24 09:06:13 +08:00
26 changed files with 230 additions and 161 deletions
+19 -2
View File
@@ -36,6 +36,23 @@ ALTER TABLE `zt_team` ADD `left` DECIMAL(12,2) UNSIGNED NOT NULL DEFAULT '0'
ALTER TABLE `zt_team` ADD `order` TINYINT(3) NOT NULL DEFAULT '0' AFTER `left`;
ALTER TABLE `zt_team` CHANGE `days` `days` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `zt_team` DROP PRIMARY KEY;
ALTER TABLE `zt_team` ADD PRIMARY KEY (`project`, `task`, `account`);
ALTER TABLE `zt_team` ADD PRIMARY KEY (`project`, `task`, `account`);
ALTER TABLE `zt_user` ADD `score` DECIMAL(12,1) NOT NULL DEFAULT '0' AFTER `deleted`;
ALTER TABLE `zt_user` ADD `score_level` DECIMAL(12,1) NOT NULL DEFAULT '0' AFTER `score`;
CREATE TABLE `zt_score` (
`id` bigint(12) unsigned NOT NULL AUTO_INCREMENT,
`userID` int(11) NOT NULL DEFAULT '0',
`account` varchar(30) NOT NULL,
`model` varchar(30) NOT NULL,
`method` varchar(30) NOT NULL,
`score` decimal(12,1) NOT NULL DEFAULT '0.0',
`type` enum('repeat','one') NOT NULL DEFAULT 'repeat',
`time` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `account` (`account`),
KEY `model` (`model`),
KEY `method` (`method`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+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];
+2 -2
View File
@@ -175,7 +175,7 @@ js::set('branch', $branch);
$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[]'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed <?php echo $useDatatable ? '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
@@ -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>
+2 -2
View File
@@ -112,7 +112,7 @@
$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[]'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed <?php echo $useDatatable ? '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
@@ -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>
+4 -1
View File
@@ -24,4 +24,7 @@
.pl-5px{padding-left:5px;}
tbody > tr > td > .btn-icon {margin-right: 2px}
.table-children td{background-color:#fff0f5!important;}
.table-children{border-left:2px solid #ccc;border-right:2px solid #ccc;}
.table-children.table-child-top{border-top:2px solid #ccc;}
.table-children.table-child-bottom{border-bottom:2px solid #ccc;}
.table-children td{background-color:#fff!important;}
@@ -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>
+13 -8
View File
@@ -52,7 +52,7 @@ js::set('browseType', $browseType);
$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[]'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed <?php echo $useDatatable ? '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)
@@ -68,15 +68,20 @@ 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
if(!empty($task->children))
{
$childrenNum = count($task->children);
foreach($task->children as $key=>$child)
{
?>
<tr class='text-center table-children<?php if($key==0) echo ' table-child-top';?><?php if(($key+1) == $childrenNum) echo ' table-child-bottom';?> 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, $useDatatable ? 'datatable' : 'table', true);?>
</tr>
<?php endforeach;?>
<?php endif;?>
<?php }?>
<?php }?>
<?php endforeach;?>
</tbody>
<tfoot>
+8 -2
View File
@@ -16,9 +16,15 @@ class score extends control
* @access public
* @return mixed
*/
public function browse()
public function browse($recTotal = 0, $recPerPage = 100)
{
$this->view->title = $this->lang->score->common;
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage);
$scores = $this->score->getScores($pager);
$this->view->title = $this->lang->score->common;
$this->view->pager = $pager;
$this->view->scores = $scores;
$this->display();
}
}
+13 -1
View File
@@ -2,4 +2,16 @@
$lang->score->common = '积分';
$lang->score->record = '积分记录';
$lang->score->reset = '重置积分';
$lang->score->reset = '重置积分';
$lang->score->id = '编号';
$lang->score->userID = '用户ID';
$lang->score->account = '用户';
$lang->score->model = '模块';
$lang->score->method = '方式';
$lang->score->type = '类型';
$lang->score->score = '分值';
$lang->score->time = '时间';
$lang->score->methods['login'] = '登录';
$lang->score->methods['admin'] = '';
$lang->score->methods['tutorial'] = '新手教程';
+4
View File
@@ -10,5 +10,9 @@
*/
class scoreModel extends model
{
public function getScores($pager)
{
}
}
+10 -40
View File
@@ -18,57 +18,27 @@
</div>
</div>
<table class='table tablesorter'>
<?php $vars = "type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<thead>
<tr class='colhead'>
<th class='w-90px'><?php common::printOrderLink('objectType', $orderBy, $vars, $lang->action->objectType);?></th>
<th class='w-id'> <?php common::printOrderLink('objectID', $orderBy, $vars, $lang->idAB);?></th>
<th><?php echo $lang->action->objectName;?></th>
<th class='w-100px'><?php common::printOrderLink('actor', $orderBy, $vars, $lang->action->actor);?></th>
<th class='w-150px'><?php common::printOrderLink('date', $orderBy, $vars, $lang->action->date);?></th>
<th class='w-100px'><?php echo $lang->actions;?></th>
<th><?php echo $lang->score->id;?></th>
<th><?php echo $lang->score->account;?></th>
<th><?php echo $lang->score->model;?></th>
<th><?php echo $lang->score->method;?></th>
<th><?php echo $lang->score->type;?></th>
<th><?php echo $lang->score->score;?></th>
<th><?php echo $lang->score->time;?></th>
</tr>
</thead>
<tbody>
<?php foreach($trashes as $action):?>
<?php $module = $action->objectType == 'case' ? 'testcase' : $action->objectType;?>
<?php if(!empty($scores))foreach($scores as $score):?>
<tr class='text-center'>
<td><?php echo zget($lang->action->objectTypes, $action->objectType, '');?></td>
<td><?php echo $action->objectID;?></td>
<td class='text-left'>
<?php
$methodName = $module == 'caselib' ? 'libview' : 'view';
$params = $action->objectType == 'user' ? "account={$action->objectName}" : "id={$action->objectID}";
if($module == 'doclib')
{
echo $action->objectName;
}
else
{
echo html::a($this->createLink($module, $methodName, $params), $action->objectName);
}
?>
</td>
<td><?php echo $users[$action->actor];?></td>
<td><?php echo $action->date;?></td>
<td>
<?php
common::printLink('action', 'undelete', "actionid=$action->id", $lang->action->undelete, 'hiddenwin');
if($type == 'all') common::printLink('action', 'hideOne', "actionid=$action->id", $lang->action->hideOne, 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='6'>
<?php if($trashes and $type == 'all'):?>
<div class='table-actions clearfix'>
<?php echo html::linkButton($lang->action->hideAll, inlink('hideAll'), 'hiddenwin');?>
<div class='text'><?php echo $lang->action->trashTips;?></div>
</div>
<?php endif;?>
<td colspan='7'>
<?php $pager->show();?>
</td>
</tr>
+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;
+2 -1
View File
@@ -233,7 +233,8 @@ class task extends control
*/
public function commonAction($taskID)
{
$this->view->task = $this->loadModel('task')->getByID($taskID);
$task=$this->loadModel('task')->getByID($taskID);
$this->view->task = $task;
$this->view->project = $this->project->getById($this->view->task->project);
$this->view->members = $this->project->getTeamMemberPairs($this->view->project->id ,'nodeleted');
$this->view->actions = $this->loadModel('action')->getList('task', $taskID);
+1
View File
@@ -14,3 +14,4 @@
#taskPlanCol, #mailCol {width: 50%}
#planAndMailCell.has-mail-col #taskPlanCol {padding-right: 5px;}
#planAndMailCell.has-mail-col #taskPlanCol + #mailCol {padding-left: 5px;}
.input-group-addon input[type='checkBox']{}
+8
View File
@@ -153,3 +153,11 @@ $(function()
if(storyID != 0) setStoryRelated(0);
})
// if(projectType == 'ops')
// {
// $("#tableBody th").eq(2).addClass('hidden');
// $("#tableBody tr").each(function() {
// $(this).find('td').eq(2).addClass('hidden');
// });
// }
+8 -2
View File
@@ -20,11 +20,16 @@ function copyStoryTitle()
/* Set the assignedTos field. */
function setOwners(result)
{
$("#multipleBox").removeAttr("checked");
$('.team-group').addClass('hidden');
$('#assignedTo, #assignedTo_chosen').removeClass('hidden');
if(result == 'affair')
{
$('#assignedTo').attr('multiple', 'multiple');
$('#assignedTo').chosen('destroy');
$('#assignedTo').chosen(defaultChosenOptions);
$('.affair').hide();
$('.team-group').addClass('hidden');
$('#selectAllUser').removeClass('hidden');
}
else if($('#assignedTo').attr('multiple') == 'multiple')
@@ -32,6 +37,7 @@ function setOwners(result)
$('#assignedTo').removeAttr('multiple');
$('#assignedTo').chosen('destroy');
$('#assignedTo').chosen(defaultChosenOptions);
$('.affair').show();
$('#selectAllUser').addClass('hidden');
}
}
@@ -219,8 +225,8 @@ $('[name^=multiple]').change(function()
$('#estimate').attr('readonly', false);
}
});
$(".btn[data-toggle='modalTeam']").click(function()
$(".team-group[data-toggle='modalTeam']").css('cursor', 'pointer');
$(".team-group[data-toggle='modalTeam']").click(function()
{
$('#modalTeam').modal('show');
adjustSortBtn();
-1
View File
@@ -103,7 +103,6 @@ $lang->task->transmitTo = '转交给';
$lang->task->children = '子任务';
$lang->task->childrenAB = '子';
$lang->task->parent = '父任务';
$lang->task->unfinished = '未完成';
$lang->task->lblPri = 'P';
$lang->task->lblHour = '(h)';
+86 -14
View File
@@ -74,10 +74,11 @@ class taskModel extends model
if(!empty($teams))
{
$firstMember = reset($teams);
$task->assignedTo = $firstMember->account;
$task->estimate = $estimate;
$task->left = $left;
$firstMember = reset($teams);
$task->assignedTo = $firstMember->account;
$task->assignedDate = helper::today();
$task->estimate = $estimate;
$task->left = $left;
}
}
@@ -248,10 +249,10 @@ class taskModel extends model
*
* @param $taskID
*
* @access public
* @access private
* @return void
*/
public function countTime($taskID)
private function countTime($taskID)
{
if(!$taskID) return true;
@@ -277,6 +278,29 @@ class taskModel extends model
$this->dao->update(TABLE_TASK)->data($newTask)->autoCheck()->where('id')->eq($taskID)->exec();
}
/**
* Check that all child status
*
* @param $parentID
* @param $status
*
* @access private
* @return bool
*/
private function parentStatus($parentID, $status = 'done')
{
if(!$parentID) return true;
$data = new stdClass();
$children = $this->dao->select('id,status')->from(TABLE_TASK)->where('parent')->eq($parentID)->fetchPairs('id', 'status');
$values = array_values(array_unique($children));
if((count($values) == 1 && $values[0] == $status) || (count($values) == 2 && in_array('closed', $values) && $status == 'done'))
{
$data->status = $status;
$this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('id')->eq($parentID)->exec();
}
}
/**
* Update a task.
*
@@ -689,6 +713,23 @@ class taskModel extends model
->check('consumed,left', 'float')
->where('id')->eq((int)$taskID)->exec();
if($oldTask->parent)
{
switch($task->status)
{
case 'doing':
$status = new stdClass();
$status->status = 'doing';
$this->dao->update(TABLE_TASK)->data($status)->autoCheck()->where('id')->eq((int)$oldTask->parent)->exec();
break;
case 'done':
$this->parentStatus($oldTask->parent,'done');
break;
}
}
$this->countTime($oldTask->parent);
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
if(!dao::isError()) return common::createChanges($oldTask, $task);
}
@@ -801,6 +842,7 @@ class taskModel extends model
if(!empty($actionID)) $this->action->logHistory($actionID, $changes);
if($task->story) $this->loadModel('story')->setStage($task->story);
if($task->status == 'done') $this->parentStatus($task->parent, 'done');
$this->countTime($task->parent);
return $changes;
@@ -848,6 +890,9 @@ class taskModel extends model
->check('consumed', 'notempty')
->where('id')->eq((int)$taskID)->exec();
if($task->status == 'done') $this->parentStatus($oldTask->parent, 'done');
$this->countTime($oldTask->parent);
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
if(!dao::isError()) return common::createChanges($oldTask, $task);
}
@@ -897,6 +942,12 @@ class taskModel extends model
->remove('comment')->get();
$this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec();
$this->parentStatus($oldTask->parent,'closed');
$this->countTime($oldTask->parent);
$data = new stdClass();
$data->status = 'closed';
$this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('parent')->eq($taskID)->exec();
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
if(!dao::isError()) return common::createChanges($oldTask, $task);
@@ -953,6 +1004,13 @@ class taskModel extends model
->check('left', 'notempty')
->where('id')->eq((int)$taskID)->exec();
$this->countTime($oldTask->parent);
$data = new stdClass();
$data->status = 'doing';
$this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('parent')->eq($taskID)->exec();
if($oldTask->parent) $this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('id')->eq((int)$oldTask->parent)->exec();
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
if(!dao::isError()) return common::createChanges($oldTask, $task);
@@ -1755,6 +1813,9 @@ class taskModel extends model
if($action == 'start' and !empty($task->children)) return false;
if($action == 'recordestimate' and !empty($task->children)) return false;
if($action == 'finish' and !empty($task->children)) return false;
if($action == 'cancel' and !empty($task->children)) return false;
if($action == 'pause' and !empty($task->children)) return false;
if($action == 'batchcreate' and !empty($task->team)) return false;
if($action == 'batchcreate' and $task->parent) return false;
@@ -1803,15 +1864,21 @@ class taskModel extends model
/**
* Print cell data.
*
* @param object $col
* @param object $task
* @param array $users
* @param string $browseType
* @param $col
* @param $task
* @param $users
* @param $browseType
* @param $branchGroups
* @param array $modulePairs
* @param string $mode
* @param bool $child
*
* @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', $child = false)
{
$canView = common::hasPriv('task', 'view');
$taskLink = helper::createLink('task', 'view', "taskID=$task->id");
$account = $this->app->user->account;
$id = $col->id;
@@ -1819,15 +1886,18 @@ 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' && $child == false) echo "<input type='checkbox' name='taskIDList[{$task->id}]' value='{$task->id}'/> ";
if($child) echo '&nbsp;&nbsp;&nbsp;&nbsp;';
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) . "'>";
@@ -1837,7 +1907,9 @@ 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'");
if($child) echo '<span class="label">'.$this->lang->task->childrenAB.'</span> ';
if(!empty($task->team)) echo '<span class="label">'.$this->lang->task->multipleAB.'</span> ';
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;
+6 -4
View File
@@ -34,12 +34,12 @@ $hiddenStory = ((isonlybody() and $storyID) || $this->config->global->flow == 'o
if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
?>
<form class='form-condensed' method='post' target='hiddenwin'>
<table class='table table-form table-fixed with-border'>
<table class='table table-form table-fixed with-border' id="tableBody">
<thead>
<tr class='text-center'>
<th class='w-30px'><?php echo $lang->idAB;?></th>
<th class='w-150px<?php echo zget($visibleFields, 'module', ' hidden')?>'><?php echo $lang->task->module?></th>
<th class='w-200px<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>'><?php echo $lang->task->story;?></th>
<?php if($project->type != 'ops'):?><th class='w-200px<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>'><?php echo $lang->task->story;?></th><?php endif;?>
<th><?php echo $lang->task->name;?> <span class='required'></span></th>
<th class='w-80px'><?php echo $lang->typeAB;?> <span class='required'></span></th>
<th class='w-150px<?php echo zget($visibleFields, 'assignedTo', ' hidden')?>'><?php echo $lang->task->assignedTo;?></th>
@@ -56,6 +56,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
$lang->task->typeList['ditto'] = $lang->task->ditto;
$members['ditto'] = $lang->task->ditto;
$modules['ditto'] = $lang->task->ditto;
if($project->type == 'ops') $colspan = $colspan-1;
?>
<?php for($i = 0; $i < $config->task->batchCreate; $i++):?>
<?php
@@ -75,7 +76,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
<tr>
<td class='text-center'><?php echo $i+1;?><?php echo html::hidden("parent[]",$parent);?></td>
<td <?php echo zget($visibleFields, 'module', "class='hidden'")?> style='overflow:visible'><?php echo html::select("module[$i]", $modules, $module, "class='form-control chosen' onchange='setStories(this.value, $project->id, $i)'")?></td>
<td <?php echo zget($visibleFields, 'story', "class='hidden'"); echo $hiddenStory;?> style='overflow: visible'>
<?php if($project->type != 'ops'):?><td <?php echo zget($visibleFields, 'story', "class='hidden'"); echo $hiddenStory;?> style='overflow: visible'>
<div class='input-group'>
<?php echo html::select("story[$i]", $stories, $currentStory, "class='form-control chosen' onchange='setStoryRelated($i)'");?>
<span class='input-group-btn'>
@@ -83,7 +84,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
<?php echo html::hidden("storyEstimate$i") . html::hidden("storyDesc$i") . html::hidden("storyPri$i");?>
</span>
</div>
</td>
</td><?php endif;?>
<td style='overflow:visible'>
<div class='input-group'>
<?php echo html::hidden("color[$i]", '', "data-provide='colorpicker' data-wrapper='input-group-btn fix-border-right' data-pull-menu-right='false' data-btn-tip='{$lang->task->colorTag}' data-update-text='#name\\[{$i}\\]'");?>
@@ -131,6 +132,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
</tr>
</tbody>
</table>
<?php js::set('projectType', $project->type);?>
<?php js::set('storyTasks', $storyTasks);?>
<?php js::set('mainField', 'name');?>
<?php js::set('ditto', $lang->task->ditto);?>
+6 -14
View File
@@ -39,25 +39,17 @@
<tr>
<th><?php echo $lang->task->assignedTo;?></th>
<td>
<div class='row-table'>
<div class='col-table'>
<?php echo html::select('assignedTo[]', $members, $task->assignedTo, "class='form-control chosen'");?>
</div>
<div class="input-group" id="dataPlanGroup">
<?php echo html::select('assignedTo[]', $members, $task->assignedTo, "class='form-control chosen'");?>
<?php if($project->type == 'ops') :?>
<div class='col-table'>
<?php echo html::input('teamMember', '', "class='form-control team-group hidden' readonly='readonly'");?>
</div>
<div class='col-table btn team-group hidden' data-toggle='modalTeam'><?php echo $lang->task->team;?></div>
<div class='col-table btn w-70px'>
<label class='checkbox-inline'><input type='checkBox' name='multiple' value='1'/><?php echo $lang->task->multipleAB;?></label>
</div>
<?php echo html::input('teamMember', '', "class='form-control team-group fix-border hidden' readonly='readonly'");?>
<span class="input-group-addon team-group hidden" data-toggle='modalTeam'><?php echo $lang->task->team;?></span>
<label class='input-group-addon affair'><input type='checkBox' name='multiple' id="multipleBox" value='1'/><?php echo $lang->task->multipleAB;?></label>
<?php endif;?>
</div>
</td>
<td>
<?php if($project->type != 'ops') :?>
<button type='button' class='btn btn-link<?php echo $task->type == 'affair' ? '' : ' hidden'?>' id='selectAllUser'><?php echo $lang->task->selectAllUser ?></button>
<?php endif;?>
<button type='button' class='btn btn-link<?php echo $task->type == 'affair' ? '' : ' hidden'?>' id='selectAllUser'><?php echo $lang->task->selectAllUser ?></button>
</td>
</tr>
<?php if(strpos(",$showFields,", ',story,') !== false and $this->config->global->flow != 'onlyTask'):?>
+2
View File
@@ -97,10 +97,12 @@
<th><?php echo $lang->task->type;?></th>
<td><?php echo html::select('type', $lang->task->typeList, $task->type, 'class=form-control');?></td>
</tr>
<?php if(empty($task->children)):?>
<tr>
<th><?php echo $lang->task->status;?></th>
<td><?php echo html::select('status', (array)$lang->task->statusList, $task->status, 'class=form-control');?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->task->pri;?></th>
<td><?php echo html::select('pri', $lang->task->priList, $task->pri, 'class=form-control');?> </td>
+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];
+2 -2
View File
@@ -51,7 +51,7 @@ js::set('branch', $branch);
$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[]'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed <?php echo $useDatatable ? '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
@@ -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];
+2 -2
View File
@@ -53,7 +53,7 @@ var moduleID = '<?php echo $moduleID;?>';
$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[]'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed <?php echo $useDatatable ? '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
@@ -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>