Add the possibility to make tags global from project settings

This commit is contained in:
Timo
2020-02-11 04:48:51 +01:00
committed by GitHub
parent f3945471b5
commit 2c98be3ead
6 changed files with 63 additions and 5 deletions

View File

@@ -121,4 +121,30 @@ class ProjectTagController extends BaseController
$this->response->redirect($this->helper->url->to('ProjectTagController', 'index', array('project_id' => $project['id'])));
}
public function confirmMakeGlobalTag()
{
$project = $this->getProject();
$tag = $this->getProjectTag($project);
$this->response->html($this->template->render('project_tag/make_global', array(
'tag' => $tag,
'project' => $project,
)));
}
public function makeGlobalTag(){
if ($this->userSession->isAdmin()) {
$project = $this->getProject();
$tag = $this->getProjectTag($project);
if ($this->tagModel->update($tag['id'], $tag['name'], $tag['color_id'], 0)) {
$this->flash->success(t('Tag updated successfully.'));
} else {
$this->flash->failure(t('Unable to update this tag.'));
}
$this->response->redirect($this->helper->url->to('ProjectTagController', 'index', array('project_id' => $project['id'])));
}
}
}