Rename all models

This commit is contained in:
Frederic Guillot
2016-05-28 19:48:22 -04:00
parent 936376ffe7
commit 14713b0ec7
411 changed files with 4145 additions and 4156 deletions

View File

@@ -3,9 +3,9 @@
namespace Kanboard\Export;
use Kanboard\Core\Base;
use Kanboard\Model\Task;
use Kanboard\Model\Subtask;
use Kanboard\Model\User;
use Kanboard\Model\TaskModel;
use Kanboard\Model\SubtaskModel;
use Kanboard\Model\UserModel;
/**
* Subtask Export
@@ -34,7 +34,7 @@ class SubtaskExport extends Base
*/
public function export($project_id, $from, $to)
{
$this->subtask_status = $this->subtask->getStatusList();
$this->subtask_status = $this->subtaskModel->getStatusList();
$subtasks = $this->getSubtasks($project_id, $from, $to);
$results = array($this->getColumns());
@@ -106,19 +106,19 @@ 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(SubtaskModel::TABLE)
->eq('project_id', $project_id)
->columns(
Subtask::TABLE.'.*',
User::TABLE.'.username AS assignee_username',
User::TABLE.'.name AS assignee_name',
Task::TABLE.'.title AS task_title'
SubtaskModel::TABLE.'.*',
UserModel::TABLE.'.username AS assignee_username',
UserModel::TABLE.'.name AS assignee_name',
TaskModel::TABLE.'.title AS task_title'
)
->gte('date_creation', $from)
->lte('date_creation', $to)
->join(Task::TABLE, 'id', 'task_id')
->join(User::TABLE, 'id', 'user_id')
->asc(Subtask::TABLE.'.id')
->join(TaskModel::TABLE, 'id', 'task_id')
->join(UserModel::TABLE, 'id', 'user_id')
->asc(SubtaskModel::TABLE.'.id')
->findAll();
}
}

View File

@@ -4,7 +4,7 @@ namespace Kanboard\Export;
use Kanboard\Core\Base;
use Kanboard\Core\DateParser;
use Kanboard\Model\Task;
use Kanboard\Model\TaskModel;
use PDO;
/**
@@ -27,7 +27,7 @@ class TaskExport extends Base
public function export($project_id, $from, $to)
{
$tasks = $this->getTasks($project_id, $from, $to);
$swimlanes = $this->swimlane->getList($project_id);
$swimlanes = $this->swimlaneModel->getList($project_id);
$results = array($this->getColumns());
foreach ($tasks as &$task) {
@@ -102,9 +102,9 @@ class TaskExport extends Base
*/
public function format(array &$task, array &$swimlanes)
{
$colors = $this->color->getList();
$colors = $this->colorModel->getList();
$task['is_active'] = $task['is_active'] == Task::STATUS_OPEN ? e('Open') : e('Closed');
$task['is_active'] = $task['is_active'] == TaskModel::STATUS_OPEN ? e('Open') : e('Closed');
$task['color_id'] = $colors[$task['color_id']];
$task['score'] = $task['score'] ?: 0;
$task['swimlane_id'] = isset($swimlanes[$task['swimlane_id']]) ? $swimlanes[$task['swimlane_id']] : '?';

View File

@@ -25,7 +25,7 @@ class TransitionExport extends Base
public function export($project_id, $from, $to)
{
$results = array($this->getColumns());
$transitions = $this->transition->getAllByProjectAndDate($project_id, $from, $to);
$transitions = $this->transitionModel->getAllByProjectAndDate($project_id, $from, $to);
foreach ($transitions as $transition) {
$results[] = $this->format($transition);
@@ -68,7 +68,7 @@ class TransitionExport extends Base
$transition['src_column'],
$transition['dst_column'],
$transition['name'] ?: $transition['username'],
date($this->config->get('application_datetime_format', DateParser::DATE_TIME_FORMAT), $transition['date']),
date($this->configModel->get('application_datetime_format', DateParser::DATE_TIME_FORMAT), $transition['date']),
round($transition['time_spent'] / 3600, 2)
);