* adjust checkDelayBugs method.

This commit is contained in:
chenfeiCF
2017-03-22 10:15:41 +08:00
parent 6e5dbf8d84
commit 224923e822
2 changed files with 18 additions and 8 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>