@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | $url = sprintf('%s/flightlog/card_tab_damage.php?id=%s&damage=%s', DOL_URL_ROOT, $flightId, $currentDamageId); |
| 59 | 59 | |
| 60 | - $html = $form->formconfirm($url, 'êtes-vous sure de vouloir marquer ce dégât comme facturé?', '','confirm_bill_damage'); |
|
| 60 | + $html = $form->formconfirm($url, 'êtes-vous sure de vouloir marquer ce dégât comme facturé?', '', 'confirm_bill_damage'); |
|
| 61 | 61 | |
| 62 | 62 | $this->renderHtml($html); |
| 63 | 63 | } |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | $currentDamageId = $this->request->getParam('damage'); |
| 69 | 69 | $confirmation = $this->request->getParam('confirm'); |
| 70 | 70 | |
| 71 | - if(!$this->request->isPost() || $confirmation === 'no'){ |
|
| 72 | - $this->redirect($_SERVER["PHP_SELF"].'?id='.$flightId); |
|
| 71 | + if (!$this->request->isPost() || $confirmation === 'no') { |
|
| 72 | + $this->redirect($_SERVER["PHP_SELF"] . '?id=' . $flightId); |
|
| 73 | 73 | return; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $this->getInvoiceDamageCommandHandler()->__invoke(new InvoiceDamageCommand($currentDamageId)); |
| 77 | - $this->redirect($_SERVER["PHP_SELF"].'?id='.$flightId); |
|
| 77 | + $this->redirect($_SERVER["PHP_SELF"] . '?id=' . $flightId); |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | \ No newline at end of file |
@@ -24,19 +24,19 @@ |
||
| 24 | 24 | $this->request = new Request(); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - protected function render($template, array $variables = []){ |
|
| 27 | + protected function render($template, array $variables = []) { |
|
| 28 | 28 | |
| 29 | - foreach($variables as $variableName => $variableValue){ |
|
| 29 | + foreach ($variables as $variableName => $variableValue) { |
|
| 30 | 30 | $GLOBALS[$variableName] = $variableValue; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - return include __DIR__.'/../templates/'.$template; |
|
| 33 | + return include __DIR__ . '/../templates/' . $template; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * @param string $html |
| 38 | 38 | */ |
| 39 | - protected function renderHtml($html){ |
|
| 39 | + protected function renderHtml($html) { |
|
| 40 | 40 | print $html; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -14,21 +14,21 @@ |
||
| 14 | 14 | <td>Montant</td> |
| 15 | 15 | </tr> |
| 16 | 16 | <?php $total = 0; ?> |
| 17 | - <?php foreach($damages as $currentDamage):?> |
|
| 17 | + <?php foreach ($damages as $currentDamage):?> |
|
| 18 | 18 | <?php $total += $currentDamage->getAmount(); ?> |
| 19 | 19 | <tr> |
| 20 | - <td><?php echo $currentDamage->getAuthorName();?></td> |
|
| 21 | - <td><?php echo $currentDamage->getAmount();?>€</td> |
|
| 20 | + <td><?php echo $currentDamage->getAuthorName(); ?></td> |
|
| 21 | + <td><?php echo $currentDamage->getAmount(); ?>€</td> |
|
| 22 | 22 | <td> |
| 23 | - <?php if($currentDamage->isInvoiced()): ?> |
|
| 23 | + <?php if ($currentDamage->isInvoiced()): ?> |
|
| 24 | 24 | <i class="fas fa-check"></i> |
| 25 | 25 | <?php else: ?> |
| 26 | 26 | <i class="fas fa-times"></i> |
| 27 | 27 | <?php endif; ?> |
| 28 | 28 | </td> |
| 29 | 29 | <td> |
| 30 | - <?php if(!$currentDamage->isInvoiced()): ?> |
|
| 31 | - <a href="<?php print sprintf('%s/flightlog/card_tab_damage.php?id=%s&action=%s&damage=%s', DOL_URL_ROOT, $flightId, 'bill_damage', $currentDamage->getId());?>"><i class="fas fa-file-invoice"></i></a> |
|
| 30 | + <?php if (!$currentDamage->isInvoiced()): ?> |
|
| 31 | + <a href="<?php print sprintf('%s/flightlog/card_tab_damage.php?id=%s&action=%s&damage=%s', DOL_URL_ROOT, $flightId, 'bill_damage', $currentDamage->getId()); ?>"><i class="fas fa-file-invoice"></i></a> |
|
| 32 | 32 | <?php endif; ?> |
| 33 | 33 | </td> |
| 34 | 34 | </tr> |