* finish the task #612.
This commit is contained in:
@@ -373,39 +373,25 @@ class project extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set('importBugQuery', '');
|
||||
if($queryID)
|
||||
{
|
||||
$query = $this->loadModel('search')->getQuery($queryID);
|
||||
if($query)
|
||||
{
|
||||
$this->session->set('importBugQuery', $query->sql);
|
||||
$this->session->set('importBugForm', $query->form);
|
||||
$this->session->set('bugQuery', $query->sql);
|
||||
$this->session->set('bugForm', $query->form);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set('importBugQuery', ' 1 = 1');
|
||||
$this->session->set('bugQuery', ' 1 = 1');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->session->imporyBugQuery == false) $this->session->set('importBugQuery', ' 1 = 1');
|
||||
if($this->session->bugQuery == false) $this->session->set('bugQuery', ' 1 = 1');
|
||||
}
|
||||
$varQuery = 'AND (`toTask` = 0) AND (`toStory` = 0)';
|
||||
if(!empty($products) and strpos($this->session->importBugQuery,'`product`') === false)
|
||||
{
|
||||
$varQuery = $varQuery . ' AND (`product` ' . helper::dbIN($products) . ')';
|
||||
}
|
||||
elseif(empty($products) and strpos($this->session->importBugQuery,'`project`') === false)
|
||||
{
|
||||
$varQuery = "$varQuery AND (`project` = $projectID)";
|
||||
}
|
||||
a($this->session->importBugQuery);
|
||||
$this->session->set('importBugQuery', $this->session->importBugQuery . $varQuery);
|
||||
a($this->session->importBugQuery);
|
||||
$importBugQuery = str_replace("`product` = 'all'", helper::dbIN($products), $this->session->importBugQuery); // Search all project.
|
||||
a($importBugQuery);
|
||||
//$bugs = $this->project->getSearchBugs($bugQuery, $pager, 'id_desc');
|
||||
$bugQuery = str_replace("`product` = 'all'", helper::dbIN($products), $this->session->bugQuery); // Search all project.
|
||||
$bugs = $this->project->getSearchBugs($products, $projectID, $bugQuery, $pager, 'id_desc');
|
||||
}
|
||||
|
||||
/* Build the search form. */
|
||||
|
||||
@@ -991,4 +991,30 @@ class projectModel extends model
|
||||
->fetchAll();
|
||||
return $tasks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get bugs by search in project.
|
||||
*
|
||||
* @param int $products
|
||||
* @param int $projectID
|
||||
* @param int $sql
|
||||
* @param int $pager
|
||||
* @param int $orderBy
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getSearchBugs($products, $projectID, $sql, $pager, $orderBy)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_BUG)
|
||||
->where($sql)
|
||||
->andWhere('status')->eq('active')
|
||||
->andWhere('toTask')->eq(0)
|
||||
->andWhere('tostory')->eq(0)
|
||||
->beginIF(!empty($products))->andWhere('product')->in(array_keys($products))
|
||||
->beginIF(empty($products))->andWhere('project')->eq($projectID)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ $(function(){
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
</script>
|
||||
<div id='featurebar'>
|
||||
<?php /* echo "<span id='bysearchTab'><a href='#'>{$lang->project->byQuery}</a></span> ";*/?>
|
||||
<?php echo "<span id='bysearchTab'><a href='#'>{$lang->project->byQuery}</a></span> ";?>
|
||||
</div>
|
||||
<div id='querybox' class='<?php /*if($browseType !='bysearch')*/ echo 'hidden';?>'><?php echo $searchForm;?></div>
|
||||
<div id='querybox' class='<?php if($browseType !='bysearch') echo 'hidden';?>'><?php echo $searchForm;?></div>
|
||||
<div>
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table-1 colored tablesorter'>
|
||||
|
||||
Reference in New Issue
Block a user