Improve Automatic Actions plugin api
This commit is contained in:
@@ -12,6 +12,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
|
||||
*
|
||||
@@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user