show/hide repo dropdown-list

This commit is contained in:
aaronchen2k
2020-01-23 11:13:08 +08:00
parent 95759739c2
commit b6c5cb2170
8 changed files with 185 additions and 525 deletions
+3 -3
View File
@@ -77,9 +77,9 @@ $lang->testsuite->menuOrder = $lang->testcase->menuOrder;
$lang->caselib->menuOrder = $lang->testcase->menuOrder;
$lang->testreport->menuOrder = $lang->testcase->menuOrder;
$lang->repo->menuOrder[5] = 'log';
$lang->repo->menuOrder[10] = 'review';
$lang->repo->menuOrder[15] = 'browse';
$lang->repo->menuOrder[5] = 'browse';
$lang->repo->menuOrder[10] = 'review';
$lang->repo->menuOrder[15] = 'maintain';
$lang->repo->menuOrder[20] = 'job';
$lang->repo->menuOrder[25] = 'jenkins';
+4 -4
View File
@@ -334,11 +334,11 @@ $lang->caselib->menu->caselib = array('link' => '用例库|caselib|browse|libI
$lang->repo = new stdclass();
$lang->repo->menu = new stdclass();
$lang->repo->menu->log = array('link' =>'浏览|repo|log|repoID=%s&entry=', 'alias' => 'diff,view,revision,showsynccomment');
$lang->repo->menu->browse = array('link' =>'浏览|repo|browse|repoID=%s', 'alias' => 'diff,view,revision,showsynccomment');
$lang->repo->menu->review = '评审|repo|review|repoID=%s';
$lang->repo->menu->browse = '代码库|repo|browse';
$lang->repo->menu->job = '构建|repo|job|repoID=%s';
$lang->repo->menu->jenkins = 'Jenkins|repo|job|repoID=%s';
$lang->repo->menu->maintain = '代码库|repo|maintain';
$lang->repo->menu->job = '构建|ci|job';
$lang->repo->menu->jenkins = 'Jenkins|jenkins|jenkins';
/* 文档视图菜单设置。*/
$lang->doc = new stdclass();
+98 -66
View File
@@ -29,88 +29,120 @@ class repo extends control
$this->scm = $this->app->loadClass('scm');
$this->repos = $this->repo->getRepoPairs();
if(common::hasPriv('repo', 'create')) $this->lang->modulePageActions = html::a(helper::createLink('repo', 'create'), "<i class='icon icon-plus text-muted'></i> " . $this->lang->repo->create, '', "class='btn'");
// if(common::hasPriv('repo', 'create')) $this->lang->modulePageActions = html::a(helper::createLink('repo', 'create'), "<i class='icon icon-plus text-muted'></i> " . $this->lang->repo->create, '', "class='btn'");
if(empty($this->repos) and $this->methodName != 'create') die(js::locate($this->repo->createLink('create')));
/* Unlock session for wait to get data of repo. */
session_write_close();
}
// /**
// * Create repo.
// *
// * @access public
// * @return void
// */
// public function create()
// {
// $this->repo->setMenu($this->repos);
// if(!empty($_POST))
// {
// $repoID = $this->repo->create();
// if(dao::isError()) die(js::error(dao::getError()));
// die(js::locate($this->repo->createLink('showSyncComment', "repoID=$repoID"), 'parent'));
// }
//
// $this->view->title = $this->lang->repo->create;
// $this->view->groups = $this->loadModel('group')->getPairs();
// $this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted');
// $this->display();
// }
//
// /**
// * Set repo.
// *
// * @param int $repoID
// * @access public
// * @return void
// */
// public function settings($repoID = 0)
// {
// $this->repo->setMenu($this->repos, $repoID);
// if($repoID == 0) $repoID = $this->session->repoID;
// if(!empty($_POST))
// {
// $needSync = $this->repo->saveSettings($repoID);
// if(dao::isError()) die(js::error(dao::getError()));
// if(!$needSync)
// {
// die(js::locate($this->repo->createLink('showSyncComment', "repoID=$repoID"), 'parent'));
// }
// die(js::locate($this->repo->createLink('browse', "repoID=$repoID"), 'parent'));
// }
//
// $this->view->title = $this->lang->repo->settings;
// $this->view->repo = $this->repo->getRepoByID($repoID);
// $this->view->groups = $this->loadModel('group')->getPairs();
// $this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted', !empty($repo->acl->users) ? $repo->acl->users : '');
// $this->display();
// }
//
// /**
// * Delete repo.
// *
// * @param int $repoID
// * @param string $confirm
// * @access public
// * @return void
// */
// public function delete($repoID, $confirm = 'no')
// {
// if($confirm == 'no')
// {
// die(js::confirm($this->lang->repo->notice->delete, $this->repo->createLink('delete', "repoID=$repoID&confirm=yes")));
// }
// $this->dao->delete()->from(TABLE_REPO)->where('id')->eq($repoID)->exec();
// $this->dao->delete()->from(TABLE_REPOHISTORY)->where('repo')->eq($repoID)->exec();
// $this->dao->delete()->from(TABLE_REPOFILES)->where('repo')->eq($repoID)->exec();
// $this->dao->delete()->from(TABLE_REPOBRANCH)->where('repo')->eq($repoID)->exec();
// echo js::alert($this->lang->repo->notice->successDelete);
// die(js::locate($this->repo->createLink('browse'), 'parent'));
// }
/**
* Create repo.
*
* List all repo.
*
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function create()
public function maintain($orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->repo->setMenu($this->repos);
if(!empty($_POST))
{
$repoID = $this->repo->create();
if(dao::isError()) die(js::error(dao::getError()));
die(js::locate($this->repo->createLink('showSyncComment', "repoID=$repoID"), 'parent'));
}
$repoID = $this->session->repoID;
$this->repo->setMenu($this->repos, $repoID, false);
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->view->repoList = $this->repo->listAll($orderBy, $pager);
$this->view->title = $this->lang->ci->repo . $this->lang->colon . $this->lang->ci->browse;
$this->view->position[] = $this->lang->ci->common;
$this->view->position[] = $this->lang->ci->repo;
$this->view->position[] = $this->lang->ci->browse;
$this->view->repoID = $repoID;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->title = $this->lang->repo->create;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted');
$this->display();
}
/**
* Set repo.
*
* @param int $repoID
* @access public
* @return void
*/
public function settings($repoID = 0)
{
$this->repo->setMenu($this->repos, $repoID);
if($repoID == 0) $repoID = $this->session->repoID;
if(!empty($_POST))
{
$needSync = $this->repo->saveSettings($repoID);
if(dao::isError()) die(js::error(dao::getError()));
if(!$needSync)
{
die(js::locate($this->repo->createLink('showSyncComment', "repoID=$repoID"), 'parent'));
}
die(js::locate($this->repo->createLink('browse', "repoID=$repoID"), 'parent'));
}
$this->view->title = $this->lang->repo->settings;
$this->view->repo = $this->repo->getRepoByID($repoID);
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted', !empty($repo->acl->users) ? $repo->acl->users : '');
$this->display();
}
/**
* Delete repo.
*
* @param int $repoID
* @param string $confirm
* @access public
* @return void
*/
public function delete($repoID, $confirm = 'no')
{
if($confirm == 'no')
{
die(js::confirm($this->lang->repo->notice->delete, $this->repo->createLink('delete', "repoID=$repoID&confirm=yes")));
}
$this->dao->delete()->from(TABLE_REPO)->where('id')->eq($repoID)->exec();
$this->dao->delete()->from(TABLE_REPOHISTORY)->where('repo')->eq($repoID)->exec();
$this->dao->delete()->from(TABLE_REPOFILES)->where('repo')->eq($repoID)->exec();
$this->dao->delete()->from(TABLE_REPOBRANCH)->where('repo')->eq($repoID)->exec();
echo js::alert($this->lang->repo->notice->successDelete);
die(js::locate($this->repo->createLink('browse'), 'parent'));
}
/**
* Browse repo.
* View repo content.
*
* @param int $repoID
* @param string $path
-150
View File
@@ -1,150 +0,0 @@
<?php
$lang->repo->common = 'Repo';
$lang->repo->create = 'Create Repo';
$lang->repo->settings = 'Settings';
$lang->repo->browse = 'View Repo';
$lang->repo->delete = 'Delete Repo';
$lang->repo->showSyncComment = 'Display Synchronization';
$lang->repo->ajaxSyncComment = 'Interface: Ajax Sync Note';
$lang->repo->download = 'Download File';
$lang->repo->downloadDiff = 'Download Diff';
$lang->repo->diffAction = 'Revision Diff';
$lang->repo->revisionAction = 'Revision Detail';
$lang->repo->blameAction = 'Repo Blame';
$lang->repo->addBug = 'Add Review';
$lang->repo->editBug = 'Edit Bug';
$lang->repo->deleteBug = 'Delete Bug';
$lang->repo->addComment = 'Add Comment';
$lang->repo->editComment = 'Edit Comment';
$lang->repo->deleteComment = 'Delete Comment';
$lang->repo->submit = 'Submit';
$lang->repo->cancel = 'Cancel';
$lang->repo->addComment = 'Add Comment';
$lang->repo->product = $lang->productCommon;
$lang->repo->module = 'Module';
$lang->repo->project = $lang->projectCommon;
$lang->repo->type = 'Type';
$lang->repo->assign = 'AssignTo';
$lang->repo->title = 'Title';
$lang->repo->detile = 'Detail';
$lang->repo->lines = 'Lines';
$lang->repo->line = 'Line';
$lang->repo->expand = 'Unfold';
$lang->repo->collapse = 'Fold';
$lang->repo->id = 'ID';
$lang->repo->SCM = 'Type';
$lang->repo->name = 'Name';
$lang->repo->path = 'Path';
$lang->repo->prefix = 'Prefix';
$lang->repo->config = 'Config';
$lang->repo->account = 'Username';
$lang->repo->password = 'Password';
$lang->repo->encoding = 'Encoding';
$lang->repo->client = 'Client Path';
$lang->repo->size = 'Size';
$lang->repo->revision = 'Revision';
$lang->repo->revisionA = 'Revision';
$lang->repo->revisions = 'Revision';
$lang->repo->time = 'Date';
$lang->repo->committer = 'Committer';
$lang->repo->commits = 'Commits';
$lang->repo->synced = 'Initialize Sync';
$lang->repo->lastSync = 'Last Sync';
$lang->repo->deleted = 'Deleted';
$lang->repo->commit = 'Commit';
$lang->repo->comment = 'Comment';
$lang->repo->view = 'View File';
$lang->repo->viewA = 'View';
$lang->repo->log = 'Revision Log';
$lang->repo->blame = 'Blame';
$lang->repo->date = 'Date';
$lang->repo->diff = 'Diff';
$lang->repo->diffAB = 'Diff';
$lang->repo->diffAll = 'Diff All';
$lang->repo->viewDiff = 'View diff';
$lang->repo->allLog = 'All Revisions';
$lang->repo->location = 'Location';
$lang->repo->file = 'File';
$lang->repo->action = 'Action';
$lang->repo->code = 'Code';
$lang->repo->review = 'Repo Review';
$lang->repo->acl = 'Privilege';
$lang->repo->group = 'Group';
$lang->repo->user = 'User';
$lang->repo->info = 'Version Info';
$lang->repo->title = 'Title';
$lang->repo->status = 'Status';
$lang->repo->openedBy = 'CreatedBy';
$lang->repo->assignedTo = 'AssignedTo';
$lang->repo->openedDate = 'CreatedDate';
$lang->repo->latestRevision = 'Latest Revision';
$lang->repo->actionInfo = "Add by %s in %s";
$lang->repo->changes = "Change Log";
$lang->repo->reviewLocation = "File: %s@%s, line:%s - %s";
$lang->repo->commentEdit = '<i class="icon-pencil"></i>';
$lang->repo->commentDelete = '<i class="icon-remove"></i>';
$lang->repo->allChanges = "Other Changes";
$lang->repo->commitTitle = "The %sth Commit";
$lang->repo->viewDiffList['inline'] = 'Inline';
$lang->repo->viewDiffList['appose'] = 'Parallel';
$lang->repo->encryptList['plain'] = 'No encryption';
$lang->repo->encryptList['base64'] = 'BASE64';
$lang->repo->logStyles['A'] = 'Add';
$lang->repo->logStyles['M'] = 'Modification';
$lang->repo->logStyles['D'] = 'Delete';
$lang->repo->encodingList['utf_8'] = 'UTF-8';
$lang->repo->encodingList['gbk'] = 'GBK';
$lang->repo->scmList['Subversion'] = 'Subversion';
$lang->repo->scmList['Git'] = 'Git';
$lang->repo->notice = new stdclass();
$lang->repo->notice->syncing = 'Synchronizing. Please wait ...';
$lang->repo->notice->syncComplete = 'Synchronized. Now redirecting ...';
$lang->repo->notice->syncedCount = 'The number of records synchronized is ';
$lang->repo->notice->delete = 'Are you sure delete this repo?';
$lang->repo->notice->successDelete = 'Repository is removed.';
$lang->repo->notice->commentContent = 'Comment';
$lang->repo->notice->deleteBug = 'Are you sure to delete this bug?';
$lang->repo->notice->deleteComment = 'Are you sure to delete this comment?';
$lang->repo->notice->lastSyncTime = 'Last Sync:';
$lang->repo->error = new stdclass();
$lang->repo->error->useless = 'Your server disabled exec and shell_exec, so it cannot be applied.';
$lang->repo->error->connect = 'Connection to the repo failed. Please enter username, password and repo address correctly!';
$lang->repo->error->version = 'Version 1.8+ of https and svn protocol is required. Please update to latest version! Go to http://subversion.apache.org/';
$lang->repo->error->path = 'Repo address is the file path, e.g. /home/test.';
$lang->repo->error->cmd = 'Client Error!';
$lang->repo->error->diff = 'Two versions must be selected.';
$lang->repo->error->product = "Please select {$lang->productCommon}!";
$lang->repo->error->commentText = 'Please enter content for review!';
$lang->repo->error->comment = 'Please enter content!';
$lang->repo->error->title = 'Please enter title!';
$lang->repo->error->accessDenied = 'You do not have the privilege to access the repository.';
$lang->repo->error->noFound = 'The repo is not found.';
$lang->repo->error->noFile = '%s does not exist.';
$lang->repo->error->noPriv = 'The program does not have the privilege to switch to %s';
$lang->repo->error->output = "The command is: %s\nThe error is(%s): %s\n";
$lang->repo->error->clientVersion = "Client version is too low, please upgrade or change SVN client";
$lang->repo->error->encoding = "The encoding maybe wrong. Please change the encoding and try again.";
$lang->repo->example = new stdclass();
$lang->repo->example->client = "For example, /usr/bin/svn, C:\subversion\svn.exe, /usr/bin/git";
$lang->repo->example->path = "For example, SVN: http://example.googlecode.com/svn/, GIT: /home/test";
$lang->repo->example->config = "Config directory is required in https. Use '--config-dir' to generate config dir.";
$lang->repo->example->encoding = "input encoding of files";
$lang->repo->typeList['standard'] = 'Standard';
$lang->repo->typeList['performance'] = 'Performance';
$lang->repo->typeList['security'] = 'Security';
$lang->repo->typeList['redundancy'] = 'Redundancy';
$lang->repo->typeList['logicError'] = 'Logic Error';
-150
View File
@@ -1,150 +0,0 @@
<?php
$lang->repo->common = 'Repo';
$lang->repo->create = 'Create Repo';
$lang->repo->settings = 'Settings';
$lang->repo->browse = 'View Repo';
$lang->repo->delete = 'Delete Repo';
$lang->repo->showSyncComment = 'Display Synchronization';
$lang->repo->ajaxSyncComment = 'Interface: Ajax Sync Note';
$lang->repo->download = 'Download File';
$lang->repo->downloadDiff = 'Download Diff';
$lang->repo->diffAction = 'Revision Diff';
$lang->repo->revisionAction = 'Revision Detail';
$lang->repo->blameAction = 'Repo Blame';
$lang->repo->addBug = 'Add Review';
$lang->repo->editBug = 'Edit Bug';
$lang->repo->deleteBug = 'Delete Bug';
$lang->repo->addComment = 'Add Comment';
$lang->repo->editComment = 'Edit Comment';
$lang->repo->deleteComment = 'Delete Comment';
$lang->repo->submit = 'Submit';
$lang->repo->cancel = 'Cancel';
$lang->repo->addComment = 'Add Comment';
$lang->repo->product = $lang->productCommon;
$lang->repo->module = 'Module';
$lang->repo->project = $lang->projectCommon;
$lang->repo->type = 'Type';
$lang->repo->assign = 'AssignTo';
$lang->repo->title = 'Title';
$lang->repo->detile = 'Detail';
$lang->repo->lines = 'Lines';
$lang->repo->line = 'Line';
$lang->repo->expand = 'Unfold';
$lang->repo->collapse = 'Fold';
$lang->repo->id = 'ID';
$lang->repo->SCM = 'Type';
$lang->repo->name = 'Name';
$lang->repo->path = 'Path';
$lang->repo->prefix = 'Prefix';
$lang->repo->config = 'Config';
$lang->repo->account = 'Username';
$lang->repo->password = 'Password';
$lang->repo->encoding = 'Encoding';
$lang->repo->client = 'Client Path';
$lang->repo->size = 'Size';
$lang->repo->revision = 'Revision';
$lang->repo->revisionA = 'Revision';
$lang->repo->revisions = 'Revision';
$lang->repo->time = 'Date';
$lang->repo->committer = 'Committer';
$lang->repo->commits = 'Commits';
$lang->repo->synced = 'Initialize Sync';
$lang->repo->lastSync = 'Last Sync';
$lang->repo->deleted = 'Deleted';
$lang->repo->commit = 'Commit';
$lang->repo->comment = 'Comment';
$lang->repo->view = 'View File';
$lang->repo->viewA = 'View';
$lang->repo->log = 'Revision Log';
$lang->repo->blame = 'Blame';
$lang->repo->date = 'Date';
$lang->repo->diff = 'Diff';
$lang->repo->diffAB = 'Diff';
$lang->repo->diffAll = 'Diff All';
$lang->repo->viewDiff = 'View diff';
$lang->repo->allLog = 'All Revisions';
$lang->repo->location = 'Location';
$lang->repo->file = 'File';
$lang->repo->action = 'Action';
$lang->repo->code = 'Code';
$lang->repo->review = 'Repo Review';
$lang->repo->acl = 'Privilege';
$lang->repo->group = 'Group';
$lang->repo->user = 'User';
$lang->repo->info = 'Version Info';
$lang->repo->title = 'Title';
$lang->repo->status = 'Status';
$lang->repo->openedBy = 'CreatedBy';
$lang->repo->assignedTo = 'AssignedTo';
$lang->repo->openedDate = 'CreatedDate';
$lang->repo->latestRevision = 'Latest Revision';
$lang->repo->actionInfo = "Add by %s in %s";
$lang->repo->changes = "Change Log";
$lang->repo->reviewLocation = "File: %s@%s, line:%s - %s";
$lang->repo->commentEdit = '<i class="icon-pencil"></i>';
$lang->repo->commentDelete = '<i class="icon-remove"></i>';
$lang->repo->allChanges = "Other Changes";
$lang->repo->commitTitle = "The %sth Commit";
$lang->repo->viewDiffList['inline'] = 'Inline';
$lang->repo->viewDiffList['appose'] = 'Parallel';
$lang->repo->encryptList['plain'] = 'No encryption';
$lang->repo->encryptList['base64'] = 'BASE64';
$lang->repo->logStyles['A'] = 'Add';
$lang->repo->logStyles['M'] = 'Modification';
$lang->repo->logStyles['D'] = 'Delete';
$lang->repo->encodingList['utf_8'] = 'UTF-8';
$lang->repo->encodingList['gbk'] = 'GBK';
$lang->repo->scmList['Subversion'] = 'Subversion';
$lang->repo->scmList['Git'] = 'Git';
$lang->repo->notice = new stdclass();
$lang->repo->notice->syncing = 'Synchronizing. Please wait ...';
$lang->repo->notice->syncComplete = 'Synchronized. Now redirecting ...';
$lang->repo->notice->syncedCount = 'The number of records synchronized is ';
$lang->repo->notice->delete = 'Are you sure delete this repo?';
$lang->repo->notice->successDelete = 'Repository is removed.';
$lang->repo->notice->commentContent = 'Comment';
$lang->repo->notice->deleteBug = 'Are you sure to delete this bug?';
$lang->repo->notice->deleteComment = 'Are you sure to delete this comment?';
$lang->repo->notice->lastSyncTime = 'Last Sync:';
$lang->repo->error = new stdclass();
$lang->repo->error->useless = 'Your server disabled exec and shell_exec, so it cannot be applied.';
$lang->repo->error->connect = 'Connection to the repo failed. Please enter username, password and repo address correctly!';
$lang->repo->error->version = 'Version 1.8+ of https and svn protocol is required. Please update to latest version! Go to http://subversion.apache.org/';
$lang->repo->error->path = 'Repo address is the file path, e.g. /home/test.';
$lang->repo->error->cmd = 'Client Error!';
$lang->repo->error->diff = 'Two versions must be selected.';
$lang->repo->error->product = "Please select {$lang->productCommon}!";
$lang->repo->error->commentText = 'Please enter content for review!';
$lang->repo->error->comment = 'Please enter content!';
$lang->repo->error->title = 'Please enter title!';
$lang->repo->error->accessDenied = 'You do not have the privilege to access the repository.';
$lang->repo->error->noFound = 'The repo is not found.';
$lang->repo->error->noFile = '%s does not exist.';
$lang->repo->error->noPriv = 'The program does not have the privilege to switch to %s';
$lang->repo->error->output = "The command is: %s\nThe error is(%s): %s\n";
$lang->repo->error->clientVersion = "Client version is too low, please upgrade or change SVN client";
$lang->repo->error->encoding = "The encoding maybe wrong. Please change the encoding and try again.";
$lang->repo->example = new stdclass();
$lang->repo->example->client = "For example, /usr/bin/svn, C:\subversion\svn.exe, /usr/bin/git";
$lang->repo->example->path = "For example, SVN: http://example.googlecode.com/svn/, GIT: /home/test";
$lang->repo->example->config = "Config directory is required in https. Use '--config-dir' to generate config dir.";
$lang->repo->example->encoding = "input encoding of files";
$lang->repo->typeList['standard'] = 'Standard';
$lang->repo->typeList['performance'] = 'Performance';
$lang->repo->typeList['security'] = 'Security';
$lang->repo->typeList['redundancy'] = 'Redundancy';
$lang->repo->typeList['logicError'] = 'Logic Error';
-150
View File
@@ -1,150 +0,0 @@
<?php
$lang->repo->common = '代碼';
$lang->repo->create = '創建版本庫';
$lang->repo->settings = '版本庫設置';
$lang->repo->browse = '瀏覽';
$lang->repo->delete = '刪除版本庫';
$lang->repo->showSyncComment = '顯示同步進度';
$lang->repo->ajaxSyncComment = '介面:AJAX同步註釋';
$lang->repo->download = '下載';
$lang->repo->downloadDiff = '下載Diff';
$lang->repo->diffAction = '版本對比';
$lang->repo->revisionAction = '版本詳情';
$lang->repo->blameAction = '版本追溯';
$lang->repo->addBug = '添加評審';
$lang->repo->editBug = '編輯評審';
$lang->repo->deleteBug = '刪除評審';
$lang->repo->addComment = '添加備註';
$lang->repo->editComment = '編輯備註';
$lang->repo->deleteComment = '刪除備註';
$lang->repo->submit = '提交';
$lang->repo->cancel = '取消';
$lang->repo->addComment = '添加評論';
$lang->repo->product = $lang->productCommon;
$lang->repo->module = '模組';
$lang->repo->project = $lang->projectCommon;
$lang->repo->type = '類型';
$lang->repo->assign = '指派';
$lang->repo->title = '標題';
$lang->repo->detile = '詳情';
$lang->repo->lines = '代碼行';
$lang->repo->line = '行';
$lang->repo->expand = '點擊展開';
$lang->repo->collapse = '點擊摺疊';
$lang->repo->id = '編號';
$lang->repo->SCM = '類型';
$lang->repo->name = '名稱';
$lang->repo->path = '地址';
$lang->repo->prefix = '地址擴展';
$lang->repo->config = '配置目錄';
$lang->repo->account = '用戶名';
$lang->repo->password = '密碼';
$lang->repo->encoding = '編碼';
$lang->repo->client = '客戶端';
$lang->repo->size = '大小';
$lang->repo->revision = '查看版本';
$lang->repo->revisionA = '版本';
$lang->repo->revisions = '版本';
$lang->repo->time = '提交時間';
$lang->repo->committer = '作者';
$lang->repo->commits = '提交數';
$lang->repo->synced = '初始化同步';
$lang->repo->lastSync = '最後同步時間';
$lang->repo->deleted = '已刪除';
$lang->repo->commit = '提交';
$lang->repo->comment = '註釋';
$lang->repo->view = '查看檔案';
$lang->repo->viewA = '查看';
$lang->repo->log = '版本歷史';
$lang->repo->blame = '追溯';
$lang->repo->date = '日期';
$lang->repo->diff = '比較差異';
$lang->repo->diffAB = '比較';
$lang->repo->diffAll = '全部比較';
$lang->repo->viewDiff = '查看差異';
$lang->repo->allLog = '所有版本';
$lang->repo->location = '位置';
$lang->repo->file = '檔案';
$lang->repo->action = '操作';
$lang->repo->code = '代碼';
$lang->repo->review = '評審';
$lang->repo->acl = '權限';
$lang->repo->group = '分組';
$lang->repo->user = '用戶';
$lang->repo->info = '版本信息';
$lang->repo->title = '標題';
$lang->repo->status = '狀態';
$lang->repo->openedBy = '創建者';
$lang->repo->assignedTo = '指派給';
$lang->repo->openedDate = '創建日期';
$lang->repo->latestRevision = '最近修訂版本';
$lang->repo->actionInfo = "由%s在%s添加";
$lang->repo->changes = "修改記錄";
$lang->repo->reviewLocation = "%s@%s,%s行 - %s行";
$lang->repo->commentEdit = '<i class="icon-pencil"></i>';
$lang->repo->commentDelete = '<i class="icon-remove"></i>';
$lang->repo->allChanges = "其他改動";
$lang->repo->commitTitle = "第%s次提交";
$lang->repo->viewDiffList['inline'] = '直列';
$lang->repo->viewDiffList['appose'] = '並排';
$lang->repo->encryptList['plain'] = '不加密';
$lang->repo->encryptList['base64'] = 'BASE64';
$lang->repo->logStyles['A'] = '添加';
$lang->repo->logStyles['M'] = '修改';
$lang->repo->logStyles['D'] = '刪除';
$lang->repo->encodingList['utf_8'] = 'UTF-8';
$lang->repo->encodingList['gbk'] = 'GBK';
$lang->repo->scmList['Subversion'] = 'Subversion';
$lang->repo->scmList['Git'] = 'Git';
$lang->repo->notice = new stdclass();
$lang->repo->notice->syncing = '正在同步中, 請稍等...';
$lang->repo->notice->syncComplete = '同步完成,正在跳轉...';
$lang->repo->notice->syncedCount = '已經同步記錄條數';
$lang->repo->notice->delete = '是否要刪除該版本庫?';
$lang->repo->notice->successDelete = '已經成功刪除版本庫。';
$lang->repo->notice->commentContent = '輸入回覆內容';
$lang->repo->notice->deleteBug = '確認刪除該Bug?';
$lang->repo->notice->deleteComment = '確認刪除該回覆?';
$lang->repo->notice->lastSyncTime = '最後更新于:';
$lang->repo->error = new stdclass();
$lang->repo->error->useless = '你的伺服器禁用了exec,shell_exec方法,無法使用該功能';
$lang->repo->error->connect = '連接版本庫失敗,請填寫正確的用戶名、密碼和版本庫地址!';
$lang->repo->error->version = "https和svn協議需要1.8及以上版本的客戶端,請升級到最新版本!詳情訪問:http://subversion.apache.org/";
$lang->repo->error->path = '版本庫地址直接填寫檔案路徑,如:/home/test。';
$lang->repo->error->cmd = '客戶端錯誤!';
$lang->repo->error->diff = '必須選擇兩個版本';
$lang->repo->error->product = "請選擇{$lang->productCommon}!";
$lang->repo->error->commentText = '請填寫評審內容';
$lang->repo->error->comment = '請填寫內容';
$lang->repo->error->title = '請填寫標題';
$lang->repo->error->accessDenied = '你沒有權限訪問該版本庫';
$lang->repo->error->noFound = '你訪問的版本庫不存在';
$lang->repo->error->noFile = '目錄 %s 不存在';
$lang->repo->error->noPriv = '程序沒有權限切換到目錄 %s';
$lang->repo->error->output = "執行命令:%s\n錯誤結果(%s): %s\n";
$lang->repo->error->clientVersion = "客戶端版本過低,請升級或更換SVN客戶端";
$lang->repo->error->encoding = "編碼可能錯誤,請更換編碼重試。";
$lang->repo->example = new stdclass();
$lang->repo->example->client = "例如:/usr/bin/svn, C:\subversion\svn.exe, /usr/bin/git";
$lang->repo->example->path = "例如:SVN: http://example.googlecode.com/svn/, GIT: /homt/test";
$lang->repo->example->config = "https需要填寫配置目錄的位置,通過config-dir選項生成配置目錄";
$lang->repo->example->encoding = "填寫版本庫中檔案的編碼";
$lang->repo->typeList['standard'] = '規範';
$lang->repo->typeList['performance'] = '性能';
$lang->repo->typeList['security'] = '安全';
$lang->repo->typeList['redundancy'] = '冗餘';
$lang->repo->typeList['logicError'] = '邏輯錯誤';
+21 -2
View File
@@ -32,7 +32,7 @@ class repoModel extends model
* @access public
* @return void
*/
public function setMenu($repos, $repoID = '')
public function setMenu($repos, $repoID = '', $showRepoSeletion = true)
{
if(empty($repoID)) $repoID = $this->session->repoID ? $this->session->repoID : key($repos);
if(!isset($repos[$repoID])) $repoID = key($repos);
@@ -54,7 +54,7 @@ class repoModel extends model
}
}
if(!empty($repos))
if($showRepoSeletion && !empty($repos))
{
$repoIndex = '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . ($repo->SCM == 'Subversion' ? '[SVN] ' : '[GIT] ') . $repo->name . ' <span class="caret"></span></button>';
$repoIndex .= $this->select($repos, $repoID);
@@ -128,6 +128,25 @@ class repoModel extends model
return $selectHtml;
}
/**
* Get repo list.
*
* @param string $orderBy
* @param object $pager
* @param bool $decode
* @access public
* @return array
*/
public function listAll($orderBy = 'id_desc', $pager = null, $decode = true)
{
$repoList = $this->dao->select('*')->from(TABLE_REPO)
->where('deleted')->eq('0')
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
return $repoList;
}
/**
* Get all repos.
*
+59
View File
@@ -0,0 +1,59 @@
<?php
/**
* The browse view file of repo module of ZenTaoPMS.
*
* @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Gang Liu <liugang@cnezsoft.com>
* @package repo
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmDelete', $lang->repo->confirmDelete); ?>
<div id='mainContent' class='main-row'>
<div class='main-col main-content'>
<form class='main-table' id='ajaxForm' method='post'>
<table id='repoList' class='table has-sort-head table-fixed'>
<thead>
<tr>
<?php $vars = "orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?>
<th class='w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->repo->id); ?></th>
<th class='w-120px'><?php common::printOrderLink('SCM', $orderBy, $vars, $lang->repo->type); ?></th>
<th class='w-200px text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->repo->name); ?></th>
<th class='w-200px text-left'><?php echo $lang->repo->path; ?></th>
<th class='c-actions-4'><?php echo $lang->actions; ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($repoList as $id => $repo): ?>
<tr>
<td class='text-center'><?php echo $id; ?></td>
<td class='text'><?php echo zget($lang->repo->scmList, $repo->SCM); ?></td>
<td class='text' title='<?php echo $repo->name; ?>'><?php echo $repo->name; ?></td>
<td class='text' title='<?php echo $repo->path; ?>'><?php echo $repo->path; ?></td>
<td class='c-actions text-right'>
<?php
common::printIcon('cirepo', 'browseBranch', "repoID=$id", '', 'list', 'file-text');
common::printIcon('cirepo', 'sync', "repoID=$id", '', 'list', 'refresh');
echo '&nbsp;';
common::printIcon('cirepo', 'edit', "repoID=$id", '', 'list', 'edit');
if (common::hasPriv('cirepo', 'delete')) {
$deleteURL = $this->createLink('cirepo', 'delete', "repoID=$id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"repoList\", confirmDelete)", '<i class="icon-trash"></i>', '', "title='{$lang->repo->delete}' class='btn'");
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php if ($repoList): ?>
<div class='table-footer'><?php $pager->show('rignt', 'pagerjs'); ?></div>
<?php endif; ?>
</form>
</div>
</div>
<?php include '../../common/view/footer.html.php'; ?>