summaryrefslogtreecommitdiff
path: root/app/Action/TaskAssignCategoryLabel.php
diff options
context:
space:
mode:
authorGerardo Zamudio <gerardozamudio@users.noreply.github.com>2016-02-24 23:48:50 -0600
committerGerardo Zamudio <gerardozamudio@users.noreply.github.com>2016-02-24 23:48:50 -0600
commite4de6b3898b64b26d29aff31f21df5fda8055686 (patch)
tree575f8a65440f291d70a070d168eafca8c82a6459 /app/Action/TaskAssignCategoryLabel.php
parentd9ffbea174ea6524d0a22f8375ca8b3aa04a3c96 (diff)
parenta6540bc604c837d92c9368540c145606723e97f7 (diff)
Merge pull request #1 from fguillot/master
Update from upstream
Diffstat (limited to 'app/Action/TaskAssignCategoryLabel.php')
-rw-r--r--app/Action/TaskAssignCategoryLabel.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/app/Action/TaskAssignCategoryLabel.php b/app/Action/TaskAssignCategoryLabel.php
index 0ef474b6..95fa116e 100644
--- a/app/Action/TaskAssignCategoryLabel.php
+++ b/app/Action/TaskAssignCategoryLabel.php
@@ -2,8 +2,6 @@
namespace Kanboard\Action;
-use Kanboard\Integration\GithubWebhook;
-
/**
* Set a category automatically according to a label
*
@@ -13,6 +11,17 @@ use Kanboard\Integration\GithubWebhook;
class TaskAssignCategoryLabel extends Base
{
/**
+ * Get automatic action description
+ *
+ * @access public
+ * @return string
+ */
+ public function getDescription()
+ {
+ return t('Change the category based on an external label');
+ }
+
+ /**
* Get the list of compatible events
*
* @access public
@@ -20,9 +29,7 @@ class TaskAssignCategoryLabel extends Base
*/
public function getCompatibleEvents()
{
- return array(
- GithubWebhook::EVENT_ISSUE_LABEL_CHANGE,
- );
+ return array();
}
/**
@@ -64,7 +71,7 @@ class TaskAssignCategoryLabel extends Base
{
$values = array(
'id' => $data['task_id'],
- 'category_id' => isset($data['category_id']) ? $data['category_id'] : $this->getParam('category_id'),
+ 'category_id' => $this->getParam('category_id'),
);
return $this->taskModification->update($values);
@@ -79,6 +86,6 @@ class TaskAssignCategoryLabel extends Base
*/
public function hasRequiredCondition(array $data)
{
- return $data['label'] == $this->getParam('label');
+ return $data['label'] == $this->getParam('label') && empty($data['category_id']);
}
}