diff --git a/Models/TaskMapper.php b/Models/TaskMapper.php index 5ca733d..f72aa63 100644 --- a/Models/TaskMapper.php +++ b/Models/TaskMapper.php @@ -328,7 +328,13 @@ final class TaskMapper extends DataMapperAbstract $sth = self::$db->con->prepare($query->toSql()); $sth->execute(); - $count = $sth->fetchAll()[0][0] ?? 0; + $fetched = $sth->fetchAll(); + + if ($fetched === false) { + return -1; + } + + $count = $fetched[0][0] ?? 0; } catch (\Exception $e) { return -1; } diff --git a/Theme/Backend/Components/Tasks/ListView.php b/Theme/Backend/Components/Tasks/ListView.php index 95cb26e..5cc9284 100644 --- a/Theme/Backend/Components/Tasks/ListView.php +++ b/Theme/Backend/Components/Tasks/ListView.php @@ -30,7 +30,13 @@ use phpOMS\Views\View; */ class ListView extends View { - protected $tasks = []; + /** + * Tasks + * + * @var \Modules\Tasks\Models\Task[] + * @since 1.0.0 + */ + protected array $tasks = []; /** * {@inheritdoc} diff --git a/Theme/Backend/Components/Tasks/list.tpl.php b/Theme/Backend/Components/Tasks/list.tpl.php index e7461ca..5f77960 100644 --- a/Theme/Backend/Components/Tasks/list.tpl.php +++ b/Theme/Backend/Components/Tasks/list.tpl.php @@ -1,3 +1,7 @@ +
| = $this->getHtml('S' . $task->getStatus(), 'Tasks') ?> | - getPriority() === \Modules\Tasks\Models\TaskPriority::NONE) : ?> + getPriority() === TaskPriority::NONE) : ?> = $this->printHtml($task->getDue()->format('Y-m-d H:i')); ?> = $this->getHtml('P' . $task->getPriority()); ?> diff --git a/Views/TaskView.php b/Views/TaskView.php index feb44ba..69230b8 100644 --- a/Views/TaskView.php +++ b/Views/TaskView.php @@ -27,8 +27,6 @@ use phpOMS\Views\View; */ class TaskView extends View { - protected $media = []; - /** * Get task status color. * |