diff --git a/module/product/model.php b/module/product/model.php index 8c58a3a463..9e4cb3ce60 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -371,7 +371,8 @@ class productModel extends model public function getProductIDByProject($projectID, $isFirst = true) { $products = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT) - ->where('product')->in($this->app->user->view->products) + ->where('1=1') + ->beginIF(!$this->app->user->admin)->andWhere('product')->in($this->app->user->view->products)->fi() ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() ->fetchPairs(); diff --git a/module/repo/model.php b/module/repo/model.php index db67885e7c..b0f126b8bb 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -350,7 +350,7 @@ class repoModel extends model $scm = $repo->SCM == 'Subversion' ? 'svn' : 'git'; if($this->checkPriv($repo)) { - if($type == 'project' or $type == 'execution') + if(($type == 'project' or $type == 'execution') and $projectID) { foreach($productIdList as $productID) { @@ -1510,6 +1510,7 @@ class repoModel extends model elseif($taskAction == 'finish' and in_array($task->status, array('wait', 'pause', 'doing'))) { $this->post->set('finishedDate', date('Y-m-d')); + $this->post->set('realStarted', date('Y-m-d')); $this->post->set('currentConsumed', $this->post->consumed); $this->post->set('consumed', $this->post->consumed + $task->consumed); $changes = $this->task->finish($taskID);