diff options
-rw-r--r-- | app/Console/BaseCommand.php | 1 | ||||
-rw-r--r-- | app/Controller/CategoryController.php | 2 | ||||
-rw-r--r-- | app/Controller/ColumnController.php | 2 | ||||
-rw-r--r-- | app/Controller/CommentController.php | 2 | ||||
-rw-r--r-- | app/Controller/CustomFilterController.php | 9 | ||||
-rw-r--r-- | app/Controller/SubtaskController.php | 2 | ||||
-rw-r--r-- | app/Controller/SwimlaneController.php | 2 | ||||
-rw-r--r-- | app/Controller/TaskExternalLinkController.php | 2 | ||||
-rw-r--r-- | app/Helper/TaskHelper.php | 5 | ||||
-rw-r--r-- | app/Import/UserImport.php | 2 | ||||
-rw-r--r-- | app/Model/CommentModel.php | 3 | ||||
-rw-r--r-- | app/Model/SubtaskModel.php | 2 |
12 files changed, 18 insertions, 16 deletions
diff --git a/app/Console/BaseCommand.php b/app/Console/BaseCommand.php index d6806d93..50417071 100644 --- a/app/Console/BaseCommand.php +++ b/app/Console/BaseCommand.php @@ -28,6 +28,7 @@ use Symfony\Component\Console\Command\Command; * @property \Kanboard\Model\ProjectUserRoleModel $projectUserRoleModel * @property \Kanboard\Core\Plugin\Loader $pluginLoader * @property \Kanboard\Core\Http\Client $httpClient + * @property \Kanboard\Core\Queue\QueueManager $queueManager * @property \Symfony\Component\EventDispatcher\EventDispatcher $dispatcher */ abstract class BaseCommand extends Command diff --git a/app/Controller/CategoryController.php b/app/Controller/CategoryController.php index fd1b3f94..dd6e1c35 100644 --- a/app/Controller/CategoryController.php +++ b/app/Controller/CategoryController.php @@ -64,7 +64,7 @@ class CategoryController extends BaseController list($valid, $errors) = $this->categoryValidator->validateCreation($values); if ($valid) { - if ($this->categoryModel->create($values)) { + if ($this->categoryModel->create($values) !== false) { $this->flash->success(t('Your category have been created successfully.')); return $this->response->redirect($this->helper->url->to('CategoryController', 'index', array('project_id' => $project['id']))); } else { diff --git a/app/Controller/ColumnController.php b/app/Controller/ColumnController.php index 8bf3d562..95fbcaaa 100644 --- a/app/Controller/ColumnController.php +++ b/app/Controller/ColumnController.php @@ -66,7 +66,7 @@ class ColumnController extends BaseController list($valid, $errors) = $this->columnValidator->validateCreation($values); if ($valid) { - if ($this->columnModel->create($project['id'], $values['title'], $values['task_limit'], $values['description'])) { + if ($this->columnModel->create($project['id'], $values['title'], $values['task_limit'], $values['description']) !== false) { $this->flash->success(t('Column created successfully.')); return $this->response->redirect($this->helper->url->to('ColumnController', 'index', array('project_id' => $project['id'])), true); } else { diff --git a/app/Controller/CommentController.php b/app/Controller/CommentController.php index 696d240f..2a8c258a 100644 --- a/app/Controller/CommentController.php +++ b/app/Controller/CommentController.php @@ -76,7 +76,7 @@ class CommentController extends BaseController list($valid, $errors) = $this->commentValidator->validateCreation($values); if ($valid) { - if ($this->commentModel->create($values)) { + if ($this->commentModel->create($values) !== false) { $this->flash->success(t('Comment added successfully.')); } else { $this->flash->failure(t('Unable to create your comment.')); diff --git a/app/Controller/CustomFilterController.php b/app/Controller/CustomFilterController.php index 8bba0856..e5f674cd 100644 --- a/app/Controller/CustomFilterController.php +++ b/app/Controller/CustomFilterController.php @@ -18,6 +18,9 @@ class CustomFilterController extends BaseController * Display list of filters * * @access public + * @param array $values + * @param array $errors + * @throws \Kanboard\Core\Controller\PageNotFoundException */ public function index(array $values = array(), array $errors = array()) { @@ -47,7 +50,7 @@ class CustomFilterController extends BaseController list($valid, $errors) = $this->customFilterValidator->validateCreation($values); if ($valid) { - if ($this->customFilterModel->create($values)) { + if ($this->customFilterModel->create($values) !== false) { $this->flash->success(t('Your custom filter have been created successfully.')); return $this->response->redirect($this->helper->url->to('CustomFilterController', 'index', array('project_id' => $project['id']))); } else { @@ -101,6 +104,10 @@ class CustomFilterController extends BaseController * Edit a custom filter (display the form) * * @access public + * @param array $values + * @param array $errors + * @throws AccessForbiddenException + * @throws \Kanboard\Core\Controller\PageNotFoundException */ public function edit(array $values = array(), array $errors = array()) { diff --git a/app/Controller/SubtaskController.php b/app/Controller/SubtaskController.php index 46061122..93dab5cd 100644 --- a/app/Controller/SubtaskController.php +++ b/app/Controller/SubtaskController.php @@ -54,7 +54,7 @@ class SubtaskController extends BaseController list($valid, $errors) = $this->subtaskValidator->validateCreation($values); if ($valid) { - if ($this->subtaskModel->create($values)) { + if ($this->subtaskModel->create($values) !== false) { $this->flash->success(t('Sub-task added successfully.')); } else { $this->flash->failure(t('Unable to create your sub-task.')); diff --git a/app/Controller/SwimlaneController.php b/app/Controller/SwimlaneController.php index 4b9567e6..c7c20ce8 100644 --- a/app/Controller/SwimlaneController.php +++ b/app/Controller/SwimlaneController.php @@ -81,7 +81,7 @@ class SwimlaneController extends BaseController list($valid, $errors) = $this->swimlaneValidator->validateCreation($values); if ($valid) { - if ($this->swimlaneModel->create($values)) { + if ($this->swimlaneModel->create($values) !== false) { $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 { diff --git a/app/Controller/TaskExternalLinkController.php b/app/Controller/TaskExternalLinkController.php index f3c6050d..9c04eb00 100644 --- a/app/Controller/TaskExternalLinkController.php +++ b/app/Controller/TaskExternalLinkController.php @@ -76,7 +76,7 @@ class TaskExternalLinkController extends BaseController $values = $this->request->getValues(); list($valid, $errors) = $this->externalLinkValidator->validateCreation($values); - if ($valid && $this->taskExternalLinkModel->create($values)) { + if ($valid && $this->taskExternalLinkModel->create($values) !== false) { $this->flash->success(t('Link added successfully.')); return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true); } diff --git a/app/Helper/TaskHelper.php b/app/Helper/TaskHelper.php index 1b510d2a..e33438d6 100644 --- a/app/Helper/TaskHelper.php +++ b/app/Helper/TaskHelper.php @@ -40,11 +40,6 @@ class TaskHelper extends Base return $this->taskModel->getRecurrenceBasedateList(); } - public function canRemove(array $task) - { - return $this->taskPermission->canRemoveTask($task); - } - public function selectAssignee(array $users, array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="3"'), $attributes); diff --git a/app/Import/UserImport.php b/app/Import/UserImport.php index c877e82a..304a3254 100644 --- a/app/Import/UserImport.php +++ b/app/Import/UserImport.php @@ -56,7 +56,7 @@ class UserImport extends Base $row = $this->prepare($row); if ($this->validateCreation($row)) { - if ($this->userModel->create($row)) { + if ($this->userModel->create($row) !== false) { $this->logger->debug('UserImport: imported successfully line '.$line_number); $this->counter++; } else { diff --git a/app/Model/CommentModel.php b/app/Model/CommentModel.php index 6e5fd9d8..36e1fc48 100644 --- a/app/Model/CommentModel.php +++ b/app/Model/CommentModel.php @@ -3,7 +3,6 @@ namespace Kanboard\Model; use Kanboard\Event\CommentEvent; - use Kanboard\Core\Base; /** @@ -114,7 +113,7 @@ class CommentModel extends Base $values['date_creation'] = time(); $comment_id = $this->db->table(self::TABLE)->persist($values); - if ($comment_id) { + if ($comment_id !== false) { $event = new CommentEvent(array('id' => $comment_id) + $values); $this->dispatcher->dispatch(self::EVENT_CREATE, $event); $this->userMentionModel->fireEvents($values['comment'], self::EVENT_USER_MENTION, $event); diff --git a/app/Model/SubtaskModel.php b/app/Model/SubtaskModel.php index b63cf0a1..019064ad 100644 --- a/app/Model/SubtaskModel.php +++ b/app/Model/SubtaskModel.php @@ -218,7 +218,7 @@ class SubtaskModel extends Base $this->prepareCreation($values); $subtask_id = $this->db->table(self::TABLE)->persist($values); - if ($subtask_id) { + if ($subtask_id !== false) { $this->container['dispatcher']->dispatch( self::EVENT_CREATE, new SubtaskEvent(array('id' => $subtask_id) + $values) |