@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $isAllowedEdit = ($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)); |
| 68 | 68 | $isAllowedDelete = ($user->rights->flightlog->vol->delete || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id && !$object->is_facture)); |
| 69 | -$permissiondellink=$user->rights->flightlog->vol->financial; |
|
| 69 | +$permissiondellink = $user->rights->flightlog->vol->financial; |
|
| 70 | 70 | |
| 71 | 71 | $search_idBBC_vols = GETPOST('search_idBBC_vols', 'int'); |
| 72 | 72 | $search_lieuD = GETPOST('search_lieuD', 'alpha'); |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); |
| 114 | 114 | |
| 115 | 115 | // Load object |
| 116 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 117 | -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
| 116 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 117 | +include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
| 118 | 118 | |
| 119 | 119 | // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array |
| 120 | 120 | $hookmanager->initHooks(array('bbcvols')); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $parameters = array(); |
| 141 | 141 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, |
| 142 | - $action); // Note that $action and $object may have been modified by some hooks |
|
| 142 | + $action); // Note that $action and $object may have been modified by some hooks |
|
| 143 | 143 | if ($reshook < 0) { |
| 144 | 144 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 145 | 145 | } |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | print '<div class="tabsAction">' . "\n"; |
| 355 | 355 | $parameters = array(); |
| 356 | 356 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, |
| 357 | - $action); // Note that $action and $object may have been modified by hook |
|
| 357 | + $action); // Note that $action and $object may have been modified by hook |
|
| 358 | 358 | if ($reshook < 0) { |
| 359 | 359 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 360 | 360 | } |
@@ -367,13 +367,13 @@ discard block |
||
| 367 | 367 | print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete">' . $langs->trans('Delete') . '</a></div>' . "\n"; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - if($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()){ |
|
| 371 | - 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"; |
|
| 370 | + if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()) { |
|
| 371 | + 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"; |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | print '</div>' . "\n"; |
| 375 | 375 | |
| 376 | - if($user->rights->flightlog->vol->financial){ |
|
| 376 | + if ($user->rights->flightlog->vol->financial) { |
|
| 377 | 377 | print '<div class="fichecenter"><div class="fichehalfleft">'; |
| 378 | 378 | $form->showLinkedObjectBlock($object); |
| 379 | 379 | print '</div></div>'; |
@@ -127,12 +127,12 @@ |
||
| 127 | 127 | * Put here all code to do according to value of "action" parameter |
| 128 | 128 | */ |
| 129 | 129 | if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) { |
| 130 | - try{ |
|
| 131 | - $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount); |
|
| 130 | + try { |
|
| 131 | + $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote, $bankAccount); |
|
| 132 | 132 | $handler->handle($command); |
| 133 | 133 | Header("Location: card.php?id=" . $flight->getId()); |
| 134 | - }catch (\Exception $e){ |
|
| 135 | - dol_syslog($e->getMessage(),LOG_ERR); |
|
| 134 | + } catch (\Exception $e) { |
|
| 135 | + dol_syslog($e->getMessage(), LOG_ERR); |
|
| 136 | 136 | dol_htmloutput_mesg("Facture non créée", '', 'error'); |
| 137 | 137 | } |
| 138 | 138 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount); |
| 132 | 132 | $handler->handle($command); |
| 133 | 133 | Header("Location: card.php?id=" . $flight->getId()); |
| 134 | - }catch (\Exception $e){ |
|
| 134 | + } catch (\Exception $e){ |
|
| 135 | 135 | dol_syslog($e->getMessage(),LOG_ERR); |
| 136 | 136 | dol_htmloutput_mesg("Facture non créée", '', 'error'); |
| 137 | 137 | } |
@@ -267,9 +267,12 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | <?php if (!$flightProduct) : ?> |
| 269 | 269 | <a class="butActionRefused" href="#">Générer</a> |
| 270 | - <?php else: ?> |
|
| 270 | + <?php else { |
|
| 271 | + : ?> |
|
| 271 | 272 | <button class="butAction" type="submit">Générer</button> |
| 272 | - <?php endif; ?> |
|
| 273 | + <?php endif; |
|
| 274 | +} |
|
| 275 | +?> |
|
| 273 | 276 | |
| 274 | 277 | <a class="butAction" href="<?php echo DOL_URL_ROOT . '/flightlog/card.php?id=' . $flight->id; ?>">Retour au |
| 275 | 278 | vol</a> |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once __DIR__.'/CreateFlightBillCommandHandler.php'; |
|
| 4 | -require_once __DIR__.'/CreateFlightBillTransactionalCommandHandler.php'; |
|
| 3 | +require_once __DIR__ . '/CreateFlightBillCommandHandler.php'; |
|
| 4 | +require_once __DIR__ . '/CreateFlightBillTransactionalCommandHandler.php'; |
|
| 5 | 5 | |
| 6 | 6 | /** |
| 7 | 7 | * @author Laurent De Coninck <[email protected]> |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | /** |
| 12 | 12 | * @return CreateFlightBillCommandHandler |
| 13 | 13 | */ |
| 14 | - public static function factory($db, $conf, $user, $langs){ |
|
| 14 | + public static function factory($db, $conf, $user, $langs) { |
|
| 15 | 15 | return new CreateFlightBillTransactionalCommandHandler($db, $conf, $user, $langs); |
| 16 | 16 | } |
| 17 | 17 | |