Files
EasySoft-ZenTaoPMS/trunk/module/bug/view/browse.html.php
2009-12-18 02:24:28 +00:00

119 lines
5.8 KiB
PHP

<?php
/**
* The browse view file of bug module of ZenTaoMS.
*
* ZenTaoMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZenTaoMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright: 2009 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package bug
* @version $Id$
* @link http://www.zentao.cn
*/
?>
<?php include '../../common/header.html.php';?>
<?php include '../../common/treeview.html.php';?>
<script language='Javascript'>
/* 切换浏览方式。*/
function browseByModule(active)
{
$('#mainbox').addClass('yui-t7');
$('#treebox').removeClass('hidden');
$('#bymoduletab').addClass('active');
$('#querybox').addClass('hidden');
$('#' + active + 'tab').removeClass('active');
}
function search(active)
{
$('#mainbox').removeClass('yui-t7');
$('#treebox').addClass('hidden');
$('#querybox').removeClass('hidden');
$('#byquerytab').addClass('active');
$('#' + active + 'tab').removeClass('active');
}
</script>
<div class='yui-d0'>
<div id='featurebar'>
<div class='f-left'>
<?php
echo "<span id='bymoduletab' onclick=\"browseByModule('$type')\">" . $lang->bug->moduleBugs . "</span> ";
echo "<span id='assigntometab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=assignToMe&param=0"), $lang->bug->assignToMe) . "</span>";
echo "<span id='openedbymetab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=openedByMe&param=0"), $lang->bug->openedByMe) . "</span>";
echo "<span id='resolvedbymetab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=resolvedByMe&param=0"), $lang->bug->resolvedByMe) . "</span>";
echo "<span id='assigntonulltab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=assignToNull&param=0"), $lang->bug->assignToNull) . "</span>";
echo "<span id='longlifebugstab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=longLifeBugs&param=0"), $lang->bug->longLifeBugs) . "</span>";
echo "<span id='postponedbugstab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=postponedBugs&param=0"), $lang->bug->postponedBugs) . "</span>";
echo "<span id='byquerytab' onclick=\"search('$type')\">{$lang->bug->byQuery}</span> ";
echo "<span id='alltab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=all&param=0"), $lang->bug->allBugs) . "</span>";
?>
</div>
<div class='f-right'>
<?php common::printLink('bug', 'create', "productID=$productID&moduleID=$moduleID", $lang->bug->create); ?>
</div>
</div>
<div id='querybox' class='<?php if($type !='byquery') echo 'hidden';?>'><?php echo $searchForm;?></div>
</div>
<div class='yui-d0 <?php if($type == 'bymodule') echo 'yui-t7';?>' id='mainbox'>
<div class='yui-b <?php if($type != 'bymodule') echo 'hidden';?>' id='treebox'>
<div class='box-title'><?php echo $productName;?></div>
<div class='box-content'>
<?php echo $moduleTree;?>
<div class='a-right'>
<?php if(common::hasPriv('tree', 'browse')) echo html::a($this->createLink('tree', 'browse', "productID=$productID&view=bug"), $lang->tree->manage);?>
</div>
</div>
</div>
<div class="yui-main">
<div class="yui-b">
<?php $vars = "productID=$productID&type=$type&param=$param&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage"; ?>
<table class='table-1 fixed'>
<thead>
<tr class='colhead'>
<th><?php common::printOrderLink('id', $orderBy, $vars, $lang->bug->id);?></th>
<th><?php common::printOrderLink('severity', $orderBy, $vars, $lang->bug->severity);?></th>
<th class='w-p50'><?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
<th><?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->bug->openedBy);?></th>
<th><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->bug->assignedTo);?></th>
<th><?php common::printOrderLink('resolvedBy', $orderBy, $vars, $lang->bug->resolvedBy);?></th>
<th><?php common::printOrderLink('resolution', $orderBy, $vars, $lang->bug->resolution);?></th>
</tr>
</thead>
<tbody>
<?php foreach($bugs as $bug):?>
<tr class='a-center'>
<td><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?></td>
<td><?php echo $bug->severity?></td>
<td class='a-left nobr'><?php echo $bug->title;?></td>
<td><?php echo $users[$bug->openedBy];?></td>
<td <?php if($bug->assignedTo == $this->app->user->account) echo 'style=color:red';?>><?php echo $users[$bug->assignedTo];?></td>
<td><?php echo $users[$bug->resolvedBy];?></td>
<td><?php echo $lang->bug->resolutionList[$bug->resolution];?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<div class='a-right'><?php echo $pager;?></div>
</div>
</div>
</div>
<script language='javascript'>
$("#<?php echo $type;?>tab").addClass('active');
$("#module<?php echo $moduleID;?>").addClass('active');
</script>
<?php include '../../common/footer.html.php';?>