diff --git a/README.markdown b/README.markdown index 9cba1e45b..d0edfa440 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 000000000..621e8e6c4 --- /dev/null +++ b/app/Action/TaskLogMoveAnotherColumn.php @@ -0,0 +1,84 @@ + 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 5af587f49..adf92d196 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 662046ce5..3cac1b316 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 9c50e1a71..751f755d2 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 b1dff1ad0..80351eeaf 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 c40cee9ee..c1c8a4953 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 d011a0a49..a74b60d20 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 a5350f71d..a539844d4 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 53b102123..e4dee5d27 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 6de3ff708..3ec3687ba 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 e5dfcb251..8b64db170 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 daf325dff..18ef5df97 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 fb347dbd1..4e8eb85fe 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 ac6b82f64..0a75ab0ea 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 362ac825d..593f7fc82 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 2204ad37d..6aef81a3e 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'), );