fix issues for code standards

This commit is contained in:
aaronchen2k
2020-01-08 20:24:31 +08:00
parent a90154075f
commit a786e50b33
6 changed files with 58 additions and 63 deletions
+23 -33
View File
@@ -1,4 +1,5 @@
<?php
/**
* The control file of ci module of ZenTaoPMS.
*
@@ -6,25 +7,19 @@
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chenqi <chenqi@cnezsoft.com>
* @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
*/
+21 -15
View File
@@ -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";
+9 -4
View File
@@ -1,16 +1,15 @@
<?php
/**
* The control file of ci module of ZenTaoPMS.
* The model file of ci module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chenqi <chenqi@cnezsoft.com>
* @package product
* @version $Id: control.php 5144 2019-12-11 06:37:03Z chenqi@cnezsoft.com $
* @version $Id: $
* @link http://www.zentao.net
*/
?>
<?php
class ciModel extends model
{
/**
@@ -167,6 +166,12 @@ class ciModel extends model
return !dao::isError();
}
/**
* list credential for repo and jenkins edit page
*
* @param $whr
* @return mixed
*/
public function listCredentialForSelection($whr)
{
$credentials = $this->dao->select('id, name')->from(TABLE_CREDENTIAL)