diff --git a/module/block/control.php b/module/block/control.php index 5cc5201c0b..ca5f15c683 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -640,7 +640,7 @@ class block extends control ->andWhere('t3.status')->ne('done') ->andWhere('t3.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) - ->beginIF($projectID)->andWhere('t2.PRJ')->eq($projectID)->fi() + ->beginIF($projectID)->andWhere('t2.project')->eq($projectID)->fi() ->orderBy($this->params->orderBy) ->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi() ->fetchAll(); @@ -649,7 +649,7 @@ class block extends control { $cases = $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_CASE) ->andWhere('deleted')->eq(0) - ->beginIF($projectID)->andWhere('PRJ')->eq($projectID)->fi() + ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() ->orderBy($this->params->orderBy) ->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi() ->fetchAll(); @@ -679,7 +679,7 @@ class block extends control ->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.project=t4.id') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.project=t5.project') ->where('t1.deleted')->eq('0') - ->beginIF($projectID)->andWhere('t1.PRJ')->eq($projectID)->fi() + ->beginIF($projectID)->andWhere('t1.project')->eq($projectID)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi() ->andWhere('t1.product = t5.product') ->beginIF($this->params->type != 'all')->andWhere('t1.status')->eq($this->params->type)->fi() @@ -740,7 +740,7 @@ class block extends control ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') ->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=t3.id') ->where('t1.deleted')->eq('0') - ->beginIF($this->view->block->module != 'my' and $this->session->project)->andWhere('t1.PRJ')->eq((int)$this->session->project)->fi() + ->beginIF($this->view->block->module != 'my' and $this->session->project)->andWhere('t1.project')->eq((int)$this->session->project)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi() ->orderBy('t1.id desc') ->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi() @@ -761,7 +761,7 @@ class block extends control ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') ->where('t1.deleted')->eq('0') ->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in($this->app->user->view->projects)->fi() - ->beginIF($this->view->block->module != 'my' and $this->session->project)->andWhere('t1.PRJ')->eq((int)$this->session->project)->fi() + ->beginIF($this->view->block->module != 'my' and $this->session->project)->andWhere('t1.project')->eq((int)$this->session->project)->fi() ->orderBy('t1.id desc') ->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi() ->fetchAll(); @@ -857,15 +857,15 @@ class block extends control $today = helper::today(); if(isset($this->config->maxVersion)) $monday = date('Ymd', strtotime($this->loadModel('weekly')->getThisMonday($today))); - $tasks = $this->dao->select("PRJ, + $tasks = $this->dao->select("project, sum(consumed) as totalConsumed, sum(if(status != 'cancel' and status != 'closed', `left`, 0)) as totalLeft") ->from(TABLE_TASK) - ->where('PRJ')->in(array_keys($projects)) + ->where('project')->in(array_keys($projects)) ->andWhere('deleted')->eq(0) ->andWhere('parent')->lt(1) - ->groupBy('PRJ') - ->fetchAll('PRJ'); + ->groupBy('project') + ->fetchAll('project'); foreach($projects as $projectID => $project) { @@ -1176,7 +1176,7 @@ class block extends control $task = $this->dao->select(" sum(consumed) as totalConsumed, sum(if(status != 'cancel' and status != 'closed', `left`, 0)) as totalLeft") - ->from(TABLE_TASK)->where('PRJ')->eq($this->session->project) + ->from(TABLE_TASK)->where('project')->eq($this->session->project) ->andWhere('deleted')->eq(0) ->andWhere('parent')->lt(1) ->fetch(); @@ -1251,9 +1251,9 @@ class block extends control $budget = $this->loadModel('workestimation')->getBudget($projectID); if(empty($budget)) $budget = new stdclass(); - $this->view->people = $this->dao->select('sum(people) as people')->from(TABLE_DURATIONESTIMATION)->where('PRJ')->eq($this->session->project)->fetch('people'); + $this->view->people = $this->dao->select('sum(people) as people')->from(TABLE_DURATIONESTIMATION)->where('project')->eq($this->session->project)->fetch('people'); $this->view->members = count($members) ? count($members) - 1 : 0; - $this->view->consumed = $this->dao->select('sum(cast(consumed as decimal(10,2))) as consumed')->from(TABLE_TASK)->where('PRJ')->eq($projectID)->andWhere('deleted')->eq(0)->andWhere('parent')->lt(1)->fetch('consumed'); + $this->view->consumed = $this->dao->select('sum(cast(consumed as decimal(10,2))) as consumed')->from(TABLE_TASK)->where('project')->eq($projectID)->andWhere('deleted')->eq(0)->andWhere('parent')->lt(1)->fetch('consumed'); $this->view->budget = $budget; } @@ -1461,7 +1461,7 @@ class block extends control ->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.project=t4.id') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.project=t5.project') ->where('t1.deleted')->eq('0') - ->andWhere('t1.PRJ')->eq($this->session->project)->fi() + ->andWhere('t1.project')->eq($this->session->project)->fi() ->andWhere('t1.product = t5.product') ->beginIF($status != 'all')->andWhere('t1.status')->eq($status)->fi() ->orderBy('t1.id desc') @@ -1620,7 +1620,7 @@ class block extends control { $casePairs = $this->dao->select('lastRunResult, COUNT(*) AS count')->from(TABLE_CASE) ->where('1=1') - ->beginIF($this->view->block->module != 'my' and $this->session->project)->andWhere('PRJ')->eq((int)$this->session->project)->fi() + ->beginIF($this->view->block->module != 'my' and $this->session->project)->andWhere('project')->eq((int)$this->session->project)->fi() ->groupBy('lastRunResult') ->fetchPairs(); @@ -1658,7 +1658,7 @@ class block extends control $pager = pager::init(0, $count, 1); $projectID = $this->view->block->module == 'my' ? 0 : (int)$this->session->project; - $this->view->executionStats = $this->loadModel('execution')->getStats($projectID, $status, 0, 0, 30, 'id_asc', $pager); + $this->view->executionStats = $this->loadModel('project')->getStats($projectID, $status, 0, 0, 30, 'id_asc', $pager); } /** diff --git a/module/block/view/projectblock.html.php b/module/block/view/projectblock.html.php index 711b5fa8e5..6ab7f38894 100644 --- a/module/block/view/projectblock.html.php +++ b/module/block/view/projectblock.html.php @@ -22,13 +22,13 @@