Skip to content

Commit

Permalink
template fixes + bug fixes + style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Eichhorn committed Apr 2, 2024
1 parent ad45c63 commit 6378eed
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function viewTaskDashboard(RequestAbstract $request, ResponseAbstract $re
->where('status', TaskStatus::OPEN)
->sort('createdAt', OrderType::DESC)
->query($openQuery)
->execute();
->executeGetArray();

$view->data['open'] = $open;

Expand All @@ -114,7 +114,7 @@ public function viewTaskDashboard(RequestAbstract $request, ResponseAbstract $re
->where('status', TaskStatus::OPEN)
->where('createdBy', $response->header->account, '=')
->sort('createdAt', OrderType::DESC)
->execute();
->executeGetArray();

$view->data['given'] = $given;

Expand Down Expand Up @@ -183,10 +183,10 @@ public function viewTaskList(RequestAbstract $request, ResponseAbstract $respons
}

if ($request->getData('ptype') === 'p') {
$view->data['tasks'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '<')
$view->data['tasks'] = $mapperQuery->where('id', $request->getDataInt('offset') ?? 0, '<')
->executeGetArray();
} elseif ($request->getData('ptype') === 'n') {
$view->data['tasks'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>')
$view->data['tasks'] = $mapperQuery->where('id', $request->getDataInt('offset') ?? 0, '>')
->executeGetArray();
} else {
$view->data['tasks'] = $mapperQuery->where('id', 0, '>')
Expand Down Expand Up @@ -315,7 +315,7 @@ public function viewTaskView(RequestAbstract $request, ResponseAbstract $respons
->with('reminderBy')
->where('task', $task->id)
->where('seenBy', $request->header->account)
->execute();
->executeGetArray();

foreach ($taskSeen as $unseen) {
// Shows all reminders
Expand Down
4 changes: 2 additions & 2 deletions Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function searchTag(RequestAbstract $request, ResponseAbstract $response,
->sort('taskElements/createdAt', OrderType::ASC)
->limit(8)
//->limit(1, 'taskElements')
->execute();
->executeGetArray();

$results = [];
$count = 0;
Expand Down Expand Up @@ -132,7 +132,7 @@ public function searchGeneral(RequestAbstract $request, ResponseAbstract $respon
->sort('taskElements/createdAt', OrderType::ASC)
->limit(8)
//->limit(1, 'taskElements')
->execute();
->executeGetArray();

$results = [];
$count = 0;
Expand Down
4 changes: 2 additions & 2 deletions Theme/Backend/task-list.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
/** @var \Modules\Tasks\Models\Task[] $tasks */
$tasks = $this->data['tasks'] ?? [];

$previous = empty($tasks) ? 'task/dashboard' : 'task/dashboard?{?}&id=' . \reset($tasks)->id . '&ptype=p';
$next = empty($tasks) ? 'task/dashboard' : 'task/dashboard?{?}&id=' . \end($tasks)->id . '&ptype=n';
$previous = empty($tasks) ? 'task/dashboard' : 'task/dashboard?{?}&offset=' . \reset($tasks)->id . '&ptype=p';
$next = empty($tasks) ? 'task/dashboard' : 'task/dashboard?{?}&offset=' . \end($tasks)->id . '&ptype=n';

echo $this->data['nav']->render(); ?>

Expand Down
2 changes: 1 addition & 1 deletion tests/Models/TaskMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function testCRUD() : void
#[\PHPUnit\Framework\Attributes\Group('module')]
public function testNewest() : void
{
$newest = TaskMapper::getAll()->sort('id', OrderType::DESC)->limit(1)->execute();
$newest = TaskMapper::getAll()->sort('id', OrderType::DESC)->limit(1)->executeGetArray();

self::assertCount(1, $newest);
}
Expand Down

0 comments on commit 6378eed

Please sign in to comment.