summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-06-03 11:32:24 -0400
committerFrederic Guillot <fred@kanboard.net>2017-06-03 11:32:24 -0400
commit43e4662b842248952aa53ebb69e8e833682a055c (patch)
tree5d20cf69c3d4998c00a396ac4096b8ade744c372
parent6251ac62d43817b996c2f0131433c1955e08a1de (diff)
Add new automatic action to assign tasks to its creator
-rw-r--r--ChangeLog7
-rw-r--r--app/Action/TaskAssignCreator.php98
-rw-r--r--app/Locale/bs_BA/translations.php1
-rw-r--r--app/Locale/ca_ES/translations.php1
-rw-r--r--app/Locale/cs_CZ/translations.php185
-rw-r--r--app/Locale/da_DK/translations.php1
-rw-r--r--app/Locale/de_DE/translations.php1
-rw-r--r--app/Locale/el_GR/translations.php1
-rw-r--r--app/Locale/es_ES/translations.php1
-rw-r--r--app/Locale/fi_FI/translations.php1
-rw-r--r--app/Locale/fr_FR/translations.php1
-rw-r--r--app/Locale/hr_HR/translations.php1
-rw-r--r--app/Locale/hu_HU/translations.php1
-rw-r--r--app/Locale/id_ID/translations.php1
-rw-r--r--app/Locale/it_IT/translations.php1
-rw-r--r--app/Locale/ja_JP/translations.php1
-rw-r--r--app/Locale/ko_KR/translations.php1
-rw-r--r--app/Locale/my_MY/translations.php1
-rw-r--r--app/Locale/nb_NO/translations.php1
-rw-r--r--app/Locale/nl_NL/translations.php1
-rw-r--r--app/Locale/pl_PL/translations.php1
-rw-r--r--app/Locale/pt_BR/translations.php1
-rw-r--r--app/Locale/pt_PT/translations.php1
-rw-r--r--app/Locale/ru_RU/translations.php1
-rw-r--r--app/Locale/sr_Latn_RS/translations.php1
-rw-r--r--app/Locale/sv_SE/translations.php1
-rw-r--r--app/Locale/th_TH/translations.php1
-rw-r--r--app/Locale/tr_TR/translations.php1
-rw-r--r--app/Locale/zh_CN/translations.php1
-rw-r--r--app/ServiceProvider/ActionProvider.php2
-rw-r--r--tests/units/Action/TaskAssignCreatorTest.php89
-rw-r--r--tests/units/Action/TaskAssignSpecificUserTest.php1
32 files changed, 316 insertions, 92 deletions
diff --git a/ChangeLog b/ChangeLog
index 3994e307..e6faec1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Version 1.0.45 (unreleased)
+---------------------------
+
+New features:
+
+* Automatic action to assign tasks to its creator
+
Version 1.0.44 (May 28, 2017)
-----------------------------
diff --git a/app/Action/TaskAssignCreator.php b/app/Action/TaskAssignCreator.php
new file mode 100644
index 00000000..ce10b35f
--- /dev/null
+++ b/app/Action/TaskAssignCreator.php
@@ -0,0 +1,98 @@
+<?php
+
+namespace Kanboard\Action;
+
+use Kanboard\Model\TaskModel;
+
+/**
+ * Assign a task to the creator
+ *
+ * @package Kanboard\Action
+ * @author Frederic Guillot
+ */
+class TaskAssignCreator extends Base
+{
+ /**
+ * Get automatic action description
+ *
+ * @access public
+ * @return string
+ */
+ public function getDescription()
+ {
+ return t('Assign the task to its creator');
+ }
+
+ /**
+ * Get the list of compatible events
+ *
+ * @access public
+ * @return array
+ */
+ public function getCompatibleEvents()
+ {
+ return array(
+ TaskModel::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',
+ 'task' => array(
+ 'project_id',
+ 'column_id',
+ 'creator_id',
+ ),
+ );
+ }
+
+ /**
+ * Execute the action
+ *
+ * @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)
+ {
+ $values = array(
+ 'id' => $data['task_id'],
+ 'owner_id' => $data['task']['creator_id'],
+ );
+
+ return $this->taskModificationModel->update($values);
+ }
+
+ /**
+ * 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['task']['column_id'] == $this->getParam('column_id');
+ }
+}
diff --git a/app/Locale/bs_BA/translations.php b/app/Locale/bs_BA/translations.php
index 2e084275..33f4e5f6 100644
--- a/app/Locale/bs_BA/translations.php
+++ b/app/Locale/bs_BA/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/ca_ES/translations.php b/app/Locale/ca_ES/translations.php
index 99001f7e..5d762917 100644
--- a/app/Locale/ca_ES/translations.php
+++ b/app/Locale/ca_ES/translations.php
@@ -1334,4 +1334,5 @@ return array(
'[DUPLICATE]' => '[DUPLICATE]',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/cs_CZ/translations.php b/app/Locale/cs_CZ/translations.php
index 90cc4488..db17d8d5 100644
--- a/app/Locale/cs_CZ/translations.php
+++ b/app/Locale/cs_CZ/translations.php
@@ -847,44 +847,44 @@ return array(
// 'Remove group' => '',
// 'Group removed successfully.' => '',
// 'Unable to remove this group.' => '',
- 'Project Permissions' => 'Oprávnění projektu',
- 'Manager' => 'Správce',
- 'Project Manager' => 'Správce projektu',
- 'Project Member' => 'Člen projektu',
- 'Project Viewer' => 'Čtenář projektu',
+ 'Project Permissions' => 'Oprávnění projektu',
+ 'Manager' => 'Správce',
+ 'Project Manager' => 'Správce projektu',
+ 'Project Member' => 'Člen projektu',
+ 'Project Viewer' => 'Čtenář projektu',
// 'Your account is locked for %d minutes' => '',
// 'Invalid captcha' => '',
// 'The name must be unique' => '',
- 'View all groups' => 'Zobrazit všechny skupiny',
+ 'View all groups' => 'Zobrazit všechny skupiny',
// 'There is no user available.' => '',
// 'Do you really want to remove the user "%s" from the group "%s"?' => '',
// 'There is no group.' => '',
// 'Add group member' => '',
// 'Do you really want to remove this group: "%s"?' => '',
// 'There is no user in this group.' => '',
- 'Permissions' => 'Oprávnění',
- 'Allowed Users' => 'Povolení uživatelé',
+ 'Permissions' => 'Oprávnění',
+ 'Allowed Users' => 'Povolení uživatelé',
// 'No user have been allowed specifically.' => '',
- 'Role' => 'Role',
- 'Enter user name...' => 'Zadejte uživatelské jméno...',
- 'Allowed Groups' => 'Povolené skupiny',
+ 'Role' => 'Role',
+ 'Enter user name...' => 'Zadejte uživatelské jméno...',
+ 'Allowed Groups' => 'Povolené skupiny',
// 'No group have been allowed specifically.' => '',
- 'Group' => 'Skupina',
- 'Group Name' => 'Jméno skupiny',
+ 'Group' => 'Skupina',
+ 'Group Name' => 'Jméno skupiny',
// 'Enter group name...' => '',
// 'Role:' => '',
- 'Project members' => 'Členové projektu',
+ 'Project members' => 'Členové projektu',
// '%s mentioned you in the task #%d' => '',
// '%s mentioned you in a comment on the task #%d' => '',
// 'You were mentioned in the task #%d' => '',
// 'You were mentioned in a comment on the task #%d' => '',
// 'Estimated hours: ' => '',
// 'Actual hours: ' => '',
- 'Hours Spent' => 'Hodin stráveno',
- 'Hours Estimated' => 'Hodin odhadováno',
- 'Estimated Time' => 'Odhadovaný čas',
- 'Actual Time' => 'Aktuální čas',
- 'Estimated vs actual time' => 'Rozdíl mezi odhadovaným a aktuálním časem',
+ 'Hours Spent' => 'Hodin stráveno',
+ 'Hours Estimated' => 'Hodin odhadováno',
+ 'Estimated Time' => 'Odhadovaný čas',
+ 'Actual Time' => 'Aktuální čas',
+ 'Estimated vs actual time' => 'Rozdíl mezi odhadovaným a aktuálním časem',
// 'RUB - Russian Ruble' => '',
// 'Assign the task to the person who does the action when the column is changed' => '',
// 'Close a task in a specific column' => '',
@@ -894,7 +894,7 @@ return array(
// 'Enable two-factor authentication' => '',
// 'There is no integration registered at the moment.' => '',
// 'Password Reset for Kanboard' => '',
- 'Forgot password?' => 'Zapomenuté heslo?',
+ 'Forgot password?' => 'Zapomenuté heslo?',
// 'Enable "Forget Password"' => '',
// 'Password Reset' => '',
// 'New password' => '',
@@ -902,80 +902,80 @@ return array(
// 'To reset your password click on this link:' => '',
// 'Last Password Reset' => '',
// 'The password has never been reinitialized.' => '',
- 'Creation' => 'Vytvoření',
+ 'Creation' => 'Vytvoření',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
- 'Close all tasks of this column' => 'Uzavřít všechny úkoly v tomto sloupci',
+ 'Close all tasks of this column' => 'Uzavřít všechny úkoly v tomto sloupci',
// 'No plugin has registered a project notification method. You can still configure individual notifications in your user profile.' => '',
- 'My dashboard' => 'Moje nástěnka',
- 'My profile' => 'Můj profil',
- 'Project owner: ' => 'Vlastník projektu: ',
+ 'My dashboard' => 'Moje nástěnka',
+ 'My profile' => 'Můj profil',
+ 'Project owner: ' => 'Vlastník projektu: ',
// 'The project identifier is optional and must be alphanumeric, example: MYPROJECT.' => '',
- 'Project owner' => 'Vlastník projektu',
- 'Private projects do not have users and groups management.' => 'Soukromé projekty nemají správu uživatelů a skupin',
- 'There is no project member.' => 'Projekt nemá žádného člena',
- 'Priority' => 'Priorita',
- 'Task priority' => 'Priorita úkolu',
- 'General' => 'Všeobecné',
- 'Dates' => 'Termíny',
- 'Default priority' => 'Výchozí priorita',
- 'Lowest priority' => 'Nejnižší priorita',
- 'Highest priority' => 'Nejvyžší priorita',
- 'Close a task when there is no activity' => 'Uzavřít úkol pokud není žádná aktivita',
- 'Duration in days' => 'Trvání ve dnech',
- 'Send email when there is no activity on a task' => 'Odeslat mail pokud není žádná aktivita u úkolu',
+ 'Project owner' => 'Vlastník projektu',
+ 'Private projects do not have users and groups management.' => 'Soukromé projekty nemají správu uživatelů a skupin',
+ 'There is no project member.' => 'Projekt nemá žádného člena',
+ 'Priority' => 'Priorita',
+ 'Task priority' => 'Priorita úkolu',
+ 'General' => 'Všeobecné',
+ 'Dates' => 'Termíny',
+ 'Default priority' => 'Výchozí priorita',
+ 'Lowest priority' => 'Nejnižší priorita',
+ 'Highest priority' => 'Nejvyžší priorita',
+ 'Close a task when there is no activity' => 'Uzavřít úkol pokud není žádná aktivita',
+ 'Duration in days' => 'Trvání ve dnech',
+ 'Send email when there is no activity on a task' => 'Odeslat mail pokud není žádná aktivita u úkolu',
// 'Unable to fetch link information.' => '',
// 'Daily background job for tasks' => '',
// 'Auto' => '',
- 'Related' => 'Související',
- 'Attachment' => 'Příloha',
- 'Title not found' => 'Název nenalezen',
- 'Web Link' => 'Webový odkaz',
- 'External links' => 'Externí odkazy',
- 'Add external link' => 'Přidat externí odkaz',
- 'Type' => 'Typ',
- 'Dependency' => 'Závislost',
- 'Add internal link' => 'Přidat interní odkaz',
- 'Add a new external link' => 'Přidat nový externí odkaz',
- 'Edit external link' => 'Upravit externí odkaz',
- 'External link' => 'Externí odkaz',
+ 'Related' => 'Související',
+ 'Attachment' => 'Příloha',
+ 'Title not found' => 'Název nenalezen',
+ 'Web Link' => 'Webový odkaz',
+ 'External links' => 'Externí odkazy',
+ 'Add external link' => 'Přidat externí odkaz',
+ 'Type' => 'Typ',
+ 'Dependency' => 'Závislost',
+ 'Add internal link' => 'Přidat interní odkaz',
+ 'Add a new external link' => 'Přidat nový externí odkaz',
+ 'Edit external link' => 'Upravit externí odkaz',
+ 'External link' => 'Externí odkaz',
'Copy and paste your link here...' => 'Zde vložte váš odkaz...',
// 'URL' => '',
- 'Internal links' => 'Interní odkazy',
+ 'Internal links' => 'Interní odkazy',
// 'Assign to me' => '',
// 'Me' => '',
// 'Do not duplicate anything' => '',
- 'Projects management' => 'Správa projektů',
- 'Users management' => 'Správa uživatelů',
- 'Groups management' => 'Správa skupin',
- 'Create from another project' => 'Vytvořit z jiného projektu',
- 'open' => 'otevřeno',
- 'closed' => 'uzavřeno',
- 'Priority:' => 'Priorita:',
+ 'Projects management' => 'Správa projektů',
+ 'Users management' => 'Správa uživatelů',
+ 'Groups management' => 'Správa skupin',
+ 'Create from another project' => 'Vytvořit z jiného projektu',
+ 'open' => 'otevřeno',
+ 'closed' => 'uzavřeno',
+ 'Priority:' => 'Priorita:',
// 'Reference:' => '',
- 'Complexity:' => 'Složitost:',
- 'Swimlane:' => 'Dráha:',
- 'Column:' => 'Sloupec:',
- 'Position:' => 'Pozice:',
- 'Creator:' => 'Autor:',
- 'Time estimated:' => 'Odhadovaný čas:',
- '%s hours' => '%s hodin',
- 'Time spent:' => 'Strávený čas:',
- 'Created:' => 'Vytvořeno:',
- 'Modified:' => 'Změněno:',
- 'Completed:' => 'Dokončeno:',
- 'Started:' => 'Započato:',
- 'Moved:' => 'Přesunuto',
- 'Task #%d' => 'Úkol #%d',
- 'Time format' => 'Časový formát',
- 'Start date: ' => 'Počáteční datum',
- 'End date: ' => 'Koncové datum',
- 'New due date: ' => 'Nové datum splnění',
- 'Start date changed: ' => 'Počáteční datum změněno: ',
- 'Disable private projects' => 'Zakázat soukromé projekty',
+ 'Complexity:' => 'Složitost:',
+ 'Swimlane:' => 'Dráha:',
+ 'Column:' => 'Sloupec:',
+ 'Position:' => 'Pozice:',
+ 'Creator:' => 'Autor:',
+ 'Time estimated:' => 'Odhadovaný čas:',
+ '%s hours' => '%s hodin',
+ 'Time spent:' => 'Strávený čas:',
+ 'Created:' => 'Vytvořeno:',
+ 'Modified:' => 'Změněno:',
+ 'Completed:' => 'Dokončeno:',
+ 'Started:' => 'Započato:',
+ 'Moved:' => 'Přesunuto',
+ 'Task #%d' => 'Úkol #%d',
+ 'Time format' => 'Časový formát',
+ 'Start date: ' => 'Počáteční datum',
+ 'End date: ' => 'Koncové datum',
+ 'New due date: ' => 'Nové datum splnění',
+ 'Start date changed: ' => 'Počáteční datum změněno: ',
+ 'Disable private projects' => 'Zakázat soukromé projekty',
// 'Do you really want to remove this custom filter: "%s"?' => '',
// 'Remove a custom filter' => '',
// 'User activated successfully.' => '',
@@ -1101,13 +1101,13 @@ return array(
// 'Tag removed successfully.' => '',
// 'Unable to remove this tag.' => '',
// 'Global tags management' => '',
- 'Tags' => 'Štítky',
- 'Tags management' => 'Správa štítků',
- 'Add new tag' => 'Přidat nový štítek',
- 'Edit a tag' => 'Upravit štítek',
- 'Project tags' => 'Štítky projektu',
+ 'Tags' => 'Štítky',
+ 'Tags management' => 'Správa štítků',
+ 'Add new tag' => 'Přidat nový štítek',
+ 'Edit a tag' => 'Upravit štítek',
+ 'Project tags' => 'Štítky projektu',
// 'There is no specific tag for this project at the moment.' => '',
- 'Tag' => 'Štítek',
+ 'Tag' => 'Štítek',
// 'Remove a tag' => '',
// 'Do you really want to remove this tag: "%s"?' => '',
// 'Global tags' => '',
@@ -1259,9 +1259,9 @@ return array(
// 'The project email is optional and could be used by several plugins.' => '',
// 'The project email must be unique across all projects' => '',
// 'The email configuration has been disabled by the administrator.' => '',
- 'Close this project' => 'Uzavřít tento projekt',
- 'Open this project' => 'Otevřít tento projekt',
- 'Close a project' => 'Uzavřít projekt',
+ 'Close this project' => 'Uzavřít tento projekt',
+ 'Open this project' => 'Otevřít tento projekt',
+ 'Close a project' => 'Uzavřít projekt',
// 'Do you really want to close this project: "%s"?' => '',
// 'Reopen a project' => '',
// 'Do you really want to reopen this project: "%s"?' => '',
@@ -1288,7 +1288,7 @@ return array(
// '%d projects' => '',
// '%d project' => '',
// 'There is no project.' => '',
- 'Sort' => 'Seřadit',
+ 'Sort' => 'Seřadit',
// 'Project ID' => '',
// 'Project name' => '',
// 'Public' => '',
@@ -1325,11 +1325,14 @@ return array(
// 'Changing assignee is not permitted' => '',
// 'Update only assigned tasks is permitted' => '',
// 'Only for tasks assigned to the current user' => '',
- 'My projects' => 'Moje projekty',
+ 'My projects' => 'Moje projekty',
// 'Your are not member of any project.' => '',
- 'My subtasks' => 'Moje dílčí úkoly',
+ 'My subtasks' => 'Moje dílčí úkoly',
// '%d subtasks' => '',
// '%d subtask' => '',
// 'Only moving task between those columns is permitted for tasks assigned to the current user' => '',
- '[DUPLICATE]' => '[KOPIE]',
+ '[DUPLICATE]' => '[KOPIE]',
+ // 'DKK - Danish Krona' => '',
+ // 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php
index c772e6d5..74eed6e2 100644
--- a/app/Locale/da_DK/translations.php
+++ b/app/Locale/da_DK/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php
index 80d26ab1..83802c8e 100644
--- a/app/Locale/de_DE/translations.php
+++ b/app/Locale/de_DE/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/el_GR/translations.php b/app/Locale/el_GR/translations.php
index a4217f0a..dc45dd21 100644
--- a/app/Locale/el_GR/translations.php
+++ b/app/Locale/el_GR/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php
index 8261d4a0..7e549bee 100644
--- a/app/Locale/es_ES/translations.php
+++ b/app/Locale/es_ES/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php
index b206c8bc..8bc92e0e 100644
--- a/app/Locale/fi_FI/translations.php
+++ b/app/Locale/fi_FI/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php
index 9f0de891..f13e1aa9 100644
--- a/app/Locale/fr_FR/translations.php
+++ b/app/Locale/fr_FR/translations.php
@@ -1334,4 +1334,5 @@ return array(
'[DUPLICATE]' => '[COPIE]',
'DKK - Danish Krona' => 'DKK - Couronne danoise',
'Remove user from group' => 'Supprimer cet utilisateur du groupe',
+ 'Assign the task to its creator' => 'Assigner une tâche à son créateur',
);
diff --git a/app/Locale/hr_HR/translations.php b/app/Locale/hr_HR/translations.php
index e167f6ac..6ced621a 100644
--- a/app/Locale/hr_HR/translations.php
+++ b/app/Locale/hr_HR/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php
index 5b27ca7b..8de328e7 100644
--- a/app/Locale/hu_HU/translations.php
+++ b/app/Locale/hu_HU/translations.php
@@ -1334,4 +1334,5 @@ return array(
'[DUPLICATE]' => '[Duplikált]',
'DKK - Danish Krona' => 'Dán korona',
'Remove user from group' => 'Felhasználó eltávolítása a csoportból',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/id_ID/translations.php b/app/Locale/id_ID/translations.php
index 7d40c521..94800a08 100644
--- a/app/Locale/id_ID/translations.php
+++ b/app/Locale/id_ID/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php
index 8cbbe377..8455d221 100644
--- a/app/Locale/it_IT/translations.php
+++ b/app/Locale/it_IT/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php
index d10582c1..42753535 100644
--- a/app/Locale/ja_JP/translations.php
+++ b/app/Locale/ja_JP/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/ko_KR/translations.php b/app/Locale/ko_KR/translations.php
index febb600c..99f7087a 100644
--- a/app/Locale/ko_KR/translations.php
+++ b/app/Locale/ko_KR/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/my_MY/translations.php b/app/Locale/my_MY/translations.php
index a588f4dc..1e7f4e04 100644
--- a/app/Locale/my_MY/translations.php
+++ b/app/Locale/my_MY/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/nb_NO/translations.php b/app/Locale/nb_NO/translations.php
index d92ec776..4f860b05 100644
--- a/app/Locale/nb_NO/translations.php
+++ b/app/Locale/nb_NO/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php
index 2af5c5c5..9fd2db7a 100644
--- a/app/Locale/nl_NL/translations.php
+++ b/app/Locale/nl_NL/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php
index 0fd1a8c6..09776670 100644
--- a/app/Locale/pl_PL/translations.php
+++ b/app/Locale/pl_PL/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php
index 05b027f5..4f733ab0 100644
--- a/app/Locale/pt_BR/translations.php
+++ b/app/Locale/pt_BR/translations.php
@@ -1334,4 +1334,5 @@ return array(
'[DUPLICATE]' => '[DUPLICADO]',
'DKK - Danish Krona' => 'DKK - Coroa Dinamarquesa',
'Remove user from group' => 'Remover usuário do grupo',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/pt_PT/translations.php b/app/Locale/pt_PT/translations.php
index 38de094e..58a71273 100644
--- a/app/Locale/pt_PT/translations.php
+++ b/app/Locale/pt_PT/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php
index 9b67c36e..93369770 100644
--- a/app/Locale/ru_RU/translations.php
+++ b/app/Locale/ru_RU/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php
index f1bdd9cb..d29e997f 100644
--- a/app/Locale/sr_Latn_RS/translations.php
+++ b/app/Locale/sr_Latn_RS/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php
index 8e349885..4dc0f338 100644
--- a/app/Locale/sv_SE/translations.php
+++ b/app/Locale/sv_SE/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php
index 66171f7a..efedf683 100644
--- a/app/Locale/th_TH/translations.php
+++ b/app/Locale/th_TH/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php
index 642e7f77..02b288cc 100644
--- a/app/Locale/tr_TR/translations.php
+++ b/app/Locale/tr_TR/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php
index 9aef6216..7a20eaf7 100644
--- a/app/Locale/zh_CN/translations.php
+++ b/app/Locale/zh_CN/translations.php
@@ -1334,4 +1334,5 @@ return array(
// '[DUPLICATE]' => '',
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
+ // 'Assign the task to its creator' => '',
);
diff --git a/app/ServiceProvider/ActionProvider.php b/app/ServiceProvider/ActionProvider.php
index a7e8040e..14b84c7a 100644
--- a/app/ServiceProvider/ActionProvider.php
+++ b/app/ServiceProvider/ActionProvider.php
@@ -19,6 +19,7 @@ use Kanboard\Action\TaskAssignColorCategory;
use Kanboard\Action\TaskAssignColorColumn;
use Kanboard\Action\TaskAssignColorLink;
use Kanboard\Action\TaskAssignColorUser;
+use Kanboard\Action\TaskAssignCreator;
use Kanboard\Action\TaskAssignCurrentUser;
use Kanboard\Action\TaskAssignCurrentUserColumn;
use Kanboard\Action\TaskAssignSpecificUser;
@@ -69,6 +70,7 @@ class ActionProvider implements ServiceProviderInterface
$container['actionManager']->register(new TaskAssignColorLink($container));
$container['actionManager']->register(new TaskAssignColorUser($container));
$container['actionManager']->register(new TaskAssignColorPriority($container));
+ $container['actionManager']->register(new TaskAssignCreator($container));
$container['actionManager']->register(new TaskAssignCurrentUser($container));
$container['actionManager']->register(new TaskAssignCurrentUserColumn($container));
$container['actionManager']->register(new TaskAssignSpecificUser($container));
diff --git a/tests/units/Action/TaskAssignCreatorTest.php b/tests/units/Action/TaskAssignCreatorTest.php
new file mode 100644
index 00000000..70bf9da5
--- /dev/null
+++ b/tests/units/Action/TaskAssignCreatorTest.php
@@ -0,0 +1,89 @@
+<?php
+
+require_once __DIR__.'/../Base.php';
+
+use Kanboard\Action\TaskAssignCreator;
+use Kanboard\Event\TaskEvent;
+use Kanboard\Model\TaskCreationModel;
+use Kanboard\Model\TaskFinderModel;
+use Kanboard\Model\ProjectModel;
+use Kanboard\Model\TaskModel;
+
+class TaskAssignCreatorTest extends Base
+{
+ public function testChangeUser()
+ {
+ $projectModel = new ProjectModel($this->container);
+ $taskCreationModel = new TaskCreationModel($this->container);
+ $taskFinderModel = new TaskFinderModel($this->container);
+
+ $this->assertEquals(1, $projectModel->create(array('name' => 'test1')));
+ $this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test', 'owner_id' => 0)));
+
+ $event = new TaskEvent(array(
+ 'task_id' => 1,
+ 'task' => array(
+ 'project_id' => 1,
+ 'column_id' => 2,
+ 'creator_id' => 1,
+ )
+ ));
+
+ $action = new TaskAssignCreator($this->container);
+ $action->setProjectId(1);
+ $action->setParam('column_id', 2);
+
+ $this->assertTrue($action->execute($event, TaskModel::EVENT_MOVE_COLUMN));
+
+ $task = $taskFinderModel->getById(1);
+ $this->assertNotEmpty($task);
+ $this->assertEquals(1, $task['owner_id']);
+ }
+
+ public function testWithoutCreator()
+ {
+ $projectModel = new ProjectModel($this->container);
+ $taskCreationModel = new TaskCreationModel($this->container);
+
+ $this->assertEquals(1, $projectModel->create(array('name' => 'test1')));
+ $this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test', 'owner_id' => 0)));
+
+ $event = new TaskEvent(array(
+ 'task_id' => 1,
+ 'task' => array(
+ 'project_id' => 1,
+ 'column_id' => 2,
+ )
+ ));
+
+ $action = new TaskAssignCreator($this->container);
+ $action->setProjectId(1);
+ $action->setParam('column_id', 2);
+
+ $this->assertFalse($action->execute($event, TaskModel::EVENT_MOVE_COLUMN));
+ }
+
+ public function testWithWrongColumn()
+ {
+ $projectModel = new ProjectModel($this->container);
+ $taskCreationModel = new TaskCreationModel($this->container);
+
+ $this->assertEquals(1, $projectModel->create(array('name' => 'test1')));
+ $this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test')));
+
+ $event = new TaskEvent(array(
+ 'task_id' => 1,
+ 'task' => array(
+ 'project_id' => 1,
+ 'column_id' => 3,
+ 'creator_id' => 1,
+ )
+ ));
+
+ $action = new TaskAssignCreator($this->container);
+ $action->setProjectId(1);
+ $action->setParam('column_id', 2);
+
+ $this->assertFalse($action->execute($event, TaskModel::EVENT_MOVE_COLUMN));
+ }
+}
diff --git a/tests/units/Action/TaskAssignSpecificUserTest.php b/tests/units/Action/TaskAssignSpecificUserTest.php
index 0e63fc13..9b0b8f5d 100644
--- a/tests/units/Action/TaskAssignSpecificUserTest.php
+++ b/tests/units/Action/TaskAssignSpecificUserTest.php
@@ -2,7 +2,6 @@
require_once __DIR__.'/../Base.php';
-use Kanboard\Event\GenericEvent;
use Kanboard\Event\TaskEvent;
use Kanboard\Model\TaskCreationModel;
use Kanboard\Model\TaskFinderModel;