From a786e50b33ea4b63fe53dbf4e6ba4f5849fdc1eb Mon Sep 17 00:00:00 2001 From: aaronchen2k <462826@qq.com> Date: Wed, 8 Jan 2020 20:24:31 +0800 Subject: [PATCH] fix issues for code standards --- lib/scm/subversion.class.php | 5 --- module/ci/control.php | 56 ++++++++++++++------------------- module/ci/lang/zh-cn.php | 36 ++++++++++++--------- module/ci/model.php | 13 +++++--- module/common/lang/zh-cn.php | 7 ++--- module/custom/view/set.html.php | 4 +-- 6 files changed, 58 insertions(+), 63 deletions(-) diff --git a/lib/scm/subversion.class.php b/lib/scm/subversion.class.php index ef8872c2bf..d5075c150b 100644 --- a/lib/scm/subversion.class.php +++ b/lib/scm/subversion.class.php @@ -262,14 +262,11 @@ class Subversion $entry = '"' . $this->root . '/' . str_replace('%2F', '/', urlencode($entry)) . '"'; $svnInfo = $this->replaceAuth(escapeCmd($this->buildCMD($entry, 'info', "-r $revision --xml"))); - a($svnInfo); - $svninfo = execCmd($svnInfo, 'string', $result); if($result) { $entry = '"' . $this->root . '/' . $resourcePath . '"'; $svnInfo = $this->replaceAuth(escapeCmd($this->buildCMD($entry, 'info', "-r $revision --xml"))); - echo $svnInfo; $svninfo = execCmd($svnInfo, 'string', $result); if($result) $svninfo = ''; @@ -464,8 +461,6 @@ class Subversion $cmd = str_replace("\\", "/", "$this->client $action $param --no-auth-cache $path"); } - a($cmd); - return $cmd; } } diff --git a/module/ci/control.php b/module/ci/control.php index 5b96a25a12..db290e1add 100644 --- a/module/ci/control.php +++ b/module/ci/control.php @@ -1,4 +1,5 @@ * @package product - * @version $Id: control.php 5144 2019-12-11 06:37:03Z chenqi@cnezsoft.com $ + * @version $Id: ${FILE_NAME} 5144 2020/1/8 8:10 下午 chenqi@cnezsoft.com $ * @link http://www.zentao.net */ class ci extends control { /** - * Construct function. - * - * @access public - * @return void + * ci constructor. + * @param string $moduleName + * @param string $methodName */ public function __construct($moduleName = '', $methodName = '') { parent::__construct($moduleName, $methodName); - - /* Load need modules. */ - $this->loadModel('credential'); - $this->loadModel('user'); - $this->scm = $this->app->loadClass('scm'); } @@ -40,14 +35,12 @@ class ci extends control } /** - * Browse credentials. + * Browse credentials * - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID - * @access public - * @return void + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID */ public function browseCredential($orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { @@ -136,7 +129,6 @@ class ci extends control $this->send(array('result' => 'success')); } - /** * Browse jenkinss. * @@ -254,14 +246,14 @@ class ci extends control $pager = new pager($recTotal, $recPerPage, $pageID); $this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->list; - $this->view->repoList = $this->ci->listRepo($orderBy, $pager); + $this->view->position[] = $this->lang->ci->common; + $this->view->position[] = $this->lang->repo->common; - $this->view->position[] = $this->lang->ci->common; - $this->view->position[] = $this->lang->repo->common; + $this->view->repoList = $this->ci->listRepo($orderBy, $pager); $this->view->orderBy = $orderBy; $this->view->pager = $pager; - $this->view->module = 'repo'; + $this->view->module = 'repo'; $this->display(); } @@ -301,7 +293,7 @@ class ci extends control /** * Edit a repo. * - * @param int $id + * @param int $repoID * @access public * @return void */ @@ -322,7 +314,6 @@ class ci extends control $this->app->loadLang('action'); $this->view->title = $this->lang->repo->edit . $this->lang->colon . $repo->name; - $this->view->position[] = $this->lang->ci->common; $this->view->position[] = html::a(inlink('browseRepo'), $this->lang->repo->common); $this->view->position[] = $this->lang->repo->edit; @@ -340,7 +331,7 @@ class ci extends control /** * Delete a repo. * - * @param int $id + * @param int $id * @access public * @return void */ @@ -355,7 +346,7 @@ class ci extends control /** * browse branches. * - * @param int $repoID + * @param int $repoID * @access public * @return void */ @@ -372,26 +363,25 @@ class ci extends control } /** - * watch branche. + * watch branch. * - * @param int $repoID - * @access public - * @return void + * @param int $repoID + * @param int $branch + * @param int $status */ - public function watchBranch($repoID = 0, $branch=0, $status=0) + public function watchBranch($repoID = 0, $branch = 0, $status = 0) { $this->dao->update(TABLE_REPOBRANCH) ->set('watch=' . $status) ->where('repo')->eq($repoID) ->andWhere('branch')->eq($branch) ->exec(); - echo true; } /** * Show sync comment. * - * @param int $repoID + * @param int $repoID * @access public * @return void */ diff --git a/module/ci/lang/zh-cn.php b/module/ci/lang/zh-cn.php index 400715100c..9aa7eb0eb6 100644 --- a/module/ci/lang/zh-cn.php +++ b/module/ci/lang/zh-cn.php @@ -52,22 +52,28 @@ $lang->jenkins->desc = '描述'; $lang->jenkins->typeList['token'] = 'Token'; $lang->jenkins->typeList['credential'] = '凭证'; - // repo -$lang->repo->id = 'ID'; -$lang->repo->name = '名称'; -$lang->repo->path = '地址'; -$lang->repo->type = '类型'; -$lang->repo->client = '客户端'; -$lang->repo->credential = '凭证'; -$lang->repo->encoding = '编码'; -$lang->repo->account = '用户名'; -$lang->repo->password = '密码'; -$lang->repo->token = 'Token'; -$lang->repo->acl = '权限'; -$lang->repo->group = '分组'; -$lang->repo->user = '用户'; -$lang->repo->desc = '描述'; +$lang->repo->common = '代码库'; +$lang->repo->browse = '浏览代码库'; +$lang->repo->create = '添加代码库'; +$lang->repo->edit = '编辑代码库'; +$lang->repo->delete = '删除代码库'; +$lang->repo->confirmDelete = '确认删除该代码库吗?'; + +$lang->repo->id = 'ID'; +$lang->repo->name = '名称'; +$lang->repo->path = '地址'; +$lang->repo->type = '类型'; +$lang->repo->client = '客户端'; +$lang->repo->credential = '凭证'; +$lang->repo->encoding = '编码'; +$lang->repo->account = '用户名'; +$lang->repo->password = '密码'; +$lang->repo->token = 'Token'; +$lang->repo->acl = '权限'; +$lang->repo->group = '分组'; +$lang->repo->user = '用户'; +$lang->repo->desc = '描述'; $lang->repo->example = new stdclass(); $lang->repo->example->client = "例如:/usr/bin/svn, C:\subversion\svn.exe, /usr/bin/git"; diff --git a/module/ci/model.php b/module/ci/model.php index 47658bd8d3..5cb12c5f7a 100644 --- a/module/ci/model.php +++ b/module/ci/model.php @@ -1,16 +1,15 @@ * @package product - * @version $Id: control.php 5144 2019-12-11 06:37:03Z chenqi@cnezsoft.com $ + * @version $Id: $ * @link http://www.zentao.net */ -?> -dao->select('id, name')->from(TABLE_CREDENTIAL) diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index ded0ba018b..1d028338ae 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -398,8 +398,7 @@ $lang->admin->subMenu->message->setting = array('link' => '设置|message|settin $lang->admin->subMenu->sso = new stdclass(); $lang->admin->subMenu->sso->ranzhi = '然之协同|admin|sso'; -$lang->admin->subMenu->sso->ci = array('link' => '持续集成|ci|index', - 'alias' => 'browsecredential,createcredential,editcredential,browsejenkins,createjenkins,editjenkins,browserepo,editrepo,browsebranch'); +$lang->admin->subMenu->sso->ci = array('link' => '持续集成|ci|index', 'alias' => 'browsecredential,createcredential,editcredential,browsejenkins,createjenkins,editjenkins,browserepo,editrepo,browsebranch'); $lang->admin->subMenu->dev = new stdclass(); $lang->admin->subMenu->dev->api = array('link' => 'API|dev|api'); @@ -428,7 +427,7 @@ $lang->entry = new stdclass(); $lang->webhook = new stdclass(); $lang->message = new stdclass(); $lang->search = new stdclass(); -$lang->ci = new stdclass(); +$lang->ci = new stdclass(); $lang->convert->menu = $lang->admin->menu; $lang->upgrade->menu = $lang->admin->menu; @@ -442,7 +441,7 @@ $lang->dev->menu = $lang->admin->menu; $lang->entry->menu = $lang->admin->menu; $lang->webhook->menu = $lang->admin->menu; $lang->message->menu = $lang->admin->menu; -$lang->ci->menu = $lang->admin->menu; +$lang->ci->menu = $lang->admin->menu; /* 菜单分组。*/ $lang->menugroup = new stdclass(); diff --git a/module/custom/view/set.html.php b/module/custom/view/set.html.php index aed1198fa0..55fc05dd45 100644 --- a/module/custom/view/set.html.php +++ b/module/custom/view/set.html.php @@ -28,9 +28,9 @@ $itemRow = << EOT; ?> - + - +