* Add GitLab and ZenTao user binding status.

This commit is contained in:
dingguodong
2021-10-11 16:21:11 +08:00
parent d9b19205b8
commit c0764bb1e9
6 changed files with 16 additions and 6 deletions
+1
View File
@@ -188,6 +188,7 @@ class gitlab extends control
$this->view->title = $this->lang->gitlab->bindUser;
$this->view->userPairs = $userPairs;
$this->view->gitlabUsers = $this->gitlab->apiGetUsers($gitlabID);
$this->view->bindedUsers = $this->gitlab->getUserAccountIdPairs($gitlabID);
$this->view->matchedResult = $this->gitlab->getMatchedUsers($gitlabID, $this->view->gitlabUsers, $zentaoUsers);
$this->display();
}
+2
View File
@@ -13,6 +13,8 @@ $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->gitlab->bindingStatus = 'Binding Status';
$lang->gitlab->binded = 'Binded';
$lang->gitlab->serverFail = 'Conntect to GitLab server failed, please check the GitLab server.';
$lang->gitlab->browseAction = 'GitLab List';
+2
View File
@@ -13,6 +13,8 @@ $lang->gitlab->delete = '删除GitLab';
$lang->gitlab->confirmDelete = '确认删除该GitLab吗?';
$lang->gitlab->gitlabAccount = 'GitLab用户';
$lang->gitlab->zentaoAccount = '禅道用户';
$lang->gitlab->bindingStatus = '绑定状态';
$lang->gitlab->binded = '已绑定';
$lang->gitlab->serverFail = '连接GitLab服务器异常,请检查GitLab服务器。';
$lang->gitlab->browseAction = 'GitLab列表';
+2
View File
@@ -13,6 +13,8 @@ $lang->gitlab->delete = '刪除GitLab';
$lang->gitlab->confirmDelete = '確認刪除該GitLab嗎?';
$lang->gitlab->gitlabAccount = 'GitLab用戶';
$lang->gitlab->zentaoAccount = '禪道用戶';
$lang->gitlab->bindingStatus = '綁定狀態';
$lang->gitlab->binded = '已綁定';
$lang->gitlab->serverFail = '連接GitLab伺服器異常,請檢查GitLab伺服器。';
$lang->gitlab->browseAction = 'GitLab列表';
+6 -6
View File
@@ -85,30 +85,30 @@ class gitlabModel extends model
/**
* Get gitlab user id and zentao account pairs of one gitlab.
*
* @param int $gitlab
* @param int $gitlabID
* @access public
* @return array
*/
public function getUserIdAccountPairs($gitlab)
public function getUserIdAccountPairs($gitlabID)
{
return $this->dao->select('openID,account')->from(TABLE_OAUTH)
->where('providerType')->eq('gitlab')
->andWhere('providerID')->eq($gitlab)
->andWhere('providerID')->eq($gitlabID)
->fetchPairs();
}
/**
* Get zentao account gitlab user id pairs of one gitlab.
*
* @param int $gitlab
* @param int $gitlabID
* @access public
* @return array
*/
public function getUserAccountIdPairs($gitlab)
public function getUserAccountIdPairs($gitlabID)
{
return $this->dao->select('account,openID')->from(TABLE_OAUTH)
->where('providerType')->eq('gitlab')
->andWhere('providerID')->eq($gitlab)
->andWhere('providerID')->eq($gitlabID)
->fetchPairs();
}
+3
View File
@@ -22,6 +22,7 @@
<tr>
<th colspan='2'><?php echo $lang->gitlab->gitlabAccount;?></th>
<th><?php echo $lang->gitlab->zentaoAccount;?></th>
<th><?php echo $lang->gitlab->bindingStatus;?></th>
</tr>
</thead>
<tbody>
@@ -35,6 +36,7 @@
<?php echo $gitlabUser->account . " &lt;" . $gitlabUser->email . "&gt;";?>
</td>
<td><?php echo html::select("zentaoUsers[$gitlabUser->id]", $userPairs, '', "class='form-control select chosen'" );?></td>
<td></td>
</tr>
<?php endforeach;?>
<?php foreach($gitlabUsers as $gitlabUser):?>
@@ -47,6 +49,7 @@
<?php echo $gitlabUser->account . " &lt;" . $gitlabUser->email . "&gt;";?>
</td>
<td><?php echo html::select("zentaoUsers[$gitlabUser->id]", $userPairs, $gitlabUser->zentaoAccount, "class='form-control select chosen'" );?></td>
<td><?php echo isset($bindedUsers[$gitlabUser->account]) ? $lang->gitlab->binded : ""; ?></td>
</tr>
<?php endforeach;?>
</tbody>