Rename all models
This commit is contained in:
@@ -4,7 +4,7 @@ namespace Kanboard\Controller;
|
||||
|
||||
use Kanboard\Core\Controller\AccessForbiddenException;
|
||||
use Kanboard\Core\Controller\PageNotFoundException;
|
||||
use Kanboard\Model\Swimlane as SwimlaneModel;
|
||||
use Kanboard\Model\SwimlaneModel;
|
||||
|
||||
/**
|
||||
* Swimlanes Controller
|
||||
@@ -23,7 +23,7 @@ class SwimlaneController extends BaseController
|
||||
*/
|
||||
private function getSwimlane()
|
||||
{
|
||||
$swimlane = $this->swimlane->getById($this->request->getIntegerParam('swimlane_id'));
|
||||
$swimlane = $this->swimlaneModel->getById($this->request->getIntegerParam('swimlane_id'));
|
||||
|
||||
if (empty($swimlane)) {
|
||||
throw new PageNotFoundException();
|
||||
@@ -42,9 +42,9 @@ class SwimlaneController extends BaseController
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->helper->layout->project('swimlane/index', array(
|
||||
'default_swimlane' => $this->swimlane->getDefault($project['id']),
|
||||
'active_swimlanes' => $this->swimlane->getAllByStatus($project['id'], SwimlaneModel::ACTIVE),
|
||||
'inactive_swimlanes' => $this->swimlane->getAllByStatus($project['id'], SwimlaneModel::INACTIVE),
|
||||
'default_swimlane' => $this->swimlaneModel->getDefault($project['id']),
|
||||
'active_swimlanes' => $this->swimlaneModel->getAllByStatus($project['id'], SwimlaneModel::ACTIVE),
|
||||
'inactive_swimlanes' => $this->swimlaneModel->getAllByStatus($project['id'], SwimlaneModel::INACTIVE),
|
||||
'project' => $project,
|
||||
'title' => t('Swimlanes')
|
||||
)));
|
||||
@@ -81,7 +81,7 @@ class SwimlaneController extends BaseController
|
||||
list($valid, $errors) = $this->swimlaneValidator->validateCreation($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->swimlane->create($values)) {
|
||||
if ($this->swimlaneModel->create($values)) {
|
||||
$this->flash->success(t('Your swimlane have been created successfully.'));
|
||||
return $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])));
|
||||
} else {
|
||||
@@ -103,7 +103,7 @@ class SwimlaneController extends BaseController
|
||||
public function editDefault(array $values = array(), array $errors = array())
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$swimlane = $this->swimlane->getDefault($project['id']);
|
||||
$swimlane = $this->swimlaneModel->getDefault($project['id']);
|
||||
|
||||
$this->response->html($this->helper->layout->project('swimlane/edit_default', array(
|
||||
'values' => empty($values) ? $swimlane : $values,
|
||||
@@ -125,7 +125,7 @@ class SwimlaneController extends BaseController
|
||||
list($valid, $errors) = $this->swimlaneValidator->validateDefaultModification($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->swimlane->updateDefault($values)) {
|
||||
if ($this->swimlaneModel->updateDefault($values)) {
|
||||
$this->flash->success(t('The default swimlane have been updated successfully.'));
|
||||
return $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])), true);
|
||||
} else {
|
||||
@@ -169,7 +169,7 @@ class SwimlaneController extends BaseController
|
||||
list($valid, $errors) = $this->swimlaneValidator->validateModification($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->swimlane->update($values)) {
|
||||
if ($this->swimlaneModel->update($values)) {
|
||||
$this->flash->success(t('Swimlane updated successfully.'));
|
||||
return $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])));
|
||||
} else {
|
||||
@@ -207,7 +207,7 @@ class SwimlaneController extends BaseController
|
||||
$project = $this->getProject();
|
||||
$swimlane_id = $this->request->getIntegerParam('swimlane_id');
|
||||
|
||||
if ($this->swimlane->remove($project['id'], $swimlane_id)) {
|
||||
if ($this->swimlaneModel->remove($project['id'], $swimlane_id)) {
|
||||
$this->flash->success(t('Swimlane removed successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to remove this swimlane.'));
|
||||
@@ -227,7 +227,7 @@ class SwimlaneController extends BaseController
|
||||
$project = $this->getProject();
|
||||
$swimlane_id = $this->request->getIntegerParam('swimlane_id');
|
||||
|
||||
if ($this->swimlane->disable($project['id'], $swimlane_id)) {
|
||||
if ($this->swimlaneModel->disable($project['id'], $swimlane_id)) {
|
||||
$this->flash->success(t('Swimlane updated successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to update this swimlane.'));
|
||||
@@ -246,7 +246,7 @@ class SwimlaneController extends BaseController
|
||||
$this->checkCSRFParam();
|
||||
$project = $this->getProject();
|
||||
|
||||
if ($this->swimlane->disableDefault($project['id'])) {
|
||||
if ($this->swimlaneModel->disableDefault($project['id'])) {
|
||||
$this->flash->success(t('Swimlane updated successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to update this swimlane.'));
|
||||
@@ -266,7 +266,7 @@ class SwimlaneController extends BaseController
|
||||
$project = $this->getProject();
|
||||
$swimlane_id = $this->request->getIntegerParam('swimlane_id');
|
||||
|
||||
if ($this->swimlane->enable($project['id'], $swimlane_id)) {
|
||||
if ($this->swimlaneModel->enable($project['id'], $swimlane_id)) {
|
||||
$this->flash->success(t('Swimlane updated successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to update this swimlane.'));
|
||||
@@ -285,7 +285,7 @@ class SwimlaneController extends BaseController
|
||||
$this->checkCSRFParam();
|
||||
$project = $this->getProject();
|
||||
|
||||
if ($this->swimlane->enableDefault($project['id'])) {
|
||||
if ($this->swimlaneModel->enableDefault($project['id'])) {
|
||||
$this->flash->success(t('Swimlane updated successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to update this swimlane.'));
|
||||
@@ -305,7 +305,7 @@ class SwimlaneController extends BaseController
|
||||
$values = $this->request->getJson();
|
||||
|
||||
if (! empty($values) && isset($values['swimlane_id']) && isset($values['position'])) {
|
||||
$result = $this->swimlane->changePosition($project['id'], $values['swimlane_id'], $values['position']);
|
||||
$result = $this->swimlaneModel->changePosition($project['id'], $values['swimlane_id'], $values['position']);
|
||||
$this->response->json(array('result' => $result));
|
||||
} else {
|
||||
throw new AccessForbiddenException();
|
||||
|
||||
Reference in New Issue
Block a user