diff --git a/module/action/model.php b/module/action/model.php index a703cd9eae..022bd3c276 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -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() diff --git a/module/admin/control.php b/module/admin/control.php index f8ef8ac8bb..181097d4ab 100755 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -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(); diff --git a/module/product/model.php b/module/product/model.php index d8ee0835ee..625d260000 100755 --- a/module/product/model.php +++ b/module/product/model.php @@ -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; diff --git a/module/productplan/model.php b/module/productplan/model.php index cbb5901e04..ec8b95847b 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -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) { diff --git a/module/testcase/js/importfromlib.js b/module/testcase/js/importfromlib.js index 0bbd5c90c5..9ac3148f13 100644 --- a/module/testcase/js/importfromlib.js +++ b/module/testcase/js/importfromlib.js @@ -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'); diff --git a/module/testcase/model.php b/module/testcase/model.php index 4512121646..3b99febe4d 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -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'); diff --git a/module/testcase/view/importfromlib.html.php b/module/testcase/view/importfromlib.html.php index 653de72e6a..11d9c6f665 100644 --- a/module/testcase/view/importfromlib.html.php +++ b/module/testcase/view/importfromlib.html.php @@ -13,7 +13,6 @@ global->flow);?> testcase->ditto);?> - app->rawModule);?>