@@ -124,12 +124,12 @@ |
||
| 124 | 124 | * Put here all code to do according to value of "action" parameter |
| 125 | 125 | */ |
| 126 | 126 | if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) { |
| 127 | - try{ |
|
| 128 | - $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount, $nbrPax); |
|
| 127 | + try { |
|
| 128 | + $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote, $bankAccount, $nbrPax); |
|
| 129 | 129 | $handler->handle($command); |
| 130 | 130 | Header("Location: card.php?id=" . $flight->getId()); |
| 131 | - }catch (\Exception $e){ |
|
| 132 | - dol_syslog($e->getMessage(),LOG_ERR); |
|
| 131 | + } catch (\Exception $e) { |
|
| 132 | + dol_syslog($e->getMessage(), LOG_ERR); |
|
| 133 | 133 | dol_htmloutput_mesg("Facture non créée", '', 'error'); |
| 134 | 134 | } |
| 135 | 135 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | $isAllowedEdit = ($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)); |
| 71 | 71 | $isAllowedDelete = ($user->rights->flightlog->vol->delete || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id && !$object->is_facture)); |
| 72 | -$permissiondellink=$user->rights->flightlog->vol->financial; |
|
| 72 | +$permissiondellink = $user->rights->flightlog->vol->financial; |
|
| 73 | 73 | |
| 74 | 74 | $search_idBBC_vols = GETPOST('search_idBBC_vols', 'int'); |
| 75 | 75 | $search_lieuD = GETPOST('search_lieuD', 'alpha'); |
@@ -116,8 +116,8 @@ discard block |
||
| 116 | 116 | $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); |
| 117 | 117 | |
| 118 | 118 | // Load object |
| 119 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 120 | -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
| 119 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 120 | +include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
| 121 | 121 | |
| 122 | 122 | // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array |
| 123 | 123 | $hookmanager->initHooks(array('bbcvols')); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $parameters = array(); |
| 144 | 144 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, |
| 145 | - $action); // Note that $action and $object may have been modified by some hooks |
|
| 145 | + $action); // Note that $action and $object may have been modified by some hooks |
|
| 146 | 146 | if ($reshook < 0) { |
| 147 | 147 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 148 | 148 | } |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | print '<div class="tabsAction">' . "\n"; |
| 378 | 378 | $parameters = array(); |
| 379 | 379 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, |
| 380 | - $action); // Note that $action and $object may have been modified by hook |
|
| 380 | + $action); // Note that $action and $object may have been modified by hook |
|
| 381 | 381 | if ($reshook < 0) { |
| 382 | 382 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 383 | 383 | } |
@@ -390,14 +390,14 @@ discard block |
||
| 390 | 390 | print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete">' . $langs->trans('Delete') . '</a></div>' . "\n"; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - if($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture() && $object->hasReceiver()){ |
|
| 394 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/flightlog/facture.php?id=' . $object->id.'">' . $langs->trans("Facturer") . '</a></div>' . "\n"; |
|
| 393 | + if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture() && $object->hasReceiver()) { |
|
| 394 | + print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/flightlog/facture.php?id=' . $object->id . '">' . $langs->trans("Facturer") . '</a></div>' . "\n"; |
|
| 395 | 395 | } |
| 396 | 396 | ?> |
| 397 | 397 | |
| 398 | - <?php if($user->rights->flightlog->vol->financial && !$object->isBilled() ): ?> |
|
| 398 | + <?php if ($user->rights->flightlog->vol->financial && !$object->isBilled()): ?> |
|
| 399 | 399 | <div class="inline-block divButAction"> |
| 400 | - <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s' , $_SERVER["PHP_SELF"], $object->id, ACTION_FLAG_BILLED);?>"> |
|
| 400 | + <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s', $_SERVER["PHP_SELF"], $object->id, ACTION_FLAG_BILLED); ?>"> |
|
| 401 | 401 | <?php echo $langs->trans("Marqué comme facturé ") ?> |
| 402 | 402 | </a> |
| 403 | 403 | </div> |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | |
| 406 | 406 | </div> |
| 407 | 407 | <?php |
| 408 | - if($user->rights->flightlog->vol->financial){ |
|
| 408 | + if ($user->rights->flightlog->vol->financial) { |
|
| 409 | 409 | print '<div class="fichecenter"><div class="fichehalfleft">'; |
| 410 | 410 | $form->showLinkedObjectBlock($object); |
| 411 | 411 | print '</div></div>'; |