| <?php |
|
|
| namespace Kanboard\Action; |
|
|
| use Kanboard\Model\TaskModel; |
|
|
| |
| |
| |
| |
| |
| |
| class TaskAssignCurrentUserColumn extends Base |
| { |
| |
| |
| |
| |
| |
| |
| public function getDescription() |
| { |
| return t('Assign the task to the person who does the action when the column is changed'); |
| } |
|
|
| |
| |
| |
| |
| |
| |
| public function getCompatibleEvents() |
| { |
| return array( |
| TaskModel::EVENT_MOVE_COLUMN, |
| ); |
| } |
|
|
| |
| |
| |
| |
| |
| |
| public function getActionRequiredParameters() |
| { |
| return array( |
| 'column_id' => t('Column'), |
| ); |
| } |
|
|
| |
| |
| |
| |
| |
| |
| public function getEventRequiredParameters() |
| { |
| return array( |
| 'task_id', |
| 'task' => array( |
| 'project_id', |
| 'column_id', |
| ), |
| ); |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| public function doAction(array $data) |
| { |
| if (! $this->userSession->isLogged()) { |
| return false; |
| } |
|
|
| $values = array( |
| 'id' => $data['task_id'], |
| 'owner_id' => $this->userSession->getId(), |
| ); |
|
|
| return $this->taskModificationModel->update($values); |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| public function hasRequiredCondition(array $data) |
| { |
| return $data['task']['column_id'] == $this->getParam('column_id'); |
| } |
| } |
|
|