summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.markdown1
-rw-r--r--app/Action/TaskLogMoveAnotherColumn.php84
-rw-r--r--app/Locale/da_DK/translations.php2
-rw-r--r--app/Locale/de_DE/translations.php2
-rw-r--r--app/Locale/es_ES/translations.php2
-rw-r--r--app/Locale/fi_FI/translations.php2
-rw-r--r--app/Locale/fr_FR/translations.php2
-rw-r--r--app/Locale/hu_HU/translations.php2
-rw-r--r--app/Locale/it_IT/translations.php2
-rw-r--r--app/Locale/ja_JP/translations.php2
-rw-r--r--app/Locale/pl_PL/translations.php2
-rw-r--r--app/Locale/pt_BR/translations.php2
-rw-r--r--app/Locale/ru_RU/translations.php2
-rw-r--r--app/Locale/sv_SE/translations.php2
-rw-r--r--app/Locale/th_TH/translations.php2
-rw-r--r--app/Locale/zh_CN/translations.php2
-rw-r--r--app/Model/Action.php1
17 files changed, 114 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 9cba1e45..d0edfa44 100644
--- a/README.markdown
+++ b/README.markdown
@@ -183,6 +183,7 @@ Contributors:
- [Null-Kelvin](https://github.com/Null-Kelvin)
- [Oliver Bertuch](https://github.com/poikilotherm)
- [Olivier Maridat](https://github.com/oliviermaridat)
+- [Oren Ben-Kiki](https://github.com/orenbenkiki)
- [Peller Zoltan](https://github.com/PierP)
- [Petja Touru](https://github.com/Petja)
- [Rafaelrossa](https://github.com/rafaelrossa)
diff --git a/app/Action/TaskLogMoveAnotherColumn.php b/app/Action/TaskLogMoveAnotherColumn.php
new file mode 100644
index 00000000..621e8e6c
--- /dev/null
+++ b/app/Action/TaskLogMoveAnotherColumn.php
@@ -0,0 +1,84 @@
+<?php
+
+namespace Action;
+
+use Model\GithubWebhook;
+use Model\Task;
+
+/**
+ * Add a log of the triggering event to the task description.
+ *
+ * @package action
+ * @author Oren Ben-Kiki
+ */
+class TaskLogMoveAnotherColumn extends Base
+{
+ /**
+ * Get the list of compatible events
+ *
+ * @access public
+ * @return array
+ */
+ public function getCompatibleEvents()
+ {
+ return array(
+ Task::EVENT_MOVE_COLUMN,
+ );
+ }
+
+ /**
+ * Get the required parameter for the action (defined by the user)
+ *
+ * @access public
+ * @return array
+ */
+ public function getActionRequiredParameters()
+ {
+ return array('column_id' => t('Column'));
+ }
+
+ /**
+ * Get the required parameter for the event
+ *
+ * @access public
+ * @return string[]
+ */
+ public function getEventRequiredParameters()
+ {
+ return array('task_id', 'column_id');
+ }
+
+ /**
+ * Execute the action (append to the task description).
+ *
+ * @access public
+ * @param array $data Event data dictionary
+ * @return bool True if the action was executed or false when not executed
+ */
+ public function doAction(array $data)
+ {
+ if (! $this->userSession->isLogged()) {
+ return false;
+ }
+
+ $column = $this->board->getColumn($data['column_id']);
+
+ return (bool) $this->comment->create(array(
+ 'comment' => t('Moved to column %s', $column['title']),
+ 'task_id' => $data['task_id'],
+ 'user_id' => $this->userSession->getId(),
+ ));
+ }
+
+ /**
+ * Check if the event data meet the action condition
+ *
+ * @access public
+ * @param array $data Event data dictionary
+ * @return bool
+ */
+ public function hasRequiredCondition(array $data)
+ {
+ return $data['column_id'] == $this->getParam('column_id');
+ }
+}
diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php
index 5af587f4..adf92d19 100644
--- a/app/Locale/da_DK/translations.php
+++ b/app/Locale/da_DK/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php
index 662046ce..3cac1b31 100644
--- a/app/Locale/de_DE/translations.php
+++ b/app/Locale/de_DE/translations.php
@@ -697,4 +697,6 @@ return array(
'All swimlanes' => 'Alle Swimlanes',
'All colors' => 'Alle Farben',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php
index 9c50e1a7..751f755d 100644
--- a/app/Locale/es_ES/translations.php
+++ b/app/Locale/es_ES/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php
index b1dff1ad..80351eea 100644
--- a/app/Locale/fi_FI/translations.php
+++ b/app/Locale/fi_FI/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php
index c40cee9e..c1c8a495 100644
--- a/app/Locale/fr_FR/translations.php
+++ b/app/Locale/fr_FR/translations.php
@@ -698,4 +698,6 @@ return array(
'All swimlanes' => 'Toutes les swimlanes',
'All colors' => 'Toutes les couleurs',
'All status' => 'Tous les états',
+ 'Add a comment logging moving the task between columns' => 'Ajouter un commentaire de log lorsqu\'une tâche est déplacée dans une autre colonne',
+ 'Moved to column %s' => 'Tâche déplacée à la colonne %s',
);
diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php
index d011a0a4..a74b60d2 100644
--- a/app/Locale/hu_HU/translations.php
+++ b/app/Locale/hu_HU/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php
index a5350f71..a539844d 100644
--- a/app/Locale/it_IT/translations.php
+++ b/app/Locale/it_IT/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php
index 53b10212..e4dee5d2 100644
--- a/app/Locale/ja_JP/translations.php
+++ b/app/Locale/ja_JP/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php
index 6de3ff70..3ec3687b 100644
--- a/app/Locale/pl_PL/translations.php
+++ b/app/Locale/pl_PL/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php
index e5dfcb25..8b64db17 100644
--- a/app/Locale/pt_BR/translations.php
+++ b/app/Locale/pt_BR/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php
index daf325df..18ef5df9 100644
--- a/app/Locale/ru_RU/translations.php
+++ b/app/Locale/ru_RU/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php
index fb347dbd..4e8eb85f 100644
--- a/app/Locale/sv_SE/translations.php
+++ b/app/Locale/sv_SE/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php
index ac6b82f6..0a75ab0e 100644
--- a/app/Locale/th_TH/translations.php
+++ b/app/Locale/th_TH/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php
index 362ac825..593f7fc8 100644
--- a/app/Locale/zh_CN/translations.php
+++ b/app/Locale/zh_CN/translations.php
@@ -697,4 +697,6 @@ return array(
// 'All swimlanes' => '',
// 'All colors' => '',
// 'All status' => '',
+ // 'Add a comment logging moving the task between columns' => '',
+ // 'Moved to column %s' => '',
);
diff --git a/app/Model/Action.php b/app/Model/Action.php
index 2204ad37..6aef81a3 100644
--- a/app/Model/Action.php
+++ b/app/Model/Action.php
@@ -49,6 +49,7 @@ class Action extends Base
'TaskAssignCategoryColor' => t('Assign automatically a category based on a color'),
'CommentCreation' => t('Create a comment from an external provider'),
'TaskCreation' => t('Create a task from an external provider'),
+ 'TaskLogMoveAnotherColumn' => t('Add a comment logging moving the task between columns'),
'TaskAssignUser' => t('Change the assignee based on an external username'),
'TaskAssignCategoryLabel' => t('Change the category based on an external label'),
);