summaryrefslogtreecommitdiff
path: root/app/Model/Action.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-09-28 18:23:21 -0400
committerFrédéric Guillot <fred@kanboard.net>2014-09-28 18:23:21 -0400
commit33f9cdbc976e0f97c3dd24658dc7d0097497c6d7 (patch)
tree3a5dc8ca9a6b3db268ba95aec357a2e5a8aad80e /app/Model/Action.php
parent03fa01ac7b036820ee232d893ec63241918c6012 (diff)
Add support for Github Issue Webhooks
Diffstat (limited to 'app/Model/Action.php')
-rw-r--r--app/Model/Action.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/app/Model/Action.php b/app/Model/Action.php
index 6b1ebdad..56a1a2bb 100644
--- a/app/Model/Action.php
+++ b/app/Model/Action.php
@@ -36,8 +36,9 @@ class Action extends Base
*/
public function getAvailableActions()
{
- return array(
+ $values = array(
'TaskClose' => t('Close a task'),
+ 'TaskOpen' => t('Open a task'),
'TaskAssignSpecificUser' => t('Assign the task to a specific user'),
'TaskAssignCurrentUser' => t('Assign the task to the person who does the action'),
'TaskDuplicateAnotherProject' => t('Duplicate the task to another project'),
@@ -45,7 +46,14 @@ class Action extends Base
'TaskAssignColorUser' => t('Assign a color to a specific user'),
'TaskAssignColorCategory' => t('Assign automatically a color based on a category'),
'TaskAssignCategoryColor' => t('Assign automatically a category based on a color'),
+ 'TaskCreation' => t('Create a task from an external provider'),
+ 'TaskAssignUser' => t('Change the assignee based on an external username'),
+ 'TaskAssignCategoryLabel' => t('Change the category based on an external label'),
);
+
+ asort($values);
+
+ return $values;
}
/**
@@ -56,7 +64,7 @@ class Action extends Base
*/
public function getAvailableEvents()
{
- return array(
+ $values = array(
Task::EVENT_MOVE_COLUMN => t('Move a task to another column'),
Task::EVENT_UPDATE => t('Task modification'),
Task::EVENT_CREATE => t('Task creation'),
@@ -65,7 +73,16 @@ class Action extends Base
Task::EVENT_CREATE_UPDATE => t('Task creation or modification'),
Task::EVENT_ASSIGNEE_CHANGE => t('Task assignee change'),
GithubWebhook::EVENT_COMMIT => t('Github commit received'),
+ GithubWebhook::EVENT_ISSUE_OPENED => t('Github issue opened'),
+ GithubWebhook::EVENT_ISSUE_CLOSED => t('Github issue closed'),
+ GithubWebhook::EVENT_ISSUE_REOPENED => t('Github issue reopened'),
+ GithubWebhook::EVENT_ISSUE_ASSIGNEE_CHANGE => t('Github issue assignee change'),
+ GithubWebhook::EVENT_ISSUE_LABEL_CHANGE => t('Github issue label change'),
);
+
+ asort($values);
+
+ return $values;
}
/**