diff --git a/module/bug/control.php b/module/bug/control.php index 778e103b63..ad0ee865bd 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -147,7 +147,7 @@ class bug extends control $pager = new pager($recTotal, $recPerPage, $pageID); /* Get executios. */ - $executions = $this->loadModel('execution')->getExecutionPairs($this->projectID, 'all', 'empty|withdelete'); + $executions = $this->loadModel('execution')->getPairs($this->projectID, 'all', 'empty|withdelete'); /* Get bugs. */ $bugs = $this->bug->getBugs($productID, $executions, $branch, $browseType, $moduleID, $queryID, $sort, $pager); @@ -1558,7 +1558,7 @@ class bug extends control /* Get users, products and executions. */ $users = $this->loadModel('user')->getPairs('noletter'); $products = $this->loadModel('product')->getPairs(); - $executions = $this->loadModel('execution')->getExecutionPairs($this->projectID, 'all', 'all'); + $executions = $this->loadModel('execution')->getPairs($this->projectID, 'all', 'all'); /* Get related objects id lists. */ $relatedProductIdList = array(); diff --git a/module/bug/model.php b/module/bug/model.php index 15da72c038..b890457f21 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1678,7 +1678,7 @@ class bugModel extends model { $datas = $this->dao->select('execution as name, count(execution) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('execution')->orderBy('value DESC')->fetchAll('name'); if(!$datas) return array(); - $executions = $this->loadModel('execution')->getExecutionPairs($this->session->project); + $executions = $this->loadModel('execution')->getPairs($this->session->project); $maxLength = 12; if(common::checkNotCN()) $maxLength = 22; diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 07af97127e..b85d580372 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -71,9 +71,9 @@ js::set('isStepsTemplate', $isStepsTemplate); - bug->execution : $lang->bug->type;?> + bug->execution : $lang->bug->type;?> - + @@ -106,7 +106,7 @@ js::set('isStepsTemplate', $isStepsTemplate); bug->lblAssignedTo;?>
- + bug->allUsers, "class='btn btn-default' onclick='loadAllUsers()' data-toggle='tooltip'");?>
diff --git a/module/build/model.php b/module/build/model.php index 5a3265c745..f7384e2fd9 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -50,24 +50,24 @@ class buildModel extends model } /** - * Get builds of a execution. + * Get builds of a project. * - * @param int $executionID + * @param int $projectID * @param string $type * @param int $param * @access public * @return array */ - public function getExecutionBuilds($executionID = 0, $type = 'all', $param = 0) + public function getProjectBuilds($projectID = 0, $type = 'all', $param = 0) { - return $this->dao->select('t1.*, t2.name as executionName, t2.id as executionID, t3.name as productName, t4.name as branchName') + return $this->dao->select('t1.*, t2.name as projectName, t2.id as projectID, t3.name as productName, t4.name as branchName') ->from(TABLE_BUILD)->alias('t1') - ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') - ->where('t1.execution')->eq((int)$executionID) + ->where('t1.project')->eq((int)$projectID) ->andWhere('t1.deleted')->eq(0) - ->andWhere('t1.execution')->ne(0) + ->andWhere('t1.project')->ne(0) ->beginIF($type == 'product' and $param)->andWhere('t1.product')->eq($param)->fi() ->beginIF($type == 'bysearch')->andWhere($param)->fi() ->orderBy('t1.date DESC, t1.id desc') @@ -75,9 +75,9 @@ class buildModel extends model } /** - * Get builds of a execution in pairs. + * Get builds of a project in pairs. * - * @param int $executionID + * @param int $projectID * @param int $productID * @param int $branch * @param string $params noempty|notrunk, can be a set of them @@ -85,7 +85,7 @@ class buildModel extends model * @access public * @return array */ - public function getExecutionBuildPairs($executionID, $productID, $branch = 0, $params = '', $buildID = 0) + public function getProjectBuildPairs($projectID, $productID, $branch = 0, $params = '', $buildID = 0) { $sysBuilds = array(); $selectedBuilds = array(); @@ -93,11 +93,11 @@ class buildModel extends model if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => $this->lang->trunk); if($buildID != 0) $selectedBuilds = $this->dao->select('id, name')->from(TABLE_BUILD)->where('id')->in($buildID)->fetchPairs(); - $executionBuilds = $this->dao->select('t1.id, t1.name, t1.execution, t2.status as executionStatus, t3.id as releaseID, t3.status as releaseStatus, t4.name as branchName')->from(TABLE_BUILD)->alias('t1') - ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') + $projectBuilds = $this->dao->select('t1.id, t1.name, t1.project, t2.status as projectStatus, t3.id as releaseID, t3.status as releaseStatus, t4.name as branchName')->from(TABLE_BUILD)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->leftJoin(TABLE_RELEASE)->alias('t3')->on('t1.id = t3.build') ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') - ->where('t1.execution')->eq((int)$executionID) + ->where('t1.project')->eq((int)$projectID) ->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi() ->beginIF($branch)->andWhere('t1.branch')->in("0,$branch")->fi() ->andWhere('t1.deleted')->eq(0) @@ -105,9 +105,9 @@ class buildModel extends model /* Set builds and filter terminate releases. */ $builds = array(); - foreach($executionBuilds as $buildID => $build) + foreach($projectBuilds as $buildID => $build) { - if(empty($build->releaseID) and (strpos($params, 'nodone') !== false) and ($build->executionStatus === 'done')) continue; + if(empty($build->releaseID) and (strpos($params, 'nodone') !== false) and ($build->projectStatus === 'done')) continue; if((strpos($params, 'noterminate') !== false) and ($build->releaseStatus === 'terminate')) continue; $builds[$buildID] = $build->name; } @@ -125,14 +125,14 @@ class buildModel extends model } /** - * Get builds of a execution by search. + * Get builds of a project by search. * - * @param int $executionID + * @param int $projectID * @param int $queryID * @access public * @return array */ - public function getExecutionBuildsBySearch($executionID, $queryID) + public function getProjectBuildsBySearch($projectID, $queryID) { /* If there are saved query conditions, reset the session. */ if((int)$queryID) @@ -140,19 +140,19 @@ class buildModel extends model $query = $this->loadModel('search')->getQuery($queryID); if($query) { - $this->session->set('executionBuildQuery', $query->sql); - $this->session->set('executionBuildForm', $query->form); + $this->session->set('projectBuildQuery', $query->sql); + $this->session->set('projectBuildForm', $query->form); } } - if($this->session->executionBuildQuery == false) $this->session->set('executionBuildQuery', ' 1 = 1'); + if($this->session->projectBuildQuery == false) $this->session->set('projectBuildQuery', ' 1 = 1'); - $buildQuery = $this->session->executionBuildQuery; + $buildQuery = $this->session->projectBuildQuery; /* Distinguish between repeated fields. */ - $fields = array('id' => '`id`', 'name' => '`name`', 'product' => '`product`', 'desc' => '`desc`', 'execution' => '`execution`'); + $fields = array('id' => '`id`', 'name' => '`name`', 'product' => '`product`', 'desc' => '`desc`', 'project' => '`project`'); foreach($fields as $field) { - if(strpos($this->session->executionBuildQuery, $field) !== false) + if(strpos($this->session->projectBuildQuery, $field) !== false) { $buildQuery = str_replace($field, "t1." . $field, $buildQuery); } diff --git a/module/story/control.php b/module/story/control.php index f4c4dfea4c..dd9a9d3024 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -896,7 +896,7 @@ class story extends control $this->view->users = $users; $this->view->relations = $this->story->getStoryRelation($story->id, $story->type); $this->view->executions = $this->execution->getPairs(0, 'all', 'nocode'); - $this->view->execution = $this->execution->getByID($story->project); + $this->view->execution = empty($story->execution) ? array() : $this->dao->findById($story->execution)->from(TABLE_EXECUTION)->fetch(); $this->view->actions = $this->action->getList('story', $storyID); $this->view->storyModule = $storyModule; $this->view->modulePath = $modulePath; @@ -1618,7 +1618,7 @@ class story extends control $moduleID = $this->loadModel('tree')->getStoryModule($moduleID); $moduleID = $this->tree->getAllChildID($moduleID); } - $stories = $this->story->getProjectStoryPairs($executionID, $productID, $branch, $moduleID, $type); + $stories = $this->story->getExecutionStoryPairs($executionID, $productID, $branch, $moduleID, $type); if($this->app->getViewType() === 'json') { die(json_encode($stories));