+ add search feature to bug module.
This commit is contained in:
13
trunk/module/bug/config.php
Normal file
13
trunk/module/bug/config.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
global $lang;
|
||||
$config->bug->search['module'] = 'bug';
|
||||
$config->bug->search['fields']['id'] = $lang->bug->id;
|
||||
$config->bug->search['fields']['title'] = $lang->bug->title;
|
||||
$config->bug->search['fields']['status'] = $lang->bug->status;
|
||||
$config->bug->search['fields']['openedBy'] = $lang->bug->openedBy;
|
||||
$config->bug->search['fields']['resolution'] = $lang->bug->resolution;
|
||||
$config->bug->search['groupItems'] = 3;
|
||||
$config->bug->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
|
||||
$config->bug->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->statusList);
|
||||
$config->bug->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
|
||||
$config->bug->search['params']['resolution'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->resolutionList);
|
||||
@@ -49,6 +49,9 @@ class bug extends control
|
||||
/* 浏览一个产品下面的bug。*/
|
||||
public function browse($productID = 0, $type = 'byModule', $param = 0, $orderBy = 'id|desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->config->bug->search['actionURL'] = $this->createLink('bug', 'browse', "productID=$productID&type=byQuery");
|
||||
$this->assign('searchForm', $this->fetch('search', 'buildForm', $this->config->bug->search));
|
||||
|
||||
$type = strtolower($type);
|
||||
$this->session->set('bugList', $this->app->getURI(true));
|
||||
|
||||
@@ -97,6 +100,11 @@ class bug extends control
|
||||
{
|
||||
$bugs = $this->dao->findByResolution('postponed')->from(TABLE_BUG)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
elseif($type == 'byquery')
|
||||
{
|
||||
if($this->session->bugQuery == false) $this->session->set('bugQuery', ' 1 = 1');
|
||||
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where($this->session->bugQuery)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
|
||||
$users = $this->user->getPairs($this->app->company->id, 'noletter');
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ function selectProduct(productID)
|
||||
</div>
|
||||
<div class="yui-main">
|
||||
<div class="yui-b">
|
||||
<div><?php echo $searchForm;?></div>
|
||||
<div id='tabbar' class='yui-d0' style='clear:right'>
|
||||
<ul>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user