diff --git a/module/bug/model.php b/module/bug/model.php index 361edefa84..bbda468a3e 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -413,12 +413,13 @@ class bugModel extends model * getActiveBugs * * @param array $products + * @param int $branch * @param int $projectID * @param object $pager * @access public * @return array */ - public function getActiveBugs($products, $branch, $projectID, $pager = null) + public function getActiveBugs($products, $branch, $projects, $pager = null) { return $this->dao->select('*')->from(TABLE_BUG) ->where('status')->eq('active') @@ -426,7 +427,7 @@ class bugModel extends model ->andWhere('tostory')->eq(0) ->beginIF(!empty($products))->andWhere('product')->in($products)->fi() ->beginIF($branch)->andWhere('branch')->in("0,$branch")->fi() - ->beginIF(empty($products))->andWhere('project')->eq($projectID)->fi() + ->beginIF(!empty($projects))->andWhere('project')->in($projects)->fi() ->andWhere('deleted')->eq(0) ->orderBy('id desc') ->page($pager) diff --git a/module/productplan/control.php b/module/productplan/control.php index 261cfb3971..7d4a7e1e0f 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -514,9 +514,9 @@ class productplan extends control } else { - $projects = $this->loadModel('project')->getPairs(); + $projects = $this->loadModel('project')->getPairs(); $projects[0] = ''; - $allBugs= $this->bug->getActiveBugs($this->view->product->id, $plan->branch, $projects); + $allBugs = $this->bug->getActiveBugs($this->view->product->id, $plan->branch, array_keys($projects)); } $this->view->allBugs = $allBugs; diff --git a/module/upgrade/control.php b/module/upgrade/control.php index 44a1bf707c..768dc85d2c 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -85,6 +85,7 @@ class upgrade extends control */ public function confirm() { + $this->session->set('step', ''); $this->view->title = $this->lang->upgrade->confirm; $this->view->position[] = $this->lang->upgrade->common; $this->view->confirm = $this->upgrade->getConfirm($this->post->fromVersion); @@ -104,6 +105,7 @@ class upgrade extends control */ public function execute($fromVersion = '') { + $this->session->set('step', ''); $fromVersion = isset($_POST['fromVersion']) ? $this->post->fromVersion : $fromVersion; $this->upgrade->execute($fromVersion); diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 0ead607e4c..dceb19bdcb 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -2168,11 +2168,9 @@ class upgradeModel extends model { $lastChild = isset($lastChildTasks[$parentTask->id]) ? $lastChildTasks[$parentTask->id] : ''; - $this->dao->update(TABLE_TASK) - ->set('assignedTo')->eq('closed') - ->beginIF($lastChild)->set('assignedDate')->eq($lastChild->assignedDate)->fi() - ->where('id')->eq($parentTask->id) - ->exec(); + $stmt = $this->dao->update(TABLE_TASK)->set('assignedTo')->eq('closed'); + if($lastChild) $stmt->set('assignedDate')->eq($lastChild->assignedDate); + $stmt->where('id')->eq($parentTask->id)->exec(); if(empty($parentTask->closedBy) && !empty($lastChild->closedBy)) { @@ -2192,11 +2190,9 @@ class upgradeModel extends model foreach($childTasks as $childTask) { - $this->dao->update(TABLE_TASK) - ->set('assignedTo')->eq('closed') - ->beginIF(!empty($parent))->set('assignedDate')->eq($parent->assignedDate)->fi() - ->where('id')->eq($childTask->id) - ->exec(); + $stmt = $this->dao->update(TABLE_TASK)->set('assignedTo')->eq('closed'); + if(!empty($parent)) $stmt->set('assignedDate')->eq($parent->assignedDate); + $stmt->where('id')->eq($childTask->id)->exec(); if(empty($childTask->closedBy) && !empty($parent->closedBy)) {