summaryrefslogtreecommitdiff
path: root/app/Integration/GitlabWebhook.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-12-04 21:28:11 -0500
committerFrederic Guillot <fred@kanboard.net>2015-12-04 21:28:11 -0500
commit3925cf68dd117522058a43f5dacc45b28a7781ed (patch)
treefbfe483fbac096b1aabfccf2e2437f9ce83a62b4 /app/Integration/GitlabWebhook.php
parent1250e745e43385b421af6ce226fcca5616336b70 (diff)
parent207ee05b0ef2d084489d5b01c071b68a4f5075ca (diff)
Merge pull-request #1523
Diffstat (limited to 'app/Integration/GitlabWebhook.php')
-rw-r--r--app/Integration/GitlabWebhook.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/app/Integration/GitlabWebhook.php b/app/Integration/GitlabWebhook.php
index b3f9b0b5..17b6da70 100644
--- a/app/Integration/GitlabWebhook.php
+++ b/app/Integration/GitlabWebhook.php
@@ -19,6 +19,7 @@ class GitlabWebhook extends \Kanboard\Core\Base
*/
const EVENT_ISSUE_OPENED = 'gitlab.webhook.issue.opened';
const EVENT_ISSUE_CLOSED = 'gitlab.webhook.issue.closed';
+ const EVENT_ISSUE_REOPENED = 'gitlab.webhook.issue.reopened';
const EVENT_COMMIT = 'gitlab.webhook.commit';
const EVENT_ISSUE_COMMENT = 'gitlab.webhook.issue.commented';
@@ -164,6 +165,8 @@ class GitlabWebhook extends \Kanboard\Core\Base
return $this->handleIssueOpened($payload['object_attributes']);
case 'close':
return $this->handleIssueClosed($payload['object_attributes']);
+ case 'reopen':
+ return $this->handleIssueReopened($payload['object_attributes']);
}
return false;
@@ -194,6 +197,36 @@ class GitlabWebhook extends \Kanboard\Core\Base
}
/**
+ * Handle issue reopening
+ *
+ * @access public
+ * @param array $issue Issue data
+ * @return boolean
+ */
+ public function handleIssueReopened(array $issue)
+ {
+ $task = $this->taskFinder->getByReference($this->project_id, $issue['id']);
+
+ if (! empty($task)) {
+ $event = array(
+ 'project_id' => $this->project_id,
+ 'task_id' => $task['id'],
+ 'reference' => $issue['id'],
+ );
+
+ $this->container['dispatcher']->dispatch(
+ self::EVENT_ISSUE_REOPENED,
+ new GenericEvent($event)
+ );
+
+ return true;
+ }
+
+ return false;
+ }
+
+
+ /**
* Handle issue closing
*
* @access public