diff options
Diffstat (limited to 'app/Action/TaskClose.php')
-rw-r--r-- | app/Action/TaskClose.php | 62 |
1 files changed, 15 insertions, 47 deletions
diff --git a/app/Action/TaskClose.php b/app/Action/TaskClose.php index d80bd023..cf91e83e 100644 --- a/app/Action/TaskClose.php +++ b/app/Action/TaskClose.php @@ -2,11 +2,6 @@ namespace Kanboard\Action; -use Kanboard\Integration\GitlabWebhook; -use Kanboard\Integration\GithubWebhook; -use Kanboard\Integration\BitbucketWebhook; -use Kanboard\Model\Task; - /** * Close automatically a task * @@ -16,6 +11,17 @@ use Kanboard\Model\Task; class TaskClose extends Base { /** + * Get automatic action description + * + * @access public + * @return string + */ + public function getDescription() + { + return t('Close a task'); + } + + /** * Get the list of compatible events * * @access public @@ -23,15 +29,7 @@ class TaskClose extends Base */ public function getCompatibleEvents() { - return array( - Task::EVENT_MOVE_COLUMN, - GithubWebhook::EVENT_COMMIT, - GithubWebhook::EVENT_ISSUE_CLOSED, - GitlabWebhook::EVENT_COMMIT, - GitlabWebhook::EVENT_ISSUE_CLOSED, - BitbucketWebhook::EVENT_COMMIT, - BitbucketWebhook::EVENT_ISSUE_CLOSED, - ); + return array(); } /** @@ -42,17 +40,7 @@ class TaskClose extends Base */ public function getActionRequiredParameters() { - switch ($this->event_name) { - case GithubWebhook::EVENT_COMMIT: - case GithubWebhook::EVENT_ISSUE_CLOSED: - case GitlabWebhook::EVENT_COMMIT: - case GitlabWebhook::EVENT_ISSUE_CLOSED: - case BitbucketWebhook::EVENT_COMMIT: - case BitbucketWebhook::EVENT_ISSUE_CLOSED: - return array(); - default: - return array('column_id' => t('Column')); - } + return array(); } /** @@ -63,17 +51,7 @@ class TaskClose extends Base */ public function getEventRequiredParameters() { - switch ($this->event_name) { - case GithubWebhook::EVENT_COMMIT: - case GithubWebhook::EVENT_ISSUE_CLOSED: - case GitlabWebhook::EVENT_COMMIT: - case GitlabWebhook::EVENT_ISSUE_CLOSED: - case BitbucketWebhook::EVENT_COMMIT: - case BitbucketWebhook::EVENT_ISSUE_CLOSED: - return array('task_id'); - default: - return array('task_id', 'column_id'); - } + return array('task_id'); } /** @@ -97,16 +75,6 @@ class TaskClose extends Base */ public function hasRequiredCondition(array $data) { - switch ($this->event_name) { - case GithubWebhook::EVENT_COMMIT: - case GithubWebhook::EVENT_ISSUE_CLOSED: - case GitlabWebhook::EVENT_COMMIT: - case GitlabWebhook::EVENT_ISSUE_CLOSED: - case BitbucketWebhook::EVENT_COMMIT: - case BitbucketWebhook::EVENT_ISSUE_CLOSED: - return true; - default: - return $data['column_id'] == $this->getParam('column_id'); - } + return true; } } |