@@ -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é', |
@@ -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> |
@@ -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,15 +89,15 @@ 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>'; |
| 97 | 97 | $successMessage = true; |
| 98 | 98 | } catch (\Exception $e) { |
| 99 | 99 | // Creation KO |
| 100 | - $msg = '<div class="error">Erreur lors de l\'ajout de la commande '.$e->getMessage().'</div>'; |
|
| 100 | + $msg = '<div class="error">Erreur lors de l\'ajout de la commande ' . $e->getMessage() . '</div>'; |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -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"> |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | $(document).ready(function() { |
| 219 | 219 | $("#socid").change(function() { |
| 220 | 220 | var socid = $(this).val(); |
| 221 | - window.location.href = "<?php echo $_SERVER["PHP_SELF"].'?socid="+socid' ?> |
|
| 221 | + window.location.href = "<?php echo $_SERVER["PHP_SELF"] . '?socid="+socid' ?> |
|
| 222 | 222 | }); |
| 223 | 223 | }); |
| 224 | 224 | </script> |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | </tr> |
| 228 | 228 | |
| 229 | 229 | |
| 230 | - <?php if($socid === null): ?> |
|
| 230 | + <?php if ($socid === null): ?> |
|
| 231 | 231 | <!-- Nom --> |
| 232 | 232 | <tr> |
| 233 | 233 | <td class="fieldrequired"> |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | <?php echo $langs->trans('DefaultLang'); ?> |
| 297 | 297 | </td> |
| 298 | 298 | <td> |
| 299 | - <?php echo $formAdmin->select_language($conf->global->MAIN_LANG_DEFAULT,'default_lang',0,0,1,0,0,'maxwidth200onsmartphone'); ?> |
|
| 299 | + <?php echo $formAdmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); ?> |
|
| 300 | 300 | </td> |
| 301 | 301 | </tr> |
| 302 | 302 | |
@@ -306,16 +306,16 @@ discard block |
||
| 306 | 306 | <?php echo $langs->trans('Region'); ?> |
| 307 | 307 | </td> |
| 308 | 308 | <td> |
| 309 | - <?php print $formcompany->select_state($formObject->state,'BE'); ?> |
|
| 309 | + <?php print $formcompany->select_state($formObject->state, 'BE'); ?> |
|
| 310 | 310 | </td> |
| 311 | 311 | </tr> |
| 312 | 312 | |
| 313 | 313 | <?php |
| 314 | 314 | // Zip / Town |
| 315 | - print '<tr><td>'.fieldLabel('Zip','zipcode').'</td><td>'; |
|
| 316 | - print $formcompany->select_ziptown($formObject->town,'zipcode',array('town','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); |
|
| 317 | - print '</td><td>'.fieldLabel('Town','town').'</td><td>'; |
|
| 318 | - print $formcompany->select_ziptown($formObject->zip,'town',array('zipcode','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); |
|
| 315 | + print '<tr><td>' . fieldLabel('Zip', 'zipcode') . '</td><td>'; |
|
| 316 | + print $formcompany->select_ziptown($formObject->town, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); |
|
| 317 | + print '</td><td>' . fieldLabel('Town', 'town') . '</td><td>'; |
|
| 318 | + print $formcompany->select_ziptown($formObject->zip, 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); |
|
| 319 | 319 | print '</td></tr>'; |
| 320 | 320 | ?> |
| 321 | 321 | |
@@ -339,16 +339,16 @@ discard block |
||
| 339 | 339 | <?php |
| 340 | 340 | if (empty($conf->global->MAIN_DISABLEVATCHECK)): ?> |
| 341 | 341 | |
| 342 | - <?php if (! empty($conf->use_javascript_ajax)): ?> |
|
| 342 | + <?php if (!empty($conf->use_javascript_ajax)): ?> |
|
| 343 | 343 | <script language="JavaScript" type="text/javascript"> |
| 344 | 344 | function CheckVAT(a) { |
| 345 | - <?php print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,300);"; ?> |
|
| 345 | + <?php print "newpopup('" . DOL_URL_ROOT . "/societe/checkvat/checkVatPopup.php?vatNumber='+a,'" . dol_escape_js($langs->trans("VATIntraCheckableOnEUSite")) . "',500,300);"; ?> |
|
| 346 | 346 | } |
| 347 | 347 | </script> |
| 348 | 348 | <a href="#" class="hideonsmartphone" onclick="javascript: CheckVAT(document.add.tva_intra.value);"><?php echo $langs->trans("VATIntraCheck"); ?></a> |
| 349 | - <?php echo $html->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); ?> |
|
| 349 | + <?php echo $html->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->trans("VATIntraCheck")), 1); ?> |
|
| 350 | 350 | <?php else: ?> |
| 351 | - <a href="<?php echo $langs->transcountry("VATIntraCheckURL",$object->country_id); ?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help'); ?></a> |
|
| 351 | + <a href="<?php echo $langs->transcountry("VATIntraCheckURL", $object->country_id); ?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help'); ?></a> |
|
| 352 | 352 | <?php endif; ?> |
| 353 | 353 | <?php endif; ?> |
| 354 | 354 | </td> |
@@ -403,10 +403,10 @@ discard block |
||
| 403 | 403 | <tr> |
| 404 | 404 | <td><?php echo $langs->trans('Le commentaire doit-il figurer sur la commande') ?></td> |
| 405 | 405 | <td> |
| 406 | - <input type="radio" id="public_comment" name="public_comment" value="1" <?php echo ($formObject->isCommentPublic == 1)?'checked="checked"' : ''; ?>/> |
|
| 406 | + <input type="radio" id="public_comment" name="public_comment" value="1" <?php echo ($formObject->isCommentPublic == 1) ? 'checked="checked"' : ''; ?>/> |
|
| 407 | 407 | <label for="public_comment">Oui</label> |
| 408 | 408 | - |
| 409 | - <input type="radio" id="private_comment" name="public_comment" value="0" <?php echo ($formObject == null || $formObject->isCommentPublic === null || $formObject->isCommentPublic === 0)?'checked="checked"' : ''; ?>/> |
|
| 409 | + <input type="radio" id="private_comment" name="public_comment" value="0" <?php echo ($formObject == null || $formObject->isCommentPublic === null || $formObject->isCommentPublic === 0) ? 'checked="checked"' : ''; ?>/> |
|
| 410 | 410 | <label for="private_comment">Non</label> |
| 411 | 411 | </td> |
| 412 | 412 | </tr> |
@@ -123,11 +123,11 @@ |
||
| 123 | 123 | * Put here all code to do according to value of "action" parameter |
| 124 | 124 | */ |
| 125 | 125 | if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) { |
| 126 | - try{ |
|
| 127 | - $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount, $nbrPax, $customerId); |
|
| 126 | + try { |
|
| 127 | + $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote, $bankAccount, $nbrPax, $customerId); |
|
| 128 | 128 | $handler->handle($command); |
| 129 | - }catch (\Exception $e){ |
|
| 130 | - dol_syslog($e->getMessage(),LOG_ERR); |
|
| 129 | + } catch (\Exception $e) { |
|
| 130 | + dol_syslog($e->getMessage(), LOG_ERR); |
|
| 131 | 131 | dol_htmloutput_mesg("Facture non créée", '', 'error'); |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | try{ |
| 127 | 127 | $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount, $nbrPax, $customerId); |
| 128 | 128 | $handler->handle($command); |
| 129 | - }catch (\Exception $e){ |
|
| 129 | + } catch (\Exception $e){ |
|
| 130 | 130 | dol_syslog($e->getMessage(),LOG_ERR); |
| 131 | 131 | dol_htmloutput_mesg("Facture non créée", '', 'error'); |
| 132 | 132 | } |
@@ -311,9 +311,12 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | <?php if (!$flightProduct || !$flight->hasReceiver()) : ?> |
| 313 | 313 | <a class="butActionRefused" href="#">Générer</a> |
| 314 | - <?php else: ?> |
|
| 314 | + <?php else { |
|
| 315 | + : ?> |
|
| 315 | 316 | <button class="butAction" type="submit">Générer</button> |
| 316 | - <?php endif; ?> |
|
| 317 | + <?php endif; |
|
| 318 | +} |
|
| 319 | +?> |
|
| 317 | 320 | |
| 318 | 321 | <a class="butAction" href="<?php echo DOL_URL_ROOT . '/flightlog/card.php?id=' . $flight->id; ?>">Retour au |
| 319 | 322 | vol</a> |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $numberOfKilometers |
| 42 | 42 | ) |
| 43 | 43 | { |
| 44 | - $pilotId = (int)$pilotId; |
|
| 44 | + $pilotId = (int) $pilotId; |
|
| 45 | 45 | |
| 46 | 46 | if (!isset($this->items[$pilotId])) { |
| 47 | 47 | $this->items[$pilotId] = new PilotMissions($pilotId, $pilotFirstname, $pilotLastname); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function addPilot($pilotId, $pilotFirstname, $pilotLastname) |
| 59 | 59 | { |
| 60 | - $pilotId = (int)$pilotId; |
|
| 60 | + $pilotId = (int) $pilotId; |
|
| 61 | 61 | |
| 62 | 62 | if (isset($this->items[$pilotId])) { |
| 63 | 63 | return; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function __construct($pilotId, $pilotFirstname, $pilotLastname) |
| 40 | 40 | { |
| 41 | - $this->pilotId = (int)$pilotId; |
|
| 41 | + $this->pilotId = (int) $pilotId; |
|
| 42 | 42 | $this->pilotFirstname = $pilotFirstname; |
| 43 | 43 | $this->pilotLastname = $pilotLastname; |
| 44 | 44 | |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | * @param int $numberOfFlights |
| 52 | 52 | * @param int $numberOfKilometers |
| 53 | 53 | */ |
| 54 | - public function addQuarter($quarter, $numberOfFlights, $numberOfKilometers){ |
|
| 55 | - $quarter = (int)$quarter; |
|
| 54 | + public function addQuarter($quarter, $numberOfFlights, $numberOfKilometers) { |
|
| 55 | + $quarter = (int) $quarter; |
|
| 56 | 56 | $this->quarterMissions[$quarter] = new QuarterMission($quarter, $numberOfFlights, $numberOfKilometers); |
| 57 | 57 | } |
| 58 | 58 | |
@@ -107,9 +107,9 @@ discard block |
||
| 107 | 107 | * |
| 108 | 108 | * @return QuarterMission |
| 109 | 109 | */ |
| 110 | - private function getQuarterMission($quarter){ |
|
| 111 | - if(!isset($this->quarterMissions[$quarter])){ |
|
| 112 | - return new QuarterMission($quarter,0,0); |
|
| 110 | + private function getQuarterMission($quarter) { |
|
| 111 | + if (!isset($this->quarterMissions[$quarter])) { |
|
| 112 | + return new QuarterMission($quarter, 0, 0); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | return $this->quarterMissions[$quarter]; |
@@ -120,6 +120,6 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function getPilotName() |
| 122 | 122 | { |
| 123 | - return $this->pilotFirstname.' '.$this->pilotLastname; |
|
| 123 | + return $this->pilotFirstname . ' ' . $this->pilotLastname; |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | \ No newline at end of file |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | */ |
| 58 | 58 | public function __construct($id, $startPoint, $endPoint, $kilometersComment, $numberOfKilometers, DateTime $date) |
| 59 | 59 | { |
| 60 | - $this->id = (int)$id; |
|
| 60 | + $this->id = (int) $id; |
|
| 61 | 61 | $this->startPoint = $startPoint; |
| 62 | 62 | $this->endPoint = $endPoint; |
| 63 | 63 | $this->kilometersComment = $kilometersComment; |
@@ -13,12 +13,12 @@ discard block |
||
| 13 | 13 | * |
| 14 | 14 | * @return mixed |
| 15 | 15 | */ |
| 16 | - public function getParam($name, $defaultValue = null){ |
|
| 17 | - if($_POST[$name]){ |
|
| 16 | + public function getParam($name, $defaultValue = null) { |
|
| 17 | + if ($_POST[$name]) { |
|
| 18 | 18 | return $_POST[$name]; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - if($_GET[$name]){ |
|
| 21 | + if ($_GET[$name]) { |
|
| 22 | 22 | return $_GET[$name]; |
| 23 | 23 | } |
| 24 | 24 | |
@@ -28,14 +28,14 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * @return bool |
| 30 | 30 | */ |
| 31 | - public function isPost(){ |
|
| 31 | + public function isPost() { |
|
| 32 | 32 | return strtoupper($_SERVER['REQUEST_METHOD']) === 'POST'; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @return array |
| 37 | 37 | */ |
| 38 | - public function getPostParameters(){ |
|
| 38 | + public function getPostParameters() { |
|
| 39 | 39 | return $_POST; |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | \ No newline at end of file |
@@ -36,9 +36,9 @@ |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.total_ttc, society.nom'; |
| 39 | - $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f'; |
|
| 40 | - $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'societe as society ON society.rowid = f.fk_soc'; |
|
| 41 | - $sql.= ' ORDER BY f.datec DESC'; |
|
| 39 | + $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_fourn as f'; |
|
| 40 | + $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'societe as society ON society.rowid = f.fk_soc'; |
|
| 41 | + $sql .= ' ORDER BY f.datec DESC'; |
|
| 42 | 42 | |
| 43 | 43 | $resql = $this->db->query($sql); |
| 44 | 44 | if ($resql) { |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | try{ |
| 50 | 50 | $this->handle($form->getObject()); |
| 51 | - }catch(\Exception $e){ |
|
| 51 | + } catch(\Exception $e){ |
|
| 52 | 52 | print $e->getMessage(); |
| 53 | 53 | dol_syslog($e->getMessage(), LOG_ERR); |
| 54 | 54 | } |
@@ -19,16 +19,16 @@ discard block |
||
| 19 | 19 | /** |
| 20 | 20 | * Display the form. |
| 21 | 21 | */ |
| 22 | - public function view(){ |
|
| 22 | + public function view() { |
|
| 23 | 23 | $id = $this->request->getParam('id'); |
| 24 | 24 | |
| 25 | - if($id === null){ |
|
| 25 | + if ($id === null) { |
|
| 26 | 26 | print '<p>Paramètre non fournis.</p>'; |
| 27 | 27 | return; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | $flight = new \Bbcvols($this->db); |
| 31 | - if($flight->fetch($id) <= 0){ |
|
| 31 | + if ($flight->fetch($id) <= 0) { |
|
| 32 | 32 | print '<p>Vol non trouvé</p>'; |
| 33 | 33 | return; |
| 34 | 34 | } |
@@ -39,24 +39,24 @@ discard block |
||
| 39 | 39 | $form = new DamageCreationForm('damage_creation', $this->db); |
| 40 | 40 | $form->bind($command); |
| 41 | 41 | |
| 42 | - if($this->request->isPost()){ |
|
| 42 | + if ($this->request->isPost()) { |
|
| 43 | 43 | $form->setData($this->request->getPostParameters()); |
| 44 | 44 | |
| 45 | - if(!$form->validate()){ |
|
| 45 | + if (!$form->validate()) { |
|
| 46 | 46 | return $this->render('flight_damage/form.php', [ |
| 47 | 47 | 'form' => $form, |
| 48 | 48 | ]); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - try{ |
|
| 51 | + try { |
|
| 52 | 52 | $this->handle($form->getObject()); |
| 53 | - }catch(\Exception $e){ |
|
| 53 | + } catch (\Exception $e) { |
|
| 54 | 54 | print $e->getMessage(); |
| 55 | 55 | dol_syslog($e->getMessage(), LOG_ERR); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | - return $this->redirect($_SERVER["PHP_SELF"].'?id='.$id); |
|
| 59 | + return $this->redirect($_SERVER["PHP_SELF"] . '?id=' . $id); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | return $this->render('flight_damage/form.php', [ |
@@ -77,14 +77,14 @@ discard block |
||
| 77 | 77 | /** |
| 78 | 78 | * @return CreateDamageCommandHandler |
| 79 | 79 | */ |
| 80 | - private function getHandler(){ |
|
| 80 | + private function getHandler() { |
|
| 81 | 81 | return new CreateDamageCommandHandler($this->db, $this->getDamageRepository()); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * @return FlightDamageRepository |
| 86 | 86 | */ |
| 87 | - private function getDamageRepository(){ |
|
| 87 | + private function getDamageRepository() { |
|
| 88 | 88 | return new FlightDamageRepository($this->db); |
| 89 | 89 | } |
| 90 | 90 | |