@@ -26,8 +26,8 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function __construct($flightId, $projectId) |
| 28 | 28 | { |
| 29 | - $this->flightId = (int)$flightId; |
|
| 30 | - $this->projectId = (int)$projectId; |
|
| 29 | + $this->flightId = (int) $flightId; |
|
| 30 | + $this->projectId = (int) $projectId; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); |
| 128 | 128 | |
| 129 | 129 | // Load object |
| 130 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 130 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 131 | 131 | include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
| 132 | 132 | |
| 133 | 133 | // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | $parameters = array(); |
| 158 | 158 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, |
| 159 | - $action); // Note that $action and $object may have been modified by some hooks |
|
| 159 | + $action); // Note that $action and $object may have been modified by some hooks |
|
| 160 | 160 | if ($reshook < 0) { |
| 161 | 161 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 162 | 162 | } |
@@ -234,12 +234,12 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | // Action to classify in a project |
| 236 | 236 | if (!empty($conf->projet->enabled) && $user->rights->projet->creer && $action === ACTION_CLASSIN) { |
| 237 | - try{ |
|
| 237 | + try { |
|
| 238 | 238 | $handler = new \flightlog\command\ClassifyFlightHandler($db, $conf, $langs, $user); |
| 239 | 239 | $handler->handle(new \flightlog\command\ClassifyFlight($id, GETPOST('projectid'))); |
| 240 | 240 | $object->fetch($id); |
| 241 | 241 | $action = 'show'; |
| 242 | - }catch(Exception $e){ |
|
| 242 | + } catch (Exception $e) { |
|
| 243 | 243 | setEventMessages($e->getMessage(), null, 'errors'); |
| 244 | 244 | } |
| 245 | 245 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | |
| 273 | 273 | |
| 274 | 274 | // Part to edit record |
| 275 | -if (($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id )) && ($id || $ref) && $action == 'edit'): ?> |
|
| 275 | +if (($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && ($id || $ref) && $action == 'edit'): ?> |
|
| 276 | 276 | |
| 277 | 277 | <?php $renderer = new \flightlog\form\SimpleFormRenderer(); ?> |
| 278 | 278 | |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | <?php echo $renderer->render($formFlight->getElement('idBBC_vols')); ?> |
| 291 | 291 | |
| 292 | - <?php if($formFlight->has('fk_type')): ?> |
|
| 292 | + <?php if ($formFlight->has('fk_type')): ?> |
|
| 293 | 293 | <section class="form-section"> |
| 294 | 294 | <h1 class="form-section-title"><?php echo $langs->trans('Type de vol'); ?></h1> |
| 295 | 295 | <table class="border" width="50%"> |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | <?php endif; ?> |
| 304 | 304 | |
| 305 | 305 | <!-- Date et heures --> |
| 306 | - <?php if($formFlight->has('date')): ?> |
|
| 306 | + <?php if ($formFlight->has('date')): ?> |
|
| 307 | 307 | <section class="form-section"> |
| 308 | 308 | <h1 class="form-section-title"><?php echo $langs->trans('Date'); ?></h1> |
| 309 | 309 | <table class="border" width="50%"> |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | </section> |
| 316 | 316 | <?php endif; ?> |
| 317 | 317 | |
| 318 | - <?php if($formFlight->has('heureD') && $formFlight->has('heureA')): ?> |
|
| 318 | + <?php if ($formFlight->has('heureD') && $formFlight->has('heureA')): ?> |
|
| 319 | 319 | <section class="form-section"> |
| 320 | 320 | <h1 class="form-section-title"><?php echo $langs->trans('Heures'); ?></h1> |
| 321 | 321 | <table class="border" width="50%"> |
@@ -335,14 +335,14 @@ discard block |
||
| 335 | 335 | <h1 class="form-section-title"><?php echo $langs->trans('Pilote & ballon') ?></h1> |
| 336 | 336 | <table class="border" width="50%"> |
| 337 | 337 | |
| 338 | - <?php if($formFlight->has('fk_pilot')): ?> |
|
| 338 | + <?php if ($formFlight->has('fk_pilot')): ?> |
|
| 339 | 339 | <tr> |
| 340 | 340 | <td class="fieldrequired"> Pilote </td> |
| 341 | - <td><?php echo $renderer->render($formFlight->getElement('fk_pilot'),['ajax' => true]); ?></td> |
|
| 341 | + <td><?php echo $renderer->render($formFlight->getElement('fk_pilot'), ['ajax' => true]); ?></td> |
|
| 342 | 342 | </tr> |
| 343 | 343 | <?php endif; ?> |
| 344 | 344 | |
| 345 | - <?php if($formFlight->has('BBC_ballons_idBBC_ballons')): ?> |
|
| 345 | + <?php if ($formFlight->has('BBC_ballons_idBBC_ballons')): ?> |
|
| 346 | 346 | <tr> |
| 347 | 347 | <td width="25%" class="fieldrequired">Ballon</td> |
| 348 | 348 | <td><?php echo $renderer->render($formFlight->getElement('BBC_ballons_idBBC_ballons')); ?></td> |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | </table> |
| 378 | 378 | </section> |
| 379 | 379 | |
| 380 | - <?php if($formFlight->has('fk_organisateur')): ?> |
|
| 380 | + <?php if ($formFlight->has('fk_organisateur')): ?> |
|
| 381 | 381 | <section class="form-section"> |
| 382 | 382 | <h1 class="form-section-title"><span class="js-organisator-field">Organisateur</span></h1> |
| 383 | 383 | <table class="border" width="50%"> |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | <td> |
| 387 | 387 | <?php |
| 388 | 388 | //organisateur |
| 389 | - print $renderer->render($formFlight->getElement('fk_organisateur'),['ajax' => true]); |
|
| 389 | + print $renderer->render($formFlight->getElement('fk_organisateur'), ['ajax' => true]); |
|
| 390 | 390 | ?> |
| 391 | 391 | </td> |
| 392 | 392 | </tr> |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | <section class="form-section js-expensable-field"> |
| 399 | 399 | <h1 class="form-section-title"><?php echo $langs->trans('Déplacements') ?></h1> |
| 400 | 400 | <table class="border" width="50%"> |
| 401 | - <?php if($formFlight->has('kilometers')): ?> |
|
| 401 | + <?php if ($formFlight->has('kilometers')): ?> |
|
| 402 | 402 | <!-- number of kilometers done for the flight --> |
| 403 | 403 | <tr> |
| 404 | 404 | <td class="fieldrequired">Nombre de kilometres effectués pour le vol</td> |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | </tr> |
| 409 | 409 | <?php endif; ?> |
| 410 | 410 | |
| 411 | - <?php if($formFlight->has('justif_kilometers')): ?> |
|
| 411 | + <?php if ($formFlight->has('justif_kilometers')): ?> |
|
| 412 | 412 | <!-- Justif Kilometers --> |
| 413 | 413 | <tr> |
| 414 | 414 | |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | <section class="form-section"> |
| 427 | 427 | <h1 class="form-section-title"><?php echo $langs->trans('Passager') ?></h1> |
| 428 | 428 | <table class="border" width="50%"> |
| 429 | - <?php if($formFlight->has('nbrPax')): ?> |
|
| 429 | + <?php if ($formFlight->has('nbrPax')): ?> |
|
| 430 | 430 | <tr> |
| 431 | 431 | <td class="fieldrequired"><?php echo $langs->trans('Nombre de passagers'); ?></td> |
| 432 | 432 | <td> |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | </tr> |
| 436 | 436 | <?php endif; ?> |
| 437 | 437 | |
| 438 | - <?php if($formFlight->has('passengerNames')): ?> |
|
| 438 | + <?php if ($formFlight->has('passengerNames')): ?> |
|
| 439 | 439 | <!-- passenger names --> |
| 440 | 440 | <tr> |
| 441 | 441 | <td width="25%" class="fieldrequired"><?php echo $langs->trans('Noms des passagers'); ?><br/>(Séparé |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | <?php print $renderer->render($formFlight->getElement('passengerNames')); ?> |
| 446 | 446 | </td> |
| 447 | 447 | </tr> |
| 448 | - <?php endif;?> |
|
| 448 | + <?php endif; ?> |
|
| 449 | 449 | </table> |
| 450 | 450 | </section> |
| 451 | 451 | |
@@ -454,17 +454,17 @@ discard block |
||
| 454 | 454 | <h1 class="form-section-title js-billable-field"><?php echo $langs->trans('Facturation') ?></h1> |
| 455 | 455 | <table class="border" width="50%"> |
| 456 | 456 | |
| 457 | - <?php if($formFlight->has('fk_receiver')): ?> |
|
| 457 | + <?php if ($formFlight->has('fk_receiver')): ?> |
|
| 458 | 458 | <!-- Money receiver --> |
| 459 | 459 | <tr class="js-hide-order js-billable-field"> |
| 460 | 460 | <td class="fieldrequired"><?php echo $langs->trans('Qui a perçu l\'argent') ?></td> |
| 461 | 461 | <td> |
| 462 | - <?php print $renderer->render($formFlight->getElement('fk_receiver'),['ajax' => true]); ?> |
|
| 462 | + <?php print $renderer->render($formFlight->getElement('fk_receiver'), ['ajax' => true]); ?> |
|
| 463 | 463 | </td> |
| 464 | 464 | </tr> |
| 465 | 465 | <?php endif; ?> |
| 466 | 466 | |
| 467 | - <?php if($formFlight->has('cost')): ?> |
|
| 467 | + <?php if ($formFlight->has('cost')): ?> |
|
| 468 | 468 | <!-- Flight cost --> |
| 469 | 469 | <tr class="js-hide-order js-billable-field"> |
| 470 | 470 | <td class="fieldrequired">Montant perçu</td> |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | <h1 class="form-section-title"><?php echo $langs->trans('Commentaires') ?></h1> |
| 483 | 483 | <table class="border" width="50%"> |
| 484 | 484 | |
| 485 | - <?php if($formFlight->has('remarque')): ?> |
|
| 485 | + <?php if ($formFlight->has('remarque')): ?> |
|
| 486 | 486 | <!-- commentaires --> |
| 487 | 487 | <tr class=""> |
| 488 | 488 | <td class="fieldrequired"> Commentaire</td> |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | </tr> |
| 493 | 493 | <?php endif; ?> |
| 494 | 494 | |
| 495 | - <?php if($formFlight->has('incidents')): ?> |
|
| 495 | + <?php if ($formFlight->has('incidents')): ?> |
|
| 496 | 496 | <!-- incidents --> |
| 497 | 497 | <tr class=""> |
| 498 | 498 | <td class="fieldrequired"> incidents</td> |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'), |
| 527 | 527 | $langs->trans('êtes-vous sure de vouloir supprimer ce vol ?'), 'confirm_delete', '', 0, 1); |
| 528 | 528 | print $formconfirm; |
| 529 | - } elseif ($user->rights->flightlog->vol->financial && $action == ACTION_FLAG_BILLED) { |
|
| 529 | + } elseif ($user->rights->flightlog->vol->financial && $action == ACTION_FLAG_BILLED) { |
|
| 530 | 530 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, |
| 531 | 531 | $langs->trans('Marque comme facturé'), |
| 532 | 532 | $langs->trans('Ce vol va être marqué comme facturé, est-ce bien le cas ?'), ACTION_CONFIRM_FLAG_BILLED, '', |
@@ -550,29 +550,29 @@ discard block |
||
| 550 | 550 | print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_pilot") . '</td><td>' . $pilot->getNomUrl(1) . '</td></tr>'; |
| 551 | 551 | print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_organisateur") . '</td><td>' . $organisator->getNomUrl(1) . '</td></tr>'; |
| 552 | 552 | |
| 553 | - if (! empty($conf->projet->enabled)) |
|
| 553 | + if (!empty($conf->projet->enabled)) |
|
| 554 | 554 | { |
| 555 | 555 | print '<tr><td class="fieldrequired">' . $langs->trans("Project") . '</td><td>'; |
| 556 | 556 | $morehtmlref = ''; |
| 557 | 557 | if ($user->rights->projet->creer) |
| 558 | 558 | { |
| 559 | 559 | if ($action !== ACTION_CLASSIFY) { |
| 560 | - $morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action='.ACTION_CLASSIFY.'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> '; |
|
| 560 | + $morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=' . ACTION_CLASSIFY . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> '; |
|
| 561 | 561 | } |
| 562 | 562 | if ($action === ACTION_CLASSIFY) { |
| 563 | - $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; |
|
| 564 | - $morehtmlref.='<input type="hidden" name="action" value="'.ACTION_CLASSIN.'">'; |
|
| 565 | - $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
|
| 566 | - $morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', 80, 0, 1, 0, 1, 0, 0, '', 1); |
|
| 567 | - $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 568 | - $morehtmlref.='</form>'; |
|
| 563 | + $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">'; |
|
| 564 | + $morehtmlref .= '<input type="hidden" name="action" value="' . ACTION_CLASSIN . '">'; |
|
| 565 | + $morehtmlref .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
| 566 | + $morehtmlref .= $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, 'projectid', 80, 0, 1, 0, 1, 0, 0, '', 1); |
|
| 567 | + $morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 568 | + $morehtmlref .= '</form>'; |
|
| 569 | 569 | } |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | if ($object->hasProject()) { |
| 573 | 573 | $proj = new Project($db); |
| 574 | 574 | $proj->fetch($object->fk_project); |
| 575 | - $morehtmlref.=$proj->getNomUrl(1); |
|
| 575 | + $morehtmlref .= $proj->getNomUrl(1); |
|
| 576 | 576 | } |
| 577 | 577 | print $morehtmlref . '</td>'; |
| 578 | 578 | } |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | print '<div class="tabsAction">' . "\n"; |
| 588 | 588 | $parameters = array(); |
| 589 | 589 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, |
| 590 | - $action); // Note that $action and $object may have been modified by hook |
|
| 590 | + $action); // Note that $action and $object may have been modified by hook |
|
| 591 | 591 | if ($reshook < 0) { |
| 592 | 592 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 593 | 593 | } |
@@ -239,7 +239,7 @@ |
||
| 239 | 239 | $handler->handle(new \flightlog\command\ClassifyFlight($id, GETPOST('projectid'))); |
| 240 | 240 | $object->fetch($id); |
| 241 | 241 | $action = 'show'; |
| 242 | - }catch(Exception $e){ |
|
| 242 | + } catch(Exception $e){ |
|
| 243 | 243 | setEventMessages($e->getMessage(), null, 'errors'); |
| 244 | 244 | } |
| 245 | 245 | } |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | |
| 112 | 112 | /** |
| 113 | 113 | * @param Product $flightProduct |
| 114 | - * @param float|int $pricePerPax |
|
| 114 | + * @param integer $pricePerPax |
|
| 115 | 115 | * |
| 116 | 116 | * @return float|int |
| 117 | 117 | */ |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | $this->language = $form->language; |
| 125 | 125 | $this->userId = $userId; |
| 126 | 126 | $this->publicComment = $form->isCommentPublic == 1; |
| 127 | - $this->socid = (int)$form->socid; |
|
| 127 | + $this->socid = (int) $form->socid; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -52,12 +52,12 @@ |
||
| 52 | 52 | if (!isset($value->socid) && empty($value->email) && empty($value->phone)) { |
| 53 | 53 | $this->addWarning('Soit l\'e-mail soit le téléphone n\'a pas été complété'); |
| 54 | 54 | } |
| 55 | - if (empty($value->nbrPax) || (int)$value->nbrPax <= 0) { |
|
| 55 | + if (empty($value->nbrPax) || (int) $value->nbrPax <= 0) { |
|
| 56 | 56 | $this->addError('nbrPax', 'Le nombre de passagers doit être plus grand que 0.'); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if ((int)$value->nbrPax > 0) { |
|
| 60 | - $costPerPax = $value->cost / (int)$value->nbrPax; |
|
| 59 | + if ((int) $value->nbrPax > 0) { |
|
| 60 | + $costPerPax = $value->cost / (int) $value->nbrPax; |
|
| 61 | 61 | if ($costPerPax < $this->getMinPrice()) { |
| 62 | 62 | $this->addError('cost', |
| 63 | 63 | sprintf('Le prix demandé par passagé est trop peu élevé. Un minimum de %s est demandé', |
@@ -12,32 +12,32 @@ discard block |
||
| 12 | 12 | dol_include_once("/flightlog/lib/flightLog.lib.php"); |
| 13 | 13 | dol_include_once("/flightlog/validators/SimpleOrderValidator.php"); |
| 14 | 14 | dol_include_once("/flightlog/command/CreateOrderCommandHandler.php"); |
| 15 | -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
| 16 | -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; |
|
| 15 | +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
| 16 | +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php'; |
|
| 17 | 17 | |
| 18 | 18 | // Load object modCodeTiers |
| 19 | -$module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard'); |
|
| 19 | +$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); |
|
| 20 | 20 | if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') |
| 21 | 21 | { |
| 22 | - $module = substr($module, 0, dol_strlen($module)-4); |
|
| 22 | + $module = substr($module, 0, dol_strlen($module) - 4); |
|
| 23 | 23 | } |
| 24 | -$dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); |
|
| 24 | +$dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); |
|
| 25 | 25 | foreach ($dirsociete as $dirroot) |
| 26 | 26 | { |
| 27 | - $res=dol_include_once($dirroot.$module.'.php'); |
|
| 27 | + $res = dol_include_once($dirroot . $module . '.php'); |
|
| 28 | 28 | if ($res) break; |
| 29 | 29 | } |
| 30 | 30 | $modCodeClient = new $module; |
| 31 | 31 | // Load object modCodeFournisseur |
| 32 | -$module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard'); |
|
| 32 | +$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); |
|
| 33 | 33 | if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') |
| 34 | 34 | { |
| 35 | - $module = substr($module, 0, dol_strlen($module)-4); |
|
| 35 | + $module = substr($module, 0, dol_strlen($module) - 4); |
|
| 36 | 36 | } |
| 37 | -$dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); |
|
| 37 | +$dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); |
|
| 38 | 38 | foreach ($dirsociete as $dirroot) |
| 39 | 39 | { |
| 40 | - $res=dol_include_once($dirroot.$module.'.php'); |
|
| 40 | + $res = dol_include_once($dirroot . $module . '.php'); |
|
| 41 | 41 | if ($res) break; |
| 42 | 42 | } |
| 43 | 43 | $modCodeFournisseur = new $module; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $msg = ''; |
| 60 | 60 | $socid = null; |
| 61 | 61 | |
| 62 | -if (GETPOST('socid', 'int') > 0){ |
|
| 62 | +if (GETPOST('socid', 'int') > 0) { |
|
| 63 | 63 | $socid = GETPOST('socid', 'int'); |
| 64 | 64 | $customer->fetch($socid); |
| 65 | 65 | } |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | $formObject = new stdClass(); |
| 72 | 72 | $formObject->socid = $socid; |
| 73 | - $formObject->name = GETPOST('name','alpha'); |
|
| 74 | - $formObject->firstname = GETPOST('firstname','alpha'); |
|
| 75 | - $formObject->zip = GETPOST('zipcode','alpha'); |
|
| 73 | + $formObject->name = GETPOST('name', 'alpha'); |
|
| 74 | + $formObject->firstname = GETPOST('firstname', 'alpha'); |
|
| 75 | + $formObject->zip = GETPOST('zipcode', 'alpha'); |
|
| 76 | 76 | $formObject->town = GETPOST('town', 'alpha'); |
| 77 | 77 | $formObject->state = GETPOST('state_id', 'int'); |
| 78 | 78 | $formObject->phone = GETPOST('phone', 'alpha'); |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | if ($validator->isValid($formObject, $_REQUEST)) { |
| 91 | 91 | $createOrderCommand = new CreateOrderCommand($formObject, $user->id); |
| 92 | - try{ |
|
| 93 | - $handler = new CreateOrderCommandHandler($db, $conf,$user,$langs,$modCodeClient, $modCodeFournisseur); |
|
| 92 | + try { |
|
| 93 | + $handler = new CreateOrderCommandHandler($db, $conf, $user, $langs, $modCodeClient, $modCodeFournisseur); |
|
| 94 | 94 | $handler->handle($createOrderCommand); |
| 95 | 95 | |
| 96 | 96 | $msg = '<div class="success ok">Commande et tiers créés. </div>'; |
@@ -125,18 +125,18 @@ discard block |
||
| 125 | 125 | ?> |
| 126 | 126 | |
| 127 | 127 | <!-- Success message with reference --> |
| 128 | - <?php if($successMessage): ?> |
|
| 128 | + <?php if ($successMessage): ?> |
|
| 129 | 129 | <div class="bbc-style"> |
| 130 | 130 | <p class="cadre_msg1"> |
| 131 | 131 | Vous avez généré la facture et créé un tiers.<br/> |
| 132 | 132 | Merci, |
| 133 | 133 | </p> |
| 134 | 134 | |
| 135 | - <?php if(count($validator->getWarningMessages()) > 0):?> |
|
| 135 | + <?php if (count($validator->getWarningMessages()) > 0):?> |
|
| 136 | 136 | <div class="box box-warning"> |
| 137 | 137 | <p>Ceci sont des messages d'attention mais qui ne bloquent pas la création de la commande</p> |
| 138 | 138 | <ul> |
| 139 | - <?php foreach($validator->getWarningMessages() as $warningMessage): ?> |
|
| 139 | + <?php foreach ($validator->getWarningMessages() as $warningMessage): ?> |
|
| 140 | 140 | <li class="warning"><?php echo $warningMessage; ?></li> |
| 141 | 141 | <?php endforeach; ?> |
| 142 | 142 | </ul> |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | <p> |
| 196 | 196 | Cette page vous permettra de créer une commande. La commande est <b>obligatoire</b> si vous désirez faire payer les passagers directement sur le compte du club.<br> |
| 197 | 197 | Si vous avez un doute sur la manière d'encoder la commande, veuillez me contacter AVANT de soumettre le dit formulaire.<br/> |
| 198 | - Si vous avez <b>déjà</b> encodé une commande, et que vous voulez la retrouver veuillez vous rendre sur : <a href="<?php echo sprintf(DOL_URL_ROOT.'/commande/list.php?search_sale=%s', $user->id); ?>">mes commandes.</a> |
|
| 198 | + Si vous avez <b>déjà</b> encodé une commande, et que vous voulez la retrouver veuillez vous rendre sur : <a href="<?php echo sprintf(DOL_URL_ROOT . '/commande/list.php?search_sale=%s', $user->id); ?>">mes commandes.</a> |
|
| 199 | 199 | </p> |
| 200 | 200 | </div> |
| 201 | 201 | <form class="flight-form" name='add' method="post"> |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $(document).ready(function() { |
| 218 | 218 | $("#socid").change(function() { |
| 219 | 219 | var socid = $(this).val(); |
| 220 | - window.location.href = "<?php echo $_SERVER["PHP_SELF"].'?socid="+socid' ?> |
|
| 220 | + window.location.href = "<?php echo $_SERVER["PHP_SELF"] . '?socid="+socid' ?> |
|
| 221 | 221 | }); |
| 222 | 222 | }); |
| 223 | 223 | </script> |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | </tr> |
| 227 | 227 | |
| 228 | 228 | |
| 229 | - <?php if($socid === null): ?> |
|
| 229 | + <?php if ($socid === null): ?> |
|
| 230 | 230 | <!-- Nom --> |
| 231 | 231 | <tr> |
| 232 | 232 | <td class="fieldrequired"> |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | <?php echo $langs->trans('DefaultLang'); ?> |
| 296 | 296 | </td> |
| 297 | 297 | <td> |
| 298 | - <?php echo $formAdmin->select_language($conf->global->MAIN_LANG_DEFAULT,'default_lang',0,0,1,0,0,'maxwidth200onsmartphone'); ?> |
|
| 298 | + <?php echo $formAdmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); ?> |
|
| 299 | 299 | </td> |
| 300 | 300 | </tr> |
| 301 | 301 | |
@@ -305,16 +305,16 @@ discard block |
||
| 305 | 305 | <?php echo $langs->trans('Region'); ?> |
| 306 | 306 | </td> |
| 307 | 307 | <td> |
| 308 | - <?php print $formcompany->select_state($formObject->state,'BE'); ?> |
|
| 308 | + <?php print $formcompany->select_state($formObject->state, 'BE'); ?> |
|
| 309 | 309 | </td> |
| 310 | 310 | </tr> |
| 311 | 311 | |
| 312 | 312 | <?php |
| 313 | 313 | // Zip / Town |
| 314 | - print '<tr><td>'.fieldLabel('Zip','zipcode').'</td><td>'; |
|
| 315 | - print $formcompany->select_ziptown($formObject->town,'zipcode',array('town','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); |
|
| 316 | - print '</td><td>'.fieldLabel('Town','town').'</td><td>'; |
|
| 317 | - print $formcompany->select_ziptown($formObject->zip,'town',array('zipcode','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); |
|
| 314 | + print '<tr><td>' . fieldLabel('Zip', 'zipcode') . '</td><td>'; |
|
| 315 | + print $formcompany->select_ziptown($formObject->town, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); |
|
| 316 | + print '</td><td>' . fieldLabel('Town', 'town') . '</td><td>'; |
|
| 317 | + print $formcompany->select_ziptown($formObject->zip, 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); |
|
| 318 | 318 | print '</td></tr>'; |
| 319 | 319 | ?> |
| 320 | 320 | |
@@ -338,16 +338,16 @@ discard block |
||
| 338 | 338 | <?php |
| 339 | 339 | if (empty($conf->global->MAIN_DISABLEVATCHECK)): ?> |
| 340 | 340 | |
| 341 | - <?php if (! empty($conf->use_javascript_ajax)): ?> |
|
| 341 | + <?php if (!empty($conf->use_javascript_ajax)): ?> |
|
| 342 | 342 | <script language="JavaScript" type="text/javascript"> |
| 343 | 343 | function CheckVAT(a) { |
| 344 | - <?php print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,300);"; ?> |
|
| 344 | + <?php print "newpopup('" . DOL_URL_ROOT . "/societe/checkvat/checkVatPopup.php?vatNumber='+a,'" . dol_escape_js($langs->trans("VATIntraCheckableOnEUSite")) . "',500,300);"; ?> |
|
| 345 | 345 | } |
| 346 | 346 | </script> |
| 347 | 347 | <a href="#" class="hideonsmartphone" onclick="javascript: CheckVAT(document.add.tva_intra.value);"><?php echo $langs->trans("VATIntraCheck"); ?></a> |
| 348 | - <?php echo $html->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); ?> |
|
| 348 | + <?php echo $html->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->trans("VATIntraCheck")), 1); ?> |
|
| 349 | 349 | <?php else: ?> |
| 350 | - <a href="<?php echo $langs->transcountry("VATIntraCheckURL",$object->country_id); ?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help'); ?></a> |
|
| 350 | + <a href="<?php echo $langs->transcountry("VATIntraCheckURL", $object->country_id); ?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help'); ?></a> |
|
| 351 | 351 | <?php endif; ?> |
| 352 | 352 | <?php endif; ?> |
| 353 | 353 | </td> |
@@ -402,10 +402,10 @@ discard block |
||
| 402 | 402 | <tr> |
| 403 | 403 | <td><?php echo $langs->trans('Le commentaire doit-il figurer sur la commande') ?></td> |
| 404 | 404 | <td> |
| 405 | - <input type="radio" id="public_comment" name="public_comment" value="1" <?php echo ($formObject->isCommentPublic == 1)?'checked="checked"' : ''; ?>/> |
|
| 405 | + <input type="radio" id="public_comment" name="public_comment" value="1" <?php echo ($formObject->isCommentPublic == 1) ? 'checked="checked"' : ''; ?>/> |
|
| 406 | 406 | <label for="public_comment">Oui</label> |
| 407 | 407 | - |
| 408 | - <input type="radio" id="private_comment" name="public_comment" value="0" <?php echo ($formObject == null || $formObject->isCommentPublic === null || $formObject->isCommentPublic === 0)?'checked="checked"' : ''; ?>/> |
|
| 408 | + <input type="radio" id="private_comment" name="public_comment" value="0" <?php echo ($formObject == null || $formObject->isCommentPublic === null || $formObject->isCommentPublic === 0) ? 'checked="checked"' : ''; ?>/> |
|
| 409 | 409 | <label for="private_comment">Non</label> |
| 410 | 410 | </td> |
| 411 | 411 | </tr> |
@@ -25,8 +25,10 @@ discard block |
||
| 25 | 25 | foreach ($dirsociete as $dirroot) |
| 26 | 26 | { |
| 27 | 27 | $res=dol_include_once($dirroot.$module.'.php'); |
| 28 | - if ($res) break; |
|
| 29 | -} |
|
| 28 | + if ($res) { |
|
| 29 | + break; |
|
| 30 | + } |
|
| 31 | + } |
|
| 30 | 32 | $modCodeClient = new $module; |
| 31 | 33 | // Load object modCodeFournisseur |
| 32 | 34 | $module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard'); |
@@ -38,8 +40,10 @@ discard block |
||
| 38 | 40 | foreach ($dirsociete as $dirroot) |
| 39 | 41 | { |
| 40 | 42 | $res=dol_include_once($dirroot.$module.'.php'); |
| 41 | - if ($res) break; |
|
| 42 | -} |
|
| 43 | + if ($res) { |
|
| 44 | + break; |
|
| 45 | + } |
|
| 46 | + } |
|
| 43 | 47 | $modCodeFournisseur = new $module; |
| 44 | 48 | |
| 45 | 49 | // Load translation files required by the page |
@@ -346,8 +350,11 @@ discard block |
||
| 346 | 350 | </script> |
| 347 | 351 | <a href="#" class="hideonsmartphone" onclick="javascript: CheckVAT(document.add.tva_intra.value);"><?php echo $langs->trans("VATIntraCheck"); ?></a> |
| 348 | 352 | <?php echo $html->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); ?> |
| 349 | - <?php else: ?> |
|
| 350 | - <a href="<?php echo $langs->transcountry("VATIntraCheckURL",$object->country_id); ?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help'); ?></a> |
|
| 353 | + <?php else { |
|
| 354 | + : ?> |
|
| 355 | + <a href="<?php echo $langs->transcountry("VATIntraCheckURL",$object->country_id); |
|
| 356 | +} |
|
| 357 | +?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help'); ?></a> |
|
| 351 | 358 | <?php endif; ?> |
| 352 | 359 | <?php endif; ?> |
| 353 | 360 | </td> |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | return $sql; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - public function completeListOfReferent(){ |
|
| 75 | + public function completeListOfReferent() { |
|
| 76 | 76 | dol_include_once('/flightlog/class/bbcvols.class.php'); |
| 77 | 77 | |
| 78 | 78 | $this->results['flightlog'] = [ |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | |
| 19 | -require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; |
|
| 19 | +require_once DOL_DOCUMENT_ROOT . '/core/triggers/dolibarrtriggers.class.php'; |
|
| 20 | 20 | dol_include_once('/flightlog/class/bbcvols.class.php'); |
| 21 | 21 | dol_include_once('/core/class/CMailFile.class.php'); |
| 22 | 22 | |
@@ -78,23 +78,23 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) |
| 80 | 80 | { |
| 81 | - if (empty($conf->flightlog->enabled) || empty($conf->workflow->enabled)){ |
|
| 81 | + if (empty($conf->flightlog->enabled) || empty($conf->workflow->enabled)) { |
|
| 82 | 82 | return 0; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - if(empty($conf->global->WORKFLOW_BBC_FLIGHTLOG_SEND_MAIL_ON_INCIDENT)){ |
|
| 85 | + if (empty($conf->global->WORKFLOW_BBC_FLIGHTLOG_SEND_MAIL_ON_INCIDENT)) { |
|
| 86 | 86 | return 0; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - if($action !== 'BBC_FLIGHT_LOG_ADD_FLIGHT'){ |
|
| 89 | + if ($action !== 'BBC_FLIGHT_LOG_ADD_FLIGHT') { |
|
| 90 | 90 | return 0; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - if(!$object->hasIncidents() && !$object->hasComment()){ |
|
| 93 | + if (!$object->hasIncidents() && !$object->hasComment()) { |
|
| 94 | 94 | return 0; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - if(!empty($conf->global->MAIN_DISABLE_ALL_MAILS)){ |
|
| 97 | + if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { |
|
| 98 | 98 | return 0; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | ); |
| 128 | 128 | |
| 129 | 129 | |
| 130 | - if (! $mailfile->sendfile()) |
|
| 130 | + if (!$mailfile->sendfile()) |
|
| 131 | 131 | { |
| 132 | 132 | dol_syslog("Error while sending mail in flight log module : incident", LOG_ERR); |
| 133 | 133 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | private function checkPassengersInformation($vol) |
| 151 | 151 | { |
| 152 | - if (!is_numeric($vol->nbrPax) || (int)$vol->nbrPax < 0) { |
|
| 152 | + if (!is_numeric($vol->nbrPax) || (int) $vol->nbrPax < 0) { |
|
| 153 | 153 | $this->addError('nbrPax', 'Erreur le nombre de passager est un nombre négatif.'); |
| 154 | 154 | } |
| 155 | 155 | |
@@ -241,10 +241,10 @@ discard block |
||
| 241 | 241 | $this->addError('order_id', 'Le nombre de passager par commande doit être >= 0.'); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $totalPassenegrs += (int)$nbrPassengers; |
|
| 244 | + $totalPassenegrs += (int) $nbrPassengers; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - if ($totalPassenegrs !== (int)$vol->getNumberOfPassengers()) { |
|
| 247 | + if ($totalPassenegrs !== (int) $vol->getNumberOfPassengers()) { |
|
| 248 | 248 | $this->addError('nbrPax', 'Le nombre de passagers ne correspond pas au nombre entré sur les commandes'); |
| 249 | 249 | } |
| 250 | 250 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | private function checkFlightDate(Bbcvols $flight) |
| 260 | 260 | { |
| 261 | - if($flight->getDate() > new DateTimeImmutable()){ |
|
| 261 | + if ($flight->getDate() > new DateTimeImmutable()) { |
|
| 262 | 262 | $this->addError('date', 'La date est plus grande que la date d\'aujourd\'hui'); |
| 263 | 263 | } |
| 264 | 264 | |