* [task#124018] Adjust branch list.

This commit is contained in:
liyang
2024-08-01 08:50:48 +08:00
committed by 曹延义
parent af6b892bf0
commit 4da591cc97
6 changed files with 26 additions and 16 deletions
+12 -7
View File
@@ -273,7 +273,7 @@ $config->repo->dtable->tag->fieldList['name']['type'] = 'title';
$config->repo->dtable->tag->fieldList['name']['name'] = 'name';
$config->repo->dtable->tag->fieldList['name']['order'] = 10;
$config->repo->dtable->tag->fieldList['committer']['title'] = $lang->repo->lastCommit;
$config->repo->dtable->tag->fieldList['committer']['title'] = $lang->repo->lastCommitter;
$config->repo->dtable->tag->fieldList['committer']['type'] = 'text';
$config->repo->dtable->tag->fieldList['committer']['sortType'] = true;
$config->repo->dtable->tag->fieldList['committer']['order'] = 20;
@@ -290,12 +290,17 @@ $config->repo->dtable->branch->fieldList['name']['title'] = $lang->repo->branch;
$config->repo->dtable->branch->fieldList['name']['type'] = 'title';
$config->repo->dtable->branch->fieldList['name']['name'] = 'name';
$config->repo->dtable->branch->fieldList['committer']['title'] = $lang->repo->lastCommit;
$config->repo->dtable->branch->fieldList['commitID']['title'] = $lang->repo->commit;
$config->repo->dtable->branch->fieldList['commitID']['type'] = 'text';
$config->repo->dtable->branch->fieldList['commitID']['link'] = helper::createLink('repo', 'revision', 'repoID={repoID}&objectID=0&revision={commitID}');
$config->repo->dtable->branch->fieldList['commitID']['sortType'] = true;
$config->repo->dtable->branch->fieldList['committer']['title'] = $lang->repo->lastCommitter;
$config->repo->dtable->branch->fieldList['committer']['type'] = 'text';
$config->repo->dtable->branch->fieldList['committer']['sortType'] = true;
$config->repo->dtable->branch->fieldList['date']['title'] = $lang->repo->lastUpdateTime;
$config->repo->dtable->branch->fieldList['date']['name'] = 'date';
$config->repo->dtable->branch->fieldList['date']['type'] = 'datetime';
$config->repo->dtable->branch->fieldList['date']['width'] = 300;
$config->repo->dtable->branch->fieldList['date']['formatDate'] = 'YYYY-MM-dd hh:mm';
$config->repo->dtable->branch->fieldList['commitDate']['title'] = $lang->repo->lastSubmitTime;
$config->repo->dtable->branch->fieldList['commitDate']['name'] = 'commitDate';
$config->repo->dtable->branch->fieldList['commitDate']['type'] = 'datetime';
$config->repo->dtable->branch->fieldList['commitDate']['width'] = 300;
$config->repo->dtable->branch->fieldList['commitDate']['formatDate'] = 'YYYY-MM-dd hh:mm';
+8 -3
View File
@@ -1867,7 +1867,7 @@ class repo extends control
* @access public
* @return void
*/
public function browseBranch(int $repoID, int $objectID = 0, string $keyword = '', string $orderBy = 'date_desc', int $recPerPage = 20, int $pageID = 1)
public function browseBranch(int $repoID, int $objectID = 0, string $keyword = '', string $orderBy = 'commitDate_desc', int $recPerPage = 20, int $pageID = 1)
{
$repoID = $this->repoZen->processRepoID($repoID, $objectID);
$this->commonAction($repoID, $objectID);
@@ -1883,12 +1883,17 @@ class repo extends control
{
$branch->repoID = $repoID;
$branch->branchName = helper::safe64Encode($branch->name);
$branch->commitID = isset($branch->commit->id) ? $branch->commit->id : '';
if(isset($branch->commit->sha)) $branch->commitID = $branch->commit->sha;
$branch->commitID = substr($branch->commitID, 0, 10);
$branch->committer = isset($branch->commit->author_name) ? $branch->commit->author_name : '';
if(isset($branch->commit->author->identity->name)) $branch->committer = $branch->commit->author->identity->name;
$branch->committer = zget($committers, $branch->committer);
$branch->date = isset($branch->commit->committed_date) ? date('Y-m-d H:i:s', strtotime($branch->commit->committed_date)) : '';
if(isset($branch->commit->author->when)) $branch->date = date('Y-m-d H:i:s', strtotime($branch->commit->author->when));
$branch->commitDate = isset($branch->commit->committed_date) ? date('Y-m-d H:i:s', strtotime($branch->commit->committed_date)) : '';
if(isset($branch->commit->author->when)) $branch->commitDate = date('Y-m-d H:i:s', strtotime($branch->commit->author->when));
}
/* Data sort. */
+2 -2
View File
@@ -143,7 +143,7 @@ $lang->repo->linkTask = 'Link Task';
$lang->repo->unlink = 'Unlink';
$lang->repo->viewBugs = 'View Bugs';
$lang->repo->lastSubmitTime = 'Final submission time';
$lang->repo->lastCommit = 'Final submission';
$lang->repo->lastCommitter = 'Last committer';
$lang->repo->lastUpdateTime = 'Last update time';
$lang->repo->title = 'Title';
@@ -301,4 +301,4 @@ $lang->repo->apiError[2] = 'branch.* already exists';
$lang->repo->apiError[3] = 'Forbidden';
$lang->repo->apiError[4] = 'cannot have ASCII control characters';
$lang->repo->apiError[5] = 'Created fail';
$lang->repo->apiError[6] = 'Project Not Found';
$lang->repo->apiError[6] = 'Project Not Found';
+1 -1
View File
@@ -143,7 +143,7 @@ $lang->repo->linkTask = 'Link Task';
$lang->repo->unlink = 'Unlink';
$lang->repo->viewBugs = 'View Bugs';
$lang->repo->lastSubmitTime = 'Final submission time';
$lang->repo->lastCommit = 'Final submission';
$lang->repo->lastCommitter = 'Last committer';
$lang->repo->lastUpdateTime = 'Last update time';
$lang->repo->title = 'Title';
+1 -1
View File
@@ -143,7 +143,7 @@ $lang->repo->linkTask = 'Link Task';
$lang->repo->unlink = 'Unlink';
$lang->repo->viewBugs = 'View Bugs';
$lang->repo->lastSubmitTime = 'Final submission time';
$lang->repo->lastCommit = 'Final submission';
$lang->repo->lastCommitter = 'Last committer';
$lang->repo->lastUpdateTime = 'Last update time';
$lang->repo->title = 'Titre';
+2 -2
View File
@@ -143,7 +143,7 @@ $lang->repo->linkTask = '关联任务';
$lang->repo->unlink = '取消关联';
$lang->repo->viewBugs = '查看Bug';
$lang->repo->lastSubmitTime = '最后提交时间';
$lang->repo->lastCommit = '最后提交';
$lang->repo->lastCommitter = '最后提交人';
$lang->repo->lastUpdateTime = '最后修改时间';
$lang->repo->title = '标题';
@@ -301,4 +301,4 @@ $lang->repo->apiError[2] = 'branch.* already exists';
$lang->repo->apiError[3] = 'Forbidden';
$lang->repo->apiError[4] = 'cannot have ASCII control characters';
$lang->repo->apiError[5] = 'Created fail';
$lang->repo->apiError[6] = 'Project Not Found';
$lang->repo->apiError[6] = 'Project Not Found';