summaryrefslogtreecommitdiff
path: root/app/Action/TaskAssignCategoryLabel.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-03 16:43:13 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-03 16:43:13 -0500
commita296ba5b18487d312acca2513d461a210a460fae (patch)
treee5e22ffa7796a9734ec284826dd313219644a539 /app/Action/TaskAssignCategoryLabel.php
parentd578b612ea8853682f65ee74fd08f4893152d87a (diff)
Improve Automatic Actions plugin api
Diffstat (limited to 'app/Action/TaskAssignCategoryLabel.php')
-rw-r--r--app/Action/TaskAssignCategoryLabel.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/app/Action/TaskAssignCategoryLabel.php b/app/Action/TaskAssignCategoryLabel.php
index 0ef474b6..8d291e89 100644
--- a/app/Action/TaskAssignCategoryLabel.php
+++ b/app/Action/TaskAssignCategoryLabel.php
@@ -13,6 +13,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
@@ -64,7 +75,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 +90,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']);
}
}