summaryrefslogtreecommitdiff
path: root/app/Helper/ProjectRoleHelper.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-09-19 20:45:36 -0400
committerFrederic Guillot <fred@kanboard.net>2016-09-19 20:45:36 -0400
commit91c1109b0562a5d6da15345fb5be44c57ca29076 (patch)
tree785595f823496a57fb16bf5f2e7bfe1cb0e1262a /app/Helper/ProjectRoleHelper.php
parentc328bcf840f2fe21e87246b10fb8c75dfa640d1d (diff)
Change column move restriction behavior
Diffstat (limited to 'app/Helper/ProjectRoleHelper.php')
-rw-r--r--app/Helper/ProjectRoleHelper.php11
1 files changed, 7 insertions, 4 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);