* Finish task #70792: link project without product to code repository.

This commit is contained in:
wangjianhua
2022-09-30 14:20:19 +08:00
parent 0c11f5b232
commit 04702a6139
13 changed files with 192 additions and 1 deletions
+32
View File
@@ -2244,4 +2244,36 @@ class project extends control
if($this->app->getViewType() == 'json') return print(json_encode($executionList));
return print(html::select('execution', $executions, $executionID, "class='form-control'"));
}
/**
* Link project and repo.
*
* @param int $projectID
* @access public
* @return void
*/
public function manageRepo($projectID)
{
$this->project->setMenu($projectID);
if($_POST)
{
$postData = fixer::input('post')->setDefault('repos', array())->get();
$this->project->updateRepoRelations($projectID, $postData->repos);
$locateLink = inLink('manageRepo', "projectID=$projectID");
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink));
}
$this->view->title = $this->lang->project->manageRepo;
$this->view->allRepos = $this->dao->select('*')->from(TABLE_REPO)->where('deleted')->eq(0)->fetchPairs('id', 'name');
$this->view->linkedRepos = $this->project->linkedRepoPairs($projectID);
$this->view->unlinkedRepos = array();
foreach($this->view->allRepos as $repoID => $repoName) if(!isset($this->view->linkedRepos[$repoID])) $this->view->unlinkedRepos[$repoID] = $repoName;
$this->display();
}
}