summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
authorJulian Maurice <julian.maurice@biblibre.com>2018-08-09 21:35:11 +0200
committerJulian Maurice <julian.maurice@biblibre.com>2018-08-11 10:15:13 +0200
commit9d4cd31e1aae02e9980932c67036fdfe574e3432 (patch)
tree6fca71d93aaed9032a0d771a0b8111d79fdc99b6 /app/Controller
parentae3ade0908bae350488260ee5d878a2ffbff605a (diff)
Allow to associate tags to colors
The color is then used as background in the board, list and task details views
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/ProjectTagController.php6
-rw-r--r--app/Controller/TagController.php6
-rw-r--r--app/Controller/TaskViewController.php2
3 files changed, 9 insertions, 5 deletions
diff --git a/app/Controller/ProjectTagController.php b/app/Controller/ProjectTagController.php
index c45e71e1..71985336 100644
--- a/app/Controller/ProjectTagController.php
+++ b/app/Controller/ProjectTagController.php
@@ -28,6 +28,7 @@ class ProjectTagController extends BaseController
$this->response->html($this->template->render('project_tag/create', array(
'project' => $project,
'values' => $values,
+ 'colors' => $this->colorModel->getList(),
'errors' => $errors,
)));
}
@@ -41,7 +42,7 @@ class ProjectTagController extends BaseController
list($valid, $errors) = $this->tagValidator->validateCreation($values);
if ($valid) {
- if ($this->tagModel->create($project['id'], $values['name']) > 0) {
+ if ($this->tagModel->create($project['id'], $values['name'], $values['color_id']) > 0) {
$this->flash->success(t('Tag created successfully.'));
} else {
$this->flash->failure(t('Unable to create this tag.'));
@@ -66,6 +67,7 @@ class ProjectTagController extends BaseController
'project' => $project,
'tag' => $tag,
'values' => $values,
+ 'colors' => $this->colorModel->getList(),
'errors' => $errors,
)));
}
@@ -81,7 +83,7 @@ class ProjectTagController extends BaseController
list($valid, $errors) = $this->tagValidator->validateModification($values);
if ($valid) {
- if ($this->tagModel->update($values['id'], $values['name'])) {
+ if ($this->tagModel->update($values['id'], $values['name'], $values['color_id'])) {
$this->flash->success(t('Tag updated successfully.'));
} else {
$this->flash->failure(t('Unable to update this tag.'));
diff --git a/app/Controller/TagController.php b/app/Controller/TagController.php
index b8389910..b550cf58 100644
--- a/app/Controller/TagController.php
+++ b/app/Controller/TagController.php
@@ -28,6 +28,7 @@ class TagController extends BaseController
$this->response->html($this->template->render('tag/create', array(
'values' => $values,
+ 'colors' => $this->colorModel->getList(),
'errors' => $errors,
)));
}
@@ -38,7 +39,7 @@ class TagController extends BaseController
list($valid, $errors) = $this->tagValidator->validateCreation($values);
if ($valid) {
- if ($this->tagModel->create(0, $values['name']) > 0) {
+ if ($this->tagModel->create(0, $values['name'], $values['color_id']) > 0) {
$this->flash->success(t('Tag created successfully.'));
} else {
$this->flash->failure(t('Unable to create this tag.'));
@@ -62,6 +63,7 @@ class TagController extends BaseController
$this->response->html($this->template->render('tag/edit', array(
'tag' => $tag,
'values' => $values,
+ 'colors' => $this->colorModel->getList(),
'errors' => $errors,
)));
}
@@ -78,7 +80,7 @@ class TagController extends BaseController
}
if ($valid) {
- if ($this->tagModel->update($values['id'], $values['name'])) {
+ if ($this->tagModel->update($values['id'], $values['name'], $values['color_id'])) {
$this->flash->success(t('Tag updated successfully.'));
} else {
$this->flash->failure(t('Unable to update this tag.'));
diff --git a/app/Controller/TaskViewController.php b/app/Controller/TaskViewController.php
index 31b9de11..9a39a3a9 100644
--- a/app/Controller/TaskViewController.php
+++ b/app/Controller/TaskViewController.php
@@ -74,7 +74,7 @@ class TaskViewController extends BaseController
'internal_links' => $this->taskLinkModel->getAllGroupedByLabel($task['id']),
'external_links' => $this->taskExternalLinkModel->getAll($task['id']),
'link_label_list' => $this->linkModel->getList(0, false),
- 'tags' => $this->taskTagModel->getList($task['id']),
+ 'tags' => $this->taskTagModel->getTagsByTask($task['id']),
)));
}