summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Helper/ProjectRoleHelper.php11
-rw-r--r--app/Template/board/table_tasks.php2
2 files changed, 8 insertions, 5 deletions
diff --git a/app/Helper/ProjectRoleHelper.php b/app/Helper/ProjectRoleHelper.php
index e1808be5..87f7fed2 100644
--- a/app/Helper/ProjectRoleHelper.php
+++ b/app/Helper/ProjectRoleHelper.php
@@ -36,7 +36,7 @@ class ProjectRoleHelper extends Base
public function isDraggable(array &$task)
{
if ($task['is_active'] == 1 && $this->helper->user->hasProjectAccess('BoardViewController', 'save', $task['project_id'])) {
- return $this->isSortableColumn($task['project_id'], $task['column_id'], 'src_column_id');
+ return $this->isSortableColumn($task['project_id'], $task['column_id']);
}
return false;
@@ -47,10 +47,9 @@ class ProjectRoleHelper extends Base
*
* @param int $project_id
* @param int $column_id
- * @param string $field
* @return bool
*/
- public function isSortableColumn($project_id, $column_id, $field)
+ public function isSortableColumn($project_id, $column_id)
{
$role = $this->getProjectUserRole($project_id);
@@ -58,7 +57,7 @@ class ProjectRoleHelper extends Base
$sortableColumns = $this->columnMoveRestrictionCacheDecorator->getSortableColumns($project_id, $role);
foreach ($sortableColumns as $column) {
- if ($column[$field] == $column_id) {
+ if ($column['src_column_id'] == $column_id || $column['dst_column_id'] == $column_id) {
return true;
}
}
@@ -92,6 +91,10 @@ class ProjectRoleHelper extends Base
if ($column['src_column_id'] == $src_column_id && $column['dst_column_id'] == $dst_column_id) {
return true;
}
+
+ if ($column['dst_column_id'] == $src_column_id && $column['src_column_id'] == $dst_column_id) {
+ return true;
+ }
}
return empty($sortableColumns);
diff --git a/app/Template/board/table_tasks.php b/app/Template/board/table_tasks.php
index a22f581b..e03ca90c 100644
--- a/app/Template/board/table_tasks.php
+++ b/app/Template/board/table_tasks.php
@@ -9,7 +9,7 @@
<!-- tasks list -->
<div
- class="board-task-list board-column-expanded <?= $this->projectRole->isSortableColumn($column['project_id'], $column['id'], 'dst_column_id') ? 'sortable-column' : '' ?>"
+ class="board-task-list board-column-expanded <?= $this->projectRole->isSortableColumn($column['project_id'], $column['id']) ? 'sortable-column' : '' ?>"
data-column-id="<?= $column['id'] ?>"
data-swimlane-id="<?= $swimlane['id'] ?>"
data-task-limit="<?= $column['task_limit'] ?>">