Rename all models
This commit is contained in:
@@ -29,12 +29,12 @@ class ActionApi extends Base
|
||||
|
||||
public function removeAction($action_id)
|
||||
{
|
||||
return $this->action->remove($action_id);
|
||||
return $this->actionModel->remove($action_id);
|
||||
}
|
||||
|
||||
public function getActions($project_id)
|
||||
{
|
||||
return $this->action->getAllByProject($project_id);
|
||||
return $this->actionModel->getAllByProject($project_id);
|
||||
}
|
||||
|
||||
public function createAction($project_id, $event_name, $action_name, array $params)
|
||||
@@ -82,6 +82,6 @@ class ActionApi extends Base
|
||||
}
|
||||
}
|
||||
|
||||
return $this->action->create($values);
|
||||
return $this->actionModel->create($values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class AppApi extends Base
|
||||
{
|
||||
public function getTimezone()
|
||||
{
|
||||
return $this->timezone->getCurrentTimezone();
|
||||
return $this->timezoneModel->getCurrentTimezone();
|
||||
}
|
||||
|
||||
public function getVersion()
|
||||
@@ -24,17 +24,17 @@ class AppApi extends Base
|
||||
|
||||
public function getDefaultTaskColor()
|
||||
{
|
||||
return $this->color->getDefaultColor();
|
||||
return $this->colorModel->getDefaultColor();
|
||||
}
|
||||
|
||||
public function getDefaultTaskColors()
|
||||
{
|
||||
return $this->color->getDefaultColors();
|
||||
return $this->colorModel->getDefaultColors();
|
||||
}
|
||||
|
||||
public function getColorList()
|
||||
{
|
||||
return $this->color->getList();
|
||||
return $this->colorModel->getList();
|
||||
}
|
||||
|
||||
public function getApplicationRoles()
|
||||
|
||||
@@ -28,7 +28,7 @@ class AuthApi extends BaseApi
|
||||
|
||||
if ($this->isUserAuthenticated($username, $password)) {
|
||||
$this->checkProcedurePermission(true, $method);
|
||||
$this->userSession->initialize($this->user->getByUsername($username));
|
||||
$this->userSession->initialize($this->userModel->getByUsername($username));
|
||||
} elseif ($this->isAppAuthenticated($username, $password)) {
|
||||
$this->checkProcedurePermission(false, $method);
|
||||
} else {
|
||||
@@ -48,7 +48,7 @@ class AuthApi extends BaseApi
|
||||
private function isUserAuthenticated($username, $password)
|
||||
{
|
||||
return $username !== 'jsonrpc' &&
|
||||
! $this->userLocking->isLocked($username) &&
|
||||
! $this->userLockingModel->isLocked($username) &&
|
||||
$this->authenticationManager->passwordAuthentication($username, $password);
|
||||
}
|
||||
|
||||
@@ -77,6 +77,6 @@ class AuthApi extends BaseApi
|
||||
return API_AUTHENTICATION_TOKEN;
|
||||
}
|
||||
|
||||
return $this->config->get('api_token');
|
||||
return $this->configModel->get('api_token');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ abstract class BaseApi extends Base
|
||||
|
||||
public function checkProjectPermission($project_id)
|
||||
{
|
||||
if ($this->userSession->isLogged() && ! $this->projectPermission->isUserAllowed($project_id, $this->userSession->getId())) {
|
||||
if ($this->userSession->isLogged() && ! $this->projectPermissionModel->isUserAllowed($project_id, $this->userSession->getId())) {
|
||||
throw new AccessDeniedException('Permission denied');
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ abstract class BaseApi extends Base
|
||||
public function checkTaskPermission($task_id)
|
||||
{
|
||||
if ($this->userSession->isLogged()) {
|
||||
$this->checkProjectPermission($this->taskFinder->getProjectId($task_id));
|
||||
$this->checkProjectPermission($this->taskFinderModel->getProjectId($task_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ abstract class BaseApi extends Base
|
||||
{
|
||||
if (! empty($task)) {
|
||||
$task['url'] = $this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), '', true);
|
||||
$task['color'] = $this->color->getColorProperties($task['color_id']);
|
||||
$task['color'] = $this->colorModel->getColorProperties($task['color_id']);
|
||||
}
|
||||
|
||||
return $task;
|
||||
|
||||
@@ -13,6 +13,6 @@ class BoardApi extends BaseApi
|
||||
public function getBoard($project_id)
|
||||
{
|
||||
$this->checkProjectPermission($project_id);
|
||||
return $this->board->getBoard($project_id);
|
||||
return $this->boardModel->getBoard($project_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,17 +14,17 @@ class CategoryApi extends Base
|
||||
{
|
||||
public function getCategory($category_id)
|
||||
{
|
||||
return $this->category->getById($category_id);
|
||||
return $this->categoryModel->getById($category_id);
|
||||
}
|
||||
|
||||
public function getAllCategories($project_id)
|
||||
{
|
||||
return $this->category->getAll($project_id);
|
||||
return $this->categoryModel->getAll($project_id);
|
||||
}
|
||||
|
||||
public function removeCategory($category_id)
|
||||
{
|
||||
return $this->category->remove($category_id);
|
||||
return $this->categoryModel->remove($category_id);
|
||||
}
|
||||
|
||||
public function createCategory($project_id, $name)
|
||||
@@ -35,7 +35,7 @@ class CategoryApi extends Base
|
||||
);
|
||||
|
||||
list($valid, ) = $this->categoryValidator->validateCreation($values);
|
||||
return $valid ? $this->category->create($values) : false;
|
||||
return $valid ? $this->categoryModel->create($values) : false;
|
||||
}
|
||||
|
||||
public function updateCategory($id, $name)
|
||||
@@ -46,6 +46,6 @@ class CategoryApi extends Base
|
||||
);
|
||||
|
||||
list($valid, ) = $this->categoryValidator->validateModification($values);
|
||||
return $valid && $this->category->update($values);
|
||||
return $valid && $this->categoryModel->update($values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,31 +12,31 @@ class ColumnApi extends BaseApi
|
||||
{
|
||||
public function getColumns($project_id)
|
||||
{
|
||||
return $this->column->getAll($project_id);
|
||||
return $this->columnModel->getAll($project_id);
|
||||
}
|
||||
|
||||
public function getColumn($column_id)
|
||||
{
|
||||
return $this->column->getById($column_id);
|
||||
return $this->columnModel->getById($column_id);
|
||||
}
|
||||
|
||||
public function updateColumn($column_id, $title, $task_limit = 0, $description = '')
|
||||
{
|
||||
return $this->column->update($column_id, $title, $task_limit, $description);
|
||||
return $this->columnModel->update($column_id, $title, $task_limit, $description);
|
||||
}
|
||||
|
||||
public function addColumn($project_id, $title, $task_limit = 0, $description = '')
|
||||
{
|
||||
return $this->column->create($project_id, $title, $task_limit, $description);
|
||||
return $this->columnModel->create($project_id, $title, $task_limit, $description);
|
||||
}
|
||||
|
||||
public function removeColumn($column_id)
|
||||
{
|
||||
return $this->column->remove($column_id);
|
||||
return $this->columnModel->remove($column_id);
|
||||
}
|
||||
|
||||
public function changeColumnPosition($project_id, $column_id, $position)
|
||||
{
|
||||
return $this->column->changePosition($project_id, $column_id, $position);
|
||||
return $this->columnModel->changePosition($project_id, $column_id, $position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,17 +14,17 @@ class CommentApi extends Base
|
||||
{
|
||||
public function getComment($comment_id)
|
||||
{
|
||||
return $this->comment->getById($comment_id);
|
||||
return $this->commentModel->getById($comment_id);
|
||||
}
|
||||
|
||||
public function getAllComments($task_id)
|
||||
{
|
||||
return $this->comment->getAll($task_id);
|
||||
return $this->commentModel->getAll($task_id);
|
||||
}
|
||||
|
||||
public function removeComment($comment_id)
|
||||
{
|
||||
return $this->comment->remove($comment_id);
|
||||
return $this->commentModel->remove($comment_id);
|
||||
}
|
||||
|
||||
public function createComment($task_id, $user_id, $content, $reference = '')
|
||||
@@ -38,7 +38,7 @@ class CommentApi extends Base
|
||||
|
||||
list($valid, ) = $this->commentValidator->validateCreation($values);
|
||||
|
||||
return $valid ? $this->comment->create($values) : false;
|
||||
return $valid ? $this->commentModel->create($values) : false;
|
||||
}
|
||||
|
||||
public function updateComment($id, $content)
|
||||
@@ -49,6 +49,6 @@ class CommentApi extends Base
|
||||
);
|
||||
|
||||
list($valid, ) = $this->commentValidator->validateModification($values);
|
||||
return $valid && $this->comment->update($values);
|
||||
return $valid && $this->commentModel->update($values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,18 +14,18 @@ class FileApi extends BaseApi
|
||||
{
|
||||
public function getTaskFile($file_id)
|
||||
{
|
||||
return $this->taskFile->getById($file_id);
|
||||
return $this->taskFileModel->getById($file_id);
|
||||
}
|
||||
|
||||
public function getAllTaskFiles($task_id)
|
||||
{
|
||||
return $this->taskFile->getAll($task_id);
|
||||
return $this->taskFileModel->getAll($task_id);
|
||||
}
|
||||
|
||||
public function downloadTaskFile($file_id)
|
||||
{
|
||||
try {
|
||||
$file = $this->taskFile->getById($file_id);
|
||||
$file = $this->taskFileModel->getById($file_id);
|
||||
|
||||
if (! empty($file)) {
|
||||
return base64_encode($this->objectStorage->get($file['path']));
|
||||
@@ -40,7 +40,7 @@ class FileApi extends BaseApi
|
||||
public function createTaskFile($project_id, $task_id, $filename, $blob)
|
||||
{
|
||||
try {
|
||||
return $this->taskFile->uploadContent($task_id, $filename, $blob);
|
||||
return $this->taskFileModel->uploadContent($task_id, $filename, $blob);
|
||||
} catch (ObjectStorageException $e) {
|
||||
$this->logger->error($e->getMessage());
|
||||
return false;
|
||||
@@ -49,12 +49,12 @@ class FileApi extends BaseApi
|
||||
|
||||
public function removeTaskFile($file_id)
|
||||
{
|
||||
return $this->taskFile->remove($file_id);
|
||||
return $this->taskFileModel->remove($file_id);
|
||||
}
|
||||
|
||||
public function removeAllTaskFiles($task_id)
|
||||
{
|
||||
return $this->taskFile->removeAll($task_id);
|
||||
return $this->taskFileModel->removeAll($task_id);
|
||||
}
|
||||
|
||||
// Deprecated procedures
|
||||
|
||||
@@ -14,7 +14,7 @@ class GroupApi extends Base
|
||||
{
|
||||
public function createGroup($name, $external_id = '')
|
||||
{
|
||||
return $this->group->create($name, $external_id);
|
||||
return $this->groupModel->create($name, $external_id);
|
||||
}
|
||||
|
||||
public function updateGroup($group_id, $name = null, $external_id = null)
|
||||
@@ -31,21 +31,21 @@ class GroupApi extends Base
|
||||
}
|
||||
}
|
||||
|
||||
return $this->group->update($values);
|
||||
return $this->groupModel->update($values);
|
||||
}
|
||||
|
||||
public function removeGroup($group_id)
|
||||
{
|
||||
return $this->group->remove($group_id);
|
||||
return $this->groupModel->remove($group_id);
|
||||
}
|
||||
|
||||
public function getGroup($group_id)
|
||||
{
|
||||
return $this->group->getById($group_id);
|
||||
return $this->groupModel->getById($group_id);
|
||||
}
|
||||
|
||||
public function getAllGroups()
|
||||
{
|
||||
return $this->group->getAll();
|
||||
return $this->groupModel->getAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,26 +14,26 @@ class GroupMemberApi extends Base
|
||||
{
|
||||
public function getMemberGroups($user_id)
|
||||
{
|
||||
return $this->groupMember->getGroups($user_id);
|
||||
return $this->groupMemberModel->getGroups($user_id);
|
||||
}
|
||||
|
||||
public function getGroupMembers($group_id)
|
||||
{
|
||||
return $this->groupMember->getMembers($group_id);
|
||||
return $this->groupMemberModel->getMembers($group_id);
|
||||
}
|
||||
|
||||
public function addGroupMember($group_id, $user_id)
|
||||
{
|
||||
return $this->groupMember->addUser($group_id, $user_id);
|
||||
return $this->groupMemberModel->addUser($group_id, $user_id);
|
||||
}
|
||||
|
||||
public function removeGroupMember($group_id, $user_id)
|
||||
{
|
||||
return $this->groupMember->removeUser($group_id, $user_id);
|
||||
return $this->groupMemberModel->removeUser($group_id, $user_id);
|
||||
}
|
||||
|
||||
public function isGroupMember($group_id, $user_id)
|
||||
{
|
||||
return $this->groupMember->isMember($group_id, $user_id);
|
||||
return $this->groupMemberModel->isMember($group_id, $user_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class LinkApi extends Base
|
||||
*/
|
||||
public function getLinkById($link_id)
|
||||
{
|
||||
return $this->link->getById($link_id);
|
||||
return $this->linkModel->getById($link_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ class LinkApi extends Base
|
||||
*/
|
||||
public function getLinkByLabel($label)
|
||||
{
|
||||
return $this->link->getByLabel($label);
|
||||
return $this->linkModel->getByLabel($label);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ class LinkApi extends Base
|
||||
*/
|
||||
public function getOppositeLinkId($link_id)
|
||||
{
|
||||
return $this->link->getOppositeLinkId($link_id);
|
||||
return $this->linkModel->getOppositeLinkId($link_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,7 +56,7 @@ class LinkApi extends Base
|
||||
*/
|
||||
public function getAllLinks()
|
||||
{
|
||||
return $this->link->getAll();
|
||||
return $this->linkModel->getAll();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,7 +75,7 @@ class LinkApi extends Base
|
||||
);
|
||||
|
||||
list($valid, ) = $this->linkValidator->validateCreation($values);
|
||||
return $valid ? $this->link->create($label, $opposite_label) : false;
|
||||
return $valid ? $this->linkModel->create($label, $opposite_label) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,7 +96,7 @@ class LinkApi extends Base
|
||||
);
|
||||
|
||||
list($valid, ) = $this->linkValidator->validateModification($values);
|
||||
return $valid && $this->link->update($values);
|
||||
return $valid && $this->linkModel->update($values);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,6 +108,6 @@ class LinkApi extends Base
|
||||
*/
|
||||
public function removeLink($link_id)
|
||||
{
|
||||
return $this->link->remove($link_id);
|
||||
return $this->linkModel->remove($link_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Kanboard\Api;
|
||||
|
||||
use Kanboard\Model\Subtask as SubtaskModel;
|
||||
use Kanboard\Model\SubtaskModel;
|
||||
|
||||
/**
|
||||
* Me API controller
|
||||
@@ -20,25 +20,25 @@ class MeApi extends BaseApi
|
||||
public function getMyDashboard()
|
||||
{
|
||||
$user_id = $this->userSession->getId();
|
||||
$projects = $this->project->getQueryColumnStats($this->projectPermission->getActiveProjectIds($user_id))->findAll();
|
||||
$tasks = $this->taskFinder->getUserQuery($user_id)->findAll();
|
||||
$projects = $this->projectModel->getQueryColumnStats($this->projectPermissionModel->getActiveProjectIds($user_id))->findAll();
|
||||
$tasks = $this->taskFinderModel->getUserQuery($user_id)->findAll();
|
||||
|
||||
return array(
|
||||
'projects' => $this->formatProjects($projects),
|
||||
'tasks' => $this->formatTasks($tasks),
|
||||
'subtasks' => $this->subtask->getUserQuery($user_id, array(SubTaskModel::STATUS_TODO, SubtaskModel::STATUS_INPROGRESS))->findAll(),
|
||||
'subtasks' => $this->subtaskModel->getUserQuery($user_id, array(SubtaskModel::STATUS_TODO, SubtaskModel::STATUS_INPROGRESS))->findAll(),
|
||||
);
|
||||
}
|
||||
|
||||
public function getMyActivityStream()
|
||||
{
|
||||
$project_ids = $this->projectPermission->getActiveProjectIds($this->userSession->getId());
|
||||
$project_ids = $this->projectPermissionModel->getActiveProjectIds($this->userSession->getId());
|
||||
return $this->helper->projectActivity->getProjectsEvents($project_ids, 100);
|
||||
}
|
||||
|
||||
public function createMyPrivateProject($name, $description = null)
|
||||
{
|
||||
if ($this->config->get('disable_private_project', 0) == 1) {
|
||||
if ($this->configModel->get('disable_private_project', 0) == 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -49,23 +49,23 @@ class MeApi extends BaseApi
|
||||
);
|
||||
|
||||
list($valid, ) = $this->projectValidator->validateCreation($values);
|
||||
return $valid ? $this->project->create($values, $this->userSession->getId(), true) : false;
|
||||
return $valid ? $this->projectModel->create($values, $this->userSession->getId(), true) : false;
|
||||
}
|
||||
|
||||
public function getMyProjectsList()
|
||||
{
|
||||
return $this->projectUserRole->getProjectsByUser($this->userSession->getId());
|
||||
return $this->projectUserRoleModel->getProjectsByUser($this->userSession->getId());
|
||||
}
|
||||
|
||||
public function getMyOverdueTasks()
|
||||
{
|
||||
return $this->taskFinder->getOverdueTasksByUser($this->userSession->getId());
|
||||
return $this->taskFinderModel->getOverdueTasksByUser($this->userSession->getId());
|
||||
}
|
||||
|
||||
public function getMyProjects()
|
||||
{
|
||||
$project_ids = $this->projectPermission->getActiveProjectIds($this->userSession->getId());
|
||||
$projects = $this->project->getAllByIds($project_ids);
|
||||
$project_ids = $this->projectPermissionModel->getActiveProjectIds($this->userSession->getId());
|
||||
$projects = $this->projectModel->getAllByIds($project_ids);
|
||||
|
||||
return $this->formatProjects($projects);
|
||||
}
|
||||
|
||||
@@ -13,42 +13,42 @@ class ProjectApi extends BaseApi
|
||||
public function getProjectById($project_id)
|
||||
{
|
||||
$this->checkProjectPermission($project_id);
|
||||
return $this->formatProject($this->project->getById($project_id));
|
||||
return $this->formatProject($this->projectModel->getById($project_id));
|
||||
}
|
||||
|
||||
public function getProjectByName($name)
|
||||
{
|
||||
return $this->formatProject($this->project->getByName($name));
|
||||
return $this->formatProject($this->projectModel->getByName($name));
|
||||
}
|
||||
|
||||
public function getAllProjects()
|
||||
{
|
||||
return $this->formatProjects($this->project->getAll());
|
||||
return $this->formatProjects($this->projectModel->getAll());
|
||||
}
|
||||
|
||||
public function removeProject($project_id)
|
||||
{
|
||||
return $this->project->remove($project_id);
|
||||
return $this->projectModel->remove($project_id);
|
||||
}
|
||||
|
||||
public function enableProject($project_id)
|
||||
{
|
||||
return $this->project->enable($project_id);
|
||||
return $this->projectModel->enable($project_id);
|
||||
}
|
||||
|
||||
public function disableProject($project_id)
|
||||
{
|
||||
return $this->project->disable($project_id);
|
||||
return $this->projectModel->disable($project_id);
|
||||
}
|
||||
|
||||
public function enableProjectPublicAccess($project_id)
|
||||
{
|
||||
return $this->project->enablePublicAccess($project_id);
|
||||
return $this->projectModel->enablePublicAccess($project_id);
|
||||
}
|
||||
|
||||
public function disableProjectPublicAccess($project_id)
|
||||
{
|
||||
return $this->project->disablePublicAccess($project_id);
|
||||
return $this->projectModel->disablePublicAccess($project_id);
|
||||
}
|
||||
|
||||
public function getProjectActivities(array $project_ids)
|
||||
@@ -70,7 +70,7 @@ class ProjectApi extends BaseApi
|
||||
);
|
||||
|
||||
list($valid, ) = $this->projectValidator->validateCreation($values);
|
||||
return $valid ? $this->project->create($values) : false;
|
||||
return $valid ? $this->projectModel->create($values) : false;
|
||||
}
|
||||
|
||||
public function updateProject($id, $name, $description = null)
|
||||
@@ -82,6 +82,6 @@ class ProjectApi extends BaseApi
|
||||
);
|
||||
|
||||
list($valid, ) = $this->projectValidator->validateModification($values);
|
||||
return $valid && $this->project->update($values);
|
||||
return $valid && $this->projectModel->update($values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,42 +15,42 @@ class ProjectPermissionApi extends Base
|
||||
{
|
||||
public function getProjectUsers($project_id)
|
||||
{
|
||||
return $this->projectUserRole->getAllUsers($project_id);
|
||||
return $this->projectUserRoleModel->getAllUsers($project_id);
|
||||
}
|
||||
|
||||
public function getAssignableUsers($project_id, $prepend_unassigned = false)
|
||||
{
|
||||
return $this->projectUserRole->getAssignableUsersList($project_id, $prepend_unassigned);
|
||||
return $this->projectUserRoleModel->getAssignableUsersList($project_id, $prepend_unassigned);
|
||||
}
|
||||
|
||||
public function addProjectUser($project_id, $user_id, $role = Role::PROJECT_MEMBER)
|
||||
{
|
||||
return $this->projectUserRole->addUser($project_id, $user_id, $role);
|
||||
return $this->projectUserRoleModel->addUser($project_id, $user_id, $role);
|
||||
}
|
||||
|
||||
public function addProjectGroup($project_id, $group_id, $role = Role::PROJECT_MEMBER)
|
||||
{
|
||||
return $this->projectGroupRole->addGroup($project_id, $group_id, $role);
|
||||
return $this->projectGroupRoleModel->addGroup($project_id, $group_id, $role);
|
||||
}
|
||||
|
||||
public function removeProjectUser($project_id, $user_id)
|
||||
{
|
||||
return $this->projectUserRole->removeUser($project_id, $user_id);
|
||||
return $this->projectUserRoleModel->removeUser($project_id, $user_id);
|
||||
}
|
||||
|
||||
public function removeProjectGroup($project_id, $group_id)
|
||||
{
|
||||
return $this->projectGroupRole->removeGroup($project_id, $group_id);
|
||||
return $this->projectGroupRoleModel->removeGroup($project_id, $group_id);
|
||||
}
|
||||
|
||||
public function changeProjectUserRole($project_id, $user_id, $role)
|
||||
{
|
||||
return $this->projectUserRole->changeUserRole($project_id, $user_id, $role);
|
||||
return $this->projectUserRoleModel->changeUserRole($project_id, $user_id, $role);
|
||||
}
|
||||
|
||||
public function changeProjectGroupRole($project_id, $group_id, $role)
|
||||
{
|
||||
return $this->projectGroupRole->changeGroupRole($project_id, $group_id, $role);
|
||||
return $this->projectGroupRoleModel->changeGroupRole($project_id, $group_id, $role);
|
||||
}
|
||||
|
||||
// Deprecated
|
||||
|
||||
@@ -14,17 +14,17 @@ class SubtaskApi extends Base
|
||||
{
|
||||
public function getSubtask($subtask_id)
|
||||
{
|
||||
return $this->subtask->getById($subtask_id);
|
||||
return $this->subtaskModel->getById($subtask_id);
|
||||
}
|
||||
|
||||
public function getAllSubtasks($task_id)
|
||||
{
|
||||
return $this->subtask->getAll($task_id);
|
||||
return $this->subtaskModel->getAll($task_id);
|
||||
}
|
||||
|
||||
public function removeSubtask($subtask_id)
|
||||
{
|
||||
return $this->subtask->remove($subtask_id);
|
||||
return $this->subtaskModel->remove($subtask_id);
|
||||
}
|
||||
|
||||
public function createSubtask($task_id, $title, $user_id = 0, $time_estimated = 0, $time_spent = 0, $status = 0)
|
||||
@@ -39,7 +39,7 @@ class SubtaskApi extends Base
|
||||
);
|
||||
|
||||
list($valid, ) = $this->subtaskValidator->validateCreation($values);
|
||||
return $valid ? $this->subtask->create($values) : false;
|
||||
return $valid ? $this->subtaskModel->create($values) : false;
|
||||
}
|
||||
|
||||
public function updateSubtask($id, $task_id, $title = null, $user_id = null, $time_estimated = null, $time_spent = null, $status = null)
|
||||
@@ -61,6 +61,6 @@ class SubtaskApi extends Base
|
||||
}
|
||||
|
||||
list($valid, ) = $this->subtaskValidator->validateApiModification($values);
|
||||
return $valid && $this->subtask->update($values);
|
||||
return $valid && $this->subtaskModel->update($values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,37 +14,37 @@ class SwimlaneApi extends Base
|
||||
{
|
||||
public function getActiveSwimlanes($project_id)
|
||||
{
|
||||
return $this->swimlane->getSwimlanes($project_id);
|
||||
return $this->swimlaneModel->getSwimlanes($project_id);
|
||||
}
|
||||
|
||||
public function getAllSwimlanes($project_id)
|
||||
{
|
||||
return $this->swimlane->getAll($project_id);
|
||||
return $this->swimlaneModel->getAll($project_id);
|
||||
}
|
||||
|
||||
public function getSwimlaneById($swimlane_id)
|
||||
{
|
||||
return $this->swimlane->getById($swimlane_id);
|
||||
return $this->swimlaneModel->getById($swimlane_id);
|
||||
}
|
||||
|
||||
public function getSwimlaneByName($project_id, $name)
|
||||
{
|
||||
return $this->swimlane->getByName($project_id, $name);
|
||||
return $this->swimlaneModel->getByName($project_id, $name);
|
||||
}
|
||||
|
||||
public function getSwimlane($swimlane_id)
|
||||
{
|
||||
return $this->swimlane->getById($swimlane_id);
|
||||
return $this->swimlaneModel->getById($swimlane_id);
|
||||
}
|
||||
|
||||
public function getDefaultSwimlane($project_id)
|
||||
{
|
||||
return $this->swimlane->getDefault($project_id);
|
||||
return $this->swimlaneModel->getDefault($project_id);
|
||||
}
|
||||
|
||||
public function addSwimlane($project_id, $name, $description = '')
|
||||
{
|
||||
return $this->swimlane->create(array('project_id' => $project_id, 'name' => $name, 'description' => $description));
|
||||
return $this->swimlaneModel->create(array('project_id' => $project_id, 'name' => $name, 'description' => $description));
|
||||
}
|
||||
|
||||
public function updateSwimlane($swimlane_id, $name, $description = null)
|
||||
@@ -55,26 +55,26 @@ class SwimlaneApi extends Base
|
||||
$values['description'] = $description;
|
||||
}
|
||||
|
||||
return $this->swimlane->update($values);
|
||||
return $this->swimlaneModel->update($values);
|
||||
}
|
||||
|
||||
public function removeSwimlane($project_id, $swimlane_id)
|
||||
{
|
||||
return $this->swimlane->remove($project_id, $swimlane_id);
|
||||
return $this->swimlaneModel->remove($project_id, $swimlane_id);
|
||||
}
|
||||
|
||||
public function disableSwimlane($project_id, $swimlane_id)
|
||||
{
|
||||
return $this->swimlane->disable($project_id, $swimlane_id);
|
||||
return $this->swimlaneModel->disable($project_id, $swimlane_id);
|
||||
}
|
||||
|
||||
public function enableSwimlane($project_id, $swimlane_id)
|
||||
{
|
||||
return $this->swimlane->enable($project_id, $swimlane_id);
|
||||
return $this->swimlaneModel->enable($project_id, $swimlane_id);
|
||||
}
|
||||
|
||||
public function changeSwimlanePosition($project_id, $swimlane_id, $position)
|
||||
{
|
||||
return $this->swimlane->changePosition($project_id, $swimlane_id, $position);
|
||||
return $this->swimlaneModel->changePosition($project_id, $swimlane_id, $position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Kanboard\Api;
|
||||
|
||||
use Kanboard\Filter\TaskProjectFilter;
|
||||
use Kanboard\Model\Task as TaskModel;
|
||||
use Kanboard\Model\TaskModel;
|
||||
|
||||
/**
|
||||
* Task API controller
|
||||
@@ -22,63 +22,63 @@ class TaskApi extends BaseApi
|
||||
public function getTask($task_id)
|
||||
{
|
||||
$this->checkTaskPermission($task_id);
|
||||
return $this->formatTask($this->taskFinder->getById($task_id));
|
||||
return $this->formatTask($this->taskFinderModel->getById($task_id));
|
||||
}
|
||||
|
||||
public function getTaskByReference($project_id, $reference)
|
||||
{
|
||||
$this->checkProjectPermission($project_id);
|
||||
return $this->formatTask($this->taskFinder->getByReference($project_id, $reference));
|
||||
return $this->formatTask($this->taskFinderModel->getByReference($project_id, $reference));
|
||||
}
|
||||
|
||||
public function getAllTasks($project_id, $status_id = TaskModel::STATUS_OPEN)
|
||||
{
|
||||
$this->checkProjectPermission($project_id);
|
||||
return $this->formatTasks($this->taskFinder->getAll($project_id, $status_id));
|
||||
return $this->formatTasks($this->taskFinderModel->getAll($project_id, $status_id));
|
||||
}
|
||||
|
||||
public function getOverdueTasks()
|
||||
{
|
||||
return $this->taskFinder->getOverdueTasks();
|
||||
return $this->taskFinderModel->getOverdueTasks();
|
||||
}
|
||||
|
||||
public function getOverdueTasksByProject($project_id)
|
||||
{
|
||||
$this->checkProjectPermission($project_id);
|
||||
return $this->taskFinder->getOverdueTasksByProject($project_id);
|
||||
return $this->taskFinderModel->getOverdueTasksByProject($project_id);
|
||||
}
|
||||
|
||||
public function openTask($task_id)
|
||||
{
|
||||
$this->checkTaskPermission($task_id);
|
||||
return $this->taskStatus->open($task_id);
|
||||
return $this->taskStatusModel->open($task_id);
|
||||
}
|
||||
|
||||
public function closeTask($task_id)
|
||||
{
|
||||
$this->checkTaskPermission($task_id);
|
||||
return $this->taskStatus->close($task_id);
|
||||
return $this->taskStatusModel->close($task_id);
|
||||
}
|
||||
|
||||
public function removeTask($task_id)
|
||||
{
|
||||
return $this->task->remove($task_id);
|
||||
return $this->taskModel->remove($task_id);
|
||||
}
|
||||
|
||||
public function moveTaskPosition($project_id, $task_id, $column_id, $position, $swimlane_id = 0)
|
||||
{
|
||||
$this->checkProjectPermission($project_id);
|
||||
return $this->taskPosition->movePosition($project_id, $task_id, $column_id, $position, $swimlane_id);
|
||||
return $this->taskPositionModel->movePosition($project_id, $task_id, $column_id, $position, $swimlane_id);
|
||||
}
|
||||
|
||||
public function moveTaskToProject($task_id, $project_id, $swimlane_id = null, $column_id = null, $category_id = null, $owner_id = null)
|
||||
{
|
||||
return $this->taskDuplication->moveToProject($task_id, $project_id, $swimlane_id, $column_id, $category_id, $owner_id);
|
||||
return $this->taskDuplicationModel->moveToProject($task_id, $project_id, $swimlane_id, $column_id, $category_id, $owner_id);
|
||||
}
|
||||
|
||||
public function duplicateTaskToProject($task_id, $project_id, $swimlane_id = null, $column_id = null, $category_id = null, $owner_id = null)
|
||||
{
|
||||
return $this->taskDuplication->duplicateToProject($task_id, $project_id, $swimlane_id, $column_id, $category_id, $owner_id);
|
||||
return $this->taskDuplicationModel->duplicateToProject($task_id, $project_id, $swimlane_id, $column_id, $category_id, $owner_id);
|
||||
}
|
||||
|
||||
public function createTask($title, $project_id, $color_id = '', $column_id = 0, $owner_id = 0, $creator_id = 0,
|
||||
@@ -88,7 +88,7 @@ class TaskApi extends BaseApi
|
||||
{
|
||||
$this->checkProjectPermission($project_id);
|
||||
|
||||
if ($owner_id !== 0 && ! $this->projectPermission->isAssignable($project_id, $owner_id)) {
|
||||
if ($owner_id !== 0 && ! $this->projectPermissionModel->isAssignable($project_id, $owner_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class TaskApi extends BaseApi
|
||||
|
||||
list($valid, ) = $this->taskValidator->validateCreation($values);
|
||||
|
||||
return $valid ? $this->taskCreation->create($values) : false;
|
||||
return $valid ? $this->taskCreationModel->create($values) : false;
|
||||
}
|
||||
|
||||
public function updateTask($id, $title = null, $color_id = null, $owner_id = null,
|
||||
@@ -129,13 +129,13 @@ class TaskApi extends BaseApi
|
||||
{
|
||||
$this->checkTaskPermission($id);
|
||||
|
||||
$project_id = $this->taskFinder->getProjectId($id);
|
||||
$project_id = $this->taskFinderModel->getProjectId($id);
|
||||
|
||||
if ($project_id === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($owner_id !== null && $owner_id != 0 && ! $this->projectPermission->isAssignable($project_id, $owner_id)) {
|
||||
if ($owner_id !== null && $owner_id != 0 && ! $this->projectPermissionModel->isAssignable($project_id, $owner_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -164,6 +164,6 @@ class TaskApi extends BaseApi
|
||||
}
|
||||
|
||||
list($valid) = $this->taskValidator->validateApiModification($values);
|
||||
return $valid && $this->taskModification->update($values);
|
||||
return $valid && $this->taskModificationModel->update($values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class TaskLinkApi extends Base
|
||||
*/
|
||||
public function getTaskLinkById($task_link_id)
|
||||
{
|
||||
return $this->taskLink->getById($task_link_id);
|
||||
return $this->taskLinkModel->getById($task_link_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ class TaskLinkApi extends Base
|
||||
*/
|
||||
public function getAllTaskLinks($task_id)
|
||||
{
|
||||
return $this->taskLink->getAll($task_id);
|
||||
return $this->taskLinkModel->getAll($task_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ class TaskLinkApi extends Base
|
||||
*/
|
||||
public function createTaskLink($task_id, $opposite_task_id, $link_id)
|
||||
{
|
||||
return $this->taskLink->create($task_id, $opposite_task_id, $link_id);
|
||||
return $this->taskLinkModel->create($task_id, $opposite_task_id, $link_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,7 +62,7 @@ class TaskLinkApi extends Base
|
||||
*/
|
||||
public function updateTaskLink($task_link_id, $task_id, $opposite_task_id, $link_id)
|
||||
{
|
||||
return $this->taskLink->update($task_link_id, $task_id, $opposite_task_id, $link_id);
|
||||
return $this->taskLinkModel->update($task_link_id, $task_id, $opposite_task_id, $link_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,6 +74,6 @@ class TaskLinkApi extends Base
|
||||
*/
|
||||
public function removeTaskLink($task_link_id)
|
||||
{
|
||||
return $this->taskLink->remove($task_link_id);
|
||||
return $this->taskLinkModel->remove($task_link_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,37 +19,37 @@ class UserApi extends Base
|
||||
{
|
||||
public function getUser($user_id)
|
||||
{
|
||||
return $this->user->getById($user_id);
|
||||
return $this->userModel->getById($user_id);
|
||||
}
|
||||
|
||||
public function getUserByName($username)
|
||||
{
|
||||
return $this->user->getByUsername($username);
|
||||
return $this->userModel->getByUsername($username);
|
||||
}
|
||||
|
||||
public function getAllUsers()
|
||||
{
|
||||
return $this->user->getAll();
|
||||
return $this->userModel->getAll();
|
||||
}
|
||||
|
||||
public function removeUser($user_id)
|
||||
{
|
||||
return $this->user->remove($user_id);
|
||||
return $this->userModel->remove($user_id);
|
||||
}
|
||||
|
||||
public function disableUser($user_id)
|
||||
{
|
||||
return $this->user->disable($user_id);
|
||||
return $this->userModel->disable($user_id);
|
||||
}
|
||||
|
||||
public function enableUser($user_id)
|
||||
{
|
||||
return $this->user->enable($user_id);
|
||||
return $this->userModel->enable($user_id);
|
||||
}
|
||||
|
||||
public function isActiveUser($user_id)
|
||||
{
|
||||
return $this->user->isActive($user_id);
|
||||
return $this->userModel->isActive($user_id);
|
||||
}
|
||||
|
||||
public function createUser($username, $password, $name = '', $email = '', $role = Role::APP_USER)
|
||||
@@ -64,7 +64,7 @@ class UserApi extends Base
|
||||
);
|
||||
|
||||
list($valid, ) = $this->userValidator->validateCreation($values);
|
||||
return $valid ? $this->user->create($values) : false;
|
||||
return $valid ? $this->userModel->create($values) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,7 +108,7 @@ class UserApi extends Base
|
||||
'is_ldap_user' => 1,
|
||||
);
|
||||
|
||||
return $this->user->create($values);
|
||||
return $this->userModel->create($values);
|
||||
|
||||
} catch (LdapException $e) {
|
||||
$this->logger->error($e->getMessage());
|
||||
@@ -133,6 +133,6 @@ class UserApi extends Base
|
||||
}
|
||||
|
||||
list($valid, ) = $this->userValidator->validateApiModification($values);
|
||||
return $valid && $this->user->update($values);
|
||||
return $valid && $this->userModel->update($values);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user