* Adjust the code.

This commit is contained in:
hufangzhou
2021-07-15 15:23:50 +08:00
43 changed files with 466 additions and 243 deletions
+48
View File
@@ -0,0 +1,48 @@
<?php
/**
* 禅道API的product资源类
* 版本V1
*
* The product entry point of zentaopms
* Version 1
*/
class productEntry extends Entry
{
public function get($productID)
{
$control = $this->loadController('product', 'view');
$control->view($productID);
$data = $this->getData();
if(isset($data->status) and $data->status == 'success') return $this->send(200, $data->data->product);
if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message);
$this->sendError(400, 'error');
}
public function put($productID)
{
$oldProduct = $this->loadModel('product')->getByID($productID);
/* Set $_POST variables. */
$fields = 'program,line,name,PO,QD,RD,type,desc,whitelist,status,acl';
$this->batchSetPost($fields, $oldProduct);
$control = $this->loadController('product', 'edit');
$control->edit($productID);
$data = $this->getData();
if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message);
$this->sendSuccess(200, 'success');
}
public function delete($productID)
{
$control = $this->loadController('product', 'delete');
$control->delete($productID, 'yes');
$this->getData();
$this->sendSuccess(200, 'success');
}
}
+49
View File
@@ -0,0 +1,49 @@
<?php
/**
* 禅道API的products资源类
* 版本V1
*
* The products entry point of zentaopms
* Version 1
*/
class productsEntry extends entry
{
public function get()
{
$control = $this->loadController('product', 'all');
$control->all();
$data = $this->getData();
if(isset($data->status) and $data->status == 'success')
{
return $this->send(200, $data->data->productStats);
}
if(isset($data->status) and $data->status == 'fail')
{
return $this->sendError(400, $data->message);
}
return $this->sendError(400, 'error');
}
public function post()
{
$fields = 'program,line,name,PO,QD,RD,type,desc,whitelist';
$this->batchSetPost($fields);
$this->setPost('acl', $this->request('acl', 'private'));
$this->setPost('whitelist', $this->request('whitelist', array()));
$control = $this->loadController('product', 'create');
$this->requireFields('name,program');
$control->create($this->request('program'));
$data = $this->getData();
if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message);
$product = $this->loadModel('product')->getByID($data->id);
$this->send(200, $product);
}
}
+57
View File
@@ -0,0 +1,57 @@
<?php
/**
* 禅道API的stories资源类
* 版本V1
*
* The stories entry point of zentaopms
* Version 1
*/
class storiesEntry extends entry
{
public function get($productID)
{
$control = $this->loadController('product', 'browse');
$control->browse($productID);
$data = $this->getData();
if(isset($data->status) and $data->status == 'success')
{
$stories = $data->data->stories;
$result = array();
foreach($stories as $story)
{
$result[] = $story;
}
return $this->send(200, $result);
}
if(isset($data->status) and $data->status == 'fail')
{
return $this->sendError(400, $data->message);
}
return $this->sendError(400, 'error');
}
public function post($productID)
{
$fields = 'title,spec,verify,reviewer,type';
$this->batchSetPost($fields);
/* If reviewer is not post, set needNotReview. */
if(empty($this->request('reviewer'))) $this->setPost('needNotReview', 1);
$this->setPost('product', $productID);
$control = $this->loadController('story', 'create');
$this->requireFields('title,spec,type');
$control->create($productID);
$data = $this->getData();
if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message);
if(isset($data->result) and !isset($data->id)) return $this->sendError(400, $data->message);
$story = $this->loadModel('story')->getByID($data->id);
$this->send(200, $story);
}
}
+45
View File
@@ -0,0 +1,45 @@
<?php
/**
* 禅道API的story资源类
* 版本V1
*
* The story entry point of zentaopms
* Version 1
*/
class storyEntry extends Entry
{
public function get($storyID)
{
$control = $this->loadController('story', 'view');
$control->view($storyID);
$data = $this->getData();
$story = $data->data->story;
$this->send(200, $story);
}
public function put($storyID)
{
$oldStory = $this->loadModel('story')->getByID($storyID);
/* Set $_POST variables. */
$fields = 'type';
$this->batchSetPost($fields, $oldStory);
$this->setPost('parent', 0);
$control = $this->loadController('story', 'edit');
$control->edit($storyID);
$this->getData();
$this->sendSuccess(200, 'success');
}
public function delete($storyID)
{
$control = $this->loadController('story', 'delete');
$control->delete($storyID, 'yes');
$this->getData();
$this->sendSuccess(200, 'success');
}
}
+39
View File
@@ -0,0 +1,39 @@
<?php
/**
* 禅道API的story资源类
* 版本V1
*
* The story entry point of zentaopms
* Version 1
*/
class storyChangeEntry extends Entry
{
public function post($storyID)
{
$oldStory = $this->loadModel('story')->getByID($storyID);
$fields = 'reviewer,comment';
$this->batchSetPost($fields);
$fields = 'title,spec,verify';
$this->batchSetPost($fields, $oldStory);
/* If reviewer is not post, set needNotReview. */
if(empty($this->request('reviewer')))
{
$this->setPost('reviewer', array());
$this->setPost('needNotReview', 1);
}
$control = $this->loadController('story', 'change');
$this->requireFields('title,spec');
$control->change($storyID);
$data = $this->getData();
if($data->status == 'fail') return $this->sendError(400, $data->message);
$story = $this->loadModel('story')->getByID($storyID);
$this->send(200, $story);
}
}
+1 -1
View File
@@ -8,7 +8,7 @@
*/
class tasksEntry extends entry
{
public function get($taskID)
public function get()
{
}
+1 -1
View File
@@ -18,7 +18,7 @@ class tokensEntry extends baseEntry
if($user)
{
$this->user->login($user);
$this->send(200, array('token' => session_id()));
$this->send(201, array('token' => session_id()));
}
$this->sendError(400, $this->app->lang->user->loginFailed);
+4
View File
@@ -17,6 +17,10 @@ $routes['/products/:id'] = 'product';
$routes['/productlines'] = 'productLines';
$routes['/productlines/:id'] = 'productLine';
$routes['/products/:id/stories'] = 'stories';
$routes['/stories/:id'] = 'story';
$routes['/stories/:id/change'] = 'storyChange';
$routes['/executions/:execution/tasks'] = 'tasks';
$routes['/tasks/:id'] = 'task';
$routes['/tasks/:id/assignto'] = 'taskAssignTo';
+1
View File
@@ -251,6 +251,7 @@ $config->objectTables['webhook'] = TABLE_WEBHOOK;
$config->objectTables['stakeholder'] = TABLE_STAKEHOLDER;
$config->objectTables['job'] = TABLE_JOB;
$config->objectTables['team'] = TABLE_TEAM;
$config->objectTables['pipeline'] = TABLE_PIPELINE;
/* Program privs.*/
$config->programPriv = new stdclass();
+1
View File
@@ -30,6 +30,7 @@ $config->action->objectNameFields['stakeholder'] = 'user';
$config->action->objectNameFields['budget'] = 'name';
$config->action->objectNameFields['job'] = 'name';
$config->action->objectNameFields['team'] = 'name';
$config->action->objectNameFields['pipeline'] = 'name';
$config->action->commonImgSize = 870;
+1
View File
@@ -99,6 +99,7 @@ $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->desc = new stdclass();
+1
View File
@@ -103,6 +103,7 @@ $lang->action->objectTypes['entry'] = 'Entry';
$lang->action->objectTypes['webhook'] = 'Webhook';
$lang->action->objectTypes['team'] = 'Team';
$lang->action->objectTypes['whitelist'] = 'Whitelist';
$lang->action->objectTypes['pipeline'] = 'GitLib';
/* Used to describe operation history. */
$lang->action->desc = new stdclass();
+1
View File
@@ -99,6 +99,7 @@ $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->desc = new stdclass();
+1
View File
@@ -99,6 +99,7 @@ $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';
/* Used to describe operation history. */
$lang->action->desc = new stdclass();
+1
View File
@@ -103,6 +103,7 @@ $lang->action->objectTypes['entry'] = '应用';
$lang->action->objectTypes['webhook'] = 'Webhook';
$lang->action->objectTypes['team'] = '团队';
$lang->action->objectTypes['whitelist'] = '白名单';
$lang->action->objectTypes['pipeline'] = 'GitLib';
/* 用来描述操作历史记录。*/
$lang->action->desc = new stdclass();
+14 -8
View File
@@ -558,9 +558,13 @@ class bug extends control
$this->view->showFields = $this->config->bug->custom->createFields;
/* Set gitlabProjects. */
$allGitlabs = $this->loadModel('gitlab')->getPairs();
$gitlabProjects = $this->loadModel('gitlab')->getProjectsByExecution($executionID);
foreach($allGitlabs as $id => $name) if($id and !isset($gitlabProjects[$id])) unset($allGitlabs[$id]);
$this->loadModel('gitlab');
$allGitlabs = $this->gitlab->getPairs();
$gitlabProjects = $this->gitlab->getProjectsByExecution($executionID);
foreach($allGitlabs as $id => $name)
{
if($id and !isset($gitlabProjects[$id])) unset($allGitlabs[$id]);
}
$this->view->gitlabList = $allGitlabs;
$this->view->gitlabProjects = $gitlabProjects;
@@ -1462,13 +1466,14 @@ class bug extends control
$_POST = array();
$bugs = $this->bug->getByList($bugIDList);
$this->loadModel('gitlab');
foreach($bugs as $bugID => $bug)
{
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
if(!empty($relation))
{
$currentIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug);
$currentIssue = $this->gitlab->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug);
}
if($bug->status != 'resolved')
@@ -1555,8 +1560,9 @@ class bug extends control
else
{
/* Delete related issue in gitlab. */
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
if(!empty($relation)) $this->loadModel('gitlab')->deleteIssue('bug', $bugID, $relation->issueID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
if(!empty($relation)) $this->gitlab->deleteIssue('bug', $bugID, $relation->issueID);
$this->bug->delete(TABLE_BUG, $bugID);
if($bug->toTask != 0)
+33 -24
View File
@@ -282,14 +282,14 @@ class bugModel extends model
* @param object $bug
* @param int $executionID
* @access public
* @return int
* @return int|bool
*/
public function createBugFromGitlabIssue($bug, $executionID)
{
$bug->openedBy = $this->app->user->account;
$bug->openedDate = helper::now(); // TODO(dingguodong) use from issue->created_at ?
$bug->assignedDate = isset($bug->assignedTo) ? helper::now() : 0;
$bug->openedBuild = 1;
$bug->openedBuild = 'trunk';
$bug->story = 0;
$bug->task = 0;
$bug->pri = 3;
@@ -368,7 +368,7 @@ class bugModel extends model
*/
public function checkDelayBug($bug)
{
// Delayed or not?.
/* Delayed or not? */
if(!helper::isZeroDate($bug->deadline))
{
if($bug->resolvedDate and !helper::isZeroDate($bug->resolvedDate))
@@ -677,8 +677,9 @@ class bugModel extends model
if(!empty($bug))
{
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
if($relation) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
}
return common::createChanges($oldBug, $bug);
}
@@ -803,8 +804,9 @@ class bugModel extends model
$allChanges[$bugID] = common::createChanges($oldBug, $bug);
/* update bug to gitlab issue. */
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
if($relation) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
}
else
{
@@ -857,12 +859,13 @@ class bugModel extends model
}
/* Update bugs. */
$this->loadModel('gitlab');
foreach($activateBugs as $bugID => $bug)
{
if(!empty($bug))
{
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', (Object)$bug, $bugID);
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
if($relation) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', (Object)$bug, $bugID);
}
$oldBug = $bugs[$bugID];
@@ -899,13 +902,14 @@ class bugModel extends model
->autoCheck()
->where('id')->eq($bugID)->exec();
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
$bug = $this->getById($bugID); // get full bug object to update issue.
$bug->assignee_id = $this->loadModel('gitlab')->getGitlabUserID($relation->gitlabID, $bug->assignedTo);
$bug->assignee_id = $this->gitlab->getGitlabUserID($relation->gitlabID, $bug->assignedTo);
if($bug->assignee_id != '')
{
// TODO(dingguodong) we should alert to operator when can not find the user, and the operator should reconfigure user binding.
$this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
/* TODO(dingguodong) we should alert to operator when can not find the user, and the operator should reconfigure user binding. */
$this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
}
if(!dao::isError()) return common::createChanges($oldBug, $bug);
@@ -952,6 +956,7 @@ class bugModel extends model
{
$now = helper::now();
$bugs = $this->getByList($bugIDList);
$this->loadModel('gitlab');
foreach($bugIDList as $bugID)
{
if($bugs[$bugID]->confirmed) continue;
@@ -964,8 +969,8 @@ class bugModel extends model
if(!empty($bug))
{
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
if($relation) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
}
$this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec();
@@ -1059,8 +1064,9 @@ class bugModel extends model
/* Link bug to build and release. */
$this->linkBugToBuild($bugID, $bug->resolvedBuild);
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
if($relation) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
return common::createChanges($oldBug, $bug);
}
@@ -1192,8 +1198,9 @@ class bugModel extends model
$this->executeHooks($bugID);
/* batch resolve issure bugs.*/
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
if($relation) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
$changes[$bugID] = common::createChanges($oldBug, $bug);
}
@@ -1254,8 +1261,9 @@ class bugModel extends model
if(!empty($bug))
{
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
if($relation) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
}
$bug->activatedCount += 1;
@@ -1287,11 +1295,12 @@ class bugModel extends model
$this->dao->update(TABLE_BUG)->data($bug)->autoCheck()->where('id')->eq((int)$bugID)->exec();
$relation = $this->loadModel('gitlab')->getRelationByObject('bug', $bugID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('bug', $bugID);
if(!empty($relation))
{
$currentIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
$currentIssue = $this->gitlab->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $bug, $bugID);
}
return common::createChanges($oldBug, $bug);
}
+4 -1
View File
@@ -1820,7 +1820,10 @@ EOD;
{
/* Get user program priv. */
if(!$this->app->session->project) return;
$program = $this->dao->findByID($this->app->session->project)->from(TABLE_PROJECT)->fetch();
$program = $this->dao->findByID($this->app->session->project)->from(TABLE_PROJECT)->fetch();
if(empty($program)) return;
$programRights = $this->dao->select('t3.module, t3.method')->from(TABLE_GROUP)->alias('t1')
->leftJoin(TABLE_USERGROUP)->alias('t2')->on('t1.id = t2.`group`')
->leftJoin(TABLE_GROUPPRIV)->alias('t3')->on('t2.`group`=t3.`group`')
+3 -2
View File
@@ -2514,8 +2514,9 @@ class execution extends control
foreach($storyIdList as $storyID)
{
/* Delete related issue in gitlab. */
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
if(!empty($relation)) $this->loadModel('gitlab')->deleteIssue('story', $storyID, $relation->issueID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('story', $storyID);
if(!empty($relation)) $this->gitlab->deleteIssue('story', $storyID, $relation->issueID);
$this->execution->unlinkStory($executionID, $storyID);
}
-19
View File
@@ -1,19 +0,0 @@
<?php
$lang->jenkins->common = 'Jenkins';
$lang->jenkins->browse = '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->jenkins->id = 'ID';
$lang->jenkins->name = 'Name';
$lang->jenkins->url = 'Service URL';
$lang->jenkins->token = 'Token';
$lang->jenkins->account = 'UserName';
$lang->jenkins->password = 'Password';
$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.';
+5 -5
View File
@@ -15,14 +15,14 @@ $lang->gitlab->zentaoAccount = 'Zentao Account';
$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->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->gitlab->id = 'ID';
$lang->gitlab->name = "{$lang->gitlab->common}name";
$lang->gitlab->url = 'GitLab Url';
$lang->gitlab->url = 'GitLab URL';
$lang->gitlab->token = 'Token';
$lang->gitlab->defaultProject = 'Default Project';
$lang->gitlab->private = 'MD5 Verify';
@@ -34,13 +34,13 @@ $lang->gitlab->tips = 'When using a password, please disable the "Prevent
$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->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->bindUserError = "Can not 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.";
-20
View File
@@ -1,20 +0,0 @@
<?php
$lang->jenkins->common = 'Jenkins';
$lang->jenkins->browse = 'Afficher Jenkins';
$lang->jenkins->create = 'Cr閑r Jenkins';
$lang->jenkins->edit = 'Editer Jenkins';
$lang->jenkins->delete = 'Supprimer';
$lang->jenkins->confirmDelete = 'Voulez-vous supprimer ce serveur Jenkins ?';
$lang->jenkins->id = 'ID';
$lang->jenkins->name = 'Nom';
$lang->jenkins->url = 'Service URL';
$lang->jenkins->token = 'Token';
$lang->jenkins->account = 'UserName';
$lang->jenkins->password = 'Password';
$lang->jenkins->lblCreate = 'Cr閑r Serveur Jenkins';
$lang->jenkins->desc = 'Description';
$lang->jenkins->tokenFirst = 'Utiliser un Token si non vide.';
$lang->jenkins->tips = 'Cancel "Prevent Cross Site Request Forgery exploits" when using password.';
$lang->jenkins->tips = "Annuler Emp阠her les exploits de contrefa鏾n de demande intersite lors de l'utilisation du mot de passe.";
-19
View File
@@ -1,19 +0,0 @@
<?php
$lang->jenkins->common = 'Jenkins';
$lang->jenkins->browse = 'Jenkins';
$lang->jenkins->create = 'Tạo Jenkins';
$lang->jenkins->edit = 'Sửa Jenkins';
$lang->jenkins->delete = 'Xóa';
$lang->jenkins->confirmDelete = 'Bạn có muốn xóa máy chủ Jenkins này?';
$lang->jenkins->id = 'ID';
$lang->jenkins->name = 'Tên';
$lang->jenkins->url = 'URL';
$lang->jenkins->token = 'Token';
$lang->jenkins->account = 'Người dùng';
$lang->jenkins->password = 'Mật khẩu';
$lang->jenkins->lblCreate = 'Tạo Jenkins Server';
$lang->jenkins->desc = 'Mô tả';
$lang->jenkins->tokenFirst = 'Sử dụng token nếu không trống.';
$lang->jenkins->tips = 'Hủy "Ngăn chặn khai thác yêu cầu trang web giả mạo" khi sử dụng mật khẩu.';
+12 -12
View File
@@ -1,20 +1,20 @@
<?php
$lang->gitlab = new stdclass;
$lang->gitlab->common = 'Gitlab';
$lang->gitlab->browse = '浏览gitlab';
$lang->gitlab->create = '添加gitlab';
$lang->gitlab->edit = '编辑gitlab';
$lang->gitlab->common = 'GitLab';
$lang->gitlab->browse = '浏览GitLab';
$lang->gitlab->create = '添加GitLab';
$lang->gitlab->edit = '编辑GitLab';
$lang->gitlab->bindUser = '绑定用户';
$lang->gitlab->webhook = 'webhook';
$lang->gitlab->bindProduct = '关联产品';
$lang->gitlab->importIssue = '关联issue';
$lang->gitlab->delete = '删除gitlab';
$lang->gitlab->confirmDelete = '确认删除该gitlab吗?';
$lang->gitlab->gitlabAccount = 'gitlab用户';
$lang->gitlab->delete = '删除GitLab';
$lang->gitlab->confirmDelete = '确认删除该GitLab吗?';
$lang->gitlab->gitlabAccount = 'GitLab用户';
$lang->gitlab->zentaoAccount = '禅道用户';
$lang->gitlab->browseAction = 'gitlab列表';
$lang->gitlab->deleteAction = '删除gitlab';
$lang->gitlab->browseAction = 'GitLab列表';
$lang->gitlab->deleteAction = '删除GitLab';
$lang->gitlab->gitlabProject = "{$lang->gitlab->common}项目";
$lang->gitlab->gitlabIssue = "{$lang->gitlab->common}issue";
$lang->gitlab->zentaoProduct = '禅道产品';
@@ -27,10 +27,10 @@ $lang->gitlab->token = 'Token';
$lang->gitlab->defaultProject = '默认项目';
$lang->gitlab->private = 'MD5验证';
$lang->gitlab->lblCreate = '添加gitlab服务器';
$lang->gitlab->lblCreate = '添加GitLab服务器';
$lang->gitlab->desc = '描述';
$lang->gitlab->tokenFirst = 'Token不为空时,优先使用Token。';
$lang->gitlab->tips = '使用密码时,请在gitlab全局安全设置中禁用"防止跨站点请求伪造"选项。';
$lang->gitlab->tips = '使用密码时,请在GitLab全局安全设置中禁用"防止跨站点请求伪造"选项。';
$lang->gitlab->placeholder = new stdclass;
$lang->gitlab->placeholder->name = '';
@@ -39,7 +39,7 @@ $lang->gitlab->placeholder->token = "请填写具有admin权限账户的access t
$lang->gitlab->noImportableIssues = "目前没有可供导入的issue。";
$lang->gitlab->tokenError = "当前token非管理员权限。";
$lang->gitlab->hostError = "无效的gitlab服务地址。";
$lang->gitlab->hostError = "无效的GitLab服务地址。";
$lang->gitlab->bindUserError = "不能重复绑定用户 %s";
$lang->gitlab->importIssueError = "未选择该issue所属的执行。";
$lang->gitlab->importIssueWarn = "存在导入失败的issue,可再次尝试导入。";
-22
View File
@@ -1,22 +0,0 @@
<?php
$lang->jenkins->common = 'Jenkins';
$lang->jenkins->browse = '瀏覽Jenkins';
$lang->jenkins->create = '添加Jenkins';
$lang->jenkins->edit = '編輯Jenkins';
$lang->jenkins->delete = '刪除';
$lang->jenkins->confirmDelete = '確認刪除該Jenkins嗎?';
$lang->jenkins->browseAction = 'Jenkins列表';
$lang->jenkins->deleteAction = '刪除Jenkins';
$lang->jenkins->id = 'ID';
$lang->jenkins->name = '名稱';
$lang->jenkins->url = '服務地址';
$lang->jenkins->token = 'Token';
$lang->jenkins->account = '用戶名';
$lang->jenkins->password = '密碼';
$lang->jenkins->lblCreate = '添加Jenkins伺服器';
$lang->jenkins->desc = '描述';
$lang->jenkins->tokenFirst = 'Token不為空時,優先使用Token。';
$lang->jenkins->tips = '使用密碼時,請在Jenkins全局安全設置中禁用"防止跨站點請求偽造"選項。';
+6 -5
View File
@@ -863,8 +863,9 @@ class gitlabModel extends model
/**
* Create relationship between zentao product and gitlab project.
*
* @param array $products
* @param int $gitlabID
* @param int $projectID
* @param int $gitlabProjectID
* @access public
* @return void
*/
@@ -926,6 +927,7 @@ class gitlabModel extends model
/**
* Create webhook for zentao.
*
* @param int $products
* @param int $gitlabID
* @param int $projectID
* @access public
@@ -948,8 +950,6 @@ class gitlabModel extends model
/**
* Delete an issue from zentao and gitlab.
*
* @param int $gitlabID
* @param int $projectID
* @param string $objectType
* @param int $objectID
* @param int $issueID
@@ -969,7 +969,7 @@ class gitlabModel extends model
*
* @param string $objectType
* @param object $object
* @param int $gitlab
* @param int $gitlabID
* @param object $issue
* @access public
* @return void
@@ -1106,7 +1106,7 @@ class gitlabModel extends model
*
* @param int $gitlabID
* @param int $projectID
* @param object $story
* @param object $bug
* @access public
* @return object
*/
@@ -1197,6 +1197,7 @@ class gitlabModel extends model
*
* @param object $issue
* @param int $gitlabID
* @param object $changes
* @access public
* @return object
*/
+2 -2
View File
@@ -42,9 +42,9 @@
<tfoot>
<tr>
<th></th>
<td class="text-center form-actions">
<td class='text-center form-actions' colspan='2'>
<?php echo html::submitButton($lang->save);?>
<?php if(!isonlybody()) echo html::a(inlink('browse', ""), $lang->goback, '', 'class="btn btn-wide"'); ?>
<?php if(!isonlybody()) echo html::a($this->createLink('repo', 'maintain', ""), $lang->goback, '', 'class="btn btn-wide"'); ?>
</td>
</tr>
</tfoot>
+7 -5
View File
@@ -320,11 +320,11 @@ class product extends control
if(!empty($_POST))
{
$productID = $this->product->create();
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('product', $productID, 'opened');
$this->executeHooks($productID);
if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $productID));
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $productID));
$openApp = $this->app->openApp;
$moduleName = $openApp == 'program'? 'program' : $this->moduleName;
@@ -332,7 +332,7 @@ class product extends control
$param = $openApp == 'program' ? "programID=$programID" : "productID=$productID";
$locate = $this->createLink($moduleName, $methodName, $param);
if($openApp == 'doc') $locate = $this->createLink('doc', 'objectLibs', 'type=product');
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
}
if($this->app->openApp == 'program') $this->loadModel('program')->setMenu($programID);
@@ -457,7 +457,7 @@ class product extends control
}
}
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
if($action == 'undelete')
{
$this->loadModel('action');
@@ -479,7 +479,7 @@ class product extends control
$locate = $this->createLink($moduleName, $methodName, $param);
if(!$programID) $this->session->set('productList', $this->createLink('product', 'browse', $param), 'product');
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
}
$productID = $this->product->saveState($productID, $this->products);
@@ -702,6 +702,8 @@ class product extends control
$this->dao->update(TABLE_DOCLIB)->set('deleted')->eq(1)->where('product')->eq($productID)->exec();
$this->session->set('product', '');
$this->executeHooks($productID);
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
die(js::locate($this->createLink('product', 'browse'), 'parent'));
}
}
+1 -1
View File
@@ -442,7 +442,7 @@ class project extends control
$linkedBranches = array();
$productPlans = array(0 => '');
$allProducts = $this->program->getProductPairs($project->parent, 'assign', 'noclosed');
$linkedProducts = $this->project->getProducts($projectID, true, 'noclosed');
$linkedProducts = $this->project->getProducts($projectID);
$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 -5
View File
@@ -86,9 +86,6 @@ $lang->repo->group = '分组';
$lang->repo->user = '用户';
$lang->repo->info = '版本信息';
$lang->repo->gitlabHost = 'Gitlab URL';
$lang->repo->gitlabToken = '版本信息';
$lang->repo->title = '标题';
$lang->repo->status = '状态';
$lang->repo->openedBy = '创建者';
@@ -131,12 +128,12 @@ $lang->repo->scmList['Gitlab'] = 'Gitlab';
$lang->repo->scmList['Subversion'] = 'Subversion';
$lang->repo->scmList['Gitlab'] = 'Gitlab';
$lang->repo->gitlabHost = 'GitLab Sever';
$lang->repo->gitlabHost = 'GitLab Server';
$lang->repo->gitlabToken = 'GitLab Token';
$lang->repo->gitlabProject = 'GitLab 项目';
$lang->repo->placeholder = new stdclass;
$lang->repo->placeholder->gitlabHost = '请填写gitlab访问地址';
$lang->repo->placeholder->gitlabHost = '请填写GitLab访问地址';
$lang->repo->notice = new stdclass();
$lang->repo->notice->syncing = '正在同步中, 请稍等...';
+6 -4
View File
@@ -230,12 +230,13 @@ class repoModel extends model
if(!dao::isError()) $this->rmClientVersionFile();
$this->loadModel('gitlab');
if($this->post->SCM == 'Gitlab')
{
$this->loadModel("gitlab")->saveProjectRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
$this->gitlab->saveProjectRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
/* create webhook for zentao */
$this->loadModel("gitlab")->initWebhooks($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
$this->gitlab->initWebhooks($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
}
return $this->dao->lastInsertID();
}
@@ -293,12 +294,13 @@ class repoModel extends model
$this->rmClientVersionFile();
if($repo->SCM == 'Gitlab') $this->loadModel("gitlab")->saveProjectRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
$this->loadModel('gitlab');
if($repo->SCM == 'Gitlab') $this->gitlab->saveProjectRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
if($repo->path != $data->path)
{
$this->dao->delete()->from(TABLE_REPOHISTORY)->where('repo')->eq($id)->exec();
$this->dao->delete()->from(TABLE_REPOFILES)->where('repo')->eq($id)->exec();
if($repo->SCM == 'Gitlab') $this->loadModel("gitlab")->initWebhooks($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
if($repo->SCM == 'Gitlab') $this->gitlab->initWebhooks($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
return false;
}
+25 -22
View File
@@ -100,7 +100,7 @@ class story extends control
{
$response['result'] = 'fail';
$response['message'] = dao::getError();
$this->send($response);
return $this->send($response);
}
$storyID = $storyResult['id'];
@@ -119,7 +119,7 @@ class story extends control
$param = $execution->type == 'project' ? "projectID=$objectID&productID=$productID" : "executionID=$objectID";
$response['locate'] = $this->createLink($moduleName, 'story', $param);
}
$this->send($response);
return $this->send($response);
}
$action = $bugID == 0 ? 'Opened' : 'Frombug';
@@ -146,16 +146,16 @@ class story extends control
$this->executeHooks($storyID);
if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $storyID));
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $storyID));
/* If link from no head then reload. */
if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
if($this->post->newStory)
{
$response['message'] = $this->lang->story->successSaved . $this->lang->story->newStory;
$response['locate'] = $this->createLink('story', 'create', "productID=$productID&branch=$branch&moduleID=$moduleID&story=0&objectID=$objectID&bugID=$bugID");
$this->send($response);
return $this->send($response);
}
$moduleID = $this->post->module ? $this->post->module : 0;
@@ -175,7 +175,7 @@ class story extends control
$response['locate'] = $this->createLink($moduleName, 'story', $param);
}
if($this->app->getViewType() == 'xhtml') $response['locate'] = $this->createLink('story', 'view', "storyID=$storyID");
$this->send($response);
return $this->send($response);
}
/* Set products, users and module. */
@@ -295,9 +295,10 @@ class story extends control
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->story->custom->createFields;
$allGitlabs = $this->loadModel('gitlab')->getPairs();
$this->loadModel('gitlab');
$allGitlabs = $this->gitlab->getPairs();
$executionID = $objectID;
$gitlabProjects = $this->loadModel('gitlab')->getProjectsByExecution($executionID);
$gitlabProjects = $this->gitlab->getProjectsByExecution($executionID);
foreach($allGitlabs as $id => $name) if($id and !isset($gitlabProjects[$id])) unset($allGitlabs[$id]);
$this->view->gitlabList = $allGitlabs;
$this->view->gitlabProjects = $gitlabProjects;
@@ -413,7 +414,7 @@ class story extends control
if(dao::isError()) die(js::error(dao::getError()));
}
if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $stories));
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $stories));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
if($storyID)
@@ -583,14 +584,8 @@ class story extends control
$this->executeHooks($storyID);
if(defined('RUN_MODE') && RUN_MODE == 'api')
{
die(array('status' => 'success', 'data' => $storyID));
}
else
{
die(js::locate($this->createLink($this->app->rawModule, 'view', "storyID=$storyID"), 'parent'));
}
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success', 'data' => $storyID));
die(js::locate($this->createLink($this->app->rawModule, 'view', "storyID=$storyID"), 'parent'));
}
$this->commonAction($storyID);
@@ -816,7 +811,11 @@ class story extends control
if(!empty($_POST))
{
$changes = $this->story->change($storyID);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError())
{
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => dao::getError()));
die(js::error(dao::getError()));
}
$version = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch('version');
$files = $this->loadModel('file')->saveUpload('story', $storyID, $version);
@@ -832,6 +831,8 @@ class story extends control
$this->executeHooks($storyID);
$module = $this->app->openApp == 'project' ? 'projectstory' : 'story';
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success'));
die(js::locate($this->createLink($module, 'view', "storyID=$storyID"), 'parent'));
}
@@ -991,8 +992,9 @@ class story extends control
else
{
/* Delete related issue in gitlab. */
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
if(!empty($relation)) $this->loadModel('gitlab')->deleteIssue('story', $storyID, $relation->issueID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('story', $storyID);
if(!empty($relation)) $this->gitlab->deleteIssue('story', $storyID, $relation->issueID);
$this->story->delete(TABLE_STORY, $storyID);
if($story->parent > 0)
@@ -1003,6 +1005,7 @@ class story extends control
$this->executeHooks($storyID);
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success'));
die(js::locate($this->session->storyList, 'parent'));
}
}
@@ -1323,12 +1326,12 @@ class story extends control
{
$response['result'] = 'fail';
$response['message'] = dao::getError();
$this->send($response);
return $this->send($response);
}
if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $tasks));
$response['locate'] = $this->createLink('execution', 'task', "executionID=$executionID");
$this->send($response);
return $this->send($response);
}
}
+31 -22
View File
@@ -700,8 +700,9 @@ class storyModel extends model
$this->file->updateObjectID($this->post->uid, $storyID, 'story');
/* update story to gitlab issue. */
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('story', $storyID);
if($relation) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
return common::createChanges($oldStory, $story);
}
@@ -883,8 +884,9 @@ class storyModel extends model
}
/* update story to gitlab issue. */
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
if($relation) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('story', $storyID);
if($relation) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
unset($oldStory->parent);
unset($story->parent);
@@ -1217,8 +1219,9 @@ class storyModel extends model
if($oldStory->plan != $story->plan) $this->updateStoryOrderOfPlan($storyID, $story->plan, $oldStory->plan);
/* update story to gitlab issue. */
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('story', $storyID);
if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
$this->executeHooks($storyID);
if($story->type == 'story') $this->batchChangeStage(array($storyID), $story->stage);
@@ -1485,12 +1488,13 @@ class storyModel extends model
->checkIF($story->closedReason == 'duplicate', 'duplicateStory', 'notempty')
->where('id')->eq($storyID)->exec();
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('story', $storyID);
if(!empty($relation))
{
$currentIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
$currentIssue = $this->gitlab->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
}
/* Update parent story status. */
@@ -1560,11 +1564,12 @@ class storyModel extends model
$this->setStage($storyID);
$allChanges[$storyID] = common::createChanges($oldStory, $story);
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('story', $storyID);
if(!empty($relation))
{
$currentIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
$currentIssue = $this->gitlab->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
}
}
else
@@ -1843,9 +1848,10 @@ class storyModel extends model
if(!dao::isError())
{
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
$story->assignee_id = $this->loadModel('gitlab')->getGitlabUserID($relation->gitlabID, $story->assignedTo);
if($story->assignee_id != '') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('story', $storyID);
$story->assignee_id = $this->gitlab->getGitlabUserID($relation->gitlabID, $story->assignedTo);
if($story->assignee_id != '') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
return common::createChanges($oldStory, $story);
}
return false;
@@ -1878,13 +1884,15 @@ class storyModel extends model
$this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq((int)$storyID)->exec();
if(!dao::isError())
{
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
$story->assignee_id = $this->loadModel('gitlab')->getGitlabUserID($relation->gitlabID, $story->assignedTo);
if($story->assignee_id != '') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('story', $storyID);
$story->assignee_id = $this->gitlab->getGitlabUserID($relation->gitlabID, $story->assignedTo);
if($story->assignee_id != '') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
/* Push this story to gitlab issue. */
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('story', $storyID);
if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
}
}
return $allChanges;
@@ -1921,8 +1929,9 @@ class storyModel extends model
if($oldStory->parent > 0) $this->updateParentStatus($storyID, $oldStory->parent);
/* Push this story to gitlab issue. */
$relation = $this->loadModel('gitlab')->getRelationByObject('story', $storyID);
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('story', $storyID);
if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'story', $story, $storyID);
return common::createChanges($oldStory, $story);
}
+8 -5
View File
@@ -217,8 +217,9 @@ class task extends control
foreach(explode(',', $this->config->task->customCreateFields) as $field) $customFields[$field] = $this->lang->task->$field;
if($execution->type == 'ops') unset($customFields['story']);
$allGitlabs = $this->loadModel('gitlab')->getPairs();
$gitlabProjects = $this->loadModel('gitlab')->getProjectsByExecution($executionID);
$this->loadModel('gitlab');
$allGitlabs = $this->gitlab->getPairs();
$gitlabProjects = $this->gitlab->getProjectsByExecution($executionID);
foreach($allGitlabs as $id => $name) if($id and !isset($gitlabProjects[$id])) unset($allGitlabs[$id]);
$this->view->gitlabList = $allGitlabs;
$this->view->gitlabProjects = $gitlabProjects;
@@ -577,7 +578,8 @@ class task extends control
$task = $this->task->getByID($taskID);
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('task', $taskID);
if($relation)$this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
$members = $this->loadModel('user')->getTeamMemberPairs($executionID, 'execution', 'nodeleted');
@@ -1298,8 +1300,9 @@ class task extends control
else
{
/* Delete related issue in gitlab. */
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
if(!empty($relation)) $this->loadModel('gitlab')->deleteIssue('task', $taskID, $relation->issueID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('task', $taskID);
if(!empty($relation)) $this->gitlab->deleteIssue('task', $taskID, $relation->issueID);
$this->task->delete(TABLE_TASK, $taskID);
if($task->parent > 0)
+29 -21
View File
@@ -982,8 +982,9 @@ class taskModel extends model
->where('id')->eq((int)$taskID)->exec();
/* update task to gitlab issue. */
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('task', $taskID);
if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
if(!dao::isError())
{
@@ -1218,12 +1219,13 @@ class taskModel extends model
$tasks[$taskID] = $task;
}
$issues = $this->loadModel('gitlab')->getIssueListByObjects('task', $taskID);
$this->loadModel('gitlab');
$issues = $this->gitlab->getIssueListByObjects('task', $taskID);
foreach($tasks as $taskID => $task)
{
$issue = zget($issues, $taskID, 0);
if(!$issue) continue;
$this->loadModel('gitlab')->apiUpdateIssue($issue->gitlabID, $issue->projectID, $issue->issueID, $task);
$this->gitlab->apiUpdateIssue($issue->gitlabID, $issue->projectID, $issue->issueID, $task);
}
/* Check field not empty. */
@@ -1297,8 +1299,9 @@ class taskModel extends model
$allChanges[$taskID] = common::createChanges($oldTask, $task);
/* update task to gitlab issue. */
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('task', $taskID);
if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
}
else
{
@@ -1386,8 +1389,9 @@ class taskModel extends model
->where('id')->eq($taskID)->exec();
$task = $this->getById($taskID);
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('task', $taskID);
if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
if(!dao::isError()) return common::createChanges($oldTask, $task);
}
@@ -1432,7 +1436,7 @@ class taskModel extends model
$task->status = 'done';
$task->finishedBy = $this->app->user->account;
$task->finishedDate = helper::now();
$task->assignedTo = $oldTask->openedBy; // Fix bug#1341
$task->assignedTo = $oldTask->openedBy;
}
/* Record consumed and left. */
@@ -1724,11 +1728,12 @@ class taskModel extends model
->where('id')->eq((int)$taskID)
->exec();
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('task', $taskID);
if(!empty($relation))
{
$currentIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
$currentIssue = $this->gitlab->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
}
if($oldTask->parent > 0) $this->updateParentStatus($taskID);
@@ -1787,11 +1792,12 @@ class taskModel extends model
$this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec();
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('task', $taskID);
if(!empty($relation))
{
$currentIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $task, $taskID);
$currentIssue = $this->gitlab->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $task, $taskID);
}
if(!dao::isError())
@@ -1837,12 +1843,13 @@ class taskModel extends model
$this->dao->update(TABLE_TASK)->set('assignedTo=openedBy')->where('parent')->eq((int)$taskID)->exec();
}
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('task', $taskID);
if(!empty($relation))
{
$currentIssue = $this->loadModel('gitlab')->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
$currentIssue = $this->gitlab->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID);
if($currentIssue->state != 'closed') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
}
if(!dao::isError()) return common::createChanges($oldTask, $task);
@@ -1910,8 +1917,9 @@ class taskModel extends model
}
if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
$relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID);
if(!empty($relation)) $this->loadModel('gitlab')->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
$this->loadModel('gitlab');
$relation = $this->gitlab->getRelationByObject('task', $taskID);
if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID);
if(!dao::isError()) return common::createChanges($oldTask, $task);
}
+9
View File
@@ -799,6 +799,15 @@ function toggleProgram(obj)
var programID = $('#programs').val();
getProgramStatus('program', programID);
}
var projectType = $('input[name="projectType"]:checked').val();
if(projectType == 'project')
{
$('.projectStatus').addClass('hidden');
}
if(projectType == 'execution')
{
$('.projectStatus').removeClass('hidden');
}
}
/**
+3 -3
View File
@@ -90,8 +90,8 @@ $lang->upgrade->to20Desc = <<<EOD
EOD;
$lang->upgrade->mergeProgramDesc = <<<EOD
<p>Next, ZenTao will migrate the existing data of {$lang->productCommon} and {$lang->projectCommon} to Program and Project. It will be one of the followings:</p><br />
<h4>1. Manage {$lang->productCommon} and {$lang->projectCommon} by Product Line </h4>
<p>Migrate the data of {$lang->productCommon} and {$lang->projectCommon} by Product Line to a Program. You can also migrate it separately.</p>
<h4>1. Manage {$lang->productCommon} and {$lang->projectCommon} by {$lang->productCommon} Line </h4>
<p>Migrate the data of {$lang->productCommon} and {$lang->projectCommon} by {$lang->productCommon} Line to a Program. You can also migrate it separately.</p>
<h4>2. Manage {$lang->projectCommon} by {$lang->productCommon}</h4>
<p>You can migrate the data of several {$lang->productCommon}s and {$lang->projectCommon}s to one Program. Or select {$lang->projectCommon}s of a {$lang->productCommon} and {$lang->productCommon} to a Program.</p>
<h4>2. Independent {$lang->projectCommon}</h4>
@@ -120,7 +120,7 @@ $lang->upgrade->projectName = 'Project Name';
$lang->upgrade->newProgram = 'Create';
$lang->upgrade->projectEmpty = 'Project must be not empty.';
$lang->upgrade->mergeSummary = "Dear users, there are %s {$lang->productCommon} and %s {$lang->projectCommon} in your system waiting for Migration. By System Calculation, we recommend your migration plan as follows, you can also adjust according to your own situation:";
$lang->upgrade->mergeByProductLine = "PRODUCTLINE-BASED {$lang->projectCommon}: Consolidate the entire product line and the {$lang->productCommon} and {$lang->projectCommon} below it into one large project.";
$lang->upgrade->mergeByProductLine = "PRODUCTLINE-BASED {$lang->projectCommon}: Consolidate the entire {$lang->productCommon} line and the {$lang->productCommon} and {$lang->projectCommon} below it into one large project.";
$lang->upgrade->mergeByProduct = "PRODUCT-BASED {$lang->projectCommon}: You can select multiple {$lang->productCommon} and their lower {$lang->projectCommon} to merge into a large project, or you can select a {$lang->productCommon} to merge its lower {$lang->projectCommon} into a larger project";
$lang->upgrade->mergeByProject = "Independent {$lang->projectCommon}: You can select several {$lang->projectCommon} and merge them into one large project, or merge them independently";
$lang->upgrade->mergeByMoreLink = "{$lang->projectCommon} that relates multiple {$lang->productCommon}: select which project the {$lang->projectCommon} belongs to.";
+3 -3
View File
@@ -71,8 +71,8 @@ $lang->upgrade->to15Desc = <<<EOD
EOD;
$lang->upgrade->mergeProgramDesc = <<<EOD
<p>Next, ZenTao will migrate the existing data of {$lang->productCommon} and {$lang->projectCommon} to Program and Project. It will be one of the followings:</p><br />
<h4>1. Manage {$lang->productCommon} and {$lang->projectCommon} by Product Line </h4>
<p>Migrate the data of {$lang->productCommon} and {$lang->projectCommon} by Product Line to a Program. You can also migrate it separately.</p>
<h4>1. Manage {$lang->productCommon} and {$lang->projectCommon} by {$lang->productCommon} Line </h4>
<p>Migrate the data of {$lang->productCommon} and {$lang->projectCommon} by {$lang->productCommon} Line to a Program. You can also migrate it separately.</p>
<h4>2. Manage {$lang->projectCommon} by {$lang->productCommon}</h4>
<p>You can migrate the data of several {$lang->productCommon}s and {$lang->projectCommon}s to one Program. Or select {$lang->projectCommon}s of a {$lang->productCommon} and {$lang->productCommon} to a Program.</p>
<h4>2. Independent {$lang->projectCommon}</h4>
@@ -107,7 +107,7 @@ $lang->upgrade->projectName = 'Project Name';
$lang->upgrade->newProgram = 'Create';
$lang->upgrade->projectEmpty = 'Project must be not empty.';
$lang->upgrade->mergeSummary = "Dear users, there are %s {$lang->productCommon} and %s {$lang->projectCommon} in your system waiting for Migration. By System Calculation, we recommend your migration plan as follows, you can also adjust according to your own situation:";
$lang->upgrade->mergeByProductLine = "PRODUCTLINE-BASED {$lang->projectCommon}: Consolidate the entire product line and the {$lang->productCommon} and {$lang->projectCommon} below it into one large project.";
$lang->upgrade->mergeByProductLine = "PRODUCTLINE-BASED {$lang->projectCommon}: Consolidate the entire {$lang->productCommon} line and the {$lang->productCommon} and {$lang->projectCommon} below it into one large project.";
$lang->upgrade->mergeByProduct = "PRODUCT-BASED {$lang->projectCommon}: You can select multiple {$lang->productCommon} and their lower {$lang->projectCommon} to merge into a large project, or you can select a {$lang->productCommon} to merge its lower {$lang->projectCommon} into a larger project";
$lang->upgrade->mergeByProject = "Independent {$lang->projectCommon}: You can select several {$lang->projectCommon} and merge them into one large project, or merge them independently";
$lang->upgrade->mergeByMoreLink = "{$lang->projectCommon} that relates multiple {$lang->productCommon}: select which project the {$lang->projectCommon} belongs to.";
+3 -3
View File
@@ -91,8 +91,8 @@ $lang->upgrade->to20Desc = <<<EOD
EOD;
$lang->upgrade->mergeProgramDesc = <<<EOD
<p>Next, ZenTao will migrate the existing data of {$lang->productCommon} and {$lang->projectCommon} to Program and Project. It will be one of the followings:</p><br />
<h4>1. Manage {$lang->productCommon} and {$lang->projectCommon} by Product Line </h4>
<p>Migrate the data of {$lang->productCommon} and {$lang->projectCommon} by Product Line to a Program. You can also migrate it separately.</p>
<h4>1. Manage {$lang->productCommon} and {$lang->projectCommon} by {$lang->productCommon} Line </h4>
<p>Migrate the data of {$lang->productCommon} and {$lang->projectCommon} by {$lang->productCommon} Line to a Program. You can also migrate it separately.</p>
<h4>2. Manage {$lang->projectCommon} by {$lang->productCommon}</h4>
<p>You can migrate the data of several {$lang->productCommon}s and {$lang->projectCommon}s to one Program. Or select {$lang->projectCommon}s of a {$lang->productCommon} and {$lang->productCommon} to a Program.</p>
<h4>2. Independent {$lang->projectCommon}</h4>
@@ -121,7 +121,7 @@ $lang->upgrade->projectName = 'Project Name';
$lang->upgrade->newProgram = 'Create';
$lang->upgrade->projectEmpty = 'Project must be not empty.';
$lang->upgrade->mergeSummary = "Dear users, there are %s {$lang->productCommon} and %s {$lang->projectCommon} in your system waiting for Migration. By System Calculation, we recommend your migration plan as follows, you can also adjust according to your own situation:";
$lang->upgrade->mergeByProductLine = "PRODUCTLINE-BASED {$lang->projectCommon}: Consolidate the entire product line and the {$lang->productCommon} and {$lang->projectCommon} below it into one large project.";
$lang->upgrade->mergeByProductLine = "PRODUCTLINE-BASED {$lang->projectCommon}: Consolidate the entire {$lang->productCommon} line and the {$lang->productCommon} and {$lang->projectCommon} below it into one large project.";
$lang->upgrade->mergeByProduct = "PRODUCT-BASED {$lang->projectCommon}: You can select multiple {$lang->productCommon} and their lower {$lang->projectCommon} to merge into a large project, or you can select a {$lang->productCommon} to merge its lower {$lang->projectCommon} into a larger project";
$lang->upgrade->mergeByProject = "Independent {$lang->projectCommon}: You can select several {$lang->projectCommon} and merge them into one large project, or merge them independently";
$lang->upgrade->mergeByMoreLink = "{$lang->projectCommon} that relates multiple {$lang->productCommon}: select which project the {$lang->projectCommon} belongs to.";
+3 -3
View File
@@ -91,8 +91,8 @@ $lang->upgrade->to20Desc = <<<EOD
EOD;
$lang->upgrade->mergeProgramDesc = <<<EOD
<p>Next, ZenTao will migrate the existing data of {$lang->productCommon} and {$lang->projectCommon} to Program and Project. It will be one of the followings:</p><br />
<h4>1. Manage {$lang->productCommon} and {$lang->projectCommon} by Product Line </h4>
<p>Migrate the data of {$lang->productCommon} and {$lang->projectCommon} by Product Line to a Program. You can also migrate it separately.</p>
<h4>1. Manage {$lang->productCommon} and {$lang->projectCommon} by {$lang->productCommon} Line </h4>
<p>Migrate the data of {$lang->productCommon} and {$lang->projectCommon} by {$lang->productCommon} Line to a Program. You can also migrate it separately.</p>
<h4>2. Manage {$lang->projectCommon} by {$lang->productCommon}</h4>
<p>You can migrate the data of several {$lang->productCommon}s and {$lang->projectCommon}s to one Program. Or select {$lang->projectCommon}s of a {$lang->productCommon} and {$lang->productCommon} to a Program.</p>
<h4>2. Independent {$lang->projectCommon}</h4>
@@ -121,7 +121,7 @@ $lang->upgrade->projectName = 'Project Name';
$lang->upgrade->newProgram = 'Create';
$lang->upgrade->projectEmpty = 'Project must be not empty.';
$lang->upgrade->mergeSummary = "Dear users, there are %s {$lang->productCommon} and %s {$lang->projectCommon} in your system waiting for Migration. By System Calculation, we recommend your migration plan as follows, you can also adjust according to your own situation:";
$lang->upgrade->mergeByProductLine = "PRODUCTLINE-BASED {$lang->projectCommon}: Consolidate the entire product line and the {$lang->productCommon} and {$lang->projectCommon} below it into one large project.";
$lang->upgrade->mergeByProductLine = "PRODUCTLINE-BASED {$lang->projectCommon}: Consolidate the entire {$lang->productCommon} line and the {$lang->productCommon} and {$lang->projectCommon} below it into one large project.";
$lang->upgrade->mergeByProduct = "PRODUCT-BASED {$lang->projectCommon}: You can select multiple {$lang->productCommon} and their lower {$lang->projectCommon} to merge into a large project, or you can select a {$lang->productCommon} to merge its lower {$lang->projectCommon} into a larger project";
$lang->upgrade->mergeByProject = "Independent {$lang->projectCommon}: You can select several {$lang->projectCommon} and merge them into one large project, or merge them independently";
$lang->upgrade->mergeByMoreLink = "{$lang->projectCommon} that relates multiple {$lang->productCommon}: select which project the {$lang->projectCommon} belongs to.";
+3 -3
View File
@@ -72,8 +72,8 @@ EOD;
$lang->upgrade->mergeProgramDesc = <<<EOD
<p>接下来我们会把之前历史{$lang->productCommon}和{$lang->projectCommon}数据迁移到项目集和项目下,迁移的情况如下:</p><br />
<h4>情况一:以产品线组织的{$lang->productCommon}和{$lang->projectCommon} </h4>
<p>可以将整个产品线及其下面的{$lang->productCommon}和{$lang->projectCommon}迁移到一个项目集中,当然您也可以根据需要分开迁移。</p>
<h4>情况一:以{$lang->productCommon}线组织的{$lang->productCommon}和{$lang->projectCommon} </h4>
<p>可以将整个{$lang->productCommon}线及其下面的{$lang->productCommon}和{$lang->projectCommon}迁移到一个项目集中,当然您也可以根据需要分开迁移。</p>
<h4>情况二:以{$lang->productCommon}组织的{$lang->projectCommon} </h4>
<p>可以选择多个{$lang->productCommon}及其下面的{$lang->projectCommon}迁移到一个项目集中,也可以选择某一个{$lang->productCommon}和{$lang->productCommon}下面的{$lang->projectCommon}迁移到项目集中。</p>
<h4>情况三:独立的{$lang->projectCommon}</h4>
@@ -108,7 +108,7 @@ $lang->upgrade->projectName = '项目名称';
$lang->upgrade->newProgram = '新建';
$lang->upgrade->projectEmpty = '所属项目不能为空!';
$lang->upgrade->mergeSummary = "尊敬的用户,您的系统中共有%s个{$lang->productCommon},%s个{$lang->projectCommon}等待迁移。";
$lang->upgrade->mergeByProductLine = "以产品线组织的{$lang->productCommon}和{$lang->projectCommon}:将整个产品线及其下面的{$lang->productCommon}和{$lang->projectCommon}归并到一个项目集和项目中,也可以分开归并。";
$lang->upgrade->mergeByProductLine = "以{$lang->productCommon}线组织的{$lang->productCommon}和{$lang->projectCommon}:将整个{$lang->productCommon}线及其下面的{$lang->productCommon}和{$lang->projectCommon}归并到一个项目集和项目中,也可以分开归并。";
$lang->upgrade->mergeByProduct = "以{$lang->productCommon}组织的{$lang->projectCommon}:可以选择多个{$lang->productCommon}及其下面的{$lang->projectCommon}归并到一个项目集和项目中,也可以选择某一个{$lang->productCommon}将其下面所属的{$lang->projectCommon}归并到项目集和项目中。";
$lang->upgrade->mergeByProject = "独立的{$lang->projectCommon}:可以选择若干{$lang->projectCommon}归并到一个项目中,也可以独立归并。";
$lang->upgrade->mergeByMoreLink = "关联多个{$lang->productCommon}的{$lang->projectCommon}:选择这个{$lang->projectCommon}归属于哪一个项目。";
+2 -1
View File
@@ -4344,7 +4344,7 @@ class upgradeModel extends model
else
{
/* Use historical projects as project upgrades. */
$projects = $this->dao->select('id,name,begin,end,status,PM')->from(TABLE_PROJECT)->where('id')->in($projectIdList)->fetchAll('id');
$projects = $this->dao->select('id,name,begin,end,status,PM,acl')->from(TABLE_PROJECT)->where('id')->in($projectIdList)->fetchAll('id');
foreach($projectIdList as $projectID)
{
$data->projectName = $projects[$projectID]->name;
@@ -4352,6 +4352,7 @@ class upgradeModel extends model
$data->end = $projects[$projectID]->end;
$data->projectStatus = $projects[$projectID]->status;
$data->PM = $projects[$projectID]->PM;
$data->projectAcl = $projects[$projectID]->acl == 'custom' ? 'private' : $projects[$projectID]->acl;
$projectList[$projectID] = $this->createProject($programID, $data);
}
+1 -1
View File
@@ -57,7 +57,7 @@
<tr class='LineName'>
<th>
<span class="line-exist hidden"><?php echo $lang->upgrade->existLine;?></span>
<span class="line-no-exist"><?php echo $lang->product->lineName;?></span>
<span class="line-no-exist"><?php echo $lang->upgrade->line;?></span>
</th>
<td>
<div class='input-group'>