Skip to content

Commit

Permalink
Add new actions to reorder tasks by column
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Feb 8, 2019
1 parent ba5878e commit 0295388
Show file tree
Hide file tree
Showing 36 changed files with 320 additions and 1 deletion.
36 changes: 36 additions & 0 deletions app/Controller/TaskReorderController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Kanboard\Controller;

use Kanboard\Core\Controller\AccessForbiddenException;

class TaskReorderController extends BaseController
{
public function reorderColumn()
{
$project = $this->getProject();

if (! $this->helper->user->hasProjectAccess('TaskModificationController', 'update', $project['id'])) {
throw new AccessForbiddenException();
}

$swimlaneID = $this->request->getIntegerParam('swimlane_id');
$columnID = $this->request->getIntegerParam('column_id');
$direction = $this->request->getStringParam('direction');
$sort = $this->request->getStringParam('sort');

switch ($sort) {
case 'priority':
$this->taskReorderModel->reorderByPriority($project['id'], $swimlaneID, $columnID, $direction);
break;
case 'assignee-priority':
$this->taskReorderModel->reorderByAssigneeAndPriority($project['id'], $swimlaneID, $columnID, $direction);
break;
case 'assignee':
$this->taskReorderModel->reorderByAssignee($project['id'], $swimlaneID, $columnID, $direction);
break;
}

$this->response->redirect($this->helper->url->to('BoardViewController', 'show', ['project_id' => $project['id']]));
}
}
1 change: 1 addition & 0 deletions app/Core/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
* @property \Kanboard\Model\TaskLinkModel $taskLinkModel
* @property \Kanboard\Model\TaskModificationModel $taskModificationModel
* @property \Kanboard\Model\TaskPositionModel $taskPositionModel
* @property \Kanboard\Model\TaskReorderModel $taskReorderModel
* @property \Kanboard\Model\TaskStatusModel $taskStatusModel
* @property \Kanboard\Model\TaskTagModel $taskTagModel
* @property \Kanboard\Model\TaskMetadataModel $taskMetadataModel
Expand Down
6 changes: 6 additions & 0 deletions app/Locale/bs_BA/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/ca_ES/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/cs_CZ/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/da_DK/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
'Destination swimlane' => 'Mål spor',
'Assign a category when the task is moved to a specific swimlane' => 'Tildele kategori når opgave flyttes til anført spor',
'Move the task to another swimlane when the category is changed' => 'Flytte opgave til andet spor når kategori ændres',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/de_DE/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/el_GR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/es_ES/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/fi_FI/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/fr_FR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
'Destination swimlane' => 'Swimlane de destination',
'Assign a category when the task is moved to a specific swimlane' => 'Assigner une catégorie lorsque la tâche est déplaçée dans une swimlane spécifique',
'Move the task to another swimlane when the category is changed' => 'Déplaçer la tâche dans une autre swimlane lorsque la catégorie est modifiée',
'Reorder this column by priority (ASC)' => 'Réorganiser cette colonne par priorité (ASC)',
'Reorder this column by priority (DESC)' => 'Réorganiser cette colonne par priorité (DESC)',
'Reorder this column by assignee and priority (ASC)' => 'Réorganiser cette colonne par assigné et par priorité (ASC)',
'Reorder this column by assignee and priority (DESC)' => 'Réorganiser cette colonne par assigné et par priorité (DESC)',
'Reorder this column by assignee (A-Z)' => 'Réorganiser cette colonne par assigné (A-Z)',
'Reorder this column by assignee (Z-A)' => 'Réorganiser cette colonne par assigné (Z-A)',
);
6 changes: 6 additions & 0 deletions app/Locale/hr_HR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/hu_HU/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/id_ID/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/it_IT/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/ja_JP/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/ko_KR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/my_MY/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/nb_NO/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/nl_NL/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/pl_PL/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/pt_BR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
'Destination swimlane' => 'Raia de destino',
'Assign a category when the task is moved to a specific swimlane' => 'Atribuir uma categoria quando a tarefa for movida para uma raia específica',
'Move the task to another swimlane when the category is changed' => 'Mover a tarefa para outra raia quando a categoria é alterada',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/pt_PT/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/ro_RO/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/ru_RU/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/sr_Latn_RS/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/sv_SE/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/th_TH/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/tr_TR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/uk_UA/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/vi_VN/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
// 'Destination swimlane' => '',
// 'Assign a category when the task is moved to a specific swimlane' => '',
// 'Move the task to another swimlane when the category is changed' => '',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
6 changes: 6 additions & 0 deletions app/Locale/zh_CN/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,4 +1392,10 @@
'Destination swimlane' => '目标泳道',
'Assign a category when the task is moved to a specific swimlane' => '将移动到指定泳道的任务设定分类',
'Move the task to another swimlane when the category is changed' => '当分类改变时将任务移动到另一个泳道',
// 'Reorder this column by priority (ASC)' => '',
// 'Reorder this column by priority (DESC)' => '',
// 'Reorder this column by assignee and priority (ASC)' => '',
// 'Reorder this column by assignee and priority (DESC)' => '',
// 'Reorder this column by assignee (A-Z)' => '',
// 'Reorder this column by assignee (Z-A)' => '',
);
Loading

0 comments on commit 0295388

Please sign in to comment.