* Finish task #38161.
This commit is contained in:
@@ -219,6 +219,7 @@ $config->objectTables['entry'] = TABLE_ENTRY;
|
||||
$config->objectTables['webhook'] = TABLE_WEBHOOK;
|
||||
$config->objectTables['stakeholder'] = TABLE_STAKEHOLDER;
|
||||
$config->objectTables['job'] = TABLE_JOB;
|
||||
$config->objectTables['team'] = TABLE_TEAM;
|
||||
|
||||
/* Program privs.*/
|
||||
$config->programPriv = new stdclass();
|
||||
|
||||
@@ -29,6 +29,7 @@ $config->action->objectNameFields['design'] = 'name';
|
||||
$config->action->objectNameFields['stakeholder'] = 'user';
|
||||
$config->action->objectNameFields['budget'] = 'name';
|
||||
$config->action->objectNameFields['job'] = 'name';
|
||||
$config->action->objectNameFields['team'] = 'name';
|
||||
|
||||
$config->action->commonImgSize = 870;
|
||||
|
||||
|
||||
@@ -97,6 +97,8 @@ $lang->action->objectTypes['budget'] = 'Cost Estimate';
|
||||
$lang->action->objectTypes['entry'] = 'Eintrag';
|
||||
$lang->action->objectTypes['webhook'] = 'Webhook';
|
||||
$lang->action->objectTypes['job'] = 'Job';
|
||||
$lang->action->objectTypes['team'] = 'Team';
|
||||
$lang->action->objectTypes['whitelist'] = 'Whitelist';
|
||||
|
||||
/* 用来描述操作历史记录。*/
|
||||
$lang->action->desc = new stdclass();
|
||||
@@ -238,6 +240,8 @@ $lang->action->label->unlinkparenttask = "unlink from parent task";
|
||||
$lang->action->label->batchcreate = "batch created tasks";
|
||||
$lang->action->label->createchildren = "create child tasks";
|
||||
$lang->action->label->managed = "managed";
|
||||
$lang->action->label->managedteam = "managed";
|
||||
$lang->action->label->managedwhitelist = "managed";
|
||||
$lang->action->label->deletechildrentask = "delete children task";
|
||||
$lang->action->label->createchildrenstory = "create child stories";
|
||||
$lang->action->label->linkchildstory = "linked a child story";
|
||||
|
||||
@@ -101,6 +101,8 @@ $lang->action->objectTypes['stakeholder'] = 'Stakeholder';
|
||||
$lang->action->objectTypes['budget'] = 'Cost Estimate';
|
||||
$lang->action->objectTypes['entry'] = 'Entry';
|
||||
$lang->action->objectTypes['webhook'] = 'Webhook';
|
||||
$lang->action->objectTypes['team'] = 'Team';
|
||||
$lang->action->objectTypes['whitelist'] = 'Whitelist';
|
||||
|
||||
/* Used to describe operation history. */
|
||||
$lang->action->desc = new stdclass();
|
||||
@@ -242,6 +244,8 @@ $lang->action->label->unlinkparenttask = "unlink from parent task";
|
||||
$lang->action->label->batchcreate = "batch created tasks";
|
||||
$lang->action->label->createchildren = "create child tasks";
|
||||
$lang->action->label->managed = "managed";
|
||||
$lang->action->label->managedteam = "managed";
|
||||
$lang->action->label->managedwhitelist = "managed";
|
||||
$lang->action->label->deletechildrentask = "delete children task";
|
||||
$lang->action->label->createchildrenstory = "create child stories";
|
||||
$lang->action->label->linkchildstory = "linked a child story";
|
||||
|
||||
@@ -97,6 +97,8 @@ $lang->action->objectTypes['budget'] = 'Cost Estimate';
|
||||
$lang->action->objectTypes['entry'] = 'Entrée';
|
||||
$lang->action->objectTypes['webhook'] = 'Webhook';
|
||||
$lang->action->objectTypes['job'] = 'Job';
|
||||
$lang->action->objectTypes['team'] = 'Team';
|
||||
$lang->action->objectTypes['whitelist'] = 'Whitelist';
|
||||
|
||||
/* 用来描述操作历史记录。*/
|
||||
$lang->action->desc = new stdclass();
|
||||
@@ -238,6 +240,8 @@ $lang->action->label->unlinkparenttask = "a décroché de la tâche parent"
|
||||
$lang->action->label->batchcreate = "a créé tâches par lot";
|
||||
$lang->action->label->createchildren = "a créé sous-tâches par lot";
|
||||
$lang->action->label->managed = "a managé";
|
||||
$lang->action->label->managedteam = "managed";
|
||||
$lang->action->label->managedwhitelist = "managed";
|
||||
$lang->action->label->deletechildrentask = "a supprimé une sous-tâche";
|
||||
$lang->action->label->createchildrenstory = "a créé une sous-story";
|
||||
$lang->action->label->linkchildstory = "a raccroché à une sous-story";
|
||||
@@ -469,13 +473,13 @@ $lang->action->search->objectTypeList['program'] = 'Program';
|
||||
$lang->action->search->objectTypeList['project'] = 'Project';
|
||||
$lang->action->search->objectTypeList['execution'] = 'Execution';
|
||||
$lang->action->search->objectTypeList['bug'] = 'Bug';
|
||||
$lang->action->search->objectTypeList['case'] = 'CasTest';
|
||||
$lang->action->search->objectTypeList['case'] = 'CasTest';
|
||||
$lang->action->search->objectTypeList['caseresult'] = 'CasTest Result';
|
||||
$lang->action->search->objectTypeList['stepresult'] = 'CasTest Steps';
|
||||
$lang->action->search->objectTypeList['story'] = "$lang->SRCommon/$lang->URCommon";
|
||||
$lang->action->search->objectTypeList['task'] = 'Tâche';
|
||||
$lang->action->search->objectTypeList['testtask'] = 'Recette';
|
||||
$lang->action->search->objectTypeList['user'] = 'Utilisateur';
|
||||
$lang->action->search->objectTypeList['task'] = 'Tâche';
|
||||
$lang->action->search->objectTypeList['testtask'] = 'Recette';
|
||||
$lang->action->search->objectTypeList['user'] = 'Utilisateur';
|
||||
$lang->action->search->objectTypeList['doc'] = 'Doc';
|
||||
$lang->action->search->objectTypeList['doclib'] = 'Doc Lib';
|
||||
$lang->action->search->objectTypeList['todo'] = 'Todo';
|
||||
|
||||
@@ -97,6 +97,8 @@ $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';
|
||||
|
||||
/* Used to describe operation history. */
|
||||
$lang->action->desc = new stdclass();
|
||||
@@ -238,6 +240,8 @@ $lang->action->label->unlinkparenttask = "unlink from nhiệm vụ cha";
|
||||
$lang->action->label->batchcreate = "batch created tasks";
|
||||
$lang->action->label->createchildren = "create child tasks";
|
||||
$lang->action->label->managed = "managed";
|
||||
$lang->action->label->managedteam = "managed";
|
||||
$lang->action->label->managedwhitelist = "managed";
|
||||
$lang->action->label->deletechildrentask = "delete children task";
|
||||
$lang->action->label->createchildrenstory = "create child stories";
|
||||
$lang->action->label->linkchildstory = "linked a child story";
|
||||
@@ -464,19 +468,19 @@ $lang->action->label->stakeholder = 'Stakeholder|stakeholder|view|userID=%s';
|
||||
|
||||
/* Object type. */
|
||||
$lang->action->search = new stdclass();
|
||||
$lang->action->search->objectTypeList[''] = '';
|
||||
$lang->action->search->objectTypeList[''] = '';
|
||||
$lang->action->search->objectTypeList['product'] = $lang->productCommon;
|
||||
$lang->action->search->objectTypeList['program'] = 'Program';
|
||||
$lang->action->search->objectTypeList['project'] = 'Project';
|
||||
$lang->action->search->objectTypeList['execution'] = 'Execution';
|
||||
$lang->action->search->objectTypeList['bug'] = 'Bug';
|
||||
$lang->action->search->objectTypeList['case'] = 'Tình huống';
|
||||
$lang->action->search->objectTypeList['case'] = 'Tình huống';
|
||||
$lang->action->search->objectTypeList['caseresult'] = 'Kết quả tình huống';
|
||||
$lang->action->search->objectTypeList['stepresult'] = 'Các bước tình huống';
|
||||
$lang->action->search->objectTypeList['story'] = "$lang->SRCommon/$lang->URCommon";
|
||||
$lang->action->search->objectTypeList['task'] = 'Nhiệm vụ';
|
||||
$lang->action->search->objectTypeList['testtask'] = 'Yêu cầu';
|
||||
$lang->action->search->objectTypeList['user'] = 'Người dùng';
|
||||
$lang->action->search->objectTypeList['task'] = 'Nhiệm vụ';
|
||||
$lang->action->search->objectTypeList['testtask'] = 'Yêu cầu';
|
||||
$lang->action->search->objectTypeList['user'] = 'Người dùng';
|
||||
$lang->action->search->objectTypeList['doc'] = 'Tài liệu';
|
||||
$lang->action->search->objectTypeList['doclib'] = 'Doc Lib';
|
||||
$lang->action->search->objectTypeList['todo'] = 'Việc làm';
|
||||
|
||||
@@ -101,6 +101,8 @@ $lang->action->objectTypes['stakeholder'] = '干系人';
|
||||
$lang->action->objectTypes['budget'] = '费用估算';
|
||||
$lang->action->objectTypes['entry'] = '应用';
|
||||
$lang->action->objectTypes['webhook'] = 'Webhook';
|
||||
$lang->action->objectTypes['team'] = '团队';
|
||||
$lang->action->objectTypes['whitelist'] = '白名单';
|
||||
|
||||
/* 用来描述操作历史记录。*/
|
||||
$lang->action->desc = new stdclass();
|
||||
@@ -242,6 +244,8 @@ $lang->action->label->unlinkparenttask = "从父任务取消关联";
|
||||
$lang->action->label->batchcreate = "批量创建任务";
|
||||
$lang->action->label->createchildren = "创建子任务";
|
||||
$lang->action->label->managed = "维护";
|
||||
$lang->action->label->managedteam = "维护了";
|
||||
$lang->action->label->managedwhitelist = "维护了";
|
||||
$lang->action->label->deletechildrentask = "删除子任务";
|
||||
$lang->action->label->createchildrenstory = "创建子需求";
|
||||
$lang->action->label->linkchildstory = "关联子需求";
|
||||
|
||||
+38
-3
@@ -65,6 +65,10 @@ class actionModel extends model
|
||||
$action->project = ($actionType == 'unlinkedfromproject' or $actionType == 'linked2project') ? (int)$extra : (int)$relation['project'];
|
||||
$action->execution = ($actionType == 'unlinkedfromexecution' or $actionType == 'linked2execution') ? (int)$extra : (int)$relation['execution'];
|
||||
|
||||
if($objectType == 'whitelist' and $extra == 'product') $action->product = $objectID;
|
||||
if($objectType == 'whitelist' and $extra == 'project') $action->project = $objectID;
|
||||
if($objectType == 'whitelist' and ($extra == 'sprint' or $extra == 'stage')) $action->execution = $objectID;
|
||||
|
||||
$this->dao->insert(TABLE_ACTION)->data($action)->autoCheck()->exec();
|
||||
$actionID = $this->dbh->lastInsertID();
|
||||
|
||||
@@ -177,7 +181,7 @@ class actionModel extends model
|
||||
}
|
||||
|
||||
/* Only process these object types. */
|
||||
if(strpos(',story,productplan,release,task,build,bug,case,testtask,doc,issue,risk,', ",{$objectType},") !== false)
|
||||
if(strpos(',story,productplan,release,task,build,bug,case,testtask,doc,issue,risk,repo,team,', ",{$objectType},") !== false)
|
||||
{
|
||||
if(!isset($this->config->objectTables[$objectType])) return $emptyRecord;
|
||||
|
||||
@@ -185,14 +189,24 @@ class actionModel extends model
|
||||
$fields = '*';
|
||||
if(strpos('story, productplan, case', $objectType) !== false) $fields = 'product';
|
||||
if(strpos('build, bug, testtask, doc', $objectType) !== false) $fields = 'product, project, execution';
|
||||
if(strpos('case, repo', $objectType) !== false) $fields = 'execution';
|
||||
if($objectType == 'release') $fields = 'product, build';
|
||||
if($objectType == 'task') $fields = 'project, execution, story';
|
||||
|
||||
$record = $this->dao->select($fields)->from($this->config->objectTables[$objectType])->where('id')->eq($objectID)->fetch();
|
||||
|
||||
/* Process story, release and task. */
|
||||
if($objectType == 'story') $record->project = $this->dao->select('project')->from(TABLE_PROJECTSTORY)->where('story')->eq($objectID)->orderBy('project_desc')->limit(1)->fetch('project');
|
||||
if($objectType == 'story')
|
||||
{
|
||||
$record->project = $this->dao->select('project')->from(TABLE_PROJECTSTORY)->where('story')->eq($objectID)->orderBy('project_desc')->limit(1)->fetch('project');
|
||||
$record->execution = $this->dao->select('project')->from(TABLE_PROJECTSTORY)->where('story')->eq($objectID)->orderBy('project_desc')->limit(1)->fetch('project');
|
||||
}
|
||||
if($objectType == 'release') $record->project = $this->dao->select('project')->from(TABLE_BUILD)->where('id')->eq($record->build)->fetch('project');
|
||||
if($objectType == 'team')
|
||||
{
|
||||
$team = $this->dao->select('type,root')->from(TABLE_TEAM)->where('id')->eq($objectID)->fetch();
|
||||
$record->{$team->type} = $team->root;
|
||||
}
|
||||
if($objectType == 'task')
|
||||
{
|
||||
if($record->story != 0)
|
||||
@@ -904,7 +918,7 @@ class actionModel extends model
|
||||
}
|
||||
elseif($objectType == 'story')
|
||||
{
|
||||
$objectInfo = $this->dao->select('id,title,type')->from($table)->where('id')->in($objectIds)->fetchAll();
|
||||
$objectInfo = $this->dao->select('id,title,type')->from($table)->where('id')->in($objectIds)->fetchAll();
|
||||
foreach($objectInfo as $object)
|
||||
{
|
||||
$objectName[$object->id] = $object->title;
|
||||
@@ -912,6 +926,20 @@ class actionModel extends model
|
||||
}
|
||||
$objectProject = array();
|
||||
}
|
||||
elseif($objectType == 'team')
|
||||
{
|
||||
$objectInfo = $this->dao->select('t1.id as projectID,t2.id,t1.team as name,t1.type')->from(TABLE_PROJECT)->alias('t1')
|
||||
->leftJoin(TABLE_TEAM)->alias('t2')->on('t1.id=t2.root')
|
||||
->where('t2.id')->in($objectIds)
|
||||
->fetchAll();
|
||||
|
||||
$objectProject = array();
|
||||
foreach($objectInfo as $object)
|
||||
{
|
||||
$objectName[$object->id] = $object->name;
|
||||
if($object->type == 'project') $objectProject[$object->id] = $object->projectID;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$objectName = $this->dao->select("id, $field AS name")->from($table)->where('id')->in($objectIds)->fetchPairs();
|
||||
@@ -989,6 +1017,13 @@ class actionModel extends model
|
||||
$action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID), '', '', $projectID);
|
||||
$action->objectLabel = $objectLabel;
|
||||
}
|
||||
elseif($action->objectType == 'team')
|
||||
{
|
||||
$action->objectLink = '';
|
||||
if($action->execution) $action->objectLink = helper::createLink('execution', 'team', 'executionID=' . $action->execution);
|
||||
if($action->project) $action->objectLink = helper::createLink('project', 'manageMembers', 'projectID=' . $action->project);
|
||||
$action->objectLabel = zget($this->lang->action->objectTypes, $action->objectLabel);
|
||||
}
|
||||
else
|
||||
{
|
||||
$action->objectLink = '';
|
||||
|
||||
@@ -2188,6 +2188,8 @@ class execution extends control
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->execution->manageMembers($executionID);
|
||||
$teamID = $this->dao->select('id')->from(TABLE_TEAM)->where('root')->eq($executionID)->andWhere('type')->eq('execution')->fetch('id');
|
||||
$this->loadModel('action')->create('team', $teamID, 'managedTeam');
|
||||
die(js::locate($this->createLink('execution', 'team', "executionID=$executionID"), 'parent'));
|
||||
}
|
||||
|
||||
@@ -2254,6 +2256,11 @@ class execution extends control
|
||||
$account = $user->account;
|
||||
|
||||
$this->execution->unlinkMember($executionID, $account);
|
||||
if(!dao::isError())
|
||||
{
|
||||
$teamID = $this->dao->select('id')->from(TABLE_TEAM)->where('root')->eq($executionID)->andWhere('type')->eq('execution')->fetch('id');
|
||||
$this->loadModel('action')->create('team', $teamID, 'managedTeam');
|
||||
}
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
@@ -165,6 +165,8 @@ class personnel extends control
|
||||
$this->personnel->addWhitelist($objectType, $objectID);
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => $this->getError()));
|
||||
|
||||
$this->loadModel('action')->create('whitelist', $objectID, 'managedWhitelist', '', $objectType);
|
||||
|
||||
$locateLink = $this->session->whitelistList ? $this->session->whitelistList : $this->createLink($module, 'whitelist', "objectID=$objectID");
|
||||
$openApp = $module == 'program' ? ($from == 'project' || $from == 'my' ? '#open=project' : '#open=program') : '';
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink . $openApp));
|
||||
@@ -219,6 +221,8 @@ class personnel extends control
|
||||
if($acl->objectType == 'product') $this->personnel->deleteProgramWhitelist($acl->objectID, $acl->account);
|
||||
if($acl->objectType == 'sprint') $this->personnel->deleteProjectWhitelist($acl->objectID, $acl->account);
|
||||
|
||||
$this->loadModel('action')->create('whitelist', $acl->objectID, 'managedWhitelist', '', $acl->objectType);
|
||||
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1094,6 +1094,9 @@ class project extends control
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->project->manageMembers($projectID);
|
||||
$teamID = $this->dao->select('id')->from(TABLE_TEAM)->where('root')->eq($projectID)->andWhere('type')->eq('project')->fetch('id');
|
||||
$this->loadModel('action')->create('team', $teamID, 'ManagedTeam');
|
||||
|
||||
$link = $this->createLink('project', 'manageMembers', "projectID=$projectID");
|
||||
$this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => $link));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user