summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkousu <nick@kousu.ca>2018-01-22 19:10:09 -0500
committerkousu <nick@kousu.ca>2018-01-25 11:09:22 -0500
commit602caf390d9fd2626030b8c0961389622e380816 (patch)
tree13ad31b4416f85c8fe7f372b8e61540bb5ef0703
parent3fbd751ad41f50871f8826a007488e87f286d237 (diff)
Set the correct swimlane/column ID when moving a task via its internal dialog.
Fixes https://github.com/kanboard/kanboard/issues/3114.
-rw-r--r--app/Template/task_move_position/show.php1
-rw-r--r--assets/js/components/task-move-position.js12
2 files changed, 11 insertions, 2 deletions
diff --git a/app/Template/task_move_position/show.php b/app/Template/task_move_position/show.php
index a73be785..dbbfdbd4 100644
--- a/app/Template/task_move_position/show.php
+++ b/app/Template/task_move_position/show.php
@@ -7,6 +7,7 @@
<?= $this->app->component('task-move-position', array(
'saveUrl' => $this->url->href('TaskMovePositionController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])),
'board' => $board,
+ 'task' => $task,
'swimlaneLabel' => t('Swimlane'),
'columnLabel' => t('Column'),
'positionLabel' => t('Position'),
diff --git a/assets/js/components/task-move-position.js b/assets/js/components/task-move-position.js
index e5a68b94..0d360e66 100644
--- a/assets/js/components/task-move-position.js
+++ b/assets/js/components/task-move-position.js
@@ -85,7 +85,11 @@ KB.component('task-move-position', function (containerElement, options) {
var swimlanes = [];
options.board.forEach(function(swimlane) {
- swimlanes.push({'value': swimlane.id, 'text': swimlane.name});
+ var option = {'value': swimlane.id, 'text': swimlane.name};
+ if(swimlane.id == options.task.swimlane_id) {
+ option.selected = "";
+ }
+ swimlanes.push(option);
});
return KB.dom('select')
@@ -102,7 +106,11 @@ KB.component('task-move-position', function (containerElement, options) {
options.board.forEach(function(swimlane) {
if (swimlaneId === swimlane.id) {
swimlane.columns.forEach(function(column) {
- columns.push({'value': column.id, 'text': column.title});
+ var option = {'value': column.id, 'text': column.title};
+ if(column.id == options.task.column_id) {
+ option.selected = "";
+ }
+ columns.push(option);
});
}
});