* finish task #2555.
This commit is contained in:
+11
-5
@@ -61,12 +61,17 @@ class bug extends control
|
||||
{
|
||||
$this->loadModel('datatable');
|
||||
|
||||
/* Set browseType, productID, moduleID, queryID and branch. */
|
||||
/* Set browse type. */
|
||||
$browseType = strtolower($browseType);
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
$branch = ($branch == '') ? $this->session->branch : $branch;
|
||||
$moduleID = ($browseType == 'bymodule') ? (int)$param : 0;
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
|
||||
if($browseType == 'bymodule') setcookie('bugModule', (int)$param, $this->config->cookieLife, $this->config->webRoot);
|
||||
if($browseType != 'bymodule') $this->session->set('bugBrowseType', $browseType);
|
||||
|
||||
/* Set productID, moduleID, queryID and branch. */
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
$branch = ($branch == '') ? $this->session->branch : $branch;
|
||||
$moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->bugModule ? $this->cookie->bugModule : 0));
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
|
||||
/* Set menu and save session. */
|
||||
$this->bug->setMenu($this->products, $productID, $branch);
|
||||
@@ -112,6 +117,7 @@ class bug extends control
|
||||
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
|
||||
$this->view->modules = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch);
|
||||
$this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'bug', $startModuleID = 0, array('treeModel', 'createBugLink'), '', $branch);
|
||||
$this->view->moduleName = $moduleID ? $this->tree->getById($moduleID)->name : $this->lang->tree->all;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->bugs = $bugs;
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#' + browseType + 'Tab').addClass('active');
|
||||
$('#' + bugBrowseType + 'Tab').addClass('active');
|
||||
$('#module' + moduleID).addClass('active');
|
||||
if(browseType == 'bysearch') ajaxGetSearchForm();
|
||||
|
||||
|
||||
+59
-35
@@ -216,25 +216,28 @@ class bugModel extends model
|
||||
*/
|
||||
public function getBugs($productID, $projects, $branch, $browseType, $moduleID, $queryID, $sort, $pager)
|
||||
{
|
||||
/* Set modules and browse type. */
|
||||
$modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : '0';
|
||||
$browseType = (($browseType == 'bymodule') and ($this->session->bugBrowseType) and ($this->session->bugBrowseType != 'bysearch')) ? $this->session->bugBrowseType : $browseType;
|
||||
|
||||
/* Get bugs by browse type. */
|
||||
if($browseType == 'all') $bugs = $this->getAllBugs($productID, $branch, $projects, $sort, $pager);
|
||||
elseif($browseType == 'bymodule') $bugs = $this->getModuleBugs($productID, $branch, $this->loadModel('tree')->getAllChildId($moduleID), $projects, $sort, $pager);
|
||||
elseif($browseType == 'assigntome') $bugs = $this->getByAssigntome($productID, $branch, $projects, $sort, $pager);
|
||||
elseif($browseType == 'openedbyme') $bugs = $this->getByOpenedbyme($productID, $branch, $projects, $sort, $pager);
|
||||
elseif($browseType == 'resolvedbyme') $bugs = $this->getByResolvedbyme($productID, $branch, $projects, $sort, $pager);
|
||||
elseif($browseType == 'assigntonull') $bugs = $this->getByAssigntonull($productID, $branch, $projects, $sort, $pager);
|
||||
elseif($browseType == 'unconfirmed') $bugs = $this->getUnconfirmed($productID, $branch, $projects, $sort, $pager);
|
||||
elseif($browseType == 'unresolved') $bugs = $this->getByStatus($productID, $branch, $projects, 'unresolved', $sort, $pager);
|
||||
elseif($browseType == 'unclosed') $bugs = $this->getByStatus($productID, $branch, $projects, 'unclosed', $sort, $pager);
|
||||
elseif($browseType == 'toclosed') $bugs = $this->getByStatus($productID, $branch, $projects, 'toclosed', $sort, $pager);
|
||||
elseif($browseType == 'longlifebugs') $bugs = $this->getByLonglifebugs($productID, $branch, $projects, $sort, $pager);
|
||||
elseif($browseType == 'postponedbugs') $bugs = $this->getByPostponedbugs($productID, $branch, $projects, $sort, $pager);
|
||||
elseif($browseType == 'needconfirm') $bugs = $this->getByNeedconfirm($productID, $branch, $projects, $sort, $pager);
|
||||
$bugs = array();
|
||||
if($browseType == 'all') $bugs = $this->getAllBugs($productID, $branch, $modules, $projects, $sort, $pager);
|
||||
elseif($browseType == 'bymodule') $bugs = $this->getModuleBugs($productID, $branch, $modules, $projects, $sort, $pager);
|
||||
elseif($browseType == 'assigntome') $bugs = $this->getByAssigntome($productID, $branch, $modules, $projects, $sort, $pager);
|
||||
elseif($browseType == 'openedbyme') $bugs = $this->getByOpenedbyme($productID, $branch, $modules, $projects, $sort, $pager);
|
||||
elseif($browseType == 'resolvedbyme') $bugs = $this->getByResolvedbyme($productID, $branch, $modules, $projects, $sort, $pager);
|
||||
elseif($browseType == 'assigntonull') $bugs = $this->getByAssigntonull($productID, $branch, $modules, $projects, $sort, $pager);
|
||||
elseif($browseType == 'unconfirmed') $bugs = $this->getUnconfirmed($productID, $branch, $modules, $projects, $sort, $pager);
|
||||
elseif($browseType == 'unresolved') $bugs = $this->getByStatus($productID, $branch, $modules, $projects, 'unresolved', $sort, $pager);
|
||||
elseif($browseType == 'unclosed') $bugs = $this->getByStatus($productID, $branch, $modules, $projects, 'unclosed', $sort, $pager);
|
||||
elseif($browseType == 'toclosed') $bugs = $this->getByStatus($productID, $branch, $modules, $projects, 'toclosed', $sort, $pager);
|
||||
elseif($browseType == 'longlifebugs') $bugs = $this->getByLonglifebugs($productID, $branch, $modules, $projects, $sort, $pager);
|
||||
elseif($browseType == 'postponedbugs') $bugs = $this->getByPostponedbugs($productID, $branch, $modules, $projects, $sort, $pager);
|
||||
elseif($browseType == 'needconfirm') $bugs = $this->getByNeedconfirm($productID, $branch, $modules, $projects, $sort, $pager);
|
||||
elseif($browseType == 'bysearch') $bugs = $this->getBySearch($productID, $queryID, $sort, $pager, $branch);
|
||||
|
||||
if($bugs) return $bugs;
|
||||
|
||||
return array();
|
||||
return $bugs;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1580,20 +1583,22 @@ class bugModel extends model
|
||||
* Get all bugs.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param array $modules
|
||||
* @param array $projects
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getAllBugs($productID, $branch, $projects, $orderBy, $pager = null)
|
||||
public function getAllBugs($productID, $branch, $modules, $projects, $orderBy, $pager = null)
|
||||
{
|
||||
$bugs = $this->dao->select('t1.*, t2.title as planTitle')->from(TABLE_BUG)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id')
|
||||
->where('t1.product')->eq($productID)
|
||||
->andWhere('t1.project')->in(array_keys($projects))
|
||||
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
|
||||
->beginIF($modules)->andWhere('t1.module')->in($modules)->fi()
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
|
||||
@@ -1606,17 +1611,19 @@ class bugModel extends model
|
||||
* Get bugs of assign to me.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param array $modules
|
||||
* @param array $projects
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByAssigntome($productID, $branch, $projects, $orderBy, $pager)
|
||||
public function getByAssigntome($productID, $branch, $modules, $projects, $orderBy, $pager)
|
||||
{
|
||||
return $this->dao->findByAssignedTo($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID)
|
||||
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
|
||||
->beginIF($modules)->andWhere('module')->in($modules)->fi()
|
||||
->andWhere('project')->in(array_keys($projects))
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
@@ -1626,17 +1633,19 @@ class bugModel extends model
|
||||
* Get bugs of opened by me.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param array $modules
|
||||
* @param array $projects
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByOpenedbyme($productID, $branch, $projects, $orderBy, $pager)
|
||||
public function getByOpenedbyme($productID, $branch, $modules, $projects, $orderBy, $pager)
|
||||
{
|
||||
return $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID)
|
||||
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
|
||||
->beginIF($modules)->andWhere('module')->in($modules)->fi()
|
||||
->andWhere('project')->in(array_keys($projects))
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
@@ -1646,17 +1655,19 @@ class bugModel extends model
|
||||
* Get bugs of resolved by me.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param array $modules
|
||||
* @param array $projects
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByResolvedbyme($productID, $branch, $projects, $orderBy, $pager)
|
||||
public function getByResolvedbyme($productID, $branch, $modules, $projects, $orderBy, $pager)
|
||||
{
|
||||
return $this->dao->findByResolvedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID)
|
||||
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
|
||||
->beginIF($modules)->andWhere('module')->in($modules)->fi()
|
||||
->andWhere('project')->in(array_keys($projects))
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
@@ -1666,18 +1677,20 @@ class bugModel extends model
|
||||
* Get bugs of nobody to do.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param array $modules
|
||||
* @param array $projects
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByAssigntonull($productID, $branch, $projects, $orderBy, $pager)
|
||||
public function getByAssigntonull($productID, $branch, $modules, $projects, $orderBy, $pager)
|
||||
{
|
||||
|
||||
return $this->dao->findByAssignedTo('')->from(TABLE_BUG)->andWhere('product')->eq($productID)
|
||||
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
|
||||
->beginIF($modules)->andWhere('module')->in($modules)->fi()
|
||||
->andWhere('project')->in(array_keys($projects))
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
@@ -1687,17 +1700,20 @@ class bugModel extends model
|
||||
* Get unconfirmed bugs.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param array $modules
|
||||
* @param int $projects
|
||||
* @param int $orderBy
|
||||
* @param int $pager
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getUnconfirmed($productID, $branch, $projects, $orderBy, $pager)
|
||||
public function getUnconfirmed($productID, $branch, $modules, $projects, $orderBy, $pager)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_BUG)
|
||||
->where('confirmed')->eq(0)
|
||||
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
|
||||
->beginIF($modules)->andWhere('module')->in($modules)->fi()
|
||||
->andWhere('product')->eq($productID)
|
||||
->andWhere('project')->in(array_keys($projects))
|
||||
->andWhere('deleted')->eq(0)
|
||||
@@ -1708,20 +1724,22 @@ class bugModel extends model
|
||||
* Get bugs the status is active or unclosed.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param array $modules
|
||||
* @param array $projects
|
||||
* @param string $status
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByStatus($productID, $branch, $projects, $status, $orderBy, $pager)
|
||||
public function getByStatus($productID, $branch, $modules, $projects, $status, $orderBy, $pager)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_BUG)
|
||||
->where('project')->in(array_keys($projects))
|
||||
->andWhere('product')->eq($productID)
|
||||
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
|
||||
->beginIF($modules)->andWhere('module')->in($modules)->fi()
|
||||
->beginIF($status == 'unclosed')->andWhere('status')->ne('closed')->fi()
|
||||
->beginIF($status == 'unresolved')->andWhere('status')->eq('active')->fi()
|
||||
->beginIF($status == 'toclosed')->andWhere('status')->eq('resolved')->fi()
|
||||
@@ -1733,18 +1751,20 @@ class bugModel extends model
|
||||
* Get unresolve bugs for long time.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param array $modules
|
||||
* @param array $projects
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByLonglifebugs($productID, $branch, $projects, $orderBy, $pager)
|
||||
public function getByLonglifebugs($productID, $branch, $modules, $projects, $orderBy, $pager)
|
||||
{
|
||||
return $this->dao->findByLastEditedDate("<", date(DT_DATE1, strtotime('-7 days')))->from(TABLE_BUG)->andWhere('product')->eq($productID)
|
||||
->andWhere('project')->in(array_keys($projects))
|
||||
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
|
||||
->beginIF($modules)->andWhere('module')->in($modules)->fi()
|
||||
->andWhere('openedDate')->lt(date(DT_DATE1,strtotime('-7 days')))
|
||||
->andWhere('deleted')->eq(0)
|
||||
->andWhere('status')->ne('closed')->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
@@ -1754,17 +1774,19 @@ class bugModel extends model
|
||||
* Get postponed bugs.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param array $modules
|
||||
* @param array $projects
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByPostponedbugs($productID, $branch, $projects, $orderBy, $pager)
|
||||
public function getByPostponedbugs($productID, $branch, $modules, $projects, $orderBy, $pager)
|
||||
{
|
||||
return $this->dao->findByResolution('postponed')->from(TABLE_BUG)->andWhere('product')->eq($productID)
|
||||
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
|
||||
->beginIF($modules)->andWhere('module')->in($modules)->fi()
|
||||
->andWhere('project')->in(array_keys($projects))
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
@@ -1774,19 +1796,21 @@ class bugModel extends model
|
||||
* Get bugs need confirm.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param array $modules
|
||||
* @param array $projects
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByNeedconfirm($productID, $branch, $projects, $orderBy, $pager)
|
||||
public function getByNeedconfirm($productID, $branch, $modules, $projects, $orderBy, $pager)
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.title AS storyTitle')->from(TABLE_BUG)->alias('t1')->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
|
||||
->where("t2.status = 'active'")
|
||||
->andWhere('t1.product')->eq($productID)
|
||||
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
|
||||
->beginIF($modules)->andWhere('t1.module')->in($modules)->fi()
|
||||
->andWhere('t2.version > t1.storyVersion')
|
||||
->andWhere('t1.project')->in(array_keys($projects))
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
|
||||
@@ -13,11 +13,25 @@
|
||||
<?php
|
||||
include '../../common/view/header.html.php';
|
||||
include '../../common/view/datatable.fix.html.php';
|
||||
js::set('browseType', $browseType);
|
||||
js::set('moduleID', $moduleID);
|
||||
js::set('browseType', $browseType);
|
||||
js::set('moduleID', $moduleID);
|
||||
js::set('bugBrowseType', $this->session->bugBrowseType);
|
||||
?>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<li>
|
||||
<span>
|
||||
<?php
|
||||
echo $moduleName;
|
||||
if($moduleID)
|
||||
{
|
||||
$removeLink = $browseType == 'bymodule' ? inlink('browse', "productID=$productID&branch=$branch&browseType=$browseType¶m=0&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("bugModule")';
|
||||
echo ' ' . html::a($removeLink, "<i class='icon icon-remove'></i>") . ' ';
|
||||
}
|
||||
echo " <i class='icon-angle-right'></i> ";
|
||||
?>
|
||||
</span>
|
||||
</li>
|
||||
<?php
|
||||
echo "<li id='unclosedTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=unclosed¶m=0"), $lang->bug->unclosed) . "</li>";
|
||||
echo "<li id='allTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=all¶m=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->bug->allBugs) . "</li>";
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
<?php if(isset($moduleID)):?>
|
||||
<li>
|
||||
<span>
|
||||
<?php
|
||||
echo $moduleName;
|
||||
if($moduleID)
|
||||
{
|
||||
$removeLink = $browseType == 'bymodule' ? inlink('task', "projectID=$projectID&browseType=$status¶m=0&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("taskModule")';
|
||||
echo ' ' . html::a($removeLink, "<i class='icon icon-remove'></i>") . ' ';
|
||||
}
|
||||
echo " <i class='icon-angle-right'></i> ";
|
||||
?>
|
||||
<?php
|
||||
echo $moduleName;
|
||||
if($moduleID)
|
||||
{
|
||||
$removeLink = $browseType == 'bymodule' ? inlink('task', "projectID=$projectID&browseType=$status¶m=0&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("taskModule")';
|
||||
echo ' ' . html::a($removeLink, "<i class='icon icon-remove'></i>") . ' ';
|
||||
}
|
||||
echo " <i class='icon-angle-right'></i> ";
|
||||
?>
|
||||
</span>
|
||||
</li>
|
||||
<?php endif;?>
|
||||
|
||||
Reference in New Issue
Block a user