Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
wangyidong
2017-03-22 11:31:42 +08:00
4 changed files with 29 additions and 11 deletions
+14 -4
View File
@@ -260,12 +260,20 @@ class bugModel extends model
public function checkDelayBugs($bugs)
{
foreach ($bugs as $bug)
{
{
// Delayed or not?.
if($bug->status == 'active' && $bug->deadline != '0000-00-00')
if($bug->deadline != '0000-00-00')
{
$delay = helper::diffDate(helper::today(), $bug->deadline);
if($delay > 0) $bug->delay = $delay;
if(substr($bug->resolvedDate, 0, 10) != '0000-00-00')
{
$delay = helper::diffDate(substr($bug->resolvedDate, 0, 10), $bug->deadline);
}
elseif($bug->status == 'active')
{
$delay = helper::diffDate(helper::today(), $bug->deadline);
}
if(isset($delay) and $delay > 0) $bug->delay = $delay;
}
}
@@ -2229,6 +2237,7 @@ class bugModel extends model
if($id == 'status') $class .= ' bug-' . $bug->status;
if($id == 'title') $class .= ' text-left';
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)
@@ -2282,6 +2291,7 @@ class bugModel extends model
break;
case 'deadline':
echo $bug->deadline;
break;
case 'resolvedBy':
echo zget($users, $bug->resolvedBy, $bug->resolvedBy);
break;
+4 -4
View File
@@ -176,6 +176,10 @@
<th><?php echo $lang->bug->lblAssignedTo;?></th>
<td><?php if($bug->assignedTo) echo $users[$bug->assignedTo] . $lang->at . $bug->assignedDate;?></td>
</tr>
<tr>
<th><?php echo $lang->bug->deadline;?></th>
<td><?php if($bug->deadline) echo $bug->deadline;?></td>
</tr>
<tr>
<th><?php echo $lang->bug->os;?></th>
<td><?php echo $lang->bug->osList[$bug->os];?></td>
@@ -250,10 +254,6 @@
?>
</td>
</tr>
<tr>
<th><?php echo $lang->bug->deadline;?></th>
<td><?php if($bug->deadline) echo $bug->deadline;?></td>
</tr>
<tr>
<th><?php echo $lang->bug->lblResolved;?></th>
<td><?php if($bug->resolvedBy) echo $users[$bug->resolvedBy] . $lang->at . $bug->resolvedDate;?></td>
+1 -1
View File
@@ -654,7 +654,7 @@ class testtask extends control
{
if(!empty($_POST))
{
$this->testtask->linkCase($taskID);
$this->testtask->linkCase($taskID, $type);
$this->locate(inlink('cases', "taskID=$taskID"));
}
+10 -2
View File
@@ -584,11 +584,12 @@ class testtaskModel extends model
/**
* Link cases.
*
* @param int $taskID
* @param int $taskID
* @param string $type
* @access public
* @return void
*/
public function linkCase($taskID)
public function linkCase($taskID, $type)
{
if($this->post->cases == false) return;
$postData = fixer::input('post')->get();
@@ -600,6 +601,13 @@ class testtaskModel extends model
$row->version = $postData->versions[$caseID];
$row->assignedTo = '';
$row->status = 'wait';
if($type == 'bybuild')
{
$assignedTo = $this->dao->select('assignedTo')->from(TABLE_TESTRUN)->where('`case`')->eq($caseID)->fetch();
$row->assignedTo = $assignedTo->assignedTo;
}
$this->dao->replace(TABLE_TESTRUN)->data($row)->exec();
}
}