* Add action logs and check privileges for linking project and Repos.

This commit is contained in:
wangjianhua
2022-10-11 17:23:55 +08:00
parent a8ffa986c0
commit baee149721
9 changed files with 33 additions and 1 deletions
+1
View File
@@ -392,6 +392,7 @@ $lang->action->label->updatetolib = 'updated';
$lang->action->label->ganttmove = 'sorted';
$lang->action->label->submitreview = 'submitted';
$lang->action->label->switchtolean = 'switch from new mode to lean mode';
$lang->action->label->managerepo = 'Linked Code Repo';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass;
+1
View File
@@ -392,6 +392,7 @@ $lang->action->label->updatetolib = 'updated';
$lang->action->label->ganttmove = 'sorted';
$lang->action->label->submitreview = 'submitted';
$lang->action->label->switchtolean = 'switch from new mode to lean mode';
$lang->action->label->managerepo = 'Linked Code Repo';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass;
+1
View File
@@ -392,6 +392,7 @@ $lang->action->label->updatetolib = 'MàJ';
$lang->action->label->ganttmove = 'sorted';
$lang->action->label->submitreview = 'submitted';
$lang->action->label->switchtolean = 'switch from new mode to lean mode';
$lang->action->label->managerepo = 'Linked Code Repo';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass();
+1
View File
@@ -306,6 +306,7 @@ $lang->action->label->syncproject = 'start';
$lang->action->label->syncexecution = 'start';
$lang->action->label->startProgram = '(The start of the project sets the status of the program as Ongoing)';
$lang->action->label->submitreview = 'submitted';
$lang->action->label->managerepo = 'Linked Code Repo';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass;
+1
View File
@@ -392,6 +392,7 @@ $lang->action->label->updatetolib = '更新了';
$lang->action->label->ganttmove = '排序了';
$lang->action->label->submitreview = '提交了评审';
$lang->action->label->switchtolean = '从综合模式切换为迅捷模式';
$lang->action->label->managerepo = '关联了代码库';
/* 动态信息按照对象分组 */
$lang->action->dynamicAction = new stdclass();
+1
View File
@@ -324,6 +324,7 @@ $lang->action->label->importfromgitlab = '從Gitlab關聯創建了';
$lang->action->label->archived = '歸檔了';
$lang->action->label->restore = '還原了';
$lang->action->label->mergedbranch = '合併分支';
$lang->action->label->managerepo = '關聯了代碼庫';
/* 動態信息按照對象分組 */
$lang->action->dynamicAction = new stdclass();
+1 -1
View File
@@ -2297,7 +2297,7 @@ class project extends control
}
$this->view->title = $this->lang->project->manageRepo;
$this->view->allRepos = $this->dao->select('*')->from(TABLE_REPO)->where('deleted')->eq(0)->fetchPairs('id', 'name');
$this->view->allRepos = $this->loadModel('repo')->repoPairsForCurrentUser();
$this->view->linkedRepos = $this->project->linkedRepoPairs($projectID);
$this->view->unlinkedRepos = array();
+3
View File
@@ -2900,6 +2900,9 @@ class projectModel extends model
$this->dao->insert(TABLE_RELATION)->data($newRelation)->exec();
}
$this->loadModel('action');
$this->action->create('project', $projectID, 'manageRepo');
}
/**
+23
View File
@@ -382,6 +382,29 @@ class repoModel extends model
return $repoPairs;
}
/**
* Get Repo pairs under current user privileges.
*
* @access public
* @return array
*/
public function repoPairsForCurrentUser()
{
$repos = $this->dao->select('*')->from(TABLE_REPO)->where('deleted')->eq(0)->fetchAll();
$repoPairs = array();
foreach($repos as $repo)
{
$repo->acl = json_decode($repo->acl);
if($this->checkPriv($repo))
{
$repoPairs[$repo->id] = $repo->name;
}
}
return $repoPairs;
}
/**
* Get repos group by repo type.
*