diff --git a/module/action/model.php b/module/action/model.php index c90296cd75..769f2cd639 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -64,7 +64,7 @@ class actionModel extends model /* Get product project and execution for this object. */ $relation = $this->getRelatedFields($action->objectType, $objectID, $actionType, $extra); - $action->product = (int)$relation['product']; + $action->product = $relation['product']; $action->project = (int)$relation['project']; $action->execution = (int)$relation['execution']; diff --git a/module/execution/control.php b/module/execution/control.php index a563257356..a4f501513b 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1433,7 +1433,7 @@ class execution extends control $position[] = $this->lang->execution->edit; $allProducts = array(0 => ''); - $executionProsucts = $this->execution->getProducts($execution->project); + $executionProsucts = $this->execution->getProducts($execution->project, true, 'noclosed'); foreach($executionProsucts as $product) $allProducts[$product->id] = $product->name; $linkedProducts = $this->execution->getProducts($execution->id); diff --git a/module/execution/model.php b/module/execution/model.php index 5ff8526817..d589bd5496 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1579,7 +1579,7 @@ class executionModel extends model * @access public * @return array */ - public function getProducts($executionID, $withBranch = true) + public function getProducts($executionID, $withBranch = true, $status = 'all') { if(defined('TUTORIAL')) { @@ -1592,6 +1592,7 @@ class executionModel extends model ->on('t1.product = t2.id') ->where('t1.project')->eq((int)$executionID) ->andWhere('t2.deleted')->eq(0) + ->beginIF(strpos($status, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->products)->fi(); if(!$withBranch) return $query->fetchPairs('id', 'name'); return $query->fetchAll('id'); diff --git a/module/gitlab/lang/en.php b/module/gitlab/lang/en.php index dd8b436308..d8a12a1798 100644 --- a/module/gitlab/lang/en.php +++ b/module/gitlab/lang/en.php @@ -1,22 +1,46 @@ jenkins->common = 'Jenkins'; -$lang->jenkins->browse = 'Jenkins'; -$lang->jenkins->create = 'Create Jenkins'; -$lang->jenkins->edit = 'Edit Jenkins'; -$lang->jenkins->delete = 'Delete'; -$lang->jenkins->confirmDelete = 'Do you want to delete this Jenkins server?'; +$lang->gitlab = new stdclass; +$lang->gitlab->common = 'GitLab'; +$lang->gitlab->browse = 'GitLab Browse'; +$lang->gitlab->create = 'Create GitLab'; +$lang->gitlab->edit = 'Edit GitLab'; +$lang->gitlab->bindUser = 'Bind User'; +$lang->gitlab->webhook = 'webhook'; +$lang->gitlab->bindProduct = 'Import Product'; +$lang->gitlab->importIssue = 'Import Issue'; +$lang->gitlab->delete = 'Delete GitLab'; +$lang->gitlab->confirmDelete = 'Do you want to delete this GitLab server?'; +$lang->gitlab->gitlabAccount = 'GitLab Account'; +$lang->gitlab->zentaoAccount = 'Zentao Account'; -$lang->jenkins->browseAction = 'Jenkins List'; -$lang->jenkins->deleteAction = 'Delete Jenkins'; +$lang->gitlab->browseAction = 'GitLab List'; +$lang->gitlab->deleteAction = 'Delete GitLab'; +$lang->gitlab->gitlabProject = "{$lang->gitlab->common}project"; +$lang->gitlab->gitlabIssue = "{$lang->gitlab->common}issue"; +$lang->gitlab->zentaoProduct = 'Zentao Product'; +$lang->gitlab->objectType = 'Type'; // task, bug, story -$lang->jenkins->id = 'ID'; -$lang->jenkins->name = 'Name'; -$lang->jenkins->url = 'URL'; -$lang->jenkins->token = 'Token'; -$lang->jenkins->account = 'Username'; -$lang->jenkins->password = 'Password'; +$lang->gitlab->id = 'ID'; +$lang->gitlab->name = "{$lang->gitlab->common}name"; +$lang->gitlab->url = 'GitLab Url'; +$lang->gitlab->token = 'Token'; +$lang->gitlab->defaultProject = 'Default Project'; +$lang->gitlab->private = 'MD5 Verify'; + +$lang->gitlab->lblCreate = 'Create GitLab Server'; +$lang->gitlab->desc = 'Description'; +$lang->gitlab->tokenFirst = 'When the Token is not empty, the Token will be used first'; +$lang->gitlab->tips = 'When using a password, please disable the "Prevent cross-site request forgery" option in the GitLab global security settings.'; + +$lang->gitlab->placeholder = new stdclass; +$lang->gitlab->placeholder->name = ''; +$lang->gitlab->placeholder->url = "Please fill in the access address of the GitLab Server homepage, as :https://gitlab.zentao.net."; +$lang->gitlab->placeholder->token = "Please fill in the access token of an account with admin privileges."; + +$lang->gitlab->noImportableIssues = "There are currently no issues available for import."; +$lang->gitlab->tokenError = "The current token is not admin rights."; +$lang->gitlab->hostError = "Invalid GitLab service address."; +$lang->gitlab->bindUserError = "Cannot bind users repeatedly %s"; +$lang->gitlab->importIssueError = "The execution to which this issue belongs is not selected."; +$lang->gitlab->importIssueWarn = "There is a problem of import failure, you can try to import again."; -$lang->jenkins->lblCreate = 'Create Jenkins Server'; -$lang->jenkins->desc = 'Description'; -$lang->jenkins->tokenFirst = 'Use token if not empty.'; -$lang->jenkins->tips = 'Cancel "Prevent Cross Site Request Forgery exploits" when using password.'; diff --git a/module/gitlab/view/binduser.html.php b/module/gitlab/view/binduser.html.php index a0cf0dd17f..e634429c64 100644 --- a/module/gitlab/view/binduser.html.php +++ b/module/gitlab/view/binduser.html.php @@ -51,8 +51,8 @@