diff --git a/config/zentaopms.php b/config/zentaopms.php index a97a6d47a3..1c33bb6d96 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -372,6 +372,7 @@ $config->objectTables['kanbanorder'] = TABLE_KANBANORDER; $config->objectTables['kanbangroup'] = TABLE_KANBANGROUP; $config->objectTables['kanbancard'] = TABLE_KANBANCARD; $config->objectTables['sonarqube'] = TABLE_PIPELINE; +$config->objectTables['gitea'] = TABLE_PIPELINE; $config->objectTables['gitlab'] = TABLE_PIPELINE; $config->objectTables['jebkins'] = TABLE_PIPELINE; $config->objectTables['stage'] = TABLE_STAGE; @@ -379,7 +380,7 @@ $config->objectTables['apistruct'] = TABLE_APISTRUCT; $config->newFeatures = array('introduction', 'tutorial', 'youngBlueTheme', 'visions'); -$config->pipelineTypeList = array('gitlab', 'sonarqube', 'jenkins'); +$config->pipelineTypeList = array('gitlab', 'sonarqube', 'jenkins', 'gitea'); /* Program privs.*/ $config->programPriv = new stdclass(); diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php index 9afe2605e6..fff699c0a3 100644 --- a/lib/base/front/front.class.php +++ b/lib/base/front/front.class.php @@ -1025,6 +1025,8 @@ EOT; } else { + /* Can not locate the url that has '#app', so remove it. */ + if(strpos($url, '#app=') !== false) $url = substr($url, 0, strpos($url, '#app=')); $js .= "$target.location='$url';\n"; } return $js . self::end(); diff --git a/module/action/config.php b/module/action/config.php index 85dd6cbcb9..cc841bc007 100755 --- a/module/action/config.php +++ b/module/action/config.php @@ -43,6 +43,7 @@ $config->action->objectNameFields['kanban'] = 'name'; $config->action->objectNameFields['kanbancard'] = 'name'; $config->action->objectNameFields['sonarqube'] = 'name'; $config->action->objectNameFields['gitlab'] = 'name'; +$config->action->objectNameFields['gitea'] = 'name'; $config->action->objectNameFields['stage'] = 'name'; $config->action->objectNameFields['apistruct'] = 'name'; @@ -60,7 +61,7 @@ $config->action->majorList['execution'] = array('opened', 'edited'); $config->action->needGetProjectType = 'build,task,bug,case,testcase,caselib,testtask,testsuite,testreport,doc,issue,release,risk,design,opportunity,trainplan,gapanalysis,researchplan,researchreport,'; $config->action->needGetRelateField = ',story,productplan,release,task,build,bug,testcase,case,testtask,testreport,doc,doclib,issue,risk,opportunity,trainplan,gapanalysis,team,whitelist,researchplan,researchreport,meeting,kanbanlane,kanbancolumn,module,'; -$config->action->noLinkModules = ',doclib,module,webhook,gitlab,sonarqube,pipeline,jenkins,kanban,kanbanspace,kanbancolumn,kanbanlane,kanbanregion,kanbancard,execution,project,traincategory,apistruct,program,product,user,entry,'; +$config->action->noLinkModules = ',doclib,module,webhook,gitlab,gitea,sonarqube,pipeline,jenkins,kanban,kanbanspace,kanbancolumn,kanbanlane,kanbanregion,kanbancard,execution,project,traincategory,apistruct,program,product,user,entry,'; $config->action->preferredTypeNum = 10; diff --git a/module/action/lang/de.php b/module/action/lang/de.php index ba4212243b..988570d7ce 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -123,6 +123,7 @@ $lang->action->objectTypes['team'] = 'Team'; $lang->action->objectTypes['whitelist'] = 'Whitelist'; $lang->action->objectTypes['pipeline'] = 'GitLib'; $lang->action->objectTypes['gitlab'] = 'GitLab Server'; +$lang->action->objectTypes['gitea'] = 'Gitea Server'; $lang->action->objectTypes['jenkins'] = 'Jenkins'; $lang->action->objectTypes['mr'] = 'Merge Request'; $lang->action->objectTypes['gitlabproject'] = 'GitLab Project'; @@ -635,6 +636,10 @@ $lang->action->dynamicAction->gitlab['created'] = 'Create GitLab Server'; $lang->action->dynamicAction->gitlab['edited'] = 'Edit GitLab Server'; $lang->action->dynamicAction->gitlab['deleted'] = 'Delete GitLab Server'; +$lang->action->dynamicAction->gitea['created'] = 'Create Gitea Server'; +$lang->action->dynamicAction->gitea['edited'] = 'Edit Gitea Server'; +$lang->action->dynamicAction->gitea['deleted'] = 'Delete Gitea Server'; + /* Generate the corresponding object link. */ $lang->action->label->product = $lang->productCommon . '|product|view|productID=%s'; $lang->action->label->productplan = 'Plan|productplan|view|productID=%s'; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 90ef4137cf..e195c73ad7 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -123,6 +123,7 @@ $lang->action->objectTypes['team'] = 'Team'; $lang->action->objectTypes['whitelist'] = 'Whitelist'; $lang->action->objectTypes['pipeline'] = 'GitLab Server'; $lang->action->objectTypes['gitlab'] = 'GitLab Server'; +$lang->action->objectTypes['gitea'] = 'Gitea Server'; $lang->action->objectTypes['jenkins'] = 'Jenkins'; $lang->action->objectTypes['mr'] = 'Merge Request'; $lang->action->objectTypes['gitlabproject'] = 'GitLab Project'; @@ -635,6 +636,10 @@ $lang->action->dynamicAction->gitlab['created'] = 'Create GitLab Server'; $lang->action->dynamicAction->gitlab['edited'] = 'Edit GitLab Server'; $lang->action->dynamicAction->gitlab['deleted'] = 'Delete GitLab Server'; +$lang->action->dynamicAction->gitea['created'] = 'Create Gitea Server'; +$lang->action->dynamicAction->gitea['edited'] = 'Edit Gitea Server'; +$lang->action->dynamicAction->gitea['deleted'] = 'Delete Gitea Server'; + /* Generate the corresponding object link. */ $lang->action->label->product = $lang->productCommon . '|product|view|productID=%s'; $lang->action->label->productplan = 'Plan|productplan|view|productID=%s'; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index 2811d2c9ec..fb1c45ebc5 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -123,6 +123,7 @@ $lang->action->objectTypes['team'] = 'Team'; $lang->action->objectTypes['whitelist'] = 'Whitelist'; $lang->action->objectTypes['pipeline'] = 'GitLib'; $lang->action->objectTypes['gitlab'] = 'GitLab Server'; +$lang->action->objectTypes['gitea'] = 'Gitea Server'; $lang->action->objectTypes['jenkins'] = 'Jenkins'; $lang->action->objectTypes['mr'] = 'Merge Request'; $lang->action->objectTypes['gitlabproject'] = 'GitLab Project'; @@ -635,6 +636,10 @@ $lang->action->dynamicAction->gitlab['created'] = 'Create GitLab Server'; $lang->action->dynamicAction->gitlab['edited'] = 'Edit GitLab Server'; $lang->action->dynamicAction->gitlab['deleted'] = 'Delete GitLab Server'; +$lang->action->dynamicAction->gitea['created'] = 'Create Gitea Server'; +$lang->action->dynamicAction->gitea['edited'] = 'Edit Gitea Server'; +$lang->action->dynamicAction->gitea['deleted'] = 'Delete Gitea Server'; + /* Generate the corresponding object link. */ $lang->action->label->product = $lang->productCommon . '|product|view|productID=%s'; $lang->action->label->productplan = 'Plan|productplan|view|productID=%s'; diff --git a/module/action/lang/vi.php b/module/action/lang/vi.php index 1b014851f3..681dc1b71f 100644 --- a/module/action/lang/vi.php +++ b/module/action/lang/vi.php @@ -65,41 +65,62 @@ $lang->action->periods['lastweek'] = $lang->action->dynamic->lastWeek; $lang->action->periods['thismonth'] = $lang->action->dynamic->thisMonth; $lang->action->periods['lastmonth'] = $lang->action->dynamic->lastMonth; -$lang->action->objectTypes['product'] = $lang->productCommon; -$lang->action->objectTypes['branch'] = 'Nhánh'; -$lang->action->objectTypes['story'] = $lang->SRCommon; -$lang->action->objectTypes['design'] = 'Design'; -$lang->action->objectTypes['productplan'] = 'Plan'; -$lang->action->objectTypes['release'] = 'Phát hành'; -$lang->action->objectTypes['program'] = 'Program'; -$lang->action->objectTypes['project'] = 'Project'; -$lang->action->objectTypes['execution'] = $lang->executionCommon; -$lang->action->objectTypes['task'] = 'Nhiệm vụ'; -$lang->action->objectTypes['build'] = 'Bản dựng'; -$lang->action->objectTypes['job'] = 'Job'; -$lang->action->objectTypes['bug'] = 'Bug'; -$lang->action->objectTypes['case'] = 'Tình huống'; -$lang->action->objectTypes['caseresult'] = 'Kết quả tình huống'; -$lang->action->objectTypes['stepresult'] = 'Các bước tình huống'; -$lang->action->objectTypes['caselib'] = 'Thư viện'; -$lang->action->objectTypes['testsuite'] = 'Suite'; -$lang->action->objectTypes['testtask'] = 'Test bản dựng'; -$lang->action->objectTypes['testreport'] = 'Báo cáo'; -$lang->action->objectTypes['doc'] = 'Tài liệu'; -$lang->action->objectTypes['doclib'] = 'Thư viện tài liệu'; -$lang->action->objectTypes['todo'] = 'Việc làm'; -$lang->action->objectTypes['risk'] = 'Risk'; -$lang->action->objectTypes['issue'] = 'Issue'; -$lang->action->objectTypes['module'] = 'Module'; -$lang->action->objectTypes['user'] = 'Người dùng'; -$lang->action->objectTypes['stakeholder'] = 'Stakeholder'; -$lang->action->objectTypes['budget'] = 'Cost Estimate'; -$lang->action->objectTypes['entry'] = 'Entry'; -$lang->action->objectTypes['webhook'] = 'Webhook'; -$lang->action->objectTypes['job'] = 'Job'; -$lang->action->objectTypes['team'] = 'Team'; -$lang->action->objectTypes['whitelist'] = 'Whitelist'; -$lang->action->objectTypes['pipeline'] = 'GitLib'; +$lang->action->objectTypes['product'] = $lang->productCommon; +$lang->action->objectTypes['branch'] = 'Nhánh'; +$lang->action->objectTypes['story'] = $lang->SRCommon; +$lang->action->objectTypes['design'] = 'Design'; +$lang->action->objectTypes['productplan'] = 'Plan'; +$lang->action->objectTypes['release'] = 'Phát hành'; +$lang->action->objectTypes['program'] = 'Program'; +$lang->action->objectTypes['project'] = 'Project'; +$lang->action->objectTypes['execution'] = $lang->executionCommon; +$lang->action->objectTypes['task'] = 'Nhiệm vụ'; +$lang->action->objectTypes['build'] = 'Bản dựng'; +$lang->action->objectTypes['job'] = 'Job'; +$lang->action->objectTypes['bug'] = 'Bug'; +$lang->action->objectTypes['case'] = 'Tình huống'; +$lang->action->objectTypes['caseresult'] = 'Kết quả tình huống'; +$lang->action->objectTypes['stepresult'] = 'Các bước tình huống'; +$lang->action->objectTypes['caselib'] = 'Thư viện'; +$lang->action->objectTypes['testsuite'] = 'Suite'; +$lang->action->objectTypes['testtask'] = 'Test bản dựng'; +$lang->action->objectTypes['testreport'] = 'Báo cáo'; +$lang->action->objectTypes['doc'] = 'Tài liệu'; +$lang->action->objectTypes['doclib'] = 'Thư viện tài liệu'; +$lang->action->objectTypes['todo'] = 'Việc làm'; +$lang->action->objectTypes['risk'] = 'Risk'; +$lang->action->objectTypes['issue'] = 'Issue'; +$lang->action->objectTypes['module'] = 'Module'; +$lang->action->objectTypes['user'] = 'Người dùng'; +$lang->action->objectTypes['stakeholder'] = 'Stakeholder'; +$lang->action->objectTypes['budget'] = 'Cost Estimate'; +$lang->action->objectTypes['entry'] = 'Entry'; +$lang->action->objectTypes['webhook'] = 'Webhook'; +$lang->action->objectTypes['job'] = 'Job'; +$lang->action->objectTypes['team'] = 'Team'; +$lang->action->objectTypes['whitelist'] = 'Whitelist'; +$lang->action->objectTypes['pipeline'] = 'GitLib'; +$lang->action->objectTypes['gitlab'] = 'GitLab Server'; +$lang->action->objectTypes['gitea'] = 'Gitea Server'; +$lang->action->objectTypes['jenkins'] = 'Jenkins'; +$lang->action->objectTypes['mr'] = 'Merge Request'; +$lang->action->objectTypes['gitlabproject'] = 'GitLab Project'; +$lang->action->objectTypes['gitlabuser'] = 'GitLab User'; +$lang->action->objectTypes['gitlabgroup'] = 'GitLab Group'; +$lang->action->objectTypes['gitlabbranch'] = 'GitLab Branch'; +$lang->action->objectTypes['gitlabbranchpriv'] = 'GitLab Protected Branches'; +$lang->action->objectTypes['gitlabtag'] = 'GitLab Tag'; +$lang->action->objectTypes['gitlabtagpriv'] = 'GitLab Tag Protected'; +$lang->action->objectTypes['kanbanspace'] = 'Kanban Space'; +$lang->action->objectTypes['kanban'] = 'Kanban'; +$lang->action->objectTypes['kanbanregion'] = 'Kanban Region'; +$lang->action->objectTypes['kanbanlane'] = 'Kanban Lane'; +$lang->action->objectTypes['kanbancolumn'] = 'Kanban Column'; +$lang->action->objectTypes['kanbancard'] = 'Kanban Card'; +$lang->action->objectTypes['sonarqube'] = 'SonarQube Server'; +$lang->action->objectTypes['sonarqubeproject'] = 'SonarQube Project'; +$lang->action->objectTypes['stage'] = 'Stage'; +$lang->action->objectTypes['patch'] = 'Patch'; /* Used to describe operation history. */ $lang->action->desc = new stdclass(); @@ -462,6 +483,26 @@ $lang->action->dynamicAction->user['loginxuanxuan'] = 'Login Desktop'; $lang->action->dynamicAction->entry['created'] = 'Thêm ứng dụng'; $lang->action->dynamicAction->entry['edited'] = 'Sửa ứng dụng'; +$lang->action->dynamicAction->job['created'] = 'Create Job'; +$lang->action->dynamicAction->job['edited'] = 'Edit Job'; +$lang->action->dynamicAction->job['executed'] = 'Execute Job'; +$lang->action->dynamicAction->job['deleted'] = 'Delete Job'; +$lang->action->dynamicAction->job['undeleted'] = 'Undelete Job'; + +$lang->action->dynamicAction->sonarqube['created'] = 'Create SonarQube Server'; +$lang->action->dynamicAction->sonarqube['edited'] = 'Edit SonarQube Server'; +$lang->action->dynamicAction->sonarqube['deleted'] = 'Delete SonarQube Server'; + +$lang->action->dynamicAction->sonarqubeproject['deleted'] = 'Delete SonarQube Project'; + +$lang->action->dynamicAction->gitlab['created'] = 'Create GitLab Server'; +$lang->action->dynamicAction->gitlab['edited'] = 'Edit GitLab Server'; +$lang->action->dynamicAction->gitlab['deleted'] = 'Delete GitLab Server'; + +$lang->action->dynamicAction->gitea['created'] = 'Create Gitea Server'; +$lang->action->dynamicAction->gitea['edited'] = 'Edit Gitea Server'; +$lang->action->dynamicAction->gitea['deleted'] = 'Delete Gitea Server'; + /* Generate the corresponding object link. */ global $config; $lang->action->label->product = $lang->productCommon . '|product|view|productID=%s'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index f1ef255b25..4b332524af 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -123,6 +123,7 @@ $lang->action->objectTypes['team'] = '团队'; $lang->action->objectTypes['whitelist'] = '白名单'; $lang->action->objectTypes['pipeline'] = 'GitLab服务器'; $lang->action->objectTypes['gitlab'] = 'GitLab服务器'; +$lang->action->objectTypes['gitea'] = 'Gitea服务器'; $lang->action->objectTypes['jenkins'] = 'Jenkins'; $lang->action->objectTypes['mr'] = '合并请求'; $lang->action->objectTypes['gitlabproject'] = 'GitLab项目'; @@ -632,9 +633,13 @@ $lang->action->dynamicAction->sonarqube['deleted'] = '删除SonarQube服务器'; $lang->action->dynamicAction->sonarqubeproject['deleted'] = '删除SonarQube项目'; $lang->action->dynamicAction->gitlab['created'] = '创建GitLab服务器'; -$lang->action->dynamicAction->gitlab['edited'] = '设置GitLab服务器'; +$lang->action->dynamicAction->gitlab['edited'] = '编辑GitLab服务器'; $lang->action->dynamicAction->gitlab['deleted'] = '删除GitLab服务器'; +$lang->action->dynamicAction->gitea['created'] = '创建Gitea服务器'; +$lang->action->dynamicAction->gitea['edited'] = '编辑Gitea服务器'; +$lang->action->dynamicAction->gitea['deleted'] = '删除Gitea服务器'; + /* 用来生成相应对象的链接。*/ $lang->action->label->product = $lang->productCommon . '|product|view|productID=%s'; $lang->action->label->productplan = "计划|productplan|view|productID=%s"; diff --git a/module/block/control.php b/module/block/control.php index 7a757e820e..8436a597c6 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1756,10 +1756,7 @@ class block extends control ->beginIF($objectType == 'story' or $objectType == 'requirement')->andWhere('t2.deleted')->eq('0')->fi() ->beginIF($objectType == 'todo')->andWhere('t1.cycle')->eq(0)->andWhere('t1.status')->eq('wait')->andWhere('t1.vision')->eq($this->config->vision)->fi() ->beginIF($objectType != 'todo')->andWhere('t1.status')->ne('closed')->fi() - ->beginIF($objectType == 'feedback') - ->andWhere('t1.status')->in('wait, noreview') - ->andWhere('t1.assignedTo')->eq($this->app->user->account) - ->fi() + ->beginIF($objectType == 'feedback')->andWhere('t1.status')->in('wait, noreview')->fi() ->orderBy($orderBy) ->beginIF($limitCount)->limit($limitCount)->fi() ->fetchAll(); diff --git a/module/branch/control.php b/module/branch/control.php index b42ee63b0c..ae9090bde2 100644 --- a/module/branch/control.php +++ b/module/branch/control.php @@ -211,7 +211,10 @@ class branch extends control public function ajaxGetDropMenu($productID, $branch, $module, $method, $extra = '') { parse_str($extra, $output); - $branches = $this->branch->getPairs($productID, 'all', isset($output['projectID']) ? $output['projectID'] : 0); + $isQaModule = (strpos(',project,execution,', ",{$this->app->tab},") !== false and strpos(',bug,', ",$method,") !== false and !empty($productID)) ? true : false; + $param = $isQaModule ? $extra : 0; + $param = isset($output['projectID']) ? $output['projectID'] : $param; + $branches = $this->branch->getPairs($productID, 'all', $param); $statusList = $this->dao->select('id,status')->from(TABLE_BRANCH)->where('product')->eq($productID)->fetchPairs(); $this->view->link = $this->loadModel('product')->getProductLink($module, $method, $extra, true); diff --git a/module/bug/control.php b/module/bug/control.php index c01bb8e481..38e223697c 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1416,13 +1416,26 @@ class bug extends control { $bug = $this->bug->getById($bugID); $execution = $this->loadModel('execution')->getByID($bug->execution); - if(isset($execution->type) and $execution->type == 'kanban' and $this->app->tab == 'execution') + if($this->app->tab == 'execution') { + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', 0, $kanbanGroup, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + if(isset($execution->type) and $execution->type == 'kanban') + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', 0, $kanbanGroup, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); + } } else { @@ -1853,16 +1866,27 @@ class bug extends control if(isonlybody()) { $execution = $this->loadModel('execution')->getByID($bug->execution); - if(isset($execution->type) and $execution->type == 'kanban' and $this->app->tab == 'execution') + if($this->app->tab == 'execution') { - $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + if(isset($execution->type) and $execution->type == 'kanban') + { + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + } + else + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); + } } else { diff --git a/module/bug/model.php b/module/bug/model.php index 6ae8cdee28..b0e3f1ccbc 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1737,6 +1737,7 @@ class bugModel extends model * * @param int $projectID * @param int $productID + * @param int $branchID * @param int $build * @param string $type * @param int $param @@ -1746,7 +1747,7 @@ class bugModel extends model * @access public * @return array */ - public function getProjectBugs($projectID, $productID = 0, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null) + public function getProjectBugs($projectID, $productID = 0, $branchID = 0, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null) { $type = strtolower($type); if($type == 'bysearch') @@ -1781,6 +1782,7 @@ class bugModel extends model ->where('t1.deleted')->eq(0) ->beginIF(empty($build))->andWhere('t1.project')->eq($projectID)->fi() ->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID)->fi() + ->andWhere('t1.branch')->eq($branchID) ->beginIF($type == 'unresolved')->andWhere('t1.status')->eq('active')->fi() ->beginIF($type == 'noclosed')->andWhere('t1.status')->ne('closed')->fi() ->beginIF($type == 'assignedtome')->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi() @@ -1801,6 +1803,7 @@ class bugModel extends model * * @param int $executionID * @param int $productID + * @param int $branchID * @param int $build * @param string $type * @param int $param @@ -1810,7 +1813,7 @@ class bugModel extends model * @access public * @return array */ - public function getExecutionBugs($executionID, $productID = 0, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null) + public function getExecutionBugs($executionID, $productID = 0, $branchID = 'all', $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null) { $type = strtolower($type); if($type == 'bysearch') @@ -1843,6 +1846,7 @@ class bugModel extends model $bugs = $this->dao->select('t1.*')->from(TABLE_BUG)->alias('t1') ->leftJoin(TABLE_MODULE)->alias('t2')->on('t1.module=t2.id') ->where('t1.deleted')->eq(0) + ->beginIF($branchID != 'all')->andWhere('t1.branch')->eq($branchID)->fi() ->beginIF(empty($build))->andWhere('t1.execution')->eq($executionID)->fi() ->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID)->fi() ->beginIF($type == 'unresolved')->andWhere('t1.status')->eq('active')->fi() diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 49381e4a63..005a5fd1fa 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -288,7 +288,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
createLink('bug', 'batchEdit', "productID=$productID&branch=$branch"); - $misc = $canBatchEdit ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'"; + $misc = $canBatchEdit ? "onclick=\"setFormAction('$actionLink', '', '#bugList')\"" : "disabled='disabled'"; echo html::commonButton($lang->edit, $misc); ?> @@ -296,17 +296,17 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow createLink('bug', 'batchConfirm'); - $misc = $canBatchConfirm ? "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"" : ''; + $misc = $canBatchConfirm ? "onclick=\"setFormAction('$actionLink', 'hiddenwin', '#bugList')\"" : ''; echo "
  • " . html::a('javascript:;', $lang->bug->confirmBug, '', $misc) . "
  • "; $class = $canBatchClose ? '' : "class='disabled'"; $actionLink = $this->createLink('bug', 'batchClose'); - $misc = $canBatchClose ? "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"" : ''; + $misc = $canBatchClose ? "onclick=\"setFormAction('$actionLink', 'hiddenwin', '#bugList')\"" : ''; echo "
  • " . html::a('javascript:;', $lang->bug->close, '', $misc) . "
  • "; $class = $canBatchActivate ? '' : "class='disabled'"; $actionLink = $this->createLink('bug', 'batchActivate', "productID=$productID&branch=$branch"); - $misc = $canBatchActivate ? "onclick=\"setFormAction('$actionLink')\"" : ''; + $misc = $canBatchActivate ? "onclick=\"setFormAction('$actionLink', '', '#bugList')\"" : ''; echo "
  • " . html::a('javascript:;', $lang->bug->activate, '', $misc) . "
  • "; $misc = $canBatchResolve ? "id='resolveItem'" : ''; @@ -332,7 +332,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow { $actionLink = $this->createLink('bug', 'batchResolve', "resolution=fixed&resolvedBuild=$key"); echo "
  • "; - echo html::a('javascript:;', $build, '', "onclick=\"setFormAction('$actionLink', 'hiddenwin')\""); + echo html::a('javascript:;', $build, '', "onclick=\"setFormAction('$actionLink', 'hiddenwin', '#bugList')\""); echo "
  • "; } echo ""; @@ -341,7 +341,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow } else { - echo '
  • ' . html::a('javascript:;', $resolution, '', "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"") . '
  • '; + echo '
  • ' . html::a('javascript:;', $resolution, '', "onclick=\"setFormAction('$actionLink', 'hiddenwin', '#bugList')\"") . '
  • '; } } echo ''; @@ -370,7 +370,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow { $searchKey = $withSearch ? ('data-key="' . zget($branchsPinYin, $branchName, '') . '"') : ''; $actionLink = $this->createLink('bug', 'batchChangeBranch', "branchID=$branchID"); - echo html::a('#', $branchName, '', "$searchKey onclick=\"setFormAction('$actionLink', 'hiddenwin')\" data-key='$branchID'"); + echo html::a('#', $branchName, '', "$searchKey onclick=\"setFormAction('$actionLink', 'hiddenwin', '#bugList')\" data-key='$branchID'"); } ?>
    @@ -398,7 +398,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow { $searchKey = $withSearch ? ('data-key="' . zget($modulesPinYin, $module, '') . '"') : ''; $actionLink = $this->createLink('bug', 'batchChangeModule', "moduleID=$moduleId"); - echo html::a('#', $module, '', "$searchKey onclick=\"setFormAction('$actionLink', 'hiddenwin')\" data-key='$moduleID'"); + echo html::a('#', $module, '', "$searchKey onclick=\"setFormAction('$actionLink', 'hiddenwin', '#bugList')\" data-key='$moduleID'"); } ?> @@ -428,7 +428,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow { if(empty($key)) continue; $searchKey = $withSearch ? ('data-key="' . zget($membersPinYin, $value, '') . " @$key\"") : "data-key='@$key'"; - echo html::a("javascript:$(\"#assignedTo\").val(\"$key\");setFormAction(\"$actionLink\", \"hiddenwin\")", $value, '', $searchKey); + echo html::a("javascript:$(\"#assignedTo\").val(\"$key\");setFormAction(\"$actionLink\", \"hiddenwin\", \"#bugList\")", $value, '', $searchKey); } ?> diff --git a/module/build/control.php b/module/build/control.php index 40b99a6fa0..df9d5102d1 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -270,7 +270,7 @@ class build extends control $this->view->storyPager = $storyPager; $generatedBugPager = new pager($type == 'generatedBug' ? $recTotal : 0, $recPerPage, $type == 'generatedBug' ? $pageID : 1); - $this->view->generatedBugs = $this->bug->getExecutionBugs($build->execution, $build->product, $build->id, $type, $param, $type == 'generatedBug' ? $orderBy : 'status_desc,id_desc', '', $generatedBugPager); + $this->view->generatedBugs = $this->bug->getExecutionBugs($build->execution, $build->product, 'all', $build->id, $type, $param, $type == 'generatedBug' ? $orderBy : 'status_desc,id_desc', '', $generatedBugPager); $this->view->generatedBugPager = $generatedBugPager; $this->executeHooks($buildID); @@ -682,7 +682,7 @@ class build extends control } else { - $allBugs = $this->bug->getExecutionBugs($build->execution, 0, $buildID, 'noclosed', 0, 'status_desc,id_desc', $build->bugs, $pager); + $allBugs = $this->bug->getExecutionBugs($build->execution, 0, 'all', $buildID, 'noclosed', 0, 'status_desc,id_desc', $build->bugs, $pager); } $this->view->allBugs = $allBugs; diff --git a/module/common/lang/common.php b/module/common/lang/common.php index 35a995258c..aee6ec0b58 100644 --- a/module/common/lang/common.php +++ b/module/common/lang/common.php @@ -176,7 +176,6 @@ $lang->createIcons['program'] = 'program'; $lang->createIcons['kanbanspace'] = 'cube'; $lang->createIcons['kanban'] = 'kanban'; -$lang->refreshIcon = ""; $lang->noMenuModule = array('report', 'my', 'todo', 'effort', 'program', 'product', 'execution', 'task', 'build', 'productplan', 'project', 'projectrelease', 'projectstory', 'story', 'branch', 'release', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'custom', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'pssp', 'sms', 'message', 'webhook', 'search', 'score', 'stage', 'entry', 'jenkins', 'gitlab', 'gitea'); if(isset($_SESSION['tutorialMode']) and $_SESSION['tutorialMode'] and !defined('TUTORIAL')) define('TUTORIAL', true); diff --git a/module/common/lang/de.php b/module/common/lang/de.php index d5bcf7f08f..c040e25ada 100644 --- a/module/common/lang/de.php +++ b/module/common/lang/de.php @@ -52,6 +52,7 @@ $lang->designedByAIUX = "reset = 'Zurücksetzen'; $lang->cancel = 'Abbrechen'; $lang->refresh = 'Aktualisieren'; +$lang->refreshIcon = ""; $lang->create = 'Create'; $lang->edit = 'Bearbeiten'; $lang->delete = 'Löschen'; diff --git a/module/common/lang/en.php b/module/common/lang/en.php index de9c5c39bd..840816c09b 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -52,6 +52,7 @@ $lang->designedByAIUX = "reset = 'Reset'; $lang->cancel = 'Cancel'; $lang->refresh = 'Refresh'; +$lang->refreshIcon = ""; $lang->create = 'Create'; $lang->edit = 'Edit'; $lang->delete = 'Delete'; @@ -186,10 +187,10 @@ $lang->upgrade->common = 'Update'; $lang->program->list = 'Program List'; $lang->program->kanban = 'Program Kanban'; $lang->design->common = 'Design'; -$lang->design->HLDS = 'HLDS'; -$lang->design->DDS = 'DDS'; -$lang->design->DBDS = 'DBDS'; -$lang->design->ADS = 'ADS'; +$lang->design->HLDS = 'Preliminary Design'; +$lang->design->DDS = 'Detailed Design'; +$lang->design->DBDS = 'Database Design'; +$lang->design->ADS = 'Interface Design'; $lang->stage->common = 'Stage'; $lang->stage->list = 'Stage List'; $lang->execution->list = "{$lang->executionCommon} List"; diff --git a/module/common/lang/fr.php b/module/common/lang/fr.php index 30d0bddb40..e237242a94 100644 --- a/module/common/lang/fr.php +++ b/module/common/lang/fr.php @@ -52,6 +52,7 @@ $lang->designedByAIUX = "reset = 'Réinitialiser'; $lang->cancel = 'Annuler'; $lang->refresh = 'Rafraichir'; +$lang->refreshIcon = ""; $lang->create = 'Create'; $lang->edit = 'Editer'; $lang->delete = 'Supprimer'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index eedbc0f23a..336f1c7a4d 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -52,6 +52,7 @@ $lang->designedByAIUX = "reset = '重填'; $lang->cancel = '取消'; $lang->refresh = '刷新'; +$lang->refreshIcon = ""; $lang->create = '新建'; $lang->edit = '编辑'; $lang->delete = '删除'; diff --git a/module/common/model.php b/module/common/model.php index 57e9041feb..02409185ed 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1601,7 +1601,7 @@ EOD; * @param string $extraClass * @param bool $onlyBody * @param string $misc - * @Param bool $extraEnabled + * @param bool $extraEnabled * @static * @access public * @return void @@ -1802,13 +1802,14 @@ EOD; * @param string $extraClass * @param bool $onlyBody * @param string $misc + * @param string $extraEnabled * @static * @access public * @return void */ - public static function printIcon($module, $method, $vars = '', $object = '', $type = 'button', $icon = '', $target = '', $extraClass = '', $onlyBody = false, $misc = '', $title = '', $programID = 0) + public static function printIcon($module, $method, $vars = '', $object = '', $type = 'button', $icon = '', $target = '', $extraClass = '', $onlyBody = false, $misc = '', $title = '', $programID = 0, $extraEnabled = '') { - echo common::buildIconButton($module, $method, $vars, $object, $type, $icon, $target, $extraClass, $onlyBody, $misc, $title, $programID); + echo common::buildIconButton($module, $method, $vars, $object, $type, $icon, $target, $extraClass, $onlyBody, $misc, $title, $programID, $extraEnabled); } /** @@ -2417,6 +2418,7 @@ EOD; ($module == 'file' and strpos('|read|download|uploadimages|ajaxwopifiles|', "|{$method}|") !== false) or ($module == 'sso' and $method == 'login') or ($module == 'report' && $method == 'annualdata') or + ($module == 'misc' && $method == 'captcha') or ($module == 'traincourse' and $method == 'ajaxuploadlargefile') or ($module == 'traincourse' and $method == 'playvideo')) { diff --git a/module/design/lang/en.php b/module/design/lang/en.php index 595098ea3f..9a25dfdb79 100644 --- a/module/design/lang/en.php +++ b/module/design/lang/en.php @@ -42,7 +42,7 @@ $lang->design->comment = 'Comment'; $lang->design->common = 'Design'; $lang->design->create = 'Create Design'; $lang->design->batchCreate = 'Batch Create'; -$lang->design->edit = 'Edit'; +$lang->design->edit = 'Change'; $lang->design->delete = 'Delete'; $lang->design->view = 'View'; $lang->design->browse = 'List'; diff --git a/module/execution/control.php b/module/execution/control.php index f9a8cd61aa..74884ff20c 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -916,6 +916,7 @@ class execution extends control * * @param int $executionID * @param int $productID + * @param int $branchID * @param string $orderBy * @param int $build * @param string $type @@ -926,7 +927,7 @@ class execution extends control * @access public * @return void */ - public function bug($executionID = 0, $productID = 0, $orderBy = 'status,id_desc', $build = 0, $type = 'all', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function bug($executionID = 0, $productID = 0, $branch = 0, $orderBy = 'status,id_desc', $build = 0, $type = 'all', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Load these two models. */ $this->loadModel('bug'); @@ -943,11 +944,10 @@ class execution extends control $execution = $this->commonAction($executionID); $executionID = $execution->id; $products = $this->product->getProducts($execution->id); - $branchID = isset($products[$productID]) ? current($products[$productID]->branches) : 0; $productPairs = array('0' => $this->lang->product->all); foreach($products as $productData) $productPairs[$productData->id] = $productData->name; - $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', $executionID, 0, 0, '', false); + $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', $executionID, $branch); /* Header and position. */ $title = $execution->name . $this->lang->colon . $this->lang->execution->bug; @@ -959,7 +959,7 @@ class execution extends control if($this->app->getViewType() == 'xhtml') $recPerPage = 10; $pager = new pager($recTotal, $recPerPage, $pageID); $sort = common::appendOrder($orderBy); - $bugs = $this->bug->getExecutionBugs($executionID, $productID, $build, $type, $param, $sort, '', $pager); + $bugs = $this->bug->getExecutionBugs($executionID, $productID, $branch, $build, $type, $param, $sort, '', $pager); $bugs = $this->bug->checkDelayedBugs($bugs); $users = $this->user->getPairs('noletter'); @@ -986,7 +986,7 @@ class execution extends control $showBranch = $this->loadModel('branch')->showBranch($productID); /* Display status of branch. */ - $branches = $this->branch->getList($productID, 0, 'all'); + $branches = $this->branch->getList($productID, $executionID, 'all'); foreach($branches as $branchInfo) { $branchOption[$branchInfo->id] = $branchInfo->name; @@ -1014,7 +1014,7 @@ class execution extends control $modules = $this->tree->getAllModulePairs('bug'); /* Get module tree.*/ - $extra = array('executionID' => $executionID, 'orderBy' => $orderBy, 'type' => $type, 'build' => $build); + $extra = array('executionID' => $executionID, 'orderBy' => $orderBy, 'type' => $type, 'build' => $build, 'branchID' => $branch); if($executionID and empty($productID) and count($products) > 1) { $moduleTree = $this->tree->getBugTreeMenu($executionID, $productID, 0, array('treeModel', 'createBugLink'), $extra); @@ -1022,7 +1022,7 @@ class execution extends control elseif(!empty($products)) { $productID = empty($productID) ? reset($products)->id : $productID; - $moduleTree = $this->tree->getTreeMenu($productID, 'bug', 0, array('treeModel', 'createBugLink'), $extra + array('productID' => $productID), 'all'); + $moduleTree = $this->tree->getTreeMenu($productID, 'bug', 0, array('treeModel', 'createBugLink'), $extra + array('branchID' => $branch, 'productID' => $productID), $branch); } else { @@ -1030,7 +1030,7 @@ class execution extends control } $tree = $moduleID ? $this->tree->getByID($moduleID) : ''; - $showModule = !empty($this->config->datatable->projectBug->showModule) ? $this->config->datatable->executionBug->showModule : ''; + $showModule = !empty($this->config->datatable->executionBug->showModule) ? $this->config->datatable->executionBug->showModule : ''; /* Assign. */ $this->view->title = $title; @@ -1043,7 +1043,7 @@ class execution extends control $this->view->orderBy = $orderBy; $this->view->users = $users; $this->view->productID = $productID; - $this->view->branchID = empty($this->view->build->branch) ? $branchID : $this->view->build->branch; + $this->view->branchID = empty($this->view->build->branch) ? $branch : $this->view->build->branch; $this->view->memberPairs = $memberPairs; $this->view->type = $type; $this->view->summary = $this->bug->summary($bugs); diff --git a/module/execution/view/bug.html.php b/module/execution/view/bug.html.php index 34819006c8..0c457dbf6c 100644 --- a/module/execution/view/bug.html.php +++ b/module/execution/view/bug.html.php @@ -15,6 +15,7 @@
    - ' . $lang->project->create, '', 'class="btn btn-primary" data-toggle="modal" data-target="#guideDialog"');?> + ' . $lang->project->create, '', 'class="btn btn-primary" data-toggle="modal"');?>
    @@ -35,7 +35,7 @@ js::set('browseType', $browseType);

    project->empty;?> - ' . $lang->project->create, '', 'class="btn btn-info btn-wide " data-toggle="modal" data-target="#guideDialog"');?> + ' . $lang->project->create, '', 'class="btn btn-info btn-wide " data-toggle="modal"');?>

    diff --git a/module/project/control.php b/module/project/control.php index 68ab495de9..e1f3870f6a 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -981,6 +981,7 @@ class project extends control * * @param int $projectID * @param int $productID + * @param int $branchID * @param string $orderBy * @param int $build * @param string $type @@ -991,7 +992,7 @@ class project extends control * @access public * @return void */ - public function bug($projectID = 0, $productID = 0, $orderBy = 'status,id_desc', $build = 0, $type = 'all', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function bug($projectID = 0, $productID = 0, $branchID = 0, $orderBy = 'status,id_desc', $build = 0, $type = 'all', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Load these two models. */ $this->loadModel('bug'); @@ -1009,11 +1010,10 @@ class project extends control $type = strtolower($type); $queryID = ($type == 'bysearch') ? (int)$param : 0; $products = $this->product->getProducts($projectID); - $branchID = isset($products[$productID]) ? current($products[$productID]->branches) : 0; $productPairs = array('0' => $this->lang->product->all); foreach($products as $productData) $productPairs[$productData->id] = $productData->name; - $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'project', 'bug', '', $branchID, 0, '', false); + $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'project', 'bug', $projectID, $branchID); /* Header and position. */ $title = $project->name . $this->lang->colon . $this->lang->bug->common; @@ -1026,7 +1026,7 @@ class project extends control $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); $sort = common::appendOrder($orderBy); - $bugs = $this->bug->getProjectBugs($projectID, $productID, $build, $type, $param, $sort, '', $pager); + $bugs = $this->bug->getProjectBugs($projectID, $productID, $branchID, $build, $type, $param, $sort, '', $pager); /* team member pairs. */ $memberPairs = array(); @@ -1047,7 +1047,7 @@ class project extends control $showBranch = $this->loadModel('branch')->showBranch($productID); /* Display status of branch. */ - $branches = $this->loadModel('branch')->getList($productID, 0, 'all'); + $branches = $this->loadModel('branch')->getList($productID, $projectID, 'all'); foreach($branches as $branchInfo) { $branchOption[$branchInfo->id] = $branchInfo->name; @@ -1055,8 +1055,6 @@ class project extends control } } - $showModule = !empty($this->config->datatable->bugBrowse->showModule) ? $this->config->datatable->bugBrowse->showModule : ''; - $storyIdList = $taskIdList = array(); foreach($bugs as $bug) { @@ -1071,7 +1069,7 @@ class project extends control $modules = $this->tree->getAllModulePairs('bug'); /* Get module tree.*/ - $extra = array('projectID' => $projectID, 'orderBy' => $orderBy, 'type' => $type, 'build' => $build); + $extra = array('projectID' => $projectID, 'orderBy' => $orderBy, 'type' => $type, 'build' => $build, 'branchID' => $branchID); if($projectID and empty($productID) and count($products) > 1) { $moduleTree = $this->tree->getBugTreeMenu($projectID, $productID, 0, array('treeModel', 'createBugLink'), $extra); @@ -1079,7 +1077,7 @@ class project extends control elseif(!empty($products)) { $productID = empty($productID) ? reset($products)->id : $productID; - $moduleTree = $this->tree->getTreeMenu($productID, 'bug', 0, array('treeModel', 'createBugLink'), $extra + array('productID' => $productID), 'all'); + $moduleTree = $this->tree->getTreeMenu($productID, 'bug', 0, array('treeModel', 'createBugLink'), $extra + array('productID' => $productID, 'branchID' => $branchID), $branchID); } else { diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index 05173139f5..0194b57fbc 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -15,6 +15,7 @@ diff --git a/module/testreport/lang/en.php b/module/testreport/lang/en.php index 7919e6550f..fd8d13c668 100644 --- a/module/testreport/lang/en.php +++ b/module/testreport/lang/en.php @@ -75,7 +75,7 @@ $lang->testreport->buildSummary = 'Tested %s builds.'; $lang->testreport->confirmDelete = 'Do you want to delete this report?'; $lang->testreport->moreNotice = 'More features can be extended with reference to the ZenTao extension manual, or you can contact us at renee@easysoft.ltd for customization.'; $lang->testreport->exportNotice = "Exported By ZenTao"; -$lang->testreport->noReport = "No report has been generated. Please check it later."; +$lang->testreport->noReport = "No report has been generated.Please select one request to generate one test report."; $lang->testreport->foundBugTip = "Bugs found in this build period and the affected build is in this test period."; $lang->testreport->legacyBugTip = "Active bugs, or bugs that are not resolved in the test period."; $lang->testreport->activatedBugTip = "Reactived bugs during the testtask."; diff --git a/module/tree/model.php b/module/tree/model.php index e20b991c99..0afab36314 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -425,12 +425,12 @@ class treeModel extends model elseif(strpos(',case,bug,', ",$type,") !== false and $this->app->tab == 'execution') { if($product->type != 'normal' and $executionID) $branches += $this->branch->getPairs($product->id, 'noempty', $executionID); - if($onlyGetLinked) $executionModules = $this->getTaskTreeModules($executionID, true, $type); + if($onlyGetLinked) $executionModules = $this->getTaskTreeModules($executionID, true, $type, $type == 'bug' ? array('branchID' => $branch) : array()); } elseif(($type == 'story' and $this->app->rawModule == 'projectstory') or (strpos(',case,bug,', ",$type,") !== false and $this->app->tab == 'project')) { if($product->type != 'normal' and $projectID) $branches += $this->branch->getPairs($product->id, 'noempty', $projectID); - if($onlyGetLinked) $executionModules = $this->getTaskTreeModules($projectID, true, $type); + if($onlyGetLinked) $executionModules = $this->getTaskTreeModules($projectID, true, $type, $type == 'bug' ? array('branchID' => $branch) : array()); } /* Add for task #1945. check the module has case or no. */ @@ -447,7 +447,7 @@ class treeModel extends model } elseif(isset($executionModules[$module->id])) { - $this->buildTree($treeMenu, $module, $type, $userFunc, $extra); + $this->buildTree($treeMenu, $module, $type, $userFunc, $extra, $branch); } } ksort($treeMenu); @@ -689,16 +689,17 @@ class treeModel extends model if(empty($branchGroups[$id])) $branchGroups[$id]['0'] = ''; foreach($branchGroups[$id] as $branch => $branchName) { - $treeMenu = array(); - $query = $this->dao->select('*')->from(TABLE_MODULE)->where("((root = $id and type = 'bug') OR (root = $id and type = 'story' and branch ='$branch'))") + $query = $this->dao->select('*')->from(TABLE_MODULE)->where("((root = $id and type = 'bug' and branch='$branch') OR (root = $id and type = 'story' and branch ='$branch'))") ->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi() ->andWhere('deleted')->eq(0) ->orderBy('grade desc, `order`, type') ->get(); - $stmt = $this->dbh->query($query); + $treeMenu = array(); + $stmt = $this->dbh->query($query); + $extra['branchID'] = $branch; while($module = $stmt->fetch()) { - if(isset($executionModules[$module->id])) $this->buildTree($treeMenu, $module, 'bug', $userFunc, $extra); + if(isset($executionModules[$module->id])) $this->buildTree($treeMenu, $module, 'bug', $userFunc, $extra, $branch); } $tree .= isset($treeMenu[0]) ? $treeMenu[0] : ''; } @@ -950,10 +951,11 @@ class treeModel extends model * @param int $executionID * @param bool $parent * @param string $linkObject + * @param array $extra * @access public * @return array */ - public function getTaskTreeModules($executionID, $parent = false, $linkObject = 'story') + public function getTaskTreeModules($executionID, $parent = false, $linkObject = 'story', $extra = array()) { $executionModules = array(); $field = $parent ? 'path' : 'id'; @@ -987,6 +989,7 @@ class treeModel extends model ->leftJoin(TABLE_MODULE)->alias('t2')->on('t1.module = t2.id') ->where('t1.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) + ->andWhere('t1.branch')->eq(zget($extra, 'branchID', 0)) ->andWhere("t1.{$this->app->tab}")->eq($executionID) ->fetchPairs(); } @@ -1215,8 +1218,8 @@ class treeModel extends model $moduleName = strpos(',project,execution,', ",{$this->app->tab},") !== false ? $this->app->tab : 'bug'; $methodName = strpos(',project,execution,', ",{$this->app->tab},") !== false ? 'bug' : 'browse'; $param = "root={$module->root}&branch=&type=byModule¶m={$module->id}"; - if($this->app->tab == 'execution') $param = "execuitonID={$extra['executionID']}&productID={$module->root}&orderBy={$extra['orderBy']}&build={$extra['build']}&type={$extra['type']}¶m={$module->id}"; - if($this->app->tab == 'project') $param = "projectID={$extra['projectID']}&productID={$module->root}&orderBy={$extra['orderBy']}&build={$extra['build']}&type={$extra['type']}¶m={$module->id}"; + if($this->app->tab == 'execution') $param = "execuitonID={$extra['executionID']}&productID={$module->root}&branch={$extra['branchID']}&orderBy={$extra['orderBy']}&build={$extra['build']}&type={$extra['type']}¶m={$module->id}"; + if($this->app->tab == 'project') $param = "projectID={$extra['projectID']}&productID={$module->root}&branch={$extra['branchID']}&orderBy={$extra['orderBy']}&build={$extra['build']}&type={$extra['type']}¶m={$module->id}"; return html::a(helper::createLink($moduleName, $methodName, $param), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); }