This commit is contained in:
hufangzhou
2021-07-14 15:07:23 +08:00
11 changed files with 57 additions and 30 deletions
+1 -1
View File
@@ -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'];
+1 -1
View File
@@ -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);
+2 -1
View File
@@ -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');
+42 -18
View File
@@ -1,22 +1,46 @@
<?php
$lang->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.';
+2 -2
View File
@@ -51,8 +51,8 @@
<tfoot>
<tr>
<td colspan="3" class="text-center form-actions">
<?php echo html::submitButton($lang->save);?>
<?php echo html::backButton();?>
<?php echo html::submitButton(); ?>
<?php if(!isonlybody()) echo html::a(inlink('browse', ""), $lang->goback, '', 'class="btn btn-wide"'); ?>
</td>
</tr>
</tfoot>
+2 -2
View File
@@ -36,8 +36,8 @@
<tr>
<th></th>
<td class='text-center form-actions'>
<?php echo html::submitButton();?>
<?php echo html::backButton();?>
<?php echo html::submitButton(); ?>
<?php if(!isonlybody()) echo html::a(inlink('browse', ""), $lang->goback, '', 'class="btn btn-wide"'); ?>
</td>
</tr>
</table>
+2 -1
View File
@@ -36,7 +36,8 @@
<tr>
<th></th>
<td class='text-center form-actions'>
<?php echo html::submitButton() . html::backButton(); ?>
<?php echo html::submitButton(); ?>
<?php if(!isonlybody()) echo html::a(inlink('browse', ""), $lang->goback, '', 'class="btn btn-wide"'); ?>
</td>
</tr>
</table>
+1 -1
View File
@@ -43,7 +43,7 @@
<tr>
<td class="text-center form-actions">
<?php echo html::submitButton($lang->save);?>
<?php echo html::backButton();?>
<?php if(!isonlybody()) echo html::a(inlink('browse', ""), $lang->goback, '', 'class="btn btn-wide"'); ?>
</td>
</tr>
</tfoot>
+1 -1
View File
@@ -441,7 +441,7 @@ class project extends control
$linkedBranches = array();
$productPlans = array(0 => '');
$allProducts = $this->program->getProductPairs($project->parent, 'assign', 'noclosed');
$linkedProducts = $this->project->getProducts($projectID);
$linkedProducts = $this->project->getProducts($projectID, true, 'noclosed');
$parentProject = $this->program->getByID($project->parent);
/* If the story of the product which linked the project, you don't allow to remove the product. */
+2 -1
View File
@@ -490,11 +490,12 @@ class projectModel extends model
* @access public
* @return array
*/
public function getProducts($projectID, $withBranch = true)
public function getProducts($projectID, $withBranch = true, $status = 'all')
{
$query = $this->dao->select('t2.id, t2.name, t2.type, t1.branch, t1.plan')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('t1.project')->eq((int)$projectID)
->beginIF(strpos($status, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi()
->andWhere('t2.deleted')->eq(0);
if(!$withBranch) return $query->fetchPairs('id', 'name');
+1 -1
View File
@@ -106,7 +106,7 @@
<th></th>
<td colspan='2' class='text-center form-actions'>
<?php echo html::submitButton(); ?>
<?php echo html::backButton() ?>
<?php if(!isonlybody()) echo html::a(inlink('maintain', ""), $lang->goback, '', 'class="btn btn-wide"'); ?>
</td>
</tr>
</table>