@@ -108,7 +108,7 @@ |
||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | - * @param null $year |
|
| 111 | + * @param integer $year |
|
| 112 | 112 | * @param null $pilotId |
| 113 | 113 | * @param null $quarter |
| 114 | 114 | * @param bool $groupBy |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | throw new \InvalidArgumentException('Model document is missing'); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - if(!isset($nbrPax) || !is_numeric($nbrPax) || $nbrPax != (int) $nbrPax){ |
|
| 94 | + if (!isset($nbrPax) || !is_numeric($nbrPax) || $nbrPax != (int) $nbrPax) { |
|
| 95 | 95 | throw new \InvalidArgumentException('The number of pax is not correct, an integer is expected'); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | { |
| 113 | 113 | $customer = new Client($this->db); |
| 114 | 114 | |
| 115 | - if($flight->fk_receiver) { |
|
| 115 | + if ($flight->fk_receiver) { |
|
| 116 | 116 | return $this->fetchCustomerFromFlight($flight); |
| 117 | 117 | } |
| 118 | 118 | |
@@ -124,11 +124,11 @@ |
||
| 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 | - }catch (\Exception $e){ |
|
| 131 | - dol_syslog($e->getMessage(),LOG_ERR); |
|
| 130 | + } catch (\Exception $e) { |
|
| 131 | + dol_syslog($e->getMessage(), LOG_ERR); |
|
| 132 | 132 | dol_htmloutput_mesg("Facture non créée", '', 'error'); |
| 133 | 133 | } |
| 134 | 134 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | try{ |
| 128 | 128 | $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount, $nbrPax); |
| 129 | 129 | $handler->handle($command); |
| 130 | - }catch (\Exception $e){ |
|
| 130 | + } catch (\Exception $e){ |
|
| 131 | 131 | dol_syslog($e->getMessage(),LOG_ERR); |
| 132 | 132 | dol_htmloutput_mesg("Facture non créée", '', 'error'); |
| 133 | 133 | } |
@@ -268,9 +268,12 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | <?php if (!$flightProduct || !$flight->hasReceiver()) : ?> |
| 270 | 270 | <a class="butActionRefused" href="#">Générer</a> |
| 271 | - <?php else: ?> |
|
| 271 | + <?php else { |
|
| 272 | + : ?> |
|
| 272 | 273 | <button class="butAction" type="submit">Générer</button> |
| 273 | - <?php endif; ?> |
|
| 274 | + <?php endif; |
|
| 275 | +} |
|
| 276 | +?> |
|
| 274 | 277 | |
| 275 | 278 | <a class="butAction" href="<?php echo DOL_URL_ROOT . '/flightlog/card.php?id=' . $flight->id; ?>">Retour au |
| 276 | 279 | vol</a> |
@@ -645,7 +645,7 @@ |
||
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | /** |
| 648 | - * @return array|BbctypesLine[] |
|
| 648 | + * @return BbctypesLine[] |
|
| 649 | 649 | */ |
| 650 | 650 | public function getLines() |
| 651 | 651 | { |
@@ -733,7 +733,7 @@ |
||
| 733 | 733 | */ |
| 734 | 734 | public function getActive() |
| 735 | 735 | { |
| 736 | - return (boolean)$this->active; |
|
| 736 | + return (boolean) $this->active; |
|
| 737 | 737 | } |
| 738 | 738 | |
| 739 | 739 | /** |
@@ -95,6 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | /** |
| 97 | 97 | * @inheritDoc |
| 98 | + * @param string $fieldName |
|
| 98 | 99 | */ |
| 99 | 100 | public function remove($fieldName) |
| 100 | 101 | { |
@@ -142,7 +143,7 @@ discard block |
||
| 142 | 143 | } |
| 143 | 144 | |
| 144 | 145 | /** |
| 145 | - * @param null|\ValidatorInterface $validator |
|
| 146 | + * @param ValidatorInterface $validator |
|
| 146 | 147 | * |
| 147 | 148 | * @return Form |
| 148 | 149 | */ |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function setValue($value) |
| 30 | 30 | { |
| 31 | - if($value instanceof \DateTime){ |
|
| 31 | + if ($value instanceof \DateTime) { |
|
| 32 | 32 | return parent::setValue($value->format('Y-m-d')); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @param array $options |
| 28 | 28 | * @param \User $user |
| 29 | 29 | */ |
| 30 | - public function __construct(\ValidatorInterface $validator, $baseObject, \DoliDB $db, $options,\User $user) |
|
| 30 | + public function __construct(\ValidatorInterface $validator, $baseObject, \DoliDB $db, $options, \User $user) |
|
| 31 | 31 | { |
| 32 | 32 | |
| 33 | 33 | parent::__construct('flight_form', FormInterface::METHOD_POST, $this->buildOptionsfromConfiguration($options)); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $flight = $object; |
| 84 | 84 | |
| 85 | 85 | // Quick fix - Fixme by a factory on this form. |
| 86 | - if($this->user->rights->flightlog->vol->advanced){ |
|
| 86 | + if ($this->user->rights->flightlog->vol->advanced) { |
|
| 87 | 87 | return parent::bind($object); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -116,7 +116,7 @@ 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 |
|
| 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 | 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 |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | $parameters = array(); |
| 147 | 147 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, |
| 148 | - $action); // Note that $action and $object may have been modified by some hooks |
|
| 148 | + $action); // Note that $action and $object may have been modified by some hooks |
|
| 149 | 149 | if ($reshook < 0) { |
| 150 | 150 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 151 | 151 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | |
| 253 | 253 | // Part to edit record |
| 254 | -if (($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id )) && ($id || $ref) && $action == 'edit'): ?> |
|
| 254 | +if (($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && ($id || $ref) && $action == 'edit'): ?> |
|
| 255 | 255 | |
| 256 | 256 | <?php $renderer = new \flightlog\form\SimpleFormRenderer(); ?> |
| 257 | 257 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | <?php echo $renderer->render($formFlight->getElement('idBBC_vols')); ?> |
| 270 | 270 | |
| 271 | - <?php if($formFlight->has('fk_type')): ?> |
|
| 271 | + <?php if ($formFlight->has('fk_type')): ?> |
|
| 272 | 272 | <section class="form-section"> |
| 273 | 273 | <h1 class="form-section-title"><?php echo $langs->trans('Type de vol'); ?></h1> |
| 274 | 274 | <table class="border" width="50%"> |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | <?php endif; ?> |
| 283 | 283 | |
| 284 | 284 | <!-- Date et heures --> |
| 285 | - <?php if($formFlight->has('date')): ?> |
|
| 285 | + <?php if ($formFlight->has('date')): ?> |
|
| 286 | 286 | <section class="form-section"> |
| 287 | 287 | <h1 class="form-section-title"><?php echo $langs->trans('Date'); ?></h1> |
| 288 | 288 | <table class="border" width="50%"> |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | </section> |
| 295 | 295 | <?php endif; ?> |
| 296 | 296 | |
| 297 | - <?php if($formFlight->has('heureD') && $formFlight->has('heureA')): ?> |
|
| 297 | + <?php if ($formFlight->has('heureD') && $formFlight->has('heureA')): ?> |
|
| 298 | 298 | <section class="form-section"> |
| 299 | 299 | <h1 class="form-section-title"><?php echo $langs->trans('Heures'); ?></h1> |
| 300 | 300 | <table class="border" width="50%"> |
@@ -314,14 +314,14 @@ discard block |
||
| 314 | 314 | <h1 class="form-section-title"><?php echo $langs->trans('Pilote & ballon') ?></h1> |
| 315 | 315 | <table class="border" width="50%"> |
| 316 | 316 | |
| 317 | - <?php if($formFlight->has('fk_pilot')): ?> |
|
| 317 | + <?php if ($formFlight->has('fk_pilot')): ?> |
|
| 318 | 318 | <tr> |
| 319 | 319 | <td class="fieldrequired"> Pilote </td> |
| 320 | - <td><?php echo $renderer->render($formFlight->getElement('fk_pilot'),['ajax' => true]); ?></td> |
|
| 320 | + <td><?php echo $renderer->render($formFlight->getElement('fk_pilot'), ['ajax' => true]); ?></td> |
|
| 321 | 321 | </tr> |
| 322 | 322 | <?php endif; ?> |
| 323 | 323 | |
| 324 | - <?php if($formFlight->has('BBC_ballons_idBBC_ballons')): ?> |
|
| 324 | + <?php if ($formFlight->has('BBC_ballons_idBBC_ballons')): ?> |
|
| 325 | 325 | <tr> |
| 326 | 326 | <td width="25%" class="fieldrequired">Ballon</td> |
| 327 | 327 | <td><?php echo $renderer->render($formFlight->getElement('BBC_ballons_idBBC_ballons')); ?></td> |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | </table> |
| 357 | 357 | </section> |
| 358 | 358 | |
| 359 | - <?php if($formFlight->has('fk_organisateur')): ?> |
|
| 359 | + <?php if ($formFlight->has('fk_organisateur')): ?> |
|
| 360 | 360 | <section class="form-section"> |
| 361 | 361 | <h1 class="form-section-title"><span class="js-organisator-field">Organisateur</span></h1> |
| 362 | 362 | <table class="border" width="50%"> |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | <td> |
| 366 | 366 | <?php |
| 367 | 367 | //organisateur |
| 368 | - print $renderer->render($formFlight->getElement('fk_organisateur'),['ajax' => true]); |
|
| 368 | + print $renderer->render($formFlight->getElement('fk_organisateur'), ['ajax' => true]); |
|
| 369 | 369 | ?> |
| 370 | 370 | </td> |
| 371 | 371 | </tr> |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | <section class="form-section js-expensable-field"> |
| 378 | 378 | <h1 class="form-section-title"><?php echo $langs->trans('Déplacements') ?></h1> |
| 379 | 379 | <table class="border" width="50%"> |
| 380 | - <?php if($formFlight->has('kilometers')): ?> |
|
| 380 | + <?php if ($formFlight->has('kilometers')): ?> |
|
| 381 | 381 | <!-- number of kilometers done for the flight --> |
| 382 | 382 | <tr> |
| 383 | 383 | <td class="fieldrequired">Nombre de kilometres effectués pour le vol</td> |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | </tr> |
| 388 | 388 | <?php endif; ?> |
| 389 | 389 | |
| 390 | - <?php if($formFlight->has('justif_kilometers')): ?> |
|
| 390 | + <?php if ($formFlight->has('justif_kilometers')): ?> |
|
| 391 | 391 | <!-- Justif Kilometers --> |
| 392 | 392 | <tr> |
| 393 | 393 | |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | <section class="form-section"> |
| 406 | 406 | <h1 class="form-section-title"><?php echo $langs->trans('Passager') ?></h1> |
| 407 | 407 | <table class="border" width="50%"> |
| 408 | - <?php if($formFlight->has('nbrPax')): ?> |
|
| 408 | + <?php if ($formFlight->has('nbrPax')): ?> |
|
| 409 | 409 | <tr> |
| 410 | 410 | <td class="fieldrequired"><?php echo $langs->trans('Nombre de passagers'); ?></td> |
| 411 | 411 | <td> |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | </tr> |
| 415 | 415 | <?php endif; ?> |
| 416 | 416 | |
| 417 | - <?php if($formFlight->has('passengerNames')): ?> |
|
| 417 | + <?php if ($formFlight->has('passengerNames')): ?> |
|
| 418 | 418 | <!-- passenger names --> |
| 419 | 419 | <tr> |
| 420 | 420 | <td width="25%" class="fieldrequired"><?php echo $langs->trans('Noms des passagers'); ?><br/>(Séparé |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | <?php print $renderer->render($formFlight->getElement('passengerNames')); ?> |
| 425 | 425 | </td> |
| 426 | 426 | </tr> |
| 427 | - <?php endif;?> |
|
| 427 | + <?php endif; ?> |
|
| 428 | 428 | </table> |
| 429 | 429 | </section> |
| 430 | 430 | |
@@ -433,17 +433,17 @@ discard block |
||
| 433 | 433 | <h1 class="form-section-title js-billable-field"><?php echo $langs->trans('Facturation') ?></h1> |
| 434 | 434 | <table class="border" width="50%"> |
| 435 | 435 | |
| 436 | - <?php if($formFlight->has('fk_receiver')): ?> |
|
| 436 | + <?php if ($formFlight->has('fk_receiver')): ?> |
|
| 437 | 437 | <!-- Money receiver --> |
| 438 | 438 | <tr class="js-hide-order js-billable-field"> |
| 439 | 439 | <td class="fieldrequired"><?php echo $langs->trans('Qui a perçu l\'argent') ?></td> |
| 440 | 440 | <td> |
| 441 | - <?php print $renderer->render($formFlight->getElement('fk_receiver'),['ajax' => true]); ?> |
|
| 441 | + <?php print $renderer->render($formFlight->getElement('fk_receiver'), ['ajax' => true]); ?> |
|
| 442 | 442 | </td> |
| 443 | 443 | </tr> |
| 444 | 444 | <?php endif; ?> |
| 445 | 445 | |
| 446 | - <?php if($formFlight->has('cost')): ?> |
|
| 446 | + <?php if ($formFlight->has('cost')): ?> |
|
| 447 | 447 | <!-- Flight cost --> |
| 448 | 448 | <tr class="js-hide-order js-billable-field"> |
| 449 | 449 | <td class="fieldrequired">Montant perçu</td> |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | <h1 class="form-section-title"><?php echo $langs->trans('Commentaires') ?></h1> |
| 462 | 462 | <table class="border" width="50%"> |
| 463 | 463 | |
| 464 | - <?php if($formFlight->has('remarque')): ?> |
|
| 464 | + <?php if ($formFlight->has('remarque')): ?> |
|
| 465 | 465 | <!-- commentaires --> |
| 466 | 466 | <tr class=""> |
| 467 | 467 | <td class="fieldrequired"> Commentaire</td> |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | </tr> |
| 472 | 472 | <?php endif; ?> |
| 473 | 473 | |
| 474 | - <?php if($formFlight->has('incidents')): ?> |
|
| 474 | + <?php if ($formFlight->has('incidents')): ?> |
|
| 475 | 475 | <!-- incidents --> |
| 476 | 476 | <tr class=""> |
| 477 | 477 | <td class="fieldrequired"> incidents</td> |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'), |
| 506 | 506 | $langs->trans('êtes-vous sure de vouloir supprimer ce vol ?'), 'confirm_delete', '', 0, 1); |
| 507 | 507 | print $formconfirm; |
| 508 | - } elseif ($user->rights->flightlog->vol->financial && $action == ACTION_FLAG_BILLED) { |
|
| 508 | + } elseif ($user->rights->flightlog->vol->financial && $action == ACTION_FLAG_BILLED) { |
|
| 509 | 509 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, |
| 510 | 510 | $langs->trans('Marque comme facturé'), |
| 511 | 511 | $langs->trans('Ce vol va être marqué comme facturé, est-ce bien le cas ?'), ACTION_CONFIRM_FLAG_BILLED, '', |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | print '<div class="tabsAction">' . "\n"; |
| 538 | 538 | $parameters = array(); |
| 539 | 539 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, |
| 540 | - $action); // Note that $action and $object may have been modified by hook |
|
| 540 | + $action); // Note that $action and $object may have been modified by hook |
|
| 541 | 541 | if ($reshook < 0) { |
| 542 | 542 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 543 | 543 | } |