+ finish task #1431.

This commit is contained in:
wangyidong
2013-06-25 01:31:43 +00:00
parent 6518a19c40
commit 5caeb06c9c
7 changed files with 200 additions and 180 deletions

View File

@@ -556,6 +556,7 @@ class bug extends control
$this->action->logHistory($actionID, $changes);
$this->sendmail($bugID, $actionID);
if(isonlybody()) die(js::closeColorbox('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -584,6 +585,7 @@ class bug extends control
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('bug', $bugID, 'bugConfirmed', $this->post->comment);
$this->sendmail($bugID, $actionID);
if(isonlybody()) die(js::closeColorbox('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -625,6 +627,7 @@ class bug extends control
$cancelURL = $this->createLink('bug', 'view', "bugID=$bugID");
die(js::confirm(sprintf($this->lang->bug->remindTask, $bug->toTask), $confirmURL, $cancelURL, 'parent', 'parent'));
}
if(isonlybody()) die(js::closeColorbox('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -660,6 +663,7 @@ class bug extends control
$files = $this->loadModel('file')->saveUpload('bug', $bugID);
$actionID = $this->action->create('bug', $bugID, 'Activated', $this->post->comment);
$this->sendmail($bugID, $actionID);
if(isonlybody()) die(js::closeColorbox('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -694,6 +698,7 @@ class bug extends control
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('bug', $bugID, 'Closed', $this->post->comment);
$this->sendmail($bugID, $actionID);
if(isonlybody()) die(js::closeColorbox('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}

View File

@@ -1,6 +1,6 @@
$(function()
{
$(function(){$('.iframe').colorbox({width:900, height:500, iframe:true, transition:'none', onCleanup:function(){parent.location.href=parent.location.href;}});})
loadColorbox('iframe', 'bugList');
if(typeof page == 'undefined') page = '';
if(page == 'create')

4
module/bug/js/view.js Normal file
View File

@@ -0,0 +1,4 @@
function loadColorbox(colorboxClass, replaceID)
{
$('.iframe').colorbox({width:900, height:500, iframe:true, transition:'none', onCleanup:function(){parent.location.href=parent.location.href;}})
}

View File

@@ -10,80 +10,10 @@
</nobr>
</td>
<td class='divider'></td>
<td>
<?php $vars = "productID=$productID&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<form method='post' action='<?php echo $this->inLink('batchEdit', "from=bugBrowse&productID=$productID&orderBy=$orderBy");?>'>
<table class='table-1 colored tablesorter datatable'>
<thead>
<tr class='colhead'>
<?php foreach($customFields as $fieldName):?>
<th><nobr><?php common::printOrderLink($fieldName, $orderBy, $vars, $lang->bug->$fieldName);?></nobr></th>
<?php endforeach;?>
<th class='w-70px {sorter:false}'><nobr><?php echo $lang->actions;?></nobr></th>
</tr>
</thead>
<tbody>
<?php foreach($bugs as $bug):?>
<?php $bugLink = inlink('view', "bugID=$bug->id");?>
<tr>
<?php $i = 0;?>
<?php foreach($customFields as $fieldName):?>
<?php $i ++;?>
<td><nobr>
<?php if($i == 1):?>
<input type='checkbox' name='bugIDList[]' value='<?php echo $bug->id;?>'/>
<?php endif;?>
<?php
if(preg_match('/^(id|title)$/i', $fieldName))
{
echo html::a($bugLink, $bug->$fieldName);
}
elseif(preg_match('/assignedTo|by/i', $fieldName))
{
echo $users[$bug->$fieldName];
}
elseif(preg_match('/^(severity|pri|resolution|os|type|browse|status|confirmed)$/i', $fieldName))
{
$key = $fieldName . 'List';
$list = $lang->bug->$key;
echo $list[$bug->$fieldName];
}
else
{
echo !($bug->$fieldName == '0') ? $bug->$fieldName : '';
}
?>
</nobr></td>
<?php endforeach;?>
<td class='a-center'><nobr>
<?php
$params = "bugID=$bug->id";
common::printIcon('bug', 'resolve', $params, '', 'list');
common::printIcon('bug', 'close', $params, '', 'list');
common::printIcon('bug', 'edit', $params, '', 'list');
?>
</nobr>
</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='<?php echo count($customFields) + 1?>'>
<?php if(!empty($bugs)):?>
<div class='f-left'>
<?php
echo html::selectAll() . html::selectReverse();
if(common::hasPriv('bug', 'batchEdit') and $bugs) echo html::submitButton($lang->edit);
?>
</div>
<?php endif?>
<div class='f-right'><?php $pager->show();?></div>
</td>
</tr>
</tfoot>
</table>
<?php include './buglist.custom.html.php'?>
</form>
<td>
</td>
</tr>
</table>

View File

@@ -11,6 +11,13 @@
*/
?>
<?php
if(isonlybody())
{
if($customed) die(include './buglist.custom.html.php');
die(include './buglist.html.php');
}
?>
<?php
include '../../common/view/header.html.php';
include '../../common/view/treeview.html.php';
include '../../common/view/colorize.html.php';
@@ -71,113 +78,7 @@ js::set('customed', $customed);
</td>
<td class='divider <?php echo $treeClass;?>'></td>
<td>
<?php $vars = "productID=$productID&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<table class='table-1 fixed colored tablesorter datatable'>
<thead>
<tr class='colhead'>
<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>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<th class='w-80px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->bug->statusAB);?></th>
<?php endif;?>
<?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>
<tbody>
<?php foreach($bugs as $bug):?>
<?php $bugLink = inlink('view', "bugID=$bug->id");?>
<tr class='a-center'>
<td class='<?php echo $bug->status;?>' style="font-weight:bold">
<input type='checkbox' name='bugIDList[]' value='<?php echo $bug->id;?>'/>
<?php echo html::a($bugLink, sprintf('%03d', $bug->id));?>
</td>
<td><span class='<?php echo 'severity' . $bug->severity;?>'><?php echo $bug->severity;?></span></td>
<td><span class='<?php echo 'pri' . $lang->bug->priList[$bug->pri];?>'><?php echo $lang->bug->priList[$bug->pri];?></span></td>
<?php $class = 'confirm' . $bug->confirmed;?>
<td class='a-left' title="<?php echo $bug->title?>"><?php echo "<span class='$class'>[{$lang->bug->confirmedList[$bug->confirmed]}] </span>" . html::a($bugLink, $bug->title);?></td>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<td><?php echo $lang->bug->statusList[$bug->status];?></td>
<?php endif;?>
<?php if($browseType == 'needconfirm'):?>
<td class='a-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 $users[$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 $users[$bug->assignedTo];?></td>
<td><?php echo $users[$bug->resolvedBy];?></td>
<td><?php echo $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='a-right'>
<?php
$params = "bugID=$bug->id";
common::printIcon('bug', 'confirmBug', $params, $bug, 'list', '', '', 'iframe', true);
common::printIcon('bug', 'assignTo', $params, '', '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&extra=bugID=$bug->id", $bug, 'list', 'copy');
?>
</td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<?php
$columns = $this->cookie->windowWidth >= $this->config->wideSize ? 12 : 9;
if($browseType == 'needconfirm') $columns = $this->cookie->windowWidth >= $this->config->wideSize ? 7 : 6;
?>
<td colspan='<?php echo $columns;?>'>
<?php if(!empty($bugs)):?>
<div class='f-left'>
<?php
echo html::selectAll() . html::selectReverse();
if(common::hasPriv('bug', 'batchEdit') and $bugs) echo html::submitButton($lang->edit);
?>
</div>
<?php endif?>
<div class='f-right'><?php $pager->show();?></div>
</td>
</tr>
</tfoot>
</table>
<?php include './buglist.html.php'?>
</td>
</tr>
</table>

View File

@@ -0,0 +1,72 @@
<?php $_GET['onlybody'] = 'no';?>
<table class='table-1 colored tablesorter datatable' id='bugList'>
<?php $vars = "productID=$productID&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<thead>
<tr class='colhead'>
<?php foreach($customFields as $fieldName):?>
<th><nobr><?php common::printOrderLink($fieldName, $orderBy, $vars, $lang->bug->$fieldName);?></nobr></th>
<?php endforeach;?>
<th class='w-70px {sorter:false}'><nobr><?php echo $lang->actions;?></nobr></th>
</tr>
</thead>
<tbody>
<?php foreach($bugs as $bug):?>
<?php $bugLink = inlink('view', "bugID=$bug->id");?>
<tr>
<?php $i = 0;?>
<?php foreach($customFields as $fieldName):?>
<?php $i ++;?>
<td><nobr>
<?php if($i == 1):?>
<input type='checkbox' name='bugIDList[]' value='<?php echo $bug->id;?>'/>
<?php endif;?>
<?php
if(preg_match('/^(id|title)$/i', $fieldName))
{
echo html::a($bugLink, $bug->$fieldName);
}
elseif(preg_match('/assignedTo|by/i', $fieldName))
{
echo $users[$bug->$fieldName];
}
elseif(preg_match('/^(severity|pri|resolution|os|type|browse|status|confirmed)$/i', $fieldName))
{
$key = $fieldName . 'List';
$list = $lang->bug->$key;
echo $list[$bug->$fieldName];
}
else
{
echo !($bug->$fieldName == '0') ? $bug->$fieldName : '';
}
?>
</nobr></td>
<?php endforeach;?>
<td class='a-center'><nobr>
<?php
$params = "bugID=$bug->id";
common::printIcon('bug', 'resolve', $params, '', 'list');
common::printIcon('bug', 'close', $params, '', 'list');
common::printIcon('bug', 'edit', $params, '', 'list');
?>
</nobr>
</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='<?php echo count($customFields) + 1?>'>
<?php if(!empty($bugs)):?>
<div class='f-left'>
<?php
echo html::selectAll() . html::selectReverse();
if(common::hasPriv('bug', 'batchEdit') and $bugs) echo html::submitButton($lang->edit);
?>
</div>
<?php endif?>
<div class='f-right'><?php $pager->show();?></div>
</td>
</tr>
</tfoot>
</table>

View File

@@ -0,0 +1,108 @@
<?php $_GET['onlybody'] = 'no';?>
<table class='table-1 fixed colored tablesorter datatable' id='bugList'>
<?php $vars = "productID=$productID&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<thead>
<tr class='colhead'>
<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>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<th class='w-80px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->bug->statusAB);?></th>
<?php endif;?>
<?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>
<tbody>
<?php foreach($bugs as $bug):?>
<?php $bugLink = inlink('view', "bugID=$bug->id");?>
<tr class='a-center'>
<td class='<?php echo $bug->status;?>' style="font-weight:bold">
<input type='checkbox' name='bugIDList[]' value='<?php echo $bug->id;?>'/>
<?php echo html::a($bugLink, sprintf('%03d', $bug->id));?>
</td>
<td><span class='<?php echo 'severity' . $bug->severity;?>'><?php echo $bug->severity;?></span></td>
<td><span class='<?php echo 'pri' . $lang->bug->priList[$bug->pri];?>'><?php echo $lang->bug->priList[$bug->pri];?></span></td>
<?php $class = 'confirm' . $bug->confirmed;?>
<td class='a-left' title="<?php echo $bug->title?>"><?php echo "<span class='$class'>[{$lang->bug->confirmedList[$bug->confirmed]}] </span>" . html::a($bugLink, $bug->title);?></td>
<?php if($this->cookie->windowWidth >= $this->config->wideSize):?>
<td><?php echo $lang->bug->statusList[$bug->status];?></td>
<?php endif;?>
<?php if($browseType == 'needconfirm'):?>
<td class='a-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 $users[$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 $users[$bug->assignedTo];?></td>
<td><?php echo $users[$bug->resolvedBy];?></td>
<td><?php echo $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='a-right'>
<?php
$params = "bugID=$bug->id";
common::printIcon('bug', 'confirmBug', $params, $bug, 'list', '', '', 'iframe', true);
common::printIcon('bug', 'assignTo', $params, '', '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&extra=bugID=$bug->id", $bug, 'list', 'copy');
?>
</td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<?php
$columns = $this->cookie->windowWidth >= $this->config->wideSize ? 12 : 9;
if($browseType == 'needconfirm') $columns = $this->cookie->windowWidth >= $this->config->wideSize ? 7 : 6;
?>
<td colspan='<?php echo $columns;?>'>
<?php if(!empty($bugs)):?>
<div class='f-left'>
<?php
echo html::selectAll() . html::selectReverse();
if(common::hasPriv('bug', 'batchEdit') and $bugs) echo html::submitButton($lang->edit);
?>
</div>
<?php endif?>
<div class='f-right'><?php $pager->show();?></div>
</td>
</tr>
</tfoot>
</table>