diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-02-07 18:36:16 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-02-07 18:36:16 -0500 |
commit | fa6d19928abcfa03861e264222dbe46ad2fdc15a (patch) | |
tree | 598861577bba3a0a65e0bd47eecfb29f11f167ae /app/Model | |
parent | f83fc5bee4b93f1209bce14d1d7eaa50fdc6870b (diff) |
Rename subtask model
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/Base.php | 2 | ||||
-rw-r--r-- | app/Model/ProjectActivity.php | 4 | ||||
-rw-r--r-- | app/Model/Subtask.php (renamed from app/Model/SubTask.php) | 12 | ||||
-rw-r--r-- | app/Model/SubtaskExport.php | 8 | ||||
-rw-r--r-- | app/Model/SubtaskTimeTracking.php | 8 | ||||
-rw-r--r-- | app/Model/TaskDuplication.php | 2 |
6 files changed, 18 insertions, 18 deletions
diff --git a/app/Model/Base.php b/app/Model/Base.php index e29588a2..cf5f2e9f 100644 --- a/app/Model/Base.php +++ b/app/Model/Base.php @@ -29,7 +29,7 @@ use Pimple\Container; * @property \Model\Project $project * @property \Model\ProjectDuplication $projectDuplication * @property \Model\ProjectPermission $projectPermission - * @property \Model\SubTask $subTask + * @property \Model\Subtask $subtask * @property \Model\SubtaskHistory $subtaskHistory * @property \Model\Swimlane $swimlane * @property \Model\Task $task diff --git a/app/Model/ProjectActivity.php b/app/Model/ProjectActivity.php index a046dffb..8ef35a97 100644 --- a/app/Model/ProjectActivity.php +++ b/app/Model/ProjectActivity.php @@ -162,9 +162,9 @@ class ProjectActivity extends Base return t('%s moved the task #%d to the column "%s"', $event['author'], $event['task']['id'], $event['task']['column_title']); case Task::EVENT_MOVE_POSITION: return t('%s moved the task #%d to the position %d in the column "%s"', $event['author'], $event['task']['id'], $event['task']['position'], $event['task']['column_title']); - case SubTask::EVENT_UPDATE: + case Subtask::EVENT_UPDATE: return t('%s updated a subtask for the task #%d', $event['author'], $event['task']['id']); - case SubTask::EVENT_CREATE: + case Subtask::EVENT_CREATE: return t('%s created a subtask for the task #%d', $event['author'], $event['task']['id']); case Comment::EVENT_UPDATE: return t('%s updated a comment on the task #%d', $event['author'], $event['task']['id']); diff --git a/app/Model/SubTask.php b/app/Model/Subtask.php index dd243b1f..9ecd2c6a 100644 --- a/app/Model/SubTask.php +++ b/app/Model/Subtask.php @@ -12,7 +12,7 @@ use SimpleValidator\Validators; * @package model * @author Frederic Guillot */ -class SubTask extends Base +class Subtask extends Base { /** * SQL table name @@ -93,16 +93,16 @@ class SubTask extends Base */ public function getUserQuery($user_id, array $status) { - return $this->db->table(SubTask::TABLE) + return $this->db->table(Subtask::TABLE) ->columns( - SubTask::TABLE.'.*', + Subtask::TABLE.'.*', Task::TABLE.'.project_id', Task::TABLE.'.color_id', Project::TABLE.'.name AS project_name' ) ->eq('user_id', $user_id) ->eq(Project::TABLE.'.is_active', Project::ACTIVE) - ->in(SubTask::TABLE.'.status', $status) + ->in(Subtask::TABLE.'.status', $status) ->join(Task::TABLE, 'id', 'task_id') ->join(Project::TABLE, 'id', 'project_id', Task::TABLE) ->filter(array($this, 'addStatusName')); @@ -283,7 +283,7 @@ class SubTask extends Base { return $this->db->transaction(function ($db) use ($src_task_id, $dst_task_id) { - $subtasks = $db->table(SubTask::TABLE) + $subtasks = $db->table(Subtask::TABLE) ->columns('title', 'time_estimated') ->eq('task_id', $src_task_id) ->asc('id') // Explicit sorting for postgresql @@ -293,7 +293,7 @@ class SubTask extends Base $subtask['task_id'] = $dst_task_id; - if (! $db->table(SubTask::TABLE)->save($subtask)) { + if (! $db->table(Subtask::TABLE)->save($subtask)) { return false; } } diff --git a/app/Model/SubtaskExport.php b/app/Model/SubtaskExport.php index 1e728c05..23dcc019 100644 --- a/app/Model/SubtaskExport.php +++ b/app/Model/SubtaskExport.php @@ -29,7 +29,7 @@ class SubtaskExport extends Base */ public function export($project_id, $from, $to) { - $this->subtask_status = $this->subTask->getStatusList(); + $this->subtask_status = $this->subtask->getStatusList(); $subtasks = $this->getSubtasks($project_id, $from, $to); $results = array($this->getColumns()); @@ -101,10 +101,10 @@ class SubtaskExport extends Base $to = $this->dateParser->removeTimeFromTimestamp(strtotime('+1 day', $this->dateParser->getTimestamp($to))); } - return $this->db->table(SubTask::TABLE) + return $this->db->table(Subtask::TABLE) ->eq('project_id', $project_id) ->columns( - SubTask::TABLE.'.*', + Subtask::TABLE.'.*', User::TABLE.'.username AS assignee_username', User::TABLE.'.name AS assignee_name', Task::TABLE.'.title AS task_title' @@ -113,7 +113,7 @@ class SubtaskExport extends Base ->lte('date_creation', $to) ->join(Task::TABLE, 'id', 'task_id') ->join(User::TABLE, 'id', 'user_id') - ->asc(SubTask::TABLE.'.id') + ->asc(Subtask::TABLE.'.id') ->findAll(); } } diff --git a/app/Model/SubtaskTimeTracking.php b/app/Model/SubtaskTimeTracking.php index 5c8a7c81..cc839ddb 100644 --- a/app/Model/SubtaskTimeTracking.php +++ b/app/Model/SubtaskTimeTracking.php @@ -33,13 +33,13 @@ class SubtaskTimeTracking extends Base self::TABLE.'.subtask_id', self::TABLE.'.end', self::TABLE.'.start', - SubTask::TABLE.'.task_id', - SubTask::TABLE.'.title AS subtask_title', + Subtask::TABLE.'.task_id', + Subtask::TABLE.'.title AS subtask_title', Task::TABLE.'.title AS task_title', Task::TABLE.'.project_id' ) - ->join(SubTask::TABLE, 'id', 'subtask_id') - ->join(Task::TABLE, 'id', 'task_id', SubTask::TABLE) + ->join(Subtask::TABLE, 'id', 'subtask_id') + ->join(Task::TABLE, 'id', 'task_id', Subtask::TABLE) ->eq(self::TABLE.'.user_id', $user_id); } diff --git a/app/Model/TaskDuplication.php b/app/Model/TaskDuplication.php index 172edb9f..bd593dc1 100644 --- a/app/Model/TaskDuplication.php +++ b/app/Model/TaskDuplication.php @@ -158,7 +158,7 @@ class TaskDuplication extends Base $new_task_id = $this->taskCreation->create($values); if ($new_task_id) { - $this->subTask->duplicate($task_id, $new_task_id); + $this->subtask->duplicate($task_id, $new_task_id); } return $new_task_id; |