template fixes + bug fixes + style fixes

This commit is contained in:
Dennis Eichhorn 2024-04-02 21:40:47 +00:00
parent 5ae8ab5c0d
commit e894f1de2f
6 changed files with 20 additions and 11 deletions

View File

@ -73,7 +73,7 @@ return [
], ],
], ],
], ],
'^/checklist/template/task(\?.*$|$)' => [ '^/checklist/template/task/view(\?.*$|$)' => [
[ [
'dest' => '\Modules\Checklist\Controller\BackendController:viewChecklistTemplateTaskView', 'dest' => '\Modules\Checklist\Controller\BackendController:viewChecklistTemplateTaskView',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -84,4 +84,15 @@ return [
], ],
], ],
], ],
'^/checklist/template/task/create(\?.*$|$)' => [
[
'dest' => '\Modules\Checklist\Controller\BackendController:viewChecklistTemplateTaskCreate',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::TEMPLATE,
],
],
],
]; ];

View File

@ -53,7 +53,7 @@ final class BackendController extends Controller
$view->data['checklists'] = ChecklistMapper::getAll() $view->data['checklists'] = ChecklistMapper::getAll()
->sort('id', OrderType::DESC) ->sort('id', OrderType::DESC)
->execute(); ->executeGetArray();
return $view; return $view;
} }
@ -110,7 +110,7 @@ final class BackendController extends Controller
$view->data['templates'] = ChecklistTemplateMapper::getAll() $view->data['templates'] = ChecklistTemplateMapper::getAll()
->sort('id', OrderType::DESC) ->sort('id', OrderType::DESC)
->execute(); ->executeGetArray();
return $view; return $view;
} }

View File

@ -26,7 +26,7 @@ return ['Checklist' => [
'Templates' => 'Vorlagen', 'Templates' => 'Vorlagen',
'TimeInMinutes' => 'Zeit in Minuten.', 'TimeInMinutes' => 'Zeit in Minuten.',
'Title' => 'Titel', 'Title' => 'Titel',
'Template' => 'Template', 'Template' => 'Template',
'Start' => 'Start', 'Start' => 'Start',
'End' => 'Ende', 'End' => 'Ende',
]]; ]];

View File

@ -26,7 +26,7 @@ return ['Checklist' => [
'Templates' => 'Templates', 'Templates' => 'Templates',
'TimeInMinutes' => 'Time in minutes', 'TimeInMinutes' => 'Time in minutes',
'Title' => 'Title', 'Title' => 'Title',
'Template' => 'Template', 'Template' => 'Template',
'Start' => 'Start', 'Start' => 'Start',
'End' => 'End', 'End' => 'End',
]]; ]];

View File

@ -12,8 +12,6 @@
*/ */
declare(strict_types=1); declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/** /**
* @var \phpOMS\Views\View $this * @var \phpOMS\Views\View $this
*/ */

View File

@ -92,7 +92,7 @@ echo $this->data['nav']->render(); ?>
<div class="portlet-head"> <div class="portlet-head">
<?= $this->getHtml('Tasks'); ?> <?= $this->getHtml('Tasks'); ?>
<span class="end-xs"> <span class="end-xs">
<a class="button" href="<?= \phpOMS\Uri\UriFactory::build('{/base}/checklist/template/task?{?}&csrf={$CSRF}'); ?>"><?= $this->getHtml('Add', '0', '0'); ?></a> <a class="button" href="<?= \phpOMS\Uri\UriFactory::build('{/base}/checklist/template/task/create?{?}&csrf={$CSRF}'); ?>"><?= $this->getHtml('Add', '0', '0'); ?></a>
</span> </span>
</div> </div>
<div class="slider"> <div class="slider">
@ -105,7 +105,7 @@ echo $this->data['nav']->render(); ?>
<tbody> <tbody>
<?php $c = 0; <?php $c = 0;
foreach ($this->data['template']->tasks as $key => $task) : ++$c; foreach ($this->data['template']->tasks as $key => $task) : ++$c;
$url = \phpOMS\Uri\UriFactory::build('{/base}/checklist/template/task?{?}&id=' . $task->id); $url = \phpOMS\Uri\UriFactory::build('{/base}/checklist/template/task/view?{?}&id=' . $task->id);
?> ?>
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
<td><?php if ($task->priority === TaskPriority::NONE) : ?> <td><?php if ($task->priority === TaskPriority::NONE) : ?>