Merge branch feature/branch-archive of zentao/zentaopms (#11201)
This commit is contained in:
@@ -59,11 +59,13 @@ class scm
|
||||
* @param string $orderBy
|
||||
* @param int $limit
|
||||
* @param int $pageID
|
||||
* @param string $label
|
||||
* @param int $showArchived
|
||||
* @return array
|
||||
*/
|
||||
public function branch(string $showDetail = '', string $orderBy = '', int $limit = 0, int $pageID = 1, string $label = '')
|
||||
public function branch(string $showDetail = '', string $orderBy = '', int $limit = 0, int $pageID = 1, string $label = '', int $showArchived = 0)
|
||||
{
|
||||
return $this->engine->branch($showDetail, $orderBy, $limit, $pageID, $label);
|
||||
return $this->engine->branch($showDetail, $orderBy, $limit, $pageID, $label, $showArchived);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+15
-13
@@ -1919,6 +1919,7 @@ class repo extends control
|
||||
* @param int $repoID
|
||||
* @param int $objectID
|
||||
* @param string $label
|
||||
* @param int $showArchived
|
||||
* @param string $keyword
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
@@ -1927,7 +1928,7 @@ class repo extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browseBranch(int $repoID, int $objectID = 0, string $label = 'all', string $keyword = '', string $orderBy = 'date_desc', int $recTotal = 0, int $recPerPage = 20, int $pageID = 1)
|
||||
public function browseBranch(int $repoID, int $objectID = 0, string $label = 'all', int $showArchived = 0, string $keyword = '', string $orderBy = 'date_desc', int $recTotal = 0, int $recPerPage = 20, int $pageID = 1)
|
||||
{
|
||||
$repoID = $this->repoZen->processRepoID($repoID, $objectID);
|
||||
$this->commonAction($repoID, $objectID);
|
||||
@@ -1939,8 +1940,8 @@ class repo extends control
|
||||
$keyword = htmlspecialchars(base64_decode($keyword));
|
||||
|
||||
$this->scm->setEngine($repo);
|
||||
$branchList = $this->scm->branch($keyword ? $keyword : 'all', $orderBy, $recPerPage, $pageID, $label);
|
||||
if(count($branchList) == 0 && $pageID != 1) $this->locate(inLink('browseBranch', "repoID=$repoID&objectID=$objectID&label=$label&keyword=$keyword&orderBy=$orderBy&recTotal=0&recPerPage=$recPerPage&pageID=1"));
|
||||
$branchList = $this->scm->branch($keyword ? $keyword : 'all', $orderBy, $recPerPage, $pageID, $label, $showArchived);
|
||||
if(count($branchList) == 0 && $pageID != 1) $this->locate(inLink('browseBranch', "repoID=$repoID&objectID=$objectID&label=$label&showArchived=$showArchived&keyword=$keyword&orderBy=$orderBy&recTotal=0&recPerPage=$recPerPage&pageID=1"));
|
||||
|
||||
$this->app->loadClass('pager', true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
@@ -1969,16 +1970,17 @@ class repo extends control
|
||||
$branch->behind = isset($branch->divergence->behind) ? $branch->divergence->behind : 0;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->repo->browseBranch;
|
||||
$this->view->repoID = $repoID;
|
||||
$this->view->objectID = $objectID;
|
||||
$this->view->repo = $repo;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->branchList = $branchList;
|
||||
$this->view->keyword = base64_encode($keyword);
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->label = $label;
|
||||
$this->view->title = $this->lang->repo->browseBranch;
|
||||
$this->view->repoID = $repoID;
|
||||
$this->view->objectID = $objectID;
|
||||
$this->view->repo = $repo;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->branchList = $branchList;
|
||||
$this->view->keyword = base64_encode($keyword);
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->label = $label;
|
||||
$this->view->showArchived = $showArchived;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ declare(strict_types=1);
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
jsVar('searchUrl', createLink('repo', 'browsebranch', "repoID={$repo->id}&objectID={$objectID}&label={$label}&keyword=%s"));
|
||||
jsVar('searchUrl', createLink('repo', 'browsebranch', "repoID={$repo->id}&objectID={$objectID}&label={$label}&showArchived={$showArchived}&keyword=%s"));
|
||||
$module = $app->tab == 'devops' ? 'repo' : $app->tab;
|
||||
dropmenu
|
||||
(
|
||||
@@ -50,14 +50,15 @@ $config->repo->dtable->branch->fieldList['committer']['map'] = $users;
|
||||
if(!hasPriv('repo', 'revision')) unset($config->repo->dtable->branch->fieldList['commitID']['link']);
|
||||
$branchList = initTableData($branchList, $config->repo->dtable->branch->fieldList);
|
||||
$urlParams = array(
|
||||
'repoID' => $repo->id,
|
||||
'objectID' => $objectID,
|
||||
'label' => $label,
|
||||
'keyword' => urlencode($keyword),
|
||||
'orderBy' => '{name}_{sortType}',
|
||||
'recTotal' => $pager->recTotal,
|
||||
'recPerPage' => $pager->recPerPage,
|
||||
'pageID' => $pager->pageID
|
||||
'repoID' => $repo->id,
|
||||
'objectID' => $objectID,
|
||||
'label' => $label,
|
||||
'showArchived' => $showArchived,
|
||||
'keyword' => urlencode($keyword),
|
||||
'orderBy' => '{name}_{sortType}',
|
||||
'recTotal' => $pager->recTotal,
|
||||
'recPerPage' => $pager->recPerPage,
|
||||
'pageID' => $pager->pageID
|
||||
);
|
||||
dtable
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user