From fe9f3ba707d1caf9348ae17e0566eabd505fbce2 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 8 Apr 2017 11:18:58 -0400 Subject: Add assignee restriction for custom project roles (dnd) --- app/Model/ColumnMoveRestrictionModel.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/Model/ColumnMoveRestrictionModel.php') 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, )); } -- cgit v1.2.3