summaryrefslogtreecommitdiff
path: root/app/Model/ColumnMoveRestrictionModel.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-04-08 11:18:58 -0400
committerFrederic Guillot <fred@kanboard.net>2017-04-08 11:18:58 -0400
commitfe9f3ba707d1caf9348ae17e0566eabd505fbce2 (patch)
treedff1f604fb6c9461642847c4b6684327806e0c8d /app/Model/ColumnMoveRestrictionModel.php
parent9a8c6d6493191a09720a634c58c230dba1cafeeb (diff)
Add assignee restriction for custom project roles (dnd)
Diffstat (limited to 'app/Model/ColumnMoveRestrictionModel.php')
-rw-r--r--app/Model/ColumnMoveRestrictionModel.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Model/ColumnMoveRestrictionModel.php b/app/Model/ColumnMoveRestrictionModel.php
index c2603efd..9d2b2842 100644
--- a/app/Model/ColumnMoveRestrictionModel.php
+++ b/app/Model/ColumnMoveRestrictionModel.php
@@ -31,6 +31,7 @@ class ColumnMoveRestrictionModel extends Base
self::TABLE.'.role_id',
self::TABLE.'.src_column_id',
self::TABLE.'.dst_column_id',
+ self::TABLE.'.only_assigned',
'pr.role',
'sc.title as src_column_title',
'dc.title as dst_column_title'
@@ -59,6 +60,7 @@ class ColumnMoveRestrictionModel extends Base
self::TABLE.'.role_id',
self::TABLE.'.src_column_id',
self::TABLE.'.dst_column_id',
+ self::TABLE.'.only_assigned',
'pr.role',
'sc.title as src_column_title',
'dc.title as dst_column_title'
@@ -81,7 +83,7 @@ class ColumnMoveRestrictionModel extends Base
{
return $this->db
->table(self::TABLE)
- ->columns(self::TABLE.'.src_column_id', self::TABLE.'.dst_column_id')
+ ->columns(self::TABLE.'.src_column_id', self::TABLE.'.dst_column_id', self::TABLE.'.only_assigned')
->left(ProjectRoleModel::TABLE, 'pr', 'role_id', self::TABLE, 'role_id')
->eq(self::TABLE.'.project_id', $project_id)
->eq('pr.role', $role)
@@ -95,9 +97,10 @@ class ColumnMoveRestrictionModel extends Base
* @param int $role_id
* @param int $src_column_id
* @param int $dst_column_id
+ * @param bool $only_assigned
* @return bool|int
*/
- public function create($project_id, $role_id, $src_column_id, $dst_column_id)
+ public function create($project_id, $role_id, $src_column_id, $dst_column_id, $only_assigned = false)
{
return $this->db
->table(self::TABLE)
@@ -106,6 +109,7 @@ class ColumnMoveRestrictionModel extends Base
'role_id' => $role_id,
'src_column_id' => $src_column_id,
'dst_column_id' => $dst_column_id,
+ 'only_assigned' => (int) $only_assigned,
));
}