diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-28 19:48:22 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-28 19:48:22 -0400 |
commit | 14713b0ec7ed93ca45578da069ad4e19a7d8addf (patch) | |
tree | 79972d53f6091a1ddb17f64a6a05a5523f5d5168 /app/Filter | |
parent | 936376ffe74c583d3cb819e98f53a85137fdf8bc (diff) |
Rename all models
Diffstat (limited to 'app/Filter')
37 files changed, 141 insertions, 141 deletions
diff --git a/app/Filter/ProjectActivityCreationDateFilter.php b/app/Filter/ProjectActivityCreationDateFilter.php index d0b7f754..451f6548 100644 --- a/app/Filter/ProjectActivityCreationDateFilter.php +++ b/app/Filter/ProjectActivityCreationDateFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\ProjectActivity; +use Kanboard\Model\ProjectActivityModel; /** * Filter activity events by creation date @@ -32,7 +32,7 @@ class ProjectActivityCreationDateFilter extends BaseDateFilter implements Filter */ public function apply() { - $this->applyDateFilter(ProjectActivity::TABLE.'.date_creation'); + $this->applyDateFilter(ProjectActivityModel::TABLE.'.date_creation'); return $this; } } diff --git a/app/Filter/ProjectActivityCreatorFilter.php b/app/Filter/ProjectActivityCreatorFilter.php index c95569d6..573238d8 100644 --- a/app/Filter/ProjectActivityCreatorFilter.php +++ b/app/Filter/ProjectActivityCreatorFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\ProjectActivity; +use Kanboard\Model\ProjectActivityModel; /** * Filter activity events by creator @@ -54,7 +54,7 @@ class ProjectActivityCreatorFilter extends BaseFilter implements FilterInterface public function apply() { if ($this->value === 'me') { - $this->query->eq(ProjectActivity::TABLE . '.creator_id', $this->currentUserId); + $this->query->eq(ProjectActivityModel::TABLE . '.creator_id', $this->currentUserId); } else { $this->query->beginOr(); $this->query->ilike('uc.username', '%'.$this->value.'%'); diff --git a/app/Filter/ProjectActivityProjectIdFilter.php b/app/Filter/ProjectActivityProjectIdFilter.php index bb4d8bd1..7146a057 100644 --- a/app/Filter/ProjectActivityProjectIdFilter.php +++ b/app/Filter/ProjectActivityProjectIdFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\ProjectActivity; +use Kanboard\Model\ProjectActivityModel; /** * Filter activity events by projectId @@ -32,7 +32,7 @@ class ProjectActivityProjectIdFilter extends BaseFilter implements FilterInterfa */ public function apply() { - $this->query->eq(ProjectActivity::TABLE.'.project_id', $this->value); + $this->query->eq(ProjectActivityModel::TABLE.'.project_id', $this->value); return $this; } } diff --git a/app/Filter/ProjectActivityProjectIdsFilter.php b/app/Filter/ProjectActivityProjectIdsFilter.php index 47cf0c25..70968f79 100644 --- a/app/Filter/ProjectActivityProjectIdsFilter.php +++ b/app/Filter/ProjectActivityProjectIdsFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\ProjectActivity; +use Kanboard\Model\ProjectActivityModel; /** * Filter activity events by projectIds @@ -33,9 +33,9 @@ class ProjectActivityProjectIdsFilter extends BaseFilter implements FilterInterf public function apply() { if (empty($this->value)) { - $this->query->eq(ProjectActivity::TABLE.'.project_id', 0); + $this->query->eq(ProjectActivityModel::TABLE.'.project_id', 0); } else { - $this->query->in(ProjectActivity::TABLE.'.project_id', $this->value); + $this->query->in(ProjectActivityModel::TABLE.'.project_id', $this->value); } return $this; diff --git a/app/Filter/ProjectActivityProjectNameFilter.php b/app/Filter/ProjectActivityProjectNameFilter.php index 0cf73657..b4872182 100644 --- a/app/Filter/ProjectActivityProjectNameFilter.php +++ b/app/Filter/ProjectActivityProjectNameFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Project; +use Kanboard\Model\ProjectModel; /** * Filter activity events by project name @@ -32,7 +32,7 @@ class ProjectActivityProjectNameFilter extends BaseFilter implements FilterInter */ public function apply() { - $this->query->ilike(Project::TABLE.'.name', '%'.$this->value.'%'); + $this->query->ilike(ProjectModel::TABLE.'.name', '%'.$this->value.'%'); return $this; } } diff --git a/app/Filter/ProjectActivityTaskIdFilter.php b/app/Filter/ProjectActivityTaskIdFilter.php index e99efe09..b8e074db 100644 --- a/app/Filter/ProjectActivityTaskIdFilter.php +++ b/app/Filter/ProjectActivityTaskIdFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\ProjectActivity; +use Kanboard\Model\ProjectActivityModel; /** * Filter activity events by taskId @@ -32,7 +32,7 @@ class ProjectActivityTaskIdFilter extends BaseFilter implements FilterInterface */ public function apply() { - $this->query->eq(ProjectActivity::TABLE.'.task_id', $this->value); + $this->query->eq(ProjectActivityModel::TABLE.'.task_id', $this->value); return $this; } } diff --git a/app/Filter/ProjectActivityTaskStatusFilter.php b/app/Filter/ProjectActivityTaskStatusFilter.php index 69e2c52d..2c98cabf 100644 --- a/app/Filter/ProjectActivityTaskStatusFilter.php +++ b/app/Filter/ProjectActivityTaskStatusFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter activity events by task status @@ -33,9 +33,9 @@ class ProjectActivityTaskStatusFilter extends BaseFilter implements FilterInterf public function apply() { if ($this->value === 'open') { - $this->query->eq(Task::TABLE.'.is_active', Task::STATUS_OPEN); + $this->query->eq(TaskModel::TABLE.'.is_active', TaskModel::STATUS_OPEN); } elseif ($this->value === 'closed') { - $this->query->eq(Task::TABLE.'.is_active', Task::STATUS_CLOSED); + $this->query->eq(TaskModel::TABLE.'.is_active', TaskModel::STATUS_CLOSED); } return $this; diff --git a/app/Filter/ProjectGroupRoleProjectFilter.php b/app/Filter/ProjectGroupRoleProjectFilter.php index b0950868..035931b3 100644 --- a/app/Filter/ProjectGroupRoleProjectFilter.php +++ b/app/Filter/ProjectGroupRoleProjectFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\ProjectGroupRole; +use Kanboard\Model\ProjectGroupRoleModel; /** * Filter ProjectGroupRole users by project @@ -32,7 +32,7 @@ class ProjectGroupRoleProjectFilter extends BaseFilter implements FilterInterfac */ public function apply() { - $this->query->eq(ProjectGroupRole::TABLE.'.project_id', $this->value); + $this->query->eq(ProjectGroupRoleModel::TABLE.'.project_id', $this->value); return $this; } } diff --git a/app/Filter/ProjectGroupRoleUsernameFilter.php b/app/Filter/ProjectGroupRoleUsernameFilter.php index c10855bc..9feac33f 100644 --- a/app/Filter/ProjectGroupRoleUsernameFilter.php +++ b/app/Filter/ProjectGroupRoleUsernameFilter.php @@ -3,9 +3,9 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\GroupMember; -use Kanboard\Model\ProjectGroupRole; -use Kanboard\Model\User; +use Kanboard\Model\GroupMemberModel; +use Kanboard\Model\ProjectGroupRoleModel; +use Kanboard\Model\UserModel; /** * Filter ProjectGroupRole users by username @@ -35,9 +35,9 @@ class ProjectGroupRoleUsernameFilter extends BaseFilter implements FilterInterfa public function apply() { $this->query - ->join(GroupMember::TABLE, 'group_id', 'group_id', ProjectGroupRole::TABLE) - ->join(User::TABLE, 'id', 'user_id', GroupMember::TABLE) - ->ilike(User::TABLE.'.username', $this->value.'%'); + ->join(GroupMemberModel::TABLE, 'group_id', 'group_id', ProjectGroupRoleModel::TABLE) + ->join(UserModel::TABLE, 'id', 'user_id', GroupMemberModel::TABLE) + ->ilike(UserModel::TABLE.'.username', $this->value.'%'); return $this; } diff --git a/app/Filter/ProjectIdsFilter.php b/app/Filter/ProjectIdsFilter.php index 641f7f18..9af9db5a 100644 --- a/app/Filter/ProjectIdsFilter.php +++ b/app/Filter/ProjectIdsFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Project; +use Kanboard\Model\ProjectModel; /** * Filter project by ids @@ -33,9 +33,9 @@ class ProjectIdsFilter extends BaseFilter implements FilterInterface public function apply() { if (empty($this->value)) { - $this->query->eq(Project::TABLE.'.id', 0); + $this->query->eq(ProjectModel::TABLE.'.id', 0); } else { - $this->query->in(Project::TABLE.'.id', $this->value); + $this->query->in(ProjectModel::TABLE.'.id', $this->value); } return $this; diff --git a/app/Filter/ProjectStatusFilter.php b/app/Filter/ProjectStatusFilter.php index a994600c..c1a06eff 100644 --- a/app/Filter/ProjectStatusFilter.php +++ b/app/Filter/ProjectStatusFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Project; +use Kanboard\Model\ProjectModel; /** * Filter project by status @@ -33,11 +33,11 @@ class ProjectStatusFilter extends BaseFilter implements FilterInterface public function apply() { if (is_int($this->value) || ctype_digit($this->value)) { - $this->query->eq(Project::TABLE.'.is_active', $this->value); + $this->query->eq(ProjectModel::TABLE.'.is_active', $this->value); } elseif ($this->value === 'inactive' || $this->value === 'closed' || $this->value === 'disabled') { - $this->query->eq(Project::TABLE.'.is_active', 0); + $this->query->eq(ProjectModel::TABLE.'.is_active', 0); } else { - $this->query->eq(Project::TABLE.'.is_active', 1); + $this->query->eq(ProjectModel::TABLE.'.is_active', 1); } return $this; diff --git a/app/Filter/ProjectTypeFilter.php b/app/Filter/ProjectTypeFilter.php index e085e2f6..6afcd293 100644 --- a/app/Filter/ProjectTypeFilter.php +++ b/app/Filter/ProjectTypeFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Project; +use Kanboard\Model\ProjectModel; /** * Filter project by type @@ -33,11 +33,11 @@ class ProjectTypeFilter extends BaseFilter implements FilterInterface public function apply() { if (is_int($this->value) || ctype_digit($this->value)) { - $this->query->eq(Project::TABLE.'.is_private', $this->value); + $this->query->eq(ProjectModel::TABLE.'.is_private', $this->value); } elseif ($this->value === 'private') { - $this->query->eq(Project::TABLE.'.is_private', Project::TYPE_PRIVATE); + $this->query->eq(ProjectModel::TABLE.'.is_private', ProjectModel::TYPE_PRIVATE); } else { - $this->query->eq(Project::TABLE.'.is_private', Project::TYPE_TEAM); + $this->query->eq(ProjectModel::TABLE.'.is_private', ProjectModel::TYPE_TEAM); } return $this; diff --git a/app/Filter/ProjectUserRoleProjectFilter.php b/app/Filter/ProjectUserRoleProjectFilter.php index 3b880df5..6952364e 100644 --- a/app/Filter/ProjectUserRoleProjectFilter.php +++ b/app/Filter/ProjectUserRoleProjectFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\ProjectUserRole; +use Kanboard\Model\ProjectUserRoleModel; /** * Filter ProjectUserRole users by project @@ -32,7 +32,7 @@ class ProjectUserRoleProjectFilter extends BaseFilter implements FilterInterface */ public function apply() { - $this->query->eq(ProjectUserRole::TABLE.'.project_id', $this->value); + $this->query->eq(ProjectUserRoleModel::TABLE.'.project_id', $this->value); return $this; } } diff --git a/app/Filter/ProjectUserRoleUsernameFilter.php b/app/Filter/ProjectUserRoleUsernameFilter.php index c00493a3..327d3d57 100644 --- a/app/Filter/ProjectUserRoleUsernameFilter.php +++ b/app/Filter/ProjectUserRoleUsernameFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\User; +use Kanboard\Model\UserModel; /** * Filter ProjectUserRole users by username @@ -33,8 +33,8 @@ class ProjectUserRoleUsernameFilter extends BaseFilter implements FilterInterfac public function apply() { $this->query - ->join(User::TABLE, 'id', 'user_id') - ->ilike(User::TABLE.'.username', $this->value.'%'); + ->join(UserModel::TABLE, 'id', 'user_id') + ->ilike(UserModel::TABLE.'.username', $this->value.'%'); return $this; } diff --git a/app/Filter/TaskAssigneeFilter.php b/app/Filter/TaskAssigneeFilter.php index 783d6a12..d6962a93 100644 --- a/app/Filter/TaskAssigneeFilter.php +++ b/app/Filter/TaskAssigneeFilter.php @@ -3,8 +3,8 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; -use Kanboard\Model\User; +use Kanboard\Model\TaskModel; +use Kanboard\Model\UserModel; /** * Filter tasks by assignee @@ -55,19 +55,19 @@ class TaskAssigneeFilter extends BaseFilter implements FilterInterface public function apply() { if (is_int($this->value) || ctype_digit($this->value)) { - $this->query->eq(Task::TABLE.'.owner_id', $this->value); + $this->query->eq(TaskModel::TABLE.'.owner_id', $this->value); } else { switch ($this->value) { case 'me': - $this->query->eq(Task::TABLE.'.owner_id', $this->currentUserId); + $this->query->eq(TaskModel::TABLE.'.owner_id', $this->currentUserId); break; case 'nobody': - $this->query->eq(Task::TABLE.'.owner_id', 0); + $this->query->eq(TaskModel::TABLE.'.owner_id', 0); break; default: $this->query->beginOr(); - $this->query->ilike(User::TABLE.'.username', '%'.$this->value.'%'); - $this->query->ilike(User::TABLE.'.name', '%'.$this->value.'%'); + $this->query->ilike(UserModel::TABLE.'.username', '%'.$this->value.'%'); + $this->query->ilike(UserModel::TABLE.'.name', '%'.$this->value.'%'); $this->query->closeOr(); } } diff --git a/app/Filter/TaskCategoryFilter.php b/app/Filter/TaskCategoryFilter.php index 517f24d9..35c52f69 100644 --- a/app/Filter/TaskCategoryFilter.php +++ b/app/Filter/TaskCategoryFilter.php @@ -3,8 +3,8 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Category; -use Kanboard\Model\Task; +use Kanboard\Model\CategoryModel; +use Kanboard\Model\TaskModel; /** * Filter tasks by category @@ -34,11 +34,11 @@ class TaskCategoryFilter extends BaseFilter implements FilterInterface public function apply() { if (is_int($this->value) || ctype_digit($this->value)) { - $this->query->eq(Task::TABLE.'.category_id', $this->value); + $this->query->eq(TaskModel::TABLE.'.category_id', $this->value); } elseif ($this->value === 'none') { - $this->query->eq(Task::TABLE.'.category_id', 0); + $this->query->eq(TaskModel::TABLE.'.category_id', 0); } else { - $this->query->eq(Category::TABLE.'.name', $this->value); + $this->query->eq(CategoryModel::TABLE.'.name', $this->value); } return $this; diff --git a/app/Filter/TaskColorFilter.php b/app/Filter/TaskColorFilter.php index 784162d4..2ddb47ce 100644 --- a/app/Filter/TaskColorFilter.php +++ b/app/Filter/TaskColorFilter.php @@ -3,8 +3,8 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Color; -use Kanboard\Model\Task; +use Kanboard\Model\ColorModel; +use Kanboard\Model\TaskModel; /** * Filter tasks by color @@ -18,7 +18,7 @@ class TaskColorFilter extends BaseFilter implements FilterInterface * Color object * * @access private - * @var Color + * @var ColorModel */ private $colorModel; @@ -26,10 +26,10 @@ class TaskColorFilter extends BaseFilter implements FilterInterface * Set color model object * * @access public - * @param Color $colorModel + * @param ColorModel $colorModel * @return TaskColorFilter */ - public function setColorModel(Color $colorModel) + public function setColorModel(ColorModel $colorModel) { $this->colorModel = $colorModel; return $this; @@ -54,7 +54,7 @@ class TaskColorFilter extends BaseFilter implements FilterInterface */ public function apply() { - $this->query->eq(Task::TABLE.'.color_id', $this->colorModel->find($this->value)); + $this->query->eq(TaskModel::TABLE.'.color_id', $this->colorModel->find($this->value)); return $this; } } diff --git a/app/Filter/TaskColumnFilter.php b/app/Filter/TaskColumnFilter.php index 9a4d4253..fa925b79 100644 --- a/app/Filter/TaskColumnFilter.php +++ b/app/Filter/TaskColumnFilter.php @@ -3,8 +3,8 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Column; -use Kanboard\Model\Task; +use Kanboard\Model\ColumnModel; +use Kanboard\Model\TaskModel; /** * Filter tasks by column @@ -34,9 +34,9 @@ class TaskColumnFilter extends BaseFilter implements FilterInterface public function apply() { if (is_int($this->value) || ctype_digit($this->value)) { - $this->query->eq(Task::TABLE.'.column_id', $this->value); + $this->query->eq(TaskModel::TABLE.'.column_id', $this->value); } else { - $this->query->eq(Column::TABLE.'.title', $this->value); + $this->query->eq(ColumnModel::TABLE.'.title', $this->value); } return $this; diff --git a/app/Filter/TaskCommentFilter.php b/app/Filter/TaskCommentFilter.php index 455098c2..52db5581 100644 --- a/app/Filter/TaskCommentFilter.php +++ b/app/Filter/TaskCommentFilter.php @@ -3,8 +3,8 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Comment; -use Kanboard\Model\Task; +use Kanboard\Model\CommentModel; +use Kanboard\Model\TaskModel; /** * Filter tasks by comment @@ -33,8 +33,8 @@ class TaskCommentFilter extends BaseFilter implements FilterInterface */ public function apply() { - $this->query->ilike(Comment::TABLE.'.comment', '%'.$this->value.'%'); - $this->query->join(Comment::TABLE, 'task_id', 'id', Task::TABLE); + $this->query->ilike(CommentModel::TABLE.'.comment', '%'.$this->value.'%'); + $this->query->join(CommentModel::TABLE, 'task_id', 'id', TaskModel::TABLE); return $this; } diff --git a/app/Filter/TaskCompletionDateFilter.php b/app/Filter/TaskCompletionDateFilter.php index f206a3e2..79b5e7d8 100644 --- a/app/Filter/TaskCompletionDateFilter.php +++ b/app/Filter/TaskCompletionDateFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by completion date @@ -32,7 +32,7 @@ class TaskCompletionDateFilter extends BaseDateFilter implements FilterInterface */ public function apply() { - $this->applyDateFilter(Task::TABLE.'.date_completed'); + $this->applyDateFilter(TaskModel::TABLE.'.date_completed'); return $this; } } diff --git a/app/Filter/TaskCreationDateFilter.php b/app/Filter/TaskCreationDateFilter.php index bb6efad6..db28ac88 100644 --- a/app/Filter/TaskCreationDateFilter.php +++ b/app/Filter/TaskCreationDateFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by creation date @@ -32,7 +32,7 @@ class TaskCreationDateFilter extends BaseDateFilter implements FilterInterface */ public function apply() { - $this->applyDateFilter(Task::TABLE.'.date_creation'); + $this->applyDateFilter(TaskModel::TABLE.'.date_creation'); return $this; } } diff --git a/app/Filter/TaskCreatorFilter.php b/app/Filter/TaskCreatorFilter.php index af35e6bc..611db189 100644 --- a/app/Filter/TaskCreatorFilter.php +++ b/app/Filter/TaskCreatorFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by creator @@ -54,14 +54,14 @@ class TaskCreatorFilter extends BaseFilter implements FilterInterface public function apply() { if (is_int($this->value) || ctype_digit($this->value)) { - $this->query->eq(Task::TABLE.'.creator_id', $this->value); + $this->query->eq(TaskModel::TABLE.'.creator_id', $this->value); } else { switch ($this->value) { case 'me': - $this->query->eq(Task::TABLE.'.creator_id', $this->currentUserId); + $this->query->eq(TaskModel::TABLE.'.creator_id', $this->currentUserId); break; case 'nobody': - $this->query->eq(Task::TABLE.'.creator_id', 0); + $this->query->eq(TaskModel::TABLE.'.creator_id', 0); break; default: $this->query->beginOr(); diff --git a/app/Filter/TaskDescriptionFilter.php b/app/Filter/TaskDescriptionFilter.php index 6dda58ae..c73c2f56 100644 --- a/app/Filter/TaskDescriptionFilter.php +++ b/app/Filter/TaskDescriptionFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by description @@ -32,7 +32,7 @@ class TaskDescriptionFilter extends BaseFilter implements FilterInterface */ public function apply() { - $this->query->ilike(Task::TABLE.'.description', '%'.$this->value.'%'); + $this->query->ilike(TaskModel::TABLE.'.description', '%'.$this->value.'%'); return $this; } } diff --git a/app/Filter/TaskDueDateFilter.php b/app/Filter/TaskDueDateFilter.php index e36efdd0..0de055bf 100644 --- a/app/Filter/TaskDueDateFilter.php +++ b/app/Filter/TaskDueDateFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by due date @@ -32,9 +32,9 @@ class TaskDueDateFilter extends BaseDateFilter implements FilterInterface */ public function apply() { - $this->query->neq(Task::TABLE.'.date_due', 0); - $this->query->notNull(Task::TABLE.'.date_due'); - $this->applyDateFilter(Task::TABLE.'.date_due'); + $this->query->neq(TaskModel::TABLE.'.date_due', 0); + $this->query->notNull(TaskModel::TABLE.'.date_due'); + $this->applyDateFilter(TaskModel::TABLE.'.date_due'); return $this; } diff --git a/app/Filter/TaskDueDateRangeFilter.php b/app/Filter/TaskDueDateRangeFilter.php index 10deb0d3..a6aefbe2 100644 --- a/app/Filter/TaskDueDateRangeFilter.php +++ b/app/Filter/TaskDueDateRangeFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by due date range @@ -32,8 +32,8 @@ class TaskDueDateRangeFilter extends BaseFilter implements FilterInterface */ public function apply() { - $this->query->gte(Task::TABLE.'.date_due', is_numeric($this->value[0]) ? $this->value[0] : strtotime($this->value[0])); - $this->query->lte(Task::TABLE.'.date_due', is_numeric($this->value[1]) ? $this->value[1] : strtotime($this->value[1])); + $this->query->gte(TaskModel::TABLE.'.date_due', is_numeric($this->value[0]) ? $this->value[0] : strtotime($this->value[0])); + $this->query->lte(TaskModel::TABLE.'.date_due', is_numeric($this->value[1]) ? $this->value[1] : strtotime($this->value[1])); return $this; } } diff --git a/app/Filter/TaskIdExclusionFilter.php b/app/Filter/TaskIdExclusionFilter.php index 8bfefb2b..20177b29 100644 --- a/app/Filter/TaskIdExclusionFilter.php +++ b/app/Filter/TaskIdExclusionFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Exclude task ids @@ -32,7 +32,7 @@ class TaskIdExclusionFilter extends BaseFilter implements FilterInterface */ public function apply() { - $this->query->notin(Task::TABLE.'.id', $this->value); + $this->query->notin(TaskModel::TABLE.'.id', $this->value); return $this; } } diff --git a/app/Filter/TaskIdFilter.php b/app/Filter/TaskIdFilter.php index 87bac794..fdf668b6 100644 --- a/app/Filter/TaskIdFilter.php +++ b/app/Filter/TaskIdFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by id @@ -32,7 +32,7 @@ class TaskIdFilter extends BaseFilter implements FilterInterface */ public function apply() { - $this->query->eq(Task::TABLE.'.id', $this->value); + $this->query->eq(TaskModel::TABLE.'.id', $this->value); return $this; } } diff --git a/app/Filter/TaskLinkFilter.php b/app/Filter/TaskLinkFilter.php index 18a13a09..98cd597f 100644 --- a/app/Filter/TaskLinkFilter.php +++ b/app/Filter/TaskLinkFilter.php @@ -3,9 +3,9 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Link; -use Kanboard\Model\Task; -use Kanboard\Model\TaskLink; +use Kanboard\Model\LinkModel; +use Kanboard\Model\TaskModel; +use Kanboard\Model\TaskLinkModel; use PicoDb\Database; use PicoDb\Table; @@ -60,9 +60,9 @@ class TaskLinkFilter extends BaseFilter implements FilterInterface $task_ids = $this->getSubQuery()->findAllByColumn('task_id'); if (! empty($task_ids)) { - $this->query->in(Task::TABLE.'.id', $task_ids); + $this->query->in(TaskModel::TABLE.'.id', $task_ids); } else { - $this->query->eq(Task::TABLE.'.id', 0); // No match + $this->query->eq(TaskModel::TABLE.'.id', 0); // No match } } @@ -74,12 +74,12 @@ class TaskLinkFilter extends BaseFilter implements FilterInterface */ protected function getSubQuery() { - return $this->db->table(TaskLink::TABLE) + return $this->db->table(TaskLinkModel::TABLE) ->columns( - TaskLink::TABLE.'.task_id', - Link::TABLE.'.label' + TaskLinkModel::TABLE.'.task_id', + LinkModel::TABLE.'.label' ) - ->join(Link::TABLE, 'id', 'link_id', TaskLink::TABLE) - ->ilike(Link::TABLE.'.label', $this->value); + ->join(LinkModel::TABLE, 'id', 'link_id', TaskLinkModel::TABLE) + ->ilike(LinkModel::TABLE.'.label', $this->value); } } diff --git a/app/Filter/TaskModificationDateFilter.php b/app/Filter/TaskModificationDateFilter.php index 5036e9c1..316f1835 100644 --- a/app/Filter/TaskModificationDateFilter.php +++ b/app/Filter/TaskModificationDateFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by modification date @@ -32,7 +32,7 @@ class TaskModificationDateFilter extends BaseDateFilter implements FilterInterfa */ public function apply() { - $this->applyDateFilter(Task::TABLE.'.date_modification'); + $this->applyDateFilter(TaskModel::TABLE.'.date_modification'); return $this; } } diff --git a/app/Filter/TaskProjectFilter.php b/app/Filter/TaskProjectFilter.php index e432efee..0b5a336b 100644 --- a/app/Filter/TaskProjectFilter.php +++ b/app/Filter/TaskProjectFilter.php @@ -3,8 +3,8 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Project; -use Kanboard\Model\Task; +use Kanboard\Model\ProjectModel; +use Kanboard\Model\TaskModel; /** * Filter tasks by project @@ -34,9 +34,9 @@ class TaskProjectFilter extends BaseFilter implements FilterInterface public function apply() { if (is_int($this->value) || ctype_digit($this->value)) { - $this->query->eq(Task::TABLE.'.project_id', $this->value); + $this->query->eq(TaskModel::TABLE.'.project_id', $this->value); } else { - $this->query->ilike(Project::TABLE.'.name', $this->value); + $this->query->ilike(ProjectModel::TABLE.'.name', $this->value); } return $this; diff --git a/app/Filter/TaskProjectsFilter.php b/app/Filter/TaskProjectsFilter.php index 47636b1d..2b6b16cb 100644 --- a/app/Filter/TaskProjectsFilter.php +++ b/app/Filter/TaskProjectsFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by project ids @@ -33,9 +33,9 @@ class TaskProjectsFilter extends BaseFilter implements FilterInterface public function apply() { if (empty($this->value)) { - $this->query->eq(Task::TABLE.'.project_id', 0); + $this->query->eq(TaskModel::TABLE.'.project_id', 0); } else { - $this->query->in(Task::TABLE.'.project_id', $this->value); + $this->query->in(TaskModel::TABLE.'.project_id', $this->value); } return $this; diff --git a/app/Filter/TaskReferenceFilter.php b/app/Filter/TaskReferenceFilter.php index 4ad47dd5..27c838f8 100644 --- a/app/Filter/TaskReferenceFilter.php +++ b/app/Filter/TaskReferenceFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by reference @@ -32,7 +32,7 @@ class TaskReferenceFilter extends BaseFilter implements FilterInterface */ public function apply() { - $this->query->eq(Task::TABLE.'.reference', $this->value); + $this->query->eq(TaskModel::TABLE.'.reference', $this->value); return $this; } } diff --git a/app/Filter/TaskStartDateFilter.php b/app/Filter/TaskStartDateFilter.php index dd30762b..d5abedb5 100644 --- a/app/Filter/TaskStartDateFilter.php +++ b/app/Filter/TaskStartDateFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by start date @@ -32,7 +32,7 @@ class TaskStartDateFilter extends BaseDateFilter implements FilterInterface */ public function apply() { - $this->applyDateFilter(Task::TABLE.'.date_started'); + $this->applyDateFilter(TaskModel::TABLE.'.date_started'); return $this; } } diff --git a/app/Filter/TaskStatusFilter.php b/app/Filter/TaskStatusFilter.php index 0ba4361e..a55532cb 100644 --- a/app/Filter/TaskStatusFilter.php +++ b/app/Filter/TaskStatusFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by status @@ -33,9 +33,9 @@ class TaskStatusFilter extends BaseFilter implements FilterInterface public function apply() { if ($this->value === 'open' || $this->value === 'closed') { - $this->query->eq(Task::TABLE.'.is_active', $this->value === 'open' ? Task::STATUS_OPEN : Task::STATUS_CLOSED); + $this->query->eq(TaskModel::TABLE.'.is_active', $this->value === 'open' ? TaskModel::STATUS_OPEN : TaskModel::STATUS_CLOSED); } else { - $this->query->eq(Task::TABLE.'.is_active', $this->value); + $this->query->eq(TaskModel::TABLE.'.is_active', $this->value); } return $this; diff --git a/app/Filter/TaskSubtaskAssigneeFilter.php b/app/Filter/TaskSubtaskAssigneeFilter.php index 4c757315..46553a3d 100644 --- a/app/Filter/TaskSubtaskAssigneeFilter.php +++ b/app/Filter/TaskSubtaskAssigneeFilter.php @@ -3,9 +3,9 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Subtask; -use Kanboard\Model\Task; -use Kanboard\Model\User; +use Kanboard\Model\SubtaskModel; +use Kanboard\Model\TaskModel; +use Kanboard\Model\UserModel; use PicoDb\Database; use PicoDb\Table; @@ -81,9 +81,9 @@ class TaskSubtaskAssigneeFilter extends BaseFilter implements FilterInterface $task_ids = $this->getSubQuery()->findAllByColumn('task_id'); if (! empty($task_ids)) { - $this->query->in(Task::TABLE.'.id', $task_ids); + $this->query->in(TaskModel::TABLE.'.id', $task_ids); } else { - $this->query->eq(Task::TABLE.'.id', 0); // No match + $this->query->eq(TaskModel::TABLE.'.id', 0); // No match } } @@ -95,15 +95,15 @@ class TaskSubtaskAssigneeFilter extends BaseFilter implements FilterInterface */ protected function getSubQuery() { - $subquery = $this->db->table(Subtask::TABLE) + $subquery = $this->db->table(SubtaskModel::TABLE) ->columns( - Subtask::TABLE.'.user_id', - Subtask::TABLE.'.task_id', - User::TABLE.'.name', - User::TABLE.'.username' + SubtaskModel::TABLE.'.user_id', + SubtaskModel::TABLE.'.task_id', + UserModel::TABLE.'.name', + UserModel::TABLE.'.username' ) - ->join(User::TABLE, 'id', 'user_id', Subtask::TABLE) - ->neq(Subtask::TABLE.'.status', Subtask::STATUS_DONE); + ->join(UserModel::TABLE, 'id', 'user_id', SubtaskModel::TABLE) + ->neq(SubtaskModel::TABLE.'.status', SubtaskModel::STATUS_DONE); return $this->applySubQueryFilter($subquery); } @@ -118,19 +118,19 @@ class TaskSubtaskAssigneeFilter extends BaseFilter implements FilterInterface protected function applySubQueryFilter(Table $subquery) { if (is_int($this->value) || ctype_digit($this->value)) { - $subquery->eq(Subtask::TABLE.'.user_id', $this->value); + $subquery->eq(SubtaskModel::TABLE.'.user_id', $this->value); } else { switch ($this->value) { case 'me': - $subquery->eq(Subtask::TABLE.'.user_id', $this->currentUserId); + $subquery->eq(SubtaskModel::TABLE.'.user_id', $this->currentUserId); break; case 'nobody': - $subquery->eq(Subtask::TABLE.'.user_id', 0); + $subquery->eq(SubtaskModel::TABLE.'.user_id', 0); break; default: $subquery->beginOr(); - $subquery->ilike(User::TABLE.'.username', $this->value.'%'); - $subquery->ilike(User::TABLE.'.name', '%'.$this->value.'%'); + $subquery->ilike(UserModel::TABLE.'.username', $this->value.'%'); + $subquery->ilike(UserModel::TABLE.'.name', '%'.$this->value.'%'); $subquery->closeOr(); } } diff --git a/app/Filter/TaskSwimlaneFilter.php b/app/Filter/TaskSwimlaneFilter.php index 4e030244..07243969 100644 --- a/app/Filter/TaskSwimlaneFilter.php +++ b/app/Filter/TaskSwimlaneFilter.php @@ -3,9 +3,9 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Project; -use Kanboard\Model\Swimlane; -use Kanboard\Model\Task; +use Kanboard\Model\ProjectModel; +use Kanboard\Model\SwimlaneModel; +use Kanboard\Model\TaskModel; /** * Filter tasks by swimlane @@ -35,13 +35,13 @@ class TaskSwimlaneFilter extends BaseFilter implements FilterInterface public function apply() { if (is_int($this->value) || ctype_digit($this->value)) { - $this->query->eq(Task::TABLE.'.swimlane_id', $this->value); + $this->query->eq(TaskModel::TABLE.'.swimlane_id', $this->value); } elseif ($this->value === 'default') { - $this->query->eq(Task::TABLE.'.swimlane_id', 0); + $this->query->eq(TaskModel::TABLE.'.swimlane_id', 0); } else { $this->query->beginOr(); - $this->query->ilike(Swimlane::TABLE.'.name', $this->value); - $this->query->ilike(Project::TABLE.'.default_swimlane', $this->value); + $this->query->ilike(SwimlaneModel::TABLE.'.name', $this->value); + $this->query->ilike(ProjectModel::TABLE.'.default_swimlane', $this->value); $this->query->closeOr(); } diff --git a/app/Filter/TaskTitleFilter.php b/app/Filter/TaskTitleFilter.php index 9853369c..4e3a2df1 100644 --- a/app/Filter/TaskTitleFilter.php +++ b/app/Filter/TaskTitleFilter.php @@ -3,7 +3,7 @@ namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; -use Kanboard\Model\Task; +use Kanboard\Model\TaskModel; /** * Filter tasks by title @@ -34,11 +34,11 @@ class TaskTitleFilter extends BaseFilter implements FilterInterface { if (ctype_digit($this->value) || (strlen($this->value) > 1 && $this->value{0} === '#' && ctype_digit(substr($this->value, 1)))) { $this->query->beginOr(); - $this->query->eq(Task::TABLE.'.id', str_replace('#', '', $this->value)); - $this->query->ilike(Task::TABLE.'.title', '%'.$this->value.'%'); + $this->query->eq(TaskModel::TABLE.'.id', str_replace('#', '', $this->value)); + $this->query->ilike(TaskModel::TABLE.'.title', '%'.$this->value.'%'); $this->query->closeOr(); } else { - $this->query->ilike(Task::TABLE.'.title', '%'.$this->value.'%'); + $this->query->ilike(TaskModel::TABLE.'.title', '%'.$this->value.'%'); } return $this; |