* Finish task #70792: link project without product to code repository.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user