Add option to enable or disable global tags per projects
This commit is contained in:
@@ -121,7 +121,12 @@ class ProjectTagController extends BaseController
|
||||
|
||||
$this->response->redirect($this->helper->url->to('ProjectTagController', 'index', array('project_id' => $project['id'])));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Confirm dialog to make a tag global
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function confirmMakeGlobalTag()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
@@ -132,7 +137,12 @@ class ProjectTagController extends BaseController
|
||||
'project' => $project,
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make a tag global and flash result
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function makeGlobalTag(){
|
||||
if ($this->userSession->isAdmin()) {
|
||||
$project = $this->getProject();
|
||||
@@ -147,4 +157,25 @@ class ProjectTagController extends BaseController
|
||||
$this->response->redirect($this->helper->url->to('ProjectTagController', 'index', array('project_id' => $project['id'])));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update project tag settings
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updateSettings()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$values = $this->request->getValues();
|
||||
|
||||
$values['enable_global_tags'] = array_key_exists('enable_global_tags', $values) ? $values['enable_global_tags'] : 0;
|
||||
|
||||
if ($this->projectModel->changeGlobalTagUsage($project['id'], $values['enable_global_tags'])) {
|
||||
$this->flash->success(t('Project updated successfully.'));
|
||||
return $this->response->redirect($this->helper->url->to('ProjectTagController', 'index', array('project_id' => $project['id'])));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to update this project.'));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user