* Adjust code

This commit is contained in:
zenggang
2021-12-30 05:24:37 +00:00
parent bfde525f13
commit 3bfc8e04c1
3 changed files with 12 additions and 16 deletions
+10 -14
View File
@@ -1023,10 +1023,7 @@ class gitlab extends control
/* Data sort. */
list($order, $sort) = explode('_', $orderBy);
$orderList = array();
foreach($tagList as $tag)
{
$orderList[] = $tag->$order;
}
foreach($tagList as $tag) $orderList[] = $tag->$order;
array_multisort($orderList, $sort == 'desc' ? SORT_DESC : SORT_ASC, $tagList);
/* Pager. */
@@ -1035,16 +1032,15 @@ class gitlab extends control
$pager = new pager($recTotal, $recPerPage, $pageID);
$tagList = array_chunk($tagList, $pager->recPerPage);
$this->view->gitlab = $this->gitlab->getByID($gitlabID);
$this->view->pager = $pager;
$this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browseTagPriv;
$this->view->levelLang = $this->lang->gitlab->branch->branchCreationLevelList;
$this->view->gitlabID = $gitlabID;
$this->view->projectID = $projectID;
$this->view->keyword = $keyword;
$this->view->project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID);
$this->view->gitlabTagList = empty($tagList) ? $tagList: $tagList[$pageID - 1];
$this->view->orderBy = $orderBy;
$this->view->gitlab = $this->gitlab->getByID($gitlabID);
$this->view->pager = $pager;
$this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browseTagPriv;
$this->view->gitlabID = $gitlabID;
$this->view->projectID = $projectID;
$this->view->keyword = $keyword;
$this->view->project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID);
$this->view->gitlabTagList = empty($tagList) ? $tagList: $tagList[$pageID - 1];
$this->view->orderBy = $orderBy;
$this->display();
}
+1 -1
View File
@@ -1535,7 +1535,7 @@ class gitlabModel extends model
* @param int $gitlabID
* @param int $projectID
* @access public
* @return void
* @return array
*/
public function apiGetTagPrivs($gitlabID, $projectID)
{
+1 -1
View File
@@ -60,7 +60,7 @@
<tr class='text'>
<td class='text-c-name' title='<?php echo $gitlabTag->name;?>'><?php echo $gitlabTag->name;?></td>
<td class='text'><?php echo $gitlabTag->lastCommitter;?></td>
<td class='text'><?php echo $levelLang[$gitlabTag->accessLevel];?></td>
<td class='text'><?php echo zget($lang->gitlab->branch->branchCreationLevelList, $gitlabTag->accessLevel);?></td>
<td class='c-actions text-left'>
<?php
common::printLink('gitlab', 'editTagPriv', "gitlabID=$gitlabID&projectID=$projectID&tag_name={$gitlabTag->name}", "<i class='icon icon-edit'></i> ", '', "title={$lang->gitlab->editTagPriv} class='btn btn-primary'");