* Adjust code for slow page.
This commit is contained in:
@@ -1511,7 +1511,7 @@ class actionModel extends model
|
||||
$condition .= " OR (`objectID` in ($programCondition) AND `objectType` = 'program')";
|
||||
|
||||
$efforts = $this->dao->select('id')->from(TABLE_EFFORT)
|
||||
->where($condition)
|
||||
->where("($condition)")
|
||||
->beginIF($period != 'all')
|
||||
->beginIF(isset($begin))->andWhere('date')->gt($begin)->fi()
|
||||
->beginIF(isset($end))->andWhere('date')->lt($end)->fi()
|
||||
|
||||
@@ -81,6 +81,7 @@ class admin extends control
|
||||
*/
|
||||
public function ajaxSetZentaoData()
|
||||
{
|
||||
session_write_close();
|
||||
if(helper::isIntranet()) return $this->send(array('result' => 'ignore'));
|
||||
|
||||
$hasInternet = $this->admin->checkInternet();
|
||||
|
||||
@@ -2184,7 +2184,7 @@ class productModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
$cases = $this->dao->select('story')->from(TABLE_CASE)->where('story')->in($storyIdList)->andWhere('deleted')->eq(0)->fetchAll('story');
|
||||
$cases = empty($storyIdList) ? array() : $this->dao->select('story')->from(TABLE_CASE)->where('story')->in($storyIdList)->andWhere('deleted')->eq(0)->fetchAll('story');
|
||||
$rate = count($stories) == 0 || $rateCount == 0 ? 0 : round(count($cases) / $rateCount, 2);
|
||||
|
||||
$storyCommon = $this->lang->SRCommon;
|
||||
|
||||
@@ -133,7 +133,7 @@ class productplanModel extends model
|
||||
if(!empty($plans))
|
||||
{
|
||||
$plans = $this->reorder4Children($plans);
|
||||
$planIdList = array_keys($plans);
|
||||
$planIdList = array_filter(array_keys($plans));
|
||||
$planProjects = array();
|
||||
|
||||
foreach($planIdList as $planID)
|
||||
@@ -159,7 +159,7 @@ class productplanModel extends model
|
||||
->fetchGroup('plan', 'id');
|
||||
}
|
||||
|
||||
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where("plan")->in($planIdList)->andWhere('deleted')->eq(0)->fetchGroup('plan', 'id');
|
||||
$bugs = $this->dao->select('id,plan')->from(TABLE_BUG)->where("plan")->in($planIdList)->andWhere('deleted')->eq(0)->fetchGroup('plan', 'id');
|
||||
$parentStories = $parentBugs = $parentHour = array();
|
||||
foreach($plans as $plan)
|
||||
{
|
||||
|
||||
@@ -106,18 +106,6 @@ function loadModules(tr, caseID, link, isAddDitto, branch)
|
||||
|
||||
$('#module' + caseID).parent('td').load(link, function(data)
|
||||
{
|
||||
if(canImportModules[branch][caseID] != undefined && Object.keys(canImportModules[branch][caseID]).length > 0)
|
||||
{
|
||||
$('tr select#module').children().each(function()
|
||||
{
|
||||
moduleID = $(this).val();
|
||||
if(canImportModules[branch][caseID][moduleID] == undefined)
|
||||
{
|
||||
$(this).remove();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
tr.find('#module').chosen();
|
||||
tr.find('#module').attr({"id": 'module' + caseID, "name": 'module[' + caseID + ']'});
|
||||
tr.find('#module' + caseID).removeAttr('onchange');
|
||||
|
||||
@@ -2555,6 +2555,8 @@ class testcaseModel extends model
|
||||
public function appendData($cases, $type = 'case', $caseIdlist = array())
|
||||
{
|
||||
if(empty($caseIdlist)) $caseIdList = array_keys($cases);
|
||||
$caseIdList = array_filter($caseIdList);
|
||||
|
||||
if($type == 'case')
|
||||
{
|
||||
$caseBugs = $this->dao->select('count(*) as count, `case`')->from(TABLE_BUG)->where('`case`')->in($caseIdList)->andWhere('deleted')->eq(0)->groupBy('`case`')->fetchPairs('case', 'count');
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('flow', $config->global->flow);?>
|
||||
<?php js::set('ditto', $lang->testcase->ditto);?>
|
||||
<?php js::set('canImportModules', $canImportModules);?>
|
||||
<?php js::set('rawModule', $this->app->rawModule);?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
|
||||
Reference in New Issue
Block a user