Merge branch 'zenops_44' into liyuchun_65983

This commit is contained in:
liyuchun
2022-08-26 14:28:47 +08:00
254 changed files with 3032 additions and 1566 deletions
+24 -9
View File
@@ -1153,16 +1153,20 @@ class bug extends control
}
if($bug->status == 'closed') $assignedToList['closed'] = 'Closed';
$branch = $product->type == 'branch' ? ($bug->branch > 0 ? $bug->branch . ',0' : '0') : '';
$productBugs = $this->bug->getProductBugPairs($productID, $branch);
$this->view->bug = $bug;
$this->view->productID = $productID;
$this->view->product = $product;
$this->view->productBugs = $productBugs;
$this->view->productName = $this->products[$productID];
$this->view->plans = $this->loadModel('productplan')->getPairs($productID, $bug->branch, '', true);
$this->view->projects = array(0 => '') + $this->product->getProjectPairsByProduct($productID, $bug->branch, $bug->project);
$this->view->moduleOptionMenu = $moduleOptionMenu;
$this->view->currentModuleID = $currentModuleID;
$this->view->executions = array(0 => '') + $this->product->getExecutionPairsByProduct($bug->product, $bug->branch, 'id_desc', $bug->project);
$this->view->stories = $bug->execution ? $this->story->getExecutionStoryPairs($bug->execution) : $this->story->getProductStoryPairs($bug->product, $bug->branch);
$this->view->stories = $bug->execution ? $this->story->getExecutionStoryPairs($bug->execution) : $this->story->getProductStoryPairs($bug->product, $bug->branch, 0, 'all', 'id_desc', 0, 'full', 'story', false);
$this->view->branchOption = $branchOption;
$this->view->branchTagOption = $branchTagOption;
$this->view->tasks = $this->task->getExecutionTaskPairs($bug->execution);
@@ -1302,6 +1306,7 @@ class bug extends control
$branchIdList = array();
$projectIdList = array();
$executionIdList = array();
$productBugList = array();
foreach($bugs as $bug)
{
$projectIdList[$bug->project] = $bug->project;
@@ -1310,6 +1315,10 @@ class bug extends control
$branchIdList[$bug->product][$bug->branch] = $bug->branch;
if(!isset($modules[$bug->product][$bug->branch]) and isset($modules[$bug->product])) $modules[$bug->product][$bug->branch] = $modules[$bug->product][0] + $this->tree->getModulesName($bug->module);
$bugProduct = isset($productList) ? $productList[$bug->product] : $product;
$branch = $bugProduct->type == 'branch' ? ($bug->branch > 0 ? $bug->branch . ',0' : '0') : '';
if(!isset($productBugList[$bug->product][$bug->branch])) $productBugList[$bug->product][$bug->branch] = $this->bug->getProductBugPairs($bug->product, $branch);
}
/* Get assigned to member. */
@@ -1389,6 +1398,7 @@ class bug extends control
$this->view->users = $users;
$this->view->modules = $modules;
$this->view->branchTagOption = $branchTagOption;
$this->view->productBugList = $productBugList;
$this->display();
}
@@ -1798,17 +1808,22 @@ class bug extends control
if(!isset($users[$assignedTo])) $assignedTo = $this->bug->getModuleOwner($bug->module, $productID);
unset($this->lang->bug->resolutionList['tostory']);
$product = $this->loadModel('product')->getById($productID);
$branch = $product->type == 'branch' ? ($bug->branch > 0 ? $bug->branch . ',0' : '0') : '';
$productBugs = $this->bug->getProductBugPairs($productID, $branch);
$this->bug->checkBugExecutionPriv($bug);
$this->qa->setMenu($this->products, $productID, $bug->branch);
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->resolve;
$this->view->bug = $bug;
$this->view->users = $users;
$this->view->assignedTo = $assignedTo;
$this->view->executions = $this->loadModel('product')->getExecutionPairsByProduct($productID, $bug->branch ? "0,{$bug->branch}" : 0, 'id_desc', $projectID);
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'withbranch');
$this->view->actions = $this->action->getList('bug', $bugID);
$this->view->execution = isset($execution) ? $execution : '';
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->resolve;
$this->view->bug = $bug;
$this->view->users = $users;
$this->view->assignedTo = $assignedTo;
$this->view->productBugs = $productBugs;
$this->view->executions = $this->loadModel('product')->getExecutionPairsByProduct($productID, $bug->branch ? "0,{$bug->branch}" : 0, 'id_desc', $projectID);
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'withbranch');
$this->view->actions = $this->action->getList('bug', $bugID);
$this->view->execution = isset($execution) ? $execution : '';
$this->display();
}
+1
View File
@@ -7,3 +7,4 @@
.select-project-modal .modal-body {right: 15px;}
.osContent, .browserContent {margin: 0 0 5px;}
.browserContent {margin-left: -4px;}
.resolution {white-space: nowrap; overflow: hidden;}
+6
View File
@@ -77,4 +77,10 @@ $(function()
{
hiddenRequireFields();
});
$('select[id^="duplicateBugs"]').picker(
{
disableEmptySearch : true,
dropWidth : 'auto'
});
});
+1 -1
View File
@@ -678,7 +678,7 @@ function setStories(moduleID, productID, storyID)
if(typeof(branch) == 'undefined') branch = 0;
var executionID = $('#execution').val();
if(typeof(executionID) == 'undefined') executionID = 0;
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&storyID=' + storyID + '&onlyOption=false&status=&limit=0&type=full&hasParent=1&executionID=' + executionID);
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&storyID=' + storyID + '&onlyOption=false&status=&limit=0&type=full&hasParent=0&executionID=' + executionID);
$.get(link, function(stories)
{
if(!stories) stories = '<select id="story" name="story" class="form-control"></select>';
+6
View File
@@ -19,6 +19,12 @@ $(function()
}
});
}
$('#duplicateBug').picker(
{
disableEmptySearch : true,
dropWidth : 'auto'
});
});
/**
+6
View File
@@ -45,4 +45,10 @@ $(function()
$('#newBuildExecutionBox').addClass('hidden');
}
})
$('#duplicateBug').picker(
{
disableEmptySearch : true,
dropWidth : 'auto'
});
})
+2
View File
@@ -177,6 +177,7 @@ $lang->bug->changed = 'Changed';
$lang->bug->storyChanged = 'Story Changed';
$lang->bug->linkMR = 'Related MRs';
$lang->bug->linkCommit = 'Related Commits';
$lang->bug->duplicateTip = 'Please enter keyword search';
/* Page tags. */
$lang->bug->lblAssignedTo = 'Bearbeiter';
@@ -417,6 +418,7 @@ $lang->bug->featureBar['browse']['unclosed'] = $lang->bug->unclosed;
$lang->bug->featureBar['browse']['openedbyme'] = $lang->bug->openedByMe;
$lang->bug->featureBar['browse']['assigntome'] = $lang->bug->assignToMe;
$lang->bug->featureBar['browse']['resolvedbyme'] = $lang->bug->resolvedByMe;
$lang->bug->featureBar['browse']['unresolved'] = $lang->bug->unResolved;
$lang->bug->featureBar['browse']['more'] = $lang->more;
+3 -1
View File
@@ -77,7 +77,7 @@ $lang->bug->deadlineAB = 'Deadline';
$lang->bug->plan = 'Plan';
$lang->bug->closedBy = 'ClosedBy';
$lang->bug->closedDate = 'ClosedDate';
$lang->bug->duplicateBug = 'Duplicated Bug ID';
$lang->bug->duplicateBug = 'Duplicated Bug';
$lang->bug->lastEditedBy = 'EditedBy';
$lang->bug->linkBug = 'Linked Bugs';
$lang->bug->linkBugs = 'Link Bug';
@@ -177,6 +177,7 @@ $lang->bug->changed = 'Changed';
$lang->bug->storyChanged = 'Story Changed';
$lang->bug->linkMR = 'Related MRs';
$lang->bug->linkCommit = 'Related Commits';
$lang->bug->duplicateTip = 'Please enter keyword search';
/* Page tags. */
$lang->bug->lblAssignedTo = 'AssignTo';
@@ -417,6 +418,7 @@ $lang->bug->featureBar['browse']['unclosed'] = $lang->bug->unclosed;
$lang->bug->featureBar['browse']['openedbyme'] = $lang->bug->openedByMe;
$lang->bug->featureBar['browse']['assigntome'] = $lang->bug->assignToMe;
$lang->bug->featureBar['browse']['resolvedbyme'] = $lang->bug->resolvedByMe;
$lang->bug->featureBar['browse']['unresolved'] = $lang->bug->unResolved;
$lang->bug->featureBar['browse']['more'] = $lang->more;
+3 -1
View File
@@ -77,7 +77,7 @@ $lang->bug->deadlineAB = 'Butoir';
$lang->bug->plan = 'Plan';
$lang->bug->closedBy = 'Fermé par';
$lang->bug->closedDate = 'Date Fermeture';
$lang->bug->duplicateBug = 'Bug ID en doublon';
$lang->bug->duplicateBug = 'Bug en doublon';
$lang->bug->lastEditedBy = 'Edité par';
$lang->bug->linkBug = 'Bugs Liés';
$lang->bug->linkBugs = 'Associer Bug';
@@ -177,6 +177,7 @@ $lang->bug->changed = 'Changed';
$lang->bug->storyChanged = 'Story Changed';
$lang->bug->linkMR = 'Related MRs';
$lang->bug->linkCommit = 'Related Commits';
$lang->bug->duplicateTip = 'Please enter keyword search';
/* Page tags. */
$lang->bug->lblAssignedTo = 'Affecté à';
@@ -417,6 +418,7 @@ $lang->bug->featureBar['browse']['unclosed'] = $lang->bug->unclosed;
$lang->bug->featureBar['browse']['openedbyme'] = $lang->bug->openedByMe;
$lang->bug->featureBar['browse']['assigntome'] = $lang->bug->assignToMe;
$lang->bug->featureBar['browse']['resolvedbyme'] = $lang->bug->resolvedByMe;
$lang->bug->featureBar['browse']['unresolved'] = $lang->bug->unResolved;
$lang->bug->featureBar['browse']['more'] = $lang->more;
+3 -1
View File
@@ -77,7 +77,7 @@ $lang->bug->deadlineAB = '截止';
$lang->bug->plan = '所属' . '计划';
$lang->bug->closedBy = '由谁关闭';
$lang->bug->closedDate = '关闭日期';
$lang->bug->duplicateBug = '重复ID';
$lang->bug->duplicateBug = '重复Bug';
$lang->bug->lastEditedBy = '最后修改者';
$lang->bug->linkBug = '相关Bug';
$lang->bug->linkBugs = '关联相关Bug';
@@ -177,6 +177,7 @@ $lang->bug->changed = '已变动';
$lang->bug->storyChanged = '需求变动';
$lang->bug->linkMR = '相关合并请求';
$lang->bug->linkCommit = '相关代码版本';
$lang->bug->duplicateTip = '请输入关键字';
/* 页面标签。*/
$lang->bug->lblAssignedTo = '当前指派';
@@ -421,6 +422,7 @@ $lang->bug->featureBar['browse']['assignedbyme'] = $lang->bug->assignedByMe;
$lang->bug->featureBar['browse']['unresolved'] = $lang->bug->unResolved;
$lang->bug->featureBar['browse']['more'] = $lang->more;
$lang->bug->moreSelects['unconfirmed'] = $lang->bug->unconfirmed;
$lang->bug->moreSelects['assigntonull'] = $lang->bug->assignToNull;
$lang->bug->moreSelects['longlifebugs'] = $lang->bug->longLifeBugs;
+49 -26
View File
@@ -384,6 +384,9 @@ class bugModel extends model
$browseType = ($browseType == 'bymodule' and $this->session->bugBrowseType and $this->session->bugBrowseType != 'bysearch') ? $this->session->bugBrowseType : $browseType;
$browseType = $browseType == 'bybranch' ? 'bymodule' : $browseType;
if(strpos($sort, 'pri_') !== false) $sort = str_replace('pri_', 'priOrder_', $sort);
if(strpos($sort, 'severity_') !== false) $sort = str_replace('severity_', 'severityOrder_', $sort);
/* Get bugs by browse type. */
$bugs = array();
if($browseType == 'all') $bugs = $this->getAllBugs($productIDList, $branch, $modules, $executions, $sort, $pager, $projectID);
@@ -483,7 +486,7 @@ class bugModel extends model
*/
public function getModuleBugs($productIDList, $branch = 0, $moduleIdList = 0, $executions = array(), $orderBy = 'id_desc', $pager = null, $projectID = 0)
{
return $this->dao->select('*')->from(TABLE_BUG)
return $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where('product')->in($productIDList)
->beginIF($branch !== 'all')->andWhere('branch')->eq($branch)->fi()
->beginIF(!empty($moduleIdList))->andWhere('module')->in($moduleIdList)->fi()
@@ -506,7 +509,8 @@ class bugModel extends model
*/
public function getPlanBugs($planID, $status = 'all', $orderBy = 'id_desc', $pager = null)
{
$bugs = $this->dao->select('*')->from(TABLE_BUG)
if(strpos($orderBy, 'pri_') !== false) $orderBy = str_replace('pri_', 'priOrder_', $orderBy);
$bugs = $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder")->from(TABLE_BUG)
->where('plan')->eq((int)$planID)
->beginIF(!$this->app->user->admin)->andWhere('execution')->in('0,' . $this->app->user->view->sprints)->fi()
->beginIF($status != 'all')->andWhere('status')->in($status)->fi()
@@ -1125,6 +1129,7 @@ class bugModel extends model
->setDefault('assignedDate', $now)
->setDefault('resolvedDate', $now)
->setDefault('assignedTo', $oldBug->openedBy)
->setDefault('duplicateBug', 0)
->removeIF($this->post->resolution != 'duplicate', 'duplicateBug')
->stripTags($this->config->bug->editor->resolve['id'], $this->config->allowedTags)
->remove('files,labels')
@@ -1565,7 +1570,6 @@ class bugModel extends model
$bugCount = $this->dao->select("count(id) as num, date_format($field, '%m/%d') as date")->from(TABLE_BUG)
->where('product')->eq($productID)
->andWhere($field)->ne('0000-00-00 00:00:00')
->andWhere($field)->ne('')
->andWhere('deleted')->eq(0)
->andWhere($field)->between($startDate, $endDate . ' 23:50:59')
->groupBy('date')
@@ -1713,8 +1717,7 @@ class bugModel extends model
$moduleName = $this->app->rawMethod == 'work' ? 'workBug' : 'contributeBug';
$queryName = $moduleName . 'Query';
$formName = $moduleName . 'Form';
$bugIDList = array();
$bugIDList = array();
if($moduleName == 'contributeBug')
{
$bugsAssignedByMe = $this->loadModel('my')->getAssignedByMe($account, 0, '', $orderBy, 'bug');
@@ -1742,7 +1745,7 @@ class bugModel extends model
$query = preg_replace('/`(\w+)`/', 't1.`$1`', $query);
if($type != 'bySearch' and !$this->loadModel('common')->checkField(TABLE_BUG, $type)) return array();
return $this->dao->select('t1.*,t2.name as productName')->from(TABLE_BUG)->alias('t1')
return $this->dao->select("t1.*,t2.name as productName, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder, IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) as severityOrder")->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq('0')
@@ -1823,6 +1826,9 @@ class bugModel extends model
public function getProjectBugs($projectID, $productID = 0, $branchID = 0, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
{
$type = strtolower($type);
if(strpos($orderBy, 'pri_') !== false) $orderBy = str_replace('pri_', 'priOrder_', $orderBy);
if(strpos($orderBy, 'severity_') !== false) $orderBy = str_replace('severity_', 'severityOrder_', $orderBy);
if($type == 'bysearch')
{
$queryID = (int)$param;
@@ -1839,7 +1845,7 @@ class bugModel extends model
$bugQuery = $this->getBugQuery($this->session->projectBugQuery);
$bugs = $this->dao->select('*')->from(TABLE_BUG)
$bugs = $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where($bugQuery)
->andWhere('project')->eq((int)$projectID)
->andWhere('deleted')->eq(0)
@@ -1852,7 +1858,7 @@ class bugModel extends model
}
else
{
$bugs = $this->dao->select('t1.*')->from(TABLE_BUG)->alias('t1')
$bugs = $this->dao->select("t1.*, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder, IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) as severityOrder")->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_MODULE)->alias('t2')->on('t1.module=t2.id')
->where('t1.deleted')->eq(0)
->beginIF(empty($build))->andWhere('t1.project')->eq($projectID)->fi()
@@ -1891,6 +1897,9 @@ class bugModel extends model
public function getExecutionBugs($executionID, $productID = 0, $branchID = 'all', $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
{
$type = strtolower($type);
if(strpos($orderBy, 'pri_') !== false) $orderBy = str_replace('pri_', 'priOrder_', $orderBy);
if(strpos($orderBy, 'severity_') !== false) $orderBy = str_replace('severity_', 'severityOrder_', $orderBy);
if($type == 'bysearch')
{
$queryID = (int)$param;
@@ -1907,7 +1916,7 @@ class bugModel extends model
$bugQuery = $this->getBugQuery($this->session->executionBugQuery);
$bugs = $this->dao->select('*')->from(TABLE_BUG)
$bugs = $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where($bugQuery)
->andWhere('execution')->eq((int)$executionID)
->andWhere('deleted')->eq(0)
@@ -1920,7 +1929,7 @@ class bugModel extends model
}
else
{
$bugs = $this->dao->select('t1.*')->from(TABLE_BUG)->alias('t1')
$bugs = $this->dao->select("t1.*, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder, IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) as severityOrder")->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_MODULE)->alias('t2')->on('t1.module=t2.id')
->where('t1.deleted')->eq(0)
->beginIF(!empty($productID) and $branchID !== 'all')->andWhere('t1.branch')->eq($branchID)->fi()
@@ -1985,16 +1994,18 @@ class bugModel extends model
/**
* get Product Bug Pairs
*
* @param int $productID
* @param int $productID
* @param int|string $branch
* @access public
* @return void
*/
public function getProductBugPairs($productID)
public function getProductBugPairs($productID, $branch = '')
{
$bugs = array('' => '');
$data = $this->dao->select('id, title')->from(TABLE_BUG)
->where('product')->eq((int)$productID)
->beginIF(!$this->app->user->admin)->andWhere('execution')->in('0,' . $this->app->user->view->sprints)->fi()
->beginIF($branch !== '')->andWhere('branch')->in($branch)->fi()
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->fetchAll();
@@ -2542,7 +2553,7 @@ class bugModel extends model
*/
public function getAllBugs($productIDList, $branch, $modules, $executions, $orderBy, $pager = null, $projectID = 0)
{
$bugs = $this->dao->select('t1.*, t2.title as planTitle')->from(TABLE_BUG)->alias('t1')
$bugs = $this->dao->select("t1.*, t2.title as planTitle, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder, IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) as severityOrder")->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id')
->where('t1.product')->in($productIDList)
->andWhere('t1.execution')->in(array_keys($executions))
@@ -2573,7 +2584,9 @@ class bugModel extends model
*/
public function getByAssigntome($productIDList, $branch, $modules, $executions, $orderBy, $pager, $projectID)
{
return $this->dao->findByAssignedTo($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->in($productIDList)
return $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where('assignedTo')->eq($this->app->user->account)
->andWhere('product')->in($productIDList)
->beginIF($branch !== 'all')->andWhere('branch')->in($branch)->fi()
->beginIF($modules)->andWhere('module')->in($modules)->fi()
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
@@ -2598,7 +2611,9 @@ class bugModel extends model
*/
public function getByOpenedbyme($productIDList, $branch, $modules, $executions, $orderBy, $pager, $projectID)
{
return $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->in($productIDList)
return $this->dao->select("*,IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where('openedBy')->eq($this->app->user->account)
->andWhere('product')->in($productIDList)
->beginIF($branch !== 'all')->andWhere('branch')->in($branch)->fi()
->beginIF($modules)->andWhere('module')->in($modules)->fi()
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
@@ -2623,7 +2638,9 @@ class bugModel extends model
*/
public function getByResolvedbyme($productIDList, $branch, $modules, $executions, $orderBy, $pager, $projectID)
{
return $this->dao->findByResolvedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->in($productIDList)
return $this->dao->select("*,IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where('resolvedBy')->eq($this->app->user->account)
->andWhere('product')->in($productIDList)
->beginIF($branch !== 'all')->andWhere('branch')->in($branch)->fi()
->beginIF($modules)->andWhere('module')->in($modules)->fi()
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
@@ -2649,7 +2666,9 @@ class bugModel extends model
public function getByAssigntonull($productIDList, $branch, $modules, $executions, $orderBy, $pager, $projectID)
{
return $this->dao->findByAssignedTo('')->from(TABLE_BUG)->andWhere('product')->in($productIDList)
return $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where('assignedTo')->eq('')
->andWhere('product')->in($productIDList)
->beginIF($branch !== 'all')->andWhere('branch')->in($branch)->fi()
->beginIF($modules)->andWhere('module')->in($modules)->fi()
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
@@ -2674,7 +2693,7 @@ class bugModel extends model
*/
public function getUnconfirmed($productIDList, $branch, $modules, $executions, $orderBy, $pager, $projectID)
{
return $this->dao->select('*')->from(TABLE_BUG)
return $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where('product')->in($productIDList)
->andWhere('execution')->in(array_keys($executions))
->andWhere('deleted')->eq(0)
@@ -2702,7 +2721,7 @@ class bugModel extends model
*/
public function getOverdueBugs($productIDList, $branch, $modules, $executions, $orderBy, $pager, $projectID)
{
return $this->dao->select('*')->from(TABLE_BUG)
return $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where('product')->in($productIDList)
->andWhere('execution')->in(array_keys($executions))
->beginIF($branch !== 'all')->andWhere('branch')->in($branch)->fi()
@@ -2732,7 +2751,7 @@ class bugModel extends model
*/
public function getByStatus($productIDList, $branch, $modules, $executions, $status, $orderBy, $pager, $projectID)
{
return $this->dao->select('*')->from(TABLE_BUG)
return $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where('product')->in($productIDList)
->andWhere('execution')->in(array_keys($executions))
->beginIF($branch !== 'all')->andWhere('branch')->in($branch)->fi()
@@ -2763,7 +2782,9 @@ class bugModel extends model
public function getByLonglifebugs($productIDList, $branch, $modules, $executions, $orderBy, $pager, $projectID)
{
$lastEditedDate = date(DT_DATE1, time() - $this->config->bug->longlife * 24 * 3600);
return $this->dao->findByLastEditedDate("<", $lastEditedDate)->from(TABLE_BUG)->andWhere('product')->in($productIDList)
return $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where('lastEditedDate')->lt($lastEditedDate)
->andWhere('product')->in($productIDList)
->andWhere('execution')->in(array_keys($executions))
->beginIF($branch !== 'all')->andWhere('branch')->in($branch)->fi()
->beginIF($modules)->andWhere('module')->in($modules)->fi()
@@ -2789,7 +2810,9 @@ class bugModel extends model
*/
public function getByPostponedbugs($productIDList, $branch, $modules, $executions, $orderBy, $pager, $projectID)
{
return $this->dao->findByResolution('postponed')->from(TABLE_BUG)->andWhere('product')->in($productIDList)
return $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where('resolution')->eq('postponed')
->andWhere('product')->in($productIDList)
->beginIF($branch !== 'all')->andWhere('branch')->in($branch)->fi()
->beginIF($modules)->andWhere('module')->in($modules)->fi()
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
@@ -2814,7 +2837,7 @@ class bugModel extends model
*/
public function getByNeedconfirm($productIDList, $branch, $modules, $executions, $orderBy, $pager, $projectID)
{
return $this->dao->select('t1.*, t2.title AS storyTitle')->from(TABLE_BUG)->alias('t1')
return $this->dao->select("t1.*, t2.title AS storyTitle, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder, IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) as severityOrder")->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->where("t2.status = 'active'")
->andWhere('t1.product')->in($productIDList)
@@ -2846,7 +2869,7 @@ class bugModel extends model
public function getByAssignedbyme($productIDList, $branch, $modules, $executions, $sort, $pager, $projectID)
{
$actionIDList = $this->dao->select('objectID')->from(TABLE_ACTION)->where('objectType')->eq('bug')->andWhere('action')->eq('assigned')->andWhere('actor')->eq($this->app->user->account)->fetchPairs('objectID', 'objectID');
return $this->dao->select('*')->from(TABLE_BUG)
return $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)
->where('product')->in($productIDList)
->beginIF($branch !== 'all')->andWhere('branch')->in($branch)->fi()
->beginIF($modules)->andWhere('module')->in($modules)->fi()
@@ -2918,7 +2941,7 @@ class bugModel extends model
if($branch !== 'all' and strpos($bugQuery, '`branch` =') === false) $bugQuery .= " AND `branch` in('0','$branch')";
if(strpos($bugQuery, $allBranch) !== false) $bugQuery = str_replace($allBranch, '1', $bugQuery);
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where($bugQuery)
$bugs = $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)->where($bugQuery)
->beginIF(!$this->app->user->admin)->andWhere('execution')->in('0,' . $this->app->user->view->sprints)->fi()
->beginIF($excludeBugs)->andWhere('id')->notIN($excludeBugs)->fi()
@@ -2950,7 +2973,7 @@ class bugModel extends model
*/
public function getReviewBugs($productIDList, $branch, $modules, $executions, $orderBy, $pager = null, $projectID = 0)
{
$bugs = $this->dao->select('t1.*, t2.title as planTitle')->from(TABLE_BUG)->alias('t1')
$bugs = $this->dao->select("t1.*, t2.title as planTitle, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id')
->where('t1.product')->in($productIDList)
->andWhere('t1.execution')->in(array_keys($executions))
+2 -2
View File
@@ -139,11 +139,11 @@
<td <?php echo zget($visibleFields, 'keywords', "class='hidden'")?>><?php echo html::input("keywords[$bugID]", $bug->keywords, 'class=form-control');?></td>
<td class='<?php echo zget($visibleFields, 'resolvedBy', ' hidden')?>' style='overflow:visible'><?php echo html::select("resolvedBys[$bugID]", $users, $bug->resolvedBy, "class='form-control picker-select' data-drop-width='auto'");?></td>
<td <?php echo zget($visibleFields, 'resolution', "class='hidden'")?>>
<table class='table-borderless table no-margin'>
<table class='table-borderless table no-margin table-form'>
<tr>
<td class='pd-0'><?php echo html::select("resolutions[$bugID]", $resolutionList, $bug->resolution, "class='form-control' onchange=setDuplicate(this.value,$bugID)");?></td>
<td class='pd-0 w-p50' id='<?php echo 'duplicateBugBox' . $bugID;?>' <?php if($bug->resolution != 'duplicate') echo "style='display:none'";?>>
<?php echo html::input("duplicateBugs[$bugID]", '', "class='form-control duplicate-input' placeholder='{$lang->bug->duplicateBug}'");?>
<?php echo html::select("duplicateBugs[$bugID]", $productBugList[$bug->product][$bug->branch], $bug->duplicateBug, "class='form-control' placeholder='{$lang->bug->duplicateTip}'");?>
</td>
</tr>
</table>
+3 -3
View File
@@ -71,16 +71,16 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
{
$moreLabel = $lang->more;
$moreLabelActive = '';
if(isset($lang->bug->moreSelects[$browseType]))
if(isset($lang->bug->moreSelects[$this->session->bugBrowseType]))
{
$moreLabel = "<span class='text'>{$lang->bug->moreSelects[$browseType]}</span> <span class='label label-light label-badge'>{$pager->recTotal}</span>";
$moreLabel = "<span class='text'>{$lang->bug->moreSelects[$this->session->bugBrowseType]}</span> <span class='label label-light label-badge'>{$pager->recTotal}</span>";
$moreLabelActive = 'btn-active-text';
}
echo "<div class='btn-group'><a href='javascript:;' data-toggle='dropdown' class='btn btn-link {$moreLabelActive}'>{$moreLabel} <span class='caret'></span></a>";
echo "<ul class='dropdown-menu'>";
foreach($lang->bug->moreSelects as $menuBrowseType => $label)
{
$active = $menuBrowseType == $browseType ? 'btn-active-text' : '';
$active = $menuBrowseType == $this->session->bugBrowseType ? 'btn-active-text' : '';
echo '<li>' . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=$menuBrowseType"), "<span class='text'>{$label}</span>", '', "class='btn btn-link $active'") . '</li>';
}
echo '</ul></div>';
+1 -1
View File
@@ -265,7 +265,7 @@ if($this->app->tab == 'project') js::set('objectID', $bug->project);
</tr>
<tr id='duplicateBugBox' <?php if($bug->resolution != 'duplicate') echo "style='display:none'";?>>
<th><?php echo $lang->bug->duplicateBug;?></th>
<td><?php echo html::input('duplicateBug', $bug->duplicateBug, 'class=form-control');?></td>
<td class='required'><?php echo html::select('duplicateBug', $productBugs, $bug->duplicateBug, "class='form-control' placeholder='{$lang->bug->duplicateTip}'");?></td>
</tr>
<tr>
<th><?php echo $lang->bug->closedBy;?></th>
+1 -1
View File
@@ -38,7 +38,7 @@ js::set('productID' , $bug->product);
</tr>
<tr id='duplicateBugBox' class='hide'>
<th><?php echo $lang->bug->duplicateBug;?></th>
<td class='required'><?php echo html::input('duplicateBug', '', "class='form-control'");?></td>
<td class='required'><?php echo html::select('duplicateBug', $productBugs, '', "class='form-control' placeholder='{$lang->bug->duplicateTip}'");?></td>
</tr>
<tr>
<th><?php echo $lang->bug->resolvedBuild;?></th>
+10 -3
View File
@@ -262,7 +262,14 @@
</tr>
<tr>
<th><?php echo $lang->bug->mailto;?></th>
<td><?php $mailto = explode(',', str_replace(' ', '', $bug->mailto)); foreach($mailto as $account) echo ' ' . zget($users, $account); ?></td>
<td>
<?php
if(empty($bug->mailto))
{
foreach(explode(',', str_replace(' ', '', $bug->mailto)) as $account) echo ' ' . zget($users, $account);
}
?>
</td>
</tr>
</tbody>
</table>
@@ -348,10 +355,10 @@
</tr>
<tr>
<th><?php echo $lang->bug->resolution;?></th>
<td>
<td class='resolution'>
<?php
echo isset($lang->bug->resolutionList[$bug->resolution]) ? $lang->bug->resolutionList[$bug->resolution] : $bug->resolution;
if(isset($bug->duplicateBugTitle)) echo " #$bug->duplicateBug:" . html::a($this->createLink('bug', 'view', "bugID=$bug->duplicateBug", '', true), $bug->duplicateBugTitle, '', "class='iframe' data-width='80%'");
if(isset($bug->duplicateBugTitle)) echo " #$bug->duplicateBug:" . html::a($this->createLink('bug', 'view', "bugID=$bug->duplicateBug", '', true), $bug->duplicateBugTitle, '', "title='{$bug->duplicateBugTitle}' class='iframe' data-width='80%'");
?>
</td>
</tr>