Skip to content

Commit

Permalink
Add dynamic headers and task details to execution form
Browse files Browse the repository at this point in the history
Enhanced the execution form with dynamic headers for adding or editing execution, and included associated task and group details. Adjusted code formatting and improved conditional checks for better readability and functionality.
  • Loading branch information
wolxXx committed Oct 7, 2024
1 parent 7446b9c commit 62dc441
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions src/views/action/execution/partial/addEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,39 @@
*/

/**
* @var array $data
* @var \DoEveryApp\Entity\Execution | null $execution
* @var \DoEveryApp\Entity\Task $task
* @var array $data
*/
?>

<h1>
<? if (null === $execution): ?>
Ausführung hinzufügen
<? endif ?>
<? if (null !== $execution): ?>
Ausführung bearbeiten
<? endif ?>
</h1>
<div>
<a href="<?= \DoEveryApp\Action\Task\ShowAction::getRoute($task->getId()) ?>">
Aufgabe: <?= \DoEveryApp\Util\View\Escaper::escape($task->getName()) ?>
</a>
<? if (null !== $task->getGroup()): ?>
| Gruppe:
<a href="<?= \DoEveryApp\Action\Group\ShowAction::getRoute($task->getGroup()->getId()) ?>">
<?= \DoEveryApp\Util\View\Escaper::escape($task->getGroup()->getName()) ?>
</a>
<? endif ?>
<hr />
</div>

<? if (null !== $task->getNote()): ?>
<div>
<?= \DoEveryApp\Util\View\TaskNote::byTask($task) ?>
</div>
<? endif ?>

<form action="" method="post" novalidate>
<div class="row">
<div class="column">
Expand All @@ -26,7 +56,7 @@
<option <?= false === array_key_exists('worker', $data) || null === $data['worker'] ? 'selected' : '' ?> value="">
- niemand -
</option>
<? foreach(\DoEveryApp\Entity\Worker::getRepository()->findIndexed() as $worker): ?>
<? foreach (\DoEveryApp\Entity\Worker::getRepository()->findIndexed() as $worker): ?>
<option <?= array_key_exists('worker', $data) && $data['worker'] == $worker->getId() ? 'selected' : '' ?> value="<?= $worker->getId() ?>">
<?= \DoEveryApp\Util\View\Worker::get($worker) ?>
</option>
Expand Down Expand Up @@ -54,7 +84,7 @@
Minuten
</div>

<? if(0 !== sizeof($data['checkListItems'])): ?>
<? if (0 !== sizeof($data['checkListItems'])): ?>
<hr>
<table>
<thead>
Expand All @@ -74,7 +104,7 @@
</tr>
</thead>
<tbody>
<? foreach($data['checkListItems'] as $index => $checkListItem): ?>
<? foreach ($data['checkListItems'] as $index => $checkListItem): ?>
<tr>
<td>
<?= \DoEveryApp\Util\View\Escaper::escape($checkListItem['name']) ?>
Expand Down Expand Up @@ -109,11 +139,7 @@
</div>
</div>



<div>
<input class="primaryButton" type="submit" value="hinzufügen" />
</div>
</form>


</form>

0 comments on commit 62dc441

Please sign in to comment.