diff --git a/actions/task_assign_color_user.php b/actions/task_assign_color_user.php new file mode 100644 index 000000000..a9f08e306 --- /dev/null +++ b/actions/task_assign_color_user.php @@ -0,0 +1,47 @@ +task = $task; + } + + public function getActionRequiredParameters() + { + return array( + 'column_id' => t('Column'), + 'color_id' => t('Color'), + 'user_id' => t('Assignee'), + ); + } + + public function getEventRequiredParameters() + { + return array( + 'task_id', + 'owner_id', + 'column_id', + ); + } + + public function doAction(array $data) + { + if ($data['column_id'] == $this->getParam('column_id') && $data['owner_id'] == $this->getParam('user_id')) { + + $this->task->update(array( + 'id' => $data['task_id'], + 'color_id' => $this->getParam('color_id'), + )); + + return true; + } + + return false; + } +} diff --git a/controllers/action.php b/controllers/action.php index 270e4e75c..32ec737da 100644 --- a/controllers/action.php +++ b/controllers/action.php @@ -37,6 +37,7 @@ class Action extends Base 'columns_list' => $this->board->getColumnsList($project['id']), 'users_list' => $this->project->getUsersList($project['id'], false), 'projects_list' => $this->project->getList(false), + 'colors_list' => $this->task->getColors(), 'menu' => 'projects', 'title' => t('Automatic actions') ))); @@ -66,6 +67,7 @@ class Action extends Base 'columns_list' => $this->board->getColumnsList($project['id']), 'users_list' => $this->project->getUsersList($project['id'], false), 'projects_list' => $this->project->getList(false), + 'colors_list' => $this->task->getColors(), 'project' => $project, 'menu' => 'projects', 'title' => t('Automatic actions') diff --git a/locales/fr_FR/translations.php b/locales/fr_FR/translations.php index b85d05d92..690ce3fa3 100644 --- a/locales/fr_FR/translations.php +++ b/locales/fr_FR/translations.php @@ -99,7 +99,7 @@ return array( 'Edit a task' => 'Modifier une tâche', 'Column' => 'Colonne', 'Color' => 'Couleur', - 'Assignee' => 'Personne assigné', + 'Assignee' => 'Personne assignée', 'Create another task' => 'Créer une autre tâche', 'New task' => 'Nouvelle tâche', 'Open a task' => 'Ouvrir une tâche', @@ -247,4 +247,5 @@ return array( 'Task creation' => 'Création d\'une tâche', 'Open a closed task' => 'Ouverture d\'une tâche fermée', 'Closing a task' => 'Fermeture d\'une tâche', + 'Assign a color to a specific user' => 'Assigner une couleur à un utilisateur', ); diff --git a/locales/pl_PL/translations.php b/locales/pl_PL/translations.php index 7da7c330b..530e5a22c 100644 --- a/locales/pl_PL/translations.php +++ b/locales/pl_PL/translations.php @@ -250,4 +250,5 @@ return array( // 'Task creation' => '', // 'Open a closed task' => '', // 'Closing a task' => '', + // 'Assign a color to a specific user' => '', ); diff --git a/models/action.php b/models/action.php index 9b18d4617..f3e2094db 100644 --- a/models/action.php +++ b/models/action.php @@ -26,6 +26,7 @@ class Action extends Base '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'), + 'TaskAssignColorUser' => t('Assign a color to a specific user'), ); } @@ -217,6 +218,10 @@ class Action extends Base require_once __DIR__.'/../actions/task_duplicate_another_project.php'; $className = '\Action\TaskDuplicateAnotherProject'; return new $className($project_id, new Task($this->db, $this->event)); + case 'TaskAssignColorUser': + require_once __DIR__.'/../actions/task_assign_color_user.php'; + $className = '\Action\TaskAssignColorUser'; + return new $className($project_id, new Task($this->db, $this->event)); default: throw new \LogicException('Action not found: '.$name); } diff --git a/templates/action_index.php b/templates/action_index.php index 6e62949ef..eccc0ec48 100644 --- a/templates/action_index.php +++ b/templates/action_index.php @@ -34,6 +34,8 @@ + + diff --git a/templates/action_params.php b/templates/action_params.php index e7efcda53..ed9d8b8f9 100644 --- a/templates/action_params.php +++ b/templates/action_params.php @@ -25,8 +25,10 @@
+ + +
-