* Let repo link product.

This commit is contained in:
Yagami
2020-12-25 13:07:39 +08:00
parent 739994edbb
commit 285320d95a
11 changed files with 21 additions and 20 deletions
+1
View File
@@ -1,3 +1,4 @@
ALTER TABLE `zt_risk` add `closedBy` char(30) AFTER `assignedTo`;
ALTER TABLE `zt_risk` add `closedDate` date AFTER `closedBy`;
ALTER TABLE `zt_issue` CHANGE `closeBy` `closedBy` char(30);
ALTER TABLE `zt_repo` CHANGE `PRJ` `product` varchar(255) NOT NULL AFTER `id`;
+1 -1
View File
@@ -810,7 +810,7 @@ CREATE TABLE IF NOT EXISTS `zt_release` (
-- DROP TABLE IF EXISTS `zt_repo`;
CREATE TABLE IF NOT EXISTS `zt_repo` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
`PRJ` varchar(255) NOT NULL,
`product` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`path` varchar(255) NOT NULL,
`prefix` varchar(100) NOT NULL,
+4 -4
View File
@@ -28,7 +28,7 @@ class repo extends control
}
$this->scm = $this->app->loadClass('scm');
$this->repos = $this->repo->getRepoPairs($this->session->PRJ);
$this->repos = $this->repo->getRepoPairs();
if(empty($this->repos) and $this->methodName != 'create') die(js::locate($this->repo->createLink('create')));
/* Unlock session for wait to get data of repo. */
@@ -54,7 +54,7 @@ class repo extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->view->repoList = $this->repo->getList($this->session->PRJ, $orderBy, $pager);
$this->view->repoList = $this->repo->getList(0, $orderBy, $pager);
$this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->browse;
$this->view->position[] = $this->lang->repo->common;
@@ -90,7 +90,7 @@ class repo extends control
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted');
$this->view->projects = $this->loadModel('program')->getPRJPairs();
$this->view->products = $this->loadModel('product')->getPairs('noclosed');
$this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->create;
$this->view->position[] = $this->lang->repo->create;
@@ -129,7 +129,7 @@ class repo extends control
$this->view->repoID = $repoID;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted');
$this->view->projects = $this->loadModel('program')->getPRJPairs();
$this->view->products = $this->loadModel('product')->getPairs('noclosed');
$this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->edit;
$this->view->position[] = html::a(inlink('maintain'), $this->lang->repo->common);
+1 -1
View File
@@ -2,7 +2,7 @@
$lang->repo->common = 'Repo';
$lang->repo->browse = 'View';
$lang->repo->viewRevision = 'View Revision';
$lang->repo->project = 'Project';
$lang->repo->product = 'Product';
$lang->repo->create = 'Create';
$lang->repo->createAction = 'Create Repo';
$lang->repo->maintain = 'Repo List';
+1 -1
View File
@@ -2,7 +2,7 @@
$lang->repo->common = 'Repo';
$lang->repo->browse = 'View';
$lang->repo->viewRevision = 'View Revision';
$lang->repo->project = 'Project';
$lang->repo->product = 'Product';
$lang->repo->create = 'Create';
$lang->repo->createAction = 'Create Repo';
$lang->repo->maintain = 'Repo List';
+1 -1
View File
@@ -2,7 +2,7 @@
$lang->repo->common = 'Référentiel';
$lang->repo->browse = 'Aff';
$lang->repo->viewRevision = 'Aff Modifs';
$lang->repo->project = 'Project';
$lang->repo->product = 'Product';
$lang->repo->create = 'Créer';
$lang->repo->createAction = 'Créer Ref';
$lang->repo->maintain = 'Liste Ref';
+1 -1
View File
@@ -2,7 +2,7 @@
$lang->repo->common = 'Repo';
$lang->repo->browse = 'Xem';
$lang->repo->viewRevision = 'Xem Revision';
$lang->repo->project = 'Project';
$lang->repo->product = 'Product';
$lang->repo->create = 'Tạo';
$lang->repo->createAction = 'Tạo Repo';
$lang->repo->maintain = 'Repo danh sách';
+1 -1
View File
@@ -2,7 +2,7 @@
$lang->repo->common = '代码';
$lang->repo->browse = '浏览';
$lang->repo->viewRevision = '查看修订';
$lang->repo->project = '所属项目';
$lang->repo->product = '所属产品';
$lang->repo->create = '创建';
$lang->repo->createAction = '创建版本库';
$lang->repo->maintain = '版本库列表';
+6 -6
View File
@@ -140,11 +140,11 @@ class repoModel extends model
* @access public
* @return array
*/
public function getList($projectID, $orderBy = 'id_desc', $pager = null)
public function getList($productID = 0, $orderBy = 'id_desc', $pager = null)
{
$repos = $this->dao->select('*')->from(TABLE_REPO)
->where('deleted')->eq('0')
->andWhere("CONCAT(',', PRJ, ',')")->like("%,{$projectID},%")
->beginIF($productID)->andWhere("CONCAT(',', product, ',')")->like("%,{$productID},%")->fi()
->orderBy($orderBy)
->page($pager)->fetchAll('id');
@@ -195,7 +195,7 @@ class repoModel extends model
if(!$this->checkConnection()) return false;
$data = fixer::input('post')
->skipSpecial('path,client,account,password')
->join('PRJ', ',')
->join('product', ',')
->get();
$data->acl = empty($data->acl) ? '' : json_encode($data->acl);
@@ -237,7 +237,7 @@ class repoModel extends model
->setDefault('prefix', $repo->prefix)
->setIF($this->post->path != $repo->path, 'synced', 0)
->skipSpecial('path,client,account,password')
->join('PRJ', ',')
->join('product', ',')
->get();
$data->acl = empty($data->acl) ? '' : json_encode($data->acl);
@@ -282,11 +282,11 @@ class repoModel extends model
* @access public
* @return array
*/
public function getRepoPairs($projectID)
public function getRepoPairs($productID = 0)
{
$repos = $this->dao->select('*')->from(TABLE_REPO)
->where('deleted')->eq(0)
->andWhere("CONCAT(',', PRJ, ',')")->like("%,{$projectID},%")
->beginIF($productID)->andWhere("CONCAT(',', product, ',')")->like("%,{$productID},%")->fi()
->fetchAll();
$repoPairs = array();
+2 -2
View File
@@ -25,8 +25,8 @@
<form id='repoForm' method='post' class='form-ajax'>
<table class='table table-form'>
<tr>
<th><?php echo $lang->repo->project; ?></th>
<td class='required'><?php echo html::select('PRJ[]', $projects, $this->session->PRJ, "class='form-control chosen' multiple"); ?></td>
<th><?php echo $lang->repo->product; ?></th>
<td class='required'><?php echo html::select('product[]', $products, '', "class='form-control chosen' multiple"); ?></td>
</tr>
<tr>
<th class='thWidth'><?php echo $lang->repo->type; ?></th>
+2 -2
View File
@@ -27,8 +27,8 @@
<form id='repoForm' method='post' class='form-ajax'>
<table class='table table-form'>
<tr>
<th><?php echo $lang->repo->project; ?></th>
<td class='required'><?php echo html::select('PRJ[]', $projects, $repo->PRJ, "class='form-control chosen' multiple"); ?></td>
<th><?php echo $lang->repo->product; ?></th>
<td class='required'><?php echo html::select('product[]', $products, $repo->product, "class='form-control chosen' multiple"); ?></td>
</tr>
<tr>
<th class='thWidth'><?php echo $lang->repo->type; ?></th>