@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function add(FormElementInterface $element) |
89 | 89 | { |
90 | - if(array_key_exists($element->getName(), $this->elements)){ |
|
90 | + if (array_key_exists($element->getName(), $this->elements)) { |
|
91 | 91 | throw new \InvalidArgumentException('Element already exists'); |
92 | 92 | } |
93 | 93 | $this->elements[$element->getName()] = $element; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function getErrorMessages() |
143 | 143 | { |
144 | - if(!$this->validator){ |
|
144 | + if (!$this->validator) { |
|
145 | 145 | return []; |
146 | 146 | } |
147 | 147 | |
@@ -186,12 +186,12 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function setData(array $data) |
188 | 188 | { |
189 | - foreach($this->elements as $element){ |
|
190 | - if($element->getType() !== 'checkbox'){ |
|
189 | + foreach ($this->elements as $element) { |
|
190 | + if ($element->getType() !== 'checkbox') { |
|
191 | 191 | continue; |
192 | 192 | } |
193 | 193 | |
194 | - if(isset($data[$element->getName()])){ |
|
194 | + if (isset($data[$element->getName()])) { |
|
195 | 195 | continue; |
196 | 196 | } |
197 | 197 |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | || !$this->isTrainingFirstHelpValid(); |
460 | 460 | } |
461 | 461 | |
462 | - public function isWarning(){ |
|
462 | + public function isWarning() { |
|
463 | 463 | return !$this->isHoursAndTakeOffValidGroupA() || !$this->isProValid(); |
464 | 464 | } |
465 | 465 | |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | |
470 | 470 | $ok = '<span class="text-success text-italic">OK</span>'; |
471 | 471 | |
472 | - if($this->isPilot()){ |
|
472 | + if ($this->isPilot()) { |
|
473 | 473 | $reasons .= '<br> <span class="text-bold">Médical : </span> ' . ($this->isMedicalValid() ? $ok : 'L\'échéance est atteinte ou dépassée.'); |
474 | 474 | $reasons .= '<br> <span class="text-bold">Training flight : </span> ' . ($this->isTrainingFlightValid() ? $ok : 'Pas de vol avec un FI dans les 48 derniers mois.'); |
475 | 475 | $reasons .= '<br> <span class="text-bold">Exp. récente Gr. A: </span> ' . ($this->isHoursAndTakeOffValidGroupA() ? $ok : 'Pas 6H & 10TO dans les 24 derniers mois'); |
@@ -481,27 +481,27 @@ discard block |
||
481 | 481 | } |
482 | 482 | |
483 | 483 | |
484 | - if($this->isPilot() || $this->isTrainingFire()){ |
|
484 | + if ($this->isPilot() || $this->isTrainingFire()) { |
|
485 | 485 | $reasons .= '<br><span class="text-bold">Feu: </span> ' . ($this->isTrainingFireValid() ? $ok : 'Date expirée'); |
486 | 486 | } |
487 | 487 | |
488 | - if($this->isPilot() || $this->isTrainingFirstHelp()){ |
|
488 | + if ($this->isPilot() || $this->isTrainingFirstHelp()) { |
|
489 | 489 | $reasons .= '<br><span class="text-bold">Premiers secours: </span> ' . ($this->isTrainingFirstHelpValid() ? $ok : 'Date expirée'); |
490 | 490 | } |
491 | 491 | |
492 | 492 | |
493 | 493 | $qualification = $ok; |
494 | - if(!$this->isPilot()){ |
|
494 | + if (!$this->isPilot()) { |
|
495 | 495 | $qualification = '<span class="text-success">CREW</span>'; |
496 | 496 | } |
497 | - if($this->isWarning()){ |
|
497 | + if ($this->isWarning()) { |
|
498 | 498 | $qualification = '<span class="text-warning">Controle du carnet de vol nécessaire</span>'; |
499 | 499 | } |
500 | - if($this->isDanger()){ |
|
500 | + if ($this->isDanger()) { |
|
501 | 501 | $qualification = '<span class="text-danger">Vol non autorisé</span>'; |
502 | 502 | } |
503 | 503 | |
504 | - return '<u><span class="text-bold">Qualification </span> : ' . $qualification .'</u>'. $reasons; |
|
504 | + return '<u><span class="text-bold">Qualification </span> : ' . $qualification . '</u>' . $reasons; |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | private function isMedicalValid(): bool |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | return true; |
511 | 511 | } |
512 | 512 | |
513 | - if(null === $this->medicalEndDate){ |
|
513 | + if (null === $this->medicalEndDate) { |
|
514 | 514 | return false; |
515 | 515 | } |
516 | 516 | |
@@ -520,11 +520,11 @@ discard block |
||
520 | 520 | |
521 | 521 | private function isTrainingFlightValid(): bool |
522 | 522 | { |
523 | - if(!$this->isPilot()){ |
|
523 | + if (!$this->isPilot()) { |
|
524 | 524 | return true; |
525 | 525 | } |
526 | 526 | |
527 | - if(null === $this->lastTrainingFlightDate){ |
|
527 | + if (null === $this->lastTrainingFlightDate) { |
|
528 | 528 | return false; |
529 | 529 | } |
530 | 530 | |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | |
534 | 534 | private function isHoursAndTakeOffValidGroupA(): bool |
535 | 535 | { |
536 | - if(!$this->isPilot()){ |
|
536 | + if (!$this->isPilot()) { |
|
537 | 537 | return true; |
538 | 538 | } |
539 | 539 | |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | |
561 | 561 | private function isProDateValid(): bool |
562 | 562 | { |
563 | - if(!$this->isPilot()){ |
|
563 | + if (!$this->isPilot()) { |
|
564 | 564 | return true; |
565 | 565 | } |
566 | 566 | |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | |
575 | 575 | private function isProValid(): bool |
576 | 576 | { |
577 | - if(!$this->isPilot()){ |
|
577 | + if (!$this->isPilot()) { |
|
578 | 578 | return true; |
579 | 579 | } |
580 | 580 | |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | return true; |
583 | 583 | } |
584 | 584 | |
585 | - if($this->lastOpcDate && $this->diffDateInMonths($this->lastOpcDate) < 6){ |
|
585 | + if ($this->lastOpcDate && $this->diffDateInMonths($this->lastOpcDate) < 6) { |
|
586 | 586 | return true; |
587 | 587 | } |
588 | 588 | |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | } |
603 | 603 | |
604 | 604 | private function diffDateInMonths(\DateTimeImmutable $dateA, \DateTimeImmutable $dateB = null): int{ |
605 | - if(null === $dateB){ |
|
605 | + if (null === $dateB) { |
|
606 | 606 | $dateB = new \DateTimeImmutable(); |
607 | 607 | } |
608 | 608 | |
@@ -612,11 +612,11 @@ discard block |
||
612 | 612 | |
613 | 613 | private function isTrainingFireValid() |
614 | 614 | { |
615 | - if(!$this->isTrainingFire() && !$this->isPilot()){ |
|
615 | + if (!$this->isTrainingFire() && !$this->isPilot()) { |
|
616 | 616 | return true; |
617 | 617 | } |
618 | 618 | |
619 | - if(null === $this->lastTrainingFireDate){ |
|
619 | + if (null === $this->lastTrainingFireDate) { |
|
620 | 620 | return false; |
621 | 621 | } |
622 | 622 | |
@@ -625,11 +625,11 @@ discard block |
||
625 | 625 | |
626 | 626 | private function isTrainingFirstHelpValid() |
627 | 627 | { |
628 | - if(!$this->isTrainingFirstHelp() && !$this->isPilot() ){ |
|
628 | + if (!$this->isTrainingFirstHelp() && !$this->isPilot()) { |
|
629 | 629 | return true; |
630 | 630 | } |
631 | 631 | |
632 | - if(null === $this->lastTrainingFirstHelpDate){ |
|
632 | + if (null === $this->lastTrainingFirstHelpDate) { |
|
633 | 633 | return false; |
634 | 634 | } |
635 | 635 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * |
32 | 32 | * @return Pilot |
33 | 33 | */ |
34 | - public function byId($id){ |
|
34 | + public function byId($id) { |
|
35 | 35 | $pilots = $this->filter(['id' => $id]); |
36 | 36 | if (empty($pilots)) { |
37 | 37 | return Pilot::fromArray(['id' => $id]); |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | )) |
91 | 91 | '; |
92 | 92 | |
93 | - if(isset($filters['id'])){ |
|
94 | - $sql .= ' AND llx_user.rowid = '.$filters['id']; |
|
93 | + if (isset($filters['id'])) { |
|
94 | + $sql .= ' AND llx_user.rowid = ' . $filters['id']; |
|
95 | 95 | } |
96 | 96 | $sql .= ' ORDER BY llx_user.firstname, llx_user.lastname, llx_user.rowid, flight.date'; |
97 | 97 | |
@@ -107,16 +107,16 @@ discard block |
||
107 | 107 | |
108 | 108 | /** @var Pilot[] $pilots */ |
109 | 109 | $pilots = []; |
110 | - for($i = 0; $i < $num ; $i++) { |
|
110 | + for ($i = 0; $i < $num; $i++) { |
|
111 | 111 | $values = $this->db->fetch_array($resql); |
112 | 112 | $pilotId = $values['id']; |
113 | 113 | |
114 | - if(!isset($pilots[$pilotId])){ |
|
114 | + if (!isset($pilots[$pilotId])) { |
|
115 | 115 | $pilots[$pilotId] = Pilot::fromArray($values); |
116 | 116 | } |
117 | 117 | |
118 | 118 | $flight = PilotFlight::fromArray($values, 'flight'); |
119 | - if($flight->isValid()){ |
|
119 | + if ($flight->isValid()) { |
|
120 | 120 | $pilots[$pilotId]->addFlight($flight); |
121 | 121 | } |
122 | 122 |
@@ -101,15 +101,15 @@ discard block |
||
101 | 101 | |
102 | 102 | $sql .= " FROM "; |
103 | 103 | $sql .= MAIN_DB_PREFIX . "bbc_vols as f "; |
104 | - $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX."user as pilot ON pilot.rowid = f.fk_pilot "; |
|
105 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX."user as organisator ON organisator.rowid = f.fk_organisateur "; |
|
106 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX."user as receiver ON receiver.rowid = f.fk_receiver "; |
|
104 | + $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX . "user as pilot ON pilot.rowid = f.fk_pilot "; |
|
105 | + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . "user as organisator ON organisator.rowid = f.fk_organisateur "; |
|
106 | + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . "user as receiver ON receiver.rowid = f.fk_receiver "; |
|
107 | 107 | |
108 | 108 | $sql .= "WHERE 1 = 1 "; |
109 | 109 | |
110 | - if($object instanceof FactureFournisseur){ |
|
110 | + if ($object instanceof FactureFournisseur) { |
|
111 | 111 | $sql .= " AND (YEAR(f.date) = (YEAR(NOW())) OR YEAR(f.date) = (YEAR(NOW()) - 1))"; |
112 | - }else{ |
|
112 | + } else { |
|
113 | 113 | $sql .= " AND YEAR(f.date) = (YEAR(NOW())) "; |
114 | 114 | $sql .= " AND f.fk_type IN (1,2) "; |
115 | 115 | $sql .= " AND f.is_facture = 0 "; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | ]; |
155 | 155 | } |
156 | 156 | |
157 | - public function addOpenElementsDashboardLine(){ |
|
157 | + public function addOpenElementsDashboardLine() { |
|
158 | 158 | $result = new WorkboardResponse(); |
159 | 159 | $result->label = 'En ordre'; |
160 | 160 | $result->nbtodo = 10; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | ]; |
171 | 171 | } |
172 | 172 | |
173 | - public function printTopRightMenu(array $parameters = []){ |
|
173 | + public function printTopRightMenu(array $parameters = []) { |
|
174 | 174 | /** @var DoliDB $db */ |
175 | 175 | global $db, $user; |
176 | 176 |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function getIdBBCVols() |
131 | 131 | { |
132 | - return (int)$this->idBBC_vols; |
|
132 | + return (int) $this->idBBC_vols; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function getId() |
139 | 139 | { |
140 | - return (int)$this->getIdBBCVols(); |
|
140 | + return (int) $this->getIdBBCVols(); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -274,13 +274,13 @@ discard block |
||
274 | 274 | $sql .= ' ' . (!isset($this->nbrPax) ? 'NULL' : "'" . $this->db->escape($this->nbrPax) . "'") . ','; |
275 | 275 | $sql .= ' ' . (!isset($this->remarque) ? 'NULL' : "'" . $this->db->escape($this->remarque) . "'") . ','; |
276 | 276 | $sql .= ' ' . (!isset($this->incidents) ? 'NULL' : "'" . $this->db->escape($this->incidents) . "'") . ','; |
277 | - $sql .= ' ' . (!isset($this->fk_type) || (int)$this->fk_type === -1 ? 'NULL' : $this->fk_type) . ','; |
|
278 | - $sql .= ' ' . (!isset($this->fk_pilot) || (int)$this->fk_pilot === -1 ? 'NULL' : $this->fk_pilot) . ','; |
|
279 | - $sql .= ' ' . (!isset($this->fk_organisateur) || (int)$this->fk_organisateur === -1 ? 'NULL' : $this->fk_organisateur) . ','; |
|
277 | + $sql .= ' ' . (!isset($this->fk_type) || (int) $this->fk_type === -1 ? 'NULL' : $this->fk_type) . ','; |
|
278 | + $sql .= ' ' . (!isset($this->fk_pilot) || (int) $this->fk_pilot === -1 ? 'NULL' : $this->fk_pilot) . ','; |
|
279 | + $sql .= ' ' . (!isset($this->fk_organisateur) || (int) $this->fk_organisateur === -1 ? 'NULL' : $this->fk_organisateur) . ','; |
|
280 | 280 | $sql .= ' ' . (!isset($this->is_facture) ? '0' : $this->is_facture) . ','; |
281 | 281 | $sql .= ' ' . (!isset($this->kilometers) || empty($this->kilometers) ? '0' : $this->kilometers) . ','; |
282 | 282 | $sql .= ' ' . (!isset($this->cost) ? 'NULL' : "'" . $this->db->escape($this->cost) . "'") . ','; |
283 | - $sql .= ' ' . (!isset($this->fk_receiver) || (int)$this->fk_receiver === -1 ? 'NULL' : $this->fk_receiver) . ','; |
|
283 | + $sql .= ' ' . (!isset($this->fk_receiver) || (int) $this->fk_receiver === -1 ? 'NULL' : $this->fk_receiver) . ','; |
|
284 | 284 | $sql .= ' ' . (!isset($this->justif_kilometers) ? 'NULL' : "'" . $this->db->escape($this->justif_kilometers) . "'") . ','; |
285 | 285 | $sql .= ' ' . "'" . date('Y-m-d H:i:s') . "'" . ','; |
286 | 286 | $sql .= ' ' . "'" . date('Y-m-d H:i:s') . "'" . ','; |
@@ -455,23 +455,23 @@ discard block |
||
455 | 455 | |
456 | 456 | $this->id = $obj->idBBC_vols; |
457 | 457 | |
458 | - $this->idBBC_vols = (int)$obj->idBBC_vols; |
|
458 | + $this->idBBC_vols = (int) $obj->idBBC_vols; |
|
459 | 459 | $this->date = $this->db->jdate($obj->date); |
460 | 460 | $this->lieuD = $obj->lieuD; |
461 | 461 | $this->lieuA = $obj->lieuA; |
462 | 462 | $this->heureD = $obj->heureD; |
463 | 463 | $this->heureA = $obj->heureA; |
464 | - $this->BBC_ballons_idBBC_ballons = (int)$obj->BBC_ballons_idBBC_ballons; |
|
464 | + $this->BBC_ballons_idBBC_ballons = (int) $obj->BBC_ballons_idBBC_ballons; |
|
465 | 465 | $this->nbrPax = $obj->nbrPax; |
466 | 466 | $this->remarque = $obj->remarque; |
467 | 467 | $this->incidents = $obj->incidents; |
468 | - $this->fk_type = (int)$obj->fk_type; |
|
469 | - $this->fk_pilot = (int)$obj->fk_pilot; |
|
470 | - $this->fk_organisateur = (int)$obj->fk_organisateur; |
|
471 | - $this->statut = $this->is_facture = (int)$obj->is_facture; |
|
468 | + $this->fk_type = (int) $obj->fk_type; |
|
469 | + $this->fk_pilot = (int) $obj->fk_pilot; |
|
470 | + $this->fk_organisateur = (int) $obj->fk_organisateur; |
|
471 | + $this->statut = $this->is_facture = (int) $obj->is_facture; |
|
472 | 472 | $this->kilometers = $obj->kilometers; |
473 | 473 | $this->total_ttc = $this->cost = $obj->cost; |
474 | - $this->fk_receiver = (int)$obj->fk_receiver; |
|
474 | + $this->fk_receiver = (int) $obj->fk_receiver; |
|
475 | 475 | $this->justif_kilometers = $obj->justif_kilometers; |
476 | 476 | $this->date_creation = $obj->date_creation; |
477 | 477 | $this->date_update = $obj->date_update; |
@@ -587,13 +587,13 @@ discard block |
||
587 | 587 | $sql .= ' nbrPax = ' . (isset($this->nbrPax) ? "'" . $this->db->escape($this->nbrPax) . "'" : "null") . ','; |
588 | 588 | $sql .= ' remarque = ' . (isset($this->remarque) ? "'" . $this->db->escape($this->remarque) . "'" : "null") . ','; |
589 | 589 | $sql .= ' incidents = ' . (isset($this->incidents) ? "'" . $this->db->escape($this->incidents) . "'" : "null") . ','; |
590 | - $sql .= ' fk_type = ' . (isset($this->fk_type) && (int)$this->fk_type > 0 ? $this->fk_type : "null") . ','; |
|
591 | - $sql .= ' fk_pilot = ' . (isset($this->fk_pilot) && (int)$this->fk_pilot > 0 ? $this->fk_pilot : "null") . ','; |
|
592 | - $sql .= ' fk_organisateur = ' . (isset($this->fk_organisateur) && (int)$this->fk_organisateur > 0 ? $this->fk_organisateur : "null") . ','; |
|
590 | + $sql .= ' fk_type = ' . (isset($this->fk_type) && (int) $this->fk_type > 0 ? $this->fk_type : "null") . ','; |
|
591 | + $sql .= ' fk_pilot = ' . (isset($this->fk_pilot) && (int) $this->fk_pilot > 0 ? $this->fk_pilot : "null") . ','; |
|
592 | + $sql .= ' fk_organisateur = ' . (isset($this->fk_organisateur) && (int) $this->fk_organisateur > 0 ? $this->fk_organisateur : "null") . ','; |
|
593 | 593 | $sql .= ' is_facture = ' . (isset($this->is_facture) ? $this->is_facture : "0") . ','; |
594 | 594 | $sql .= ' kilometers = ' . (!empty($this->kilometers) ? $this->kilometers : "0") . ','; |
595 | 595 | $sql .= ' cost = ' . (isset($this->cost) ? "'" . $this->db->escape($this->cost) . "'" : "''") . ','; |
596 | - $sql .= ' fk_receiver = ' . (isset($this->fk_receiver) && (int)$this->fk_receiver > 0 ? $this->fk_receiver : "null") . ','; |
|
596 | + $sql .= ' fk_receiver = ' . (isset($this->fk_receiver) && (int) $this->fk_receiver > 0 ? $this->fk_receiver : "null") . ','; |
|
597 | 597 | $sql .= ' justif_kilometers = ' . (isset($this->justif_kilometers) ? "'" . $this->db->escape($this->justif_kilometers) . "'," : "'',"); |
598 | 598 | $sql .= ' date_update = ' . "'" . date('Y-m-d H:i:s') . "',"; |
599 | 599 | $sql .= ' is_night = ' . ($this->nightFlight ? 1 : 0) . ','; |
@@ -701,9 +701,9 @@ discard block |
||
701 | 701 | |
702 | 702 | $label = '<u>' . $langs->trans("MyModule") . '</u>'; |
703 | 703 | $label .= '<div width="100%">'; |
704 | - $label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->idBBC_vols . ' - <b>'.$langs->trans('T') . '</b>' . $this->fk_type . '<br>'; |
|
704 | + $label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->idBBC_vols . ' - <b>' . $langs->trans('T') . '</b>' . $this->fk_type . '<br>'; |
|
705 | 705 | $label .= '<b>' . $langs->trans('Date') . ':</b> ' . dol_print_date($this->date, '%d-%m-%Y') . '<br/>'; |
706 | - $label .= '<b>' . $langs->trans('De') . ':</b> ' . $this->lieuD . ' - '. '<b>' . $langs->trans('à') . ':</b> ' . $this->lieuA . '<br/>'; |
|
706 | + $label .= '<b>' . $langs->trans('De') . ':</b> ' . $this->lieuD . ' - ' . '<b>' . $langs->trans('à') . ':</b> ' . $this->lieuA . '<br/>'; |
|
707 | 707 | $label .= '<b>' . $langs->trans('Pilote') . ':</b> ' . $this->getPilot()->getFullName($langs) . '<br/>'; |
708 | 708 | $label .= '<b>' . $langs->trans('Organisateur') . ':</b> ' . $this->getOrganisator()->getFullName($langs) . '<br/>'; |
709 | 709 | $label .= '</div>'; |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | */ |
904 | 904 | public function getPilotId() |
905 | 905 | { |
906 | - return (int)$this->fk_pilot; |
|
906 | + return (int) $this->fk_pilot; |
|
907 | 907 | } |
908 | 908 | |
909 | 909 | /** |
@@ -911,7 +911,7 @@ discard block |
||
911 | 911 | */ |
912 | 912 | public function getOrganisatorId() |
913 | 913 | { |
914 | - return (int)$this->fk_organisateur; |
|
914 | + return (int) $this->fk_organisateur; |
|
915 | 915 | } |
916 | 916 | |
917 | 917 | /** |
@@ -948,7 +948,7 @@ discard block |
||
948 | 948 | */ |
949 | 949 | public function hasPax() |
950 | 950 | { |
951 | - return (int)$this->nbrPax > 0; |
|
951 | + return (int) $this->nbrPax > 0; |
|
952 | 952 | } |
953 | 953 | |
954 | 954 | /** |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | */ |
1018 | 1018 | public function getKilometers() |
1019 | 1019 | { |
1020 | - return (int)$this->kilometers; |
|
1020 | + return (int) $this->kilometers; |
|
1021 | 1021 | } |
1022 | 1022 | |
1023 | 1023 | /** |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | */ |
1061 | 1061 | public function getNumberOfPassengers() |
1062 | 1062 | { |
1063 | - return (int)$this->nbrPax; |
|
1063 | + return (int) $this->nbrPax; |
|
1064 | 1064 | } |
1065 | 1065 | |
1066 | 1066 | /** |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | */ |
1264 | 1264 | public function getBBCBallonsIdBBCBallons() |
1265 | 1265 | { |
1266 | - return (int)$this->BBC_ballons_idBBC_ballons; |
|
1266 | + return (int) $this->BBC_ballons_idBBC_ballons; |
|
1267 | 1267 | } |
1268 | 1268 | |
1269 | 1269 | /** |
@@ -1339,7 +1339,7 @@ discard block |
||
1339 | 1339 | */ |
1340 | 1340 | public function getFkType() |
1341 | 1341 | { |
1342 | - return (int)$this->fk_type; |
|
1342 | + return (int) $this->fk_type; |
|
1343 | 1343 | } |
1344 | 1344 | |
1345 | 1345 | /** |
@@ -1434,7 +1434,7 @@ discard block |
||
1434 | 1434 | */ |
1435 | 1435 | public function getFkReceiver() |
1436 | 1436 | { |
1437 | - return (int)$this->fk_receiver; |
|
1437 | + return (int) $this->fk_receiver; |
|
1438 | 1438 | } |
1439 | 1439 | |
1440 | 1440 | /** |
@@ -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> |
@@ -220,7 +220,7 @@ |
||
220 | 220 | |
221 | 221 | $orderId = $this->order->create($this->user); |
222 | 222 | if ($orderId <= 0) { |
223 | - throw new Exception('Exception during the order creation ('.$this->order->error.')'); |
|
223 | + throw new Exception('Exception during the order creation (' . $this->order->error . ')'); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | return $this; |
@@ -153,10 +153,10 @@ discard block |
||
153 | 153 | $tableQueryHandler = new BillableFlightQueryHandler($db, $conf->global); |
154 | 154 | $pilotQueryRepository = new PilotQueryRepository($db); |
155 | 155 | |
156 | -function pilotStatus($id){ |
|
156 | +function pilotStatus($id) { |
|
157 | 157 | global $pilotQueryRepository; |
158 | 158 | $member = $pilotQueryRepository->byId($id); |
159 | - if($member === null){ |
|
159 | + if ($member === null) { |
|
160 | 160 | return ''; |
161 | 161 | } |
162 | 162 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | print '<td>' . $pilot->getCountForType('orga_T6')->getCount() . '</td>'; |
202 | 202 | print '<td>' . $pilot->getCountForType('orga_T6')->getCost()->getValue() . '</td>'; |
203 | 203 | |
204 | - print sprintf('<td class="%s">', $pilot->getFlightBonus()->getValue() === 0?'text-muted':'text-bold'). $pilot->getFlightBonus()->getValue() . ' pts</td>'; |
|
204 | + print sprintf('<td class="%s">', $pilot->getFlightBonus()->getValue() === 0 ? 'text-muted' : 'text-bold') . $pilot->getFlightBonus()->getValue() . ' pts</td>'; |
|
205 | 205 | |
206 | 206 | print '<td>' . $pilot->getCountForType('3')->getCount() . '</td>'; |
207 | 207 | print '<td>' . price($pilot->getCountForType('3')->getCost()->getValue()) . '€</td>'; |
@@ -220,8 +220,8 @@ discard block |
||
220 | 220 | print '<td>' . price($pilot->damageCost()->getValue()) . '€</td>'; |
221 | 221 | print '<td>' . price($pilot->invoicedDamageCost()->getValue()) . '€</td>'; |
222 | 222 | |
223 | - print sprintf('<td class="%s">', $pilot->getFlightsCost()->getValue() === 0?'text-muted':'text-bold'). price($pilot->getFlightsCost()->getValue()) . '€ </td>'; |
|
224 | - print sprintf('<td class="%s">', $pilot->isBillable(FlightBonus::zero())?'text-bold':'text-muted'). price($pilot->getTotalBill()->getValue()) . '€</td>'; |
|
223 | + print sprintf('<td class="%s">', $pilot->getFlightsCost()->getValue() === 0 ? 'text-muted' : 'text-bold') . price($pilot->getFlightsCost()->getValue()) . '€ </td>'; |
|
224 | + print sprintf('<td class="%s">', $pilot->isBillable(FlightBonus::zero()) ? 'text-bold' : 'text-muted') . price($pilot->getTotalBill()->getValue()) . '€</td>'; |
|
225 | 225 | print '</tr>'; |
226 | 226 | } |
227 | 227 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | print '<td>' . $totalT3 . '</td>'; |
247 | 247 | print '<td></td>'; |
248 | 248 | |
249 | -print '<td>' . $totalT4. '</td>'; |
|
249 | +print '<td>' . $totalT4 . '</td>'; |
|
250 | 250 | print '<td></td>'; |
251 | 251 | |
252 | 252 | print '<td>' . $totalT5 . '</td>'; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | //table km |
276 | 276 | $tauxRemb = isset($conf->global->BBC_FLIGHT_LOG_TAUX_REMB_KM) ? $conf->global->BBC_FLIGHT_LOG_TAUX_REMB_KM : 0; |
277 | 277 | $year = GETPOST("year", 'int'); |
278 | -if(empty($year)){ |
|
278 | +if (empty($year)) { |
|
279 | 279 | $year = date('Y'); |
280 | 280 | } |
281 | 281 |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $search_fk_type = GETPOST('search_fk_type', 'int'); |
51 | 51 | $search_fk_pilot = GETPOST('search_fk_pilot', 'int') ?: ($user->admin ? '' : $user->id); |
52 | 52 | $search_fk_organisateur = GETPOST('search_fk_organisateur', 'int'); |
53 | -$search_is_facture = GETPOST('search_is_facture', 'int') === ''? -1 : (int)GETPOST('search_is_facture', 'int'); |
|
54 | -if($search_is_facture === 0){ |
|
53 | +$search_is_facture = GETPOST('search_is_facture', 'int') === '' ? -1 : (int) GETPOST('search_is_facture', 'int'); |
|
54 | +if ($search_is_facture === 0) { |
|
55 | 55 | $search_is_facture = '<=0'; |
56 | 56 | } |
57 | 57 | $search_kilometers = GETPOST('search_kilometers', 'alpha'); |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | if ($page == -1) { |
73 | 73 | $page = 0; |
74 | 74 | } |
75 | -$offset = $limit * (int)$page; |
|
76 | -$pageprev = (int)$page - 1; |
|
77 | -$pagenext = (int)$page + 1; |
|
75 | +$offset = $limit * (int) $page; |
|
76 | +$pageprev = (int) $page - 1; |
|
77 | +$pagenext = (int) $page + 1; |
|
78 | 78 | if (!$sortfield) { |
79 | 79 | $sortfield = "t.date, t.heureD"; |
80 | 80 | } // Set here default search field |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | $parameters = array(); |
181 | 181 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, |
182 | - $action); // Note that $action and $object may have been modified by some hooks |
|
182 | + $action); // Note that $action and $object may have been modified by some hooks |
|
183 | 183 | if ($reshook < 0) { |
184 | 184 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
185 | 185 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | // Add fields from hooks |
279 | 279 | $parameters = array(); |
280 | 280 | $reshook = $hookmanager->executeHooks('printFieldListSelect', |
281 | - $parameters); // Note that $action and $object may have been modified by hook |
|
281 | + $parameters); // Note that $action and $object may have been modified by hook |
|
282 | 282 | $sql .= $hookmanager->resPrint; |
283 | 283 | $sql .= " FROM " . MAIN_DB_PREFIX . "bbc_vols as t"; |
284 | 284 | if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { |
@@ -292,8 +292,8 @@ discard block |
||
292 | 292 | |
293 | 293 | $sql .= " WHERE 1 = 1"; |
294 | 294 | |
295 | -if($search_all){ |
|
296 | - $sql .= natural_search(["idBBC_vols", "lieuD", "lieuA", "pilot.lastname", "pilot.firstname", "balloon.immat"], $search_all); |
|
295 | +if ($search_all) { |
|
296 | + $sql .= natural_search(["idBBC_vols", "lieuD", "lieuA", "pilot.lastname", "pilot.firstname", "balloon.immat"], $search_all); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | if ($search_idBBC_vols) { |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | } |
338 | 338 | |
339 | 339 | if ($search_is_facture != -1) { |
340 | - $sql .= natural_search("is_facture", $search_is_facture,1); |
|
340 | + $sql .= natural_search("is_facture", $search_is_facture, 1); |
|
341 | 341 | } |
342 | 342 | if ($search_kilometers) { |
343 | 343 | $sql .= natural_search("kilometers", $search_kilometers, 1); |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | // Add where from hooks |
373 | 373 | $parameters = array(); |
374 | 374 | $reshook = $hookmanager->executeHooks('printFieldListWhere', |
375 | - $parameters); // Note that $action and $object may have been modified by hook |
|
375 | + $parameters); // Note that $action and $object may have been modified by hook |
|
376 | 376 | $sql .= $hookmanager->resPrint; |
377 | 377 | $sql .= $db->order($sortfield, $sortorder); |
378 | 378 | //$sql.= $db->plimit($conf->liste_limit+1, $offset); |
@@ -414,58 +414,58 @@ discard block |
||
414 | 414 | if ($limit > 0 && $limit != $conf->liste_limit) { |
415 | 415 | $param .= '&limit=' . $limit; |
416 | 416 | } |
417 | -if ($search_idBBC_vols != '') { |
|
417 | +if ($search_idBBC_vols != '') { |
|
418 | 418 | $param .= '&search_idBBC_vols=' . urlencode($search_idBBC_vols); |
419 | 419 | } |
420 | -if ($search_date != '') { |
|
420 | +if ($search_date != '') { |
|
421 | 421 | $param .= '&search_date=' . urlencode($search_date); |
422 | 422 | } |
423 | -if ($search_lieuD != '') { |
|
423 | +if ($search_lieuD != '') { |
|
424 | 424 | $param .= '&search_lieuD=' . urlencode($search_lieuD); |
425 | 425 | } |
426 | -if ($search_lieuA != '') { |
|
426 | +if ($search_lieuA != '') { |
|
427 | 427 | $param .= '&search_lieuA=' . urlencode($search_lieuA); |
428 | 428 | } |
429 | -if ($search_heureD != '') { |
|
429 | +if ($search_heureD != '') { |
|
430 | 430 | $param .= '&search_heureD=' . urlencode($search_heureD); |
431 | 431 | } |
432 | -if ($search_heureA != '') { |
|
432 | +if ($search_heureA != '') { |
|
433 | 433 | $param .= '&search_heureA=' . urlencode($search_heureA); |
434 | 434 | } |
435 | -if ($search_BBC_ballons_idBBC_ballons != '') { |
|
435 | +if ($search_BBC_ballons_idBBC_ballons != '') { |
|
436 | 436 | $param .= '&search_BBC_ballons_idBBC_ballons=' . urlencode($search_BBC_ballons_idBBC_ballons); |
437 | 437 | } |
438 | -if ($search_nbrPax != '') { |
|
438 | +if ($search_nbrPax != '') { |
|
439 | 439 | $param .= '&search_nbrPax=' . urlencode($search_nbrPax); |
440 | 440 | } |
441 | -if ($search_remarque != '') { |
|
441 | +if ($search_remarque != '') { |
|
442 | 442 | $param .= '&search_remarque=' . urlencode($search_remarque); |
443 | 443 | } |
444 | -if ($search_incidents != '') { |
|
444 | +if ($search_incidents != '') { |
|
445 | 445 | $param .= '&search_incidents=' . urlencode($search_incidents); |
446 | 446 | } |
447 | -if ($search_fk_type != '') { |
|
447 | +if ($search_fk_type != '') { |
|
448 | 448 | $param .= '&search_fk_type=' . urlencode($search_fk_type); |
449 | 449 | } |
450 | 450 | if ($search_fk_pilot != '') { |
451 | 451 | $param .= '&search_fk_pilot=' . urlencode($search_fk_pilot); |
452 | 452 | } |
453 | -if ($search_fk_organisateur != '') { |
|
453 | +if ($search_fk_organisateur != '') { |
|
454 | 454 | $param .= '&search_fk_organisateur=' . urlencode($search_fk_organisateur); |
455 | 455 | } |
456 | -if ($search_is_facture != -1) { |
|
456 | +if ($search_is_facture != -1) { |
|
457 | 457 | $param .= '&search_is_facture=' . urlencode($search_is_facture); |
458 | 458 | } |
459 | -if ($search_kilometers != '') { |
|
459 | +if ($search_kilometers != '') { |
|
460 | 460 | $param .= '&search_kilometers=' . urlencode($search_kilometers); |
461 | 461 | } |
462 | -if ($search_cost != '') { |
|
462 | +if ($search_cost != '') { |
|
463 | 463 | $param .= '&search_cost=' . urlencode($search_cost); |
464 | 464 | } |
465 | -if ($search_fk_receiver != '') { |
|
465 | +if ($search_fk_receiver != '') { |
|
466 | 466 | $param .= '&search_fk_receiver=' . urlencode($search_fk_receiver); |
467 | 467 | } |
468 | -if ($search_justif_kilometers != '') { |
|
468 | +if ($search_justif_kilometers != '') { |
|
469 | 469 | $param .= '&search_justif_kilometers=' . urlencode($search_justif_kilometers); |
470 | 470 | } |
471 | 471 | if ($search_all != '') { |
@@ -509,8 +509,8 @@ discard block |
||
509 | 509 | |
510 | 510 | |
511 | 511 | $moreHtml = ""; |
512 | -if($search_all !== ""){ |
|
513 | - $moreHtml = "<p>".$langs->trans(sprintf("La liste est en recherche globale sur : l'identifiant du vol, le nom du pilote, l'immat du ballon, le lieu de Décollage et le lieu d'atterissage : %s", $search_all))."</p>"; |
|
512 | +if ($search_all !== "") { |
|
513 | + $moreHtml = "<p>" . $langs->trans(sprintf("La liste est en recherche globale sur : l'identifiant du vol, le nom du pilote, l'immat du ballon, le lieu de Décollage et le lieu d'atterissage : %s", $search_all)) . "</p>"; |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | |
531 | 531 | $parameters = array(); |
532 | 532 | $reshook = $hookmanager->executeHooks('printFieldPreListTitle', |
533 | - $parameters); // Note that $action and $object may have been modified by hook |
|
533 | + $parameters); // Note that $action and $object may have been modified by hook |
|
534 | 534 | if (empty($reshook)) { |
535 | 535 | $moreforfilter .= $hookmanager->resPrint; |
536 | 536 | } else { |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | |
546 | 546 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
547 | 547 | $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, |
548 | - $varpage); // This also change content of $arrayfields |
|
548 | + $varpage); // This also change content of $arrayfields |
|
549 | 549 | |
550 | 550 | print '<div class="div-table-responsive">'; |
551 | 551 | print '<table class="tagtable liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | // Hook fields |
642 | 642 | $parameters = array('arrayfields' => $arrayfields); |
643 | 643 | $reshook = $hookmanager->executeHooks('printFieldListTitle', |
644 | - $parameters); // Note that $action and $object may have been modified by hook |
|
644 | + $parameters); // Note that $action and $object may have been modified by hook |
|
645 | 645 | print $hookmanager->resPrint; |
646 | 646 | if (!empty($arrayfields['t.datec']['checked'])) { |
647 | 647 | print_liste_field_titre($arrayfields['t.datec']['label'], $_SERVER["PHP_SELF"], "t.datec", "", $param, |
@@ -699,18 +699,18 @@ discard block |
||
699 | 699 | } |
700 | 700 | if (!empty($arrayfields['t.fk_pilot']['checked'])) { |
701 | 701 | print '<td class="liste_titre">'; |
702 | - print $form->select_dolusers($search_fk_pilot, "search_fk_pilot", true, null, 0, '', '', 0,0,0,'',0,'','', true); |
|
702 | + print $form->select_dolusers($search_fk_pilot, "search_fk_pilot", true, null, 0, '', '', 0, 0, 0, '', 0, '', '', true); |
|
703 | 703 | print '</td>'; |
704 | 704 | } |
705 | 705 | if (!empty($arrayfields['t.fk_organisateur']['checked'])) { |
706 | 706 | print '<td class="liste_titre">'; |
707 | - print $form->select_dolusers($search_fk_organisateur, "search_fk_organisateur", true, null, 0, '', '', 0,0,0,'',0,'','', true); |
|
707 | + print $form->select_dolusers($search_fk_organisateur, "search_fk_organisateur", true, null, 0, '', '', 0, 0, 0, '', 0, '', '', true); |
|
708 | 708 | print '</td>'; |
709 | 709 | } |
710 | 710 | |
711 | 711 | if (!empty($arrayfields['t.is_facture']['checked'])) { |
712 | 712 | print '<td class="liste_titre">'; |
713 | - print '<select name="search_is_facture"><option value="-1" '.($search_is_facture != 1 && $search_is_facture != 0 && $search_is_facture != '<=0'? 'selected' : '' ).'></option><option value="1" '.($search_is_facture == 1 ? 'selected' : '' ).'>Facturé</option><option value="0" '.($search_is_facture == 0 || $search_is_facture == '<=0' ? 'selected' : '' ).'>Ouvert</option></select>'; |
|
713 | + print '<select name="search_is_facture"><option value="-1" ' . ($search_is_facture != 1 && $search_is_facture != 0 && $search_is_facture != '<=0' ? 'selected' : '') . '></option><option value="1" ' . ($search_is_facture == 1 ? 'selected' : '') . '>Facturé</option><option value="0" ' . ($search_is_facture == 0 || $search_is_facture == '<=0' ? 'selected' : '') . '>Ouvert</option></select>'; |
|
714 | 714 | print '</td>'; |
715 | 715 | } |
716 | 716 | |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | // Fields from hook |
756 | 756 | $parameters = array('arrayfields' => $arrayfields); |
757 | 757 | $reshook = $hookmanager->executeHooks('printFieldListOption', |
758 | - $parameters); // Note that $action and $object may have been modified by hook |
|
758 | + $parameters); // Note that $action and $object may have been modified by hook |
|
759 | 759 | print $hookmanager->resPrint; |
760 | 760 | if (!empty($arrayfields['t.datec']['checked'])) { |
761 | 761 | // Date creation |
@@ -797,125 +797,125 @@ discard block |
||
797 | 797 | // Show here line of result |
798 | 798 | print '<tr ' . $bc[$var] . '>'; |
799 | 799 | |
800 | - if (! empty($arrayfields['t.idBBC_vols']['checked'])) |
|
800 | + if (!empty($arrayfields['t.idBBC_vols']['checked'])) |
|
801 | 801 | { |
802 | - print '<td>'.$flight->getNomUrl(0).'</td>'; |
|
802 | + print '<td>' . $flight->getNomUrl(0) . '</td>'; |
|
803 | 803 | |
804 | - if (! $i) $totalarray['nbfield']++; |
|
804 | + if (!$i) $totalarray['nbfield']++; |
|
805 | 805 | } |
806 | - if (! empty($arrayfields['t.date']['checked'])) |
|
806 | + if (!empty($arrayfields['t.date']['checked'])) |
|
807 | 807 | { |
808 | 808 | print '<td>'; |
809 | 809 | print dol_print_date($db->jdate($obj->date), '%d-%m-%y'); |
810 | 810 | print '</td>'; |
811 | 811 | |
812 | - if (! $i) $totalarray['nbfield']++; |
|
812 | + if (!$i) $totalarray['nbfield']++; |
|
813 | 813 | } |
814 | - if (! empty($arrayfields['t.lieuD']['checked'])) |
|
814 | + if (!empty($arrayfields['t.lieuD']['checked'])) |
|
815 | 815 | { |
816 | - print '<td>'.$obj->lieuD.'</td>'; |
|
816 | + print '<td>' . $obj->lieuD . '</td>'; |
|
817 | 817 | |
818 | - if (! $i) $totalarray['nbfield']++; |
|
818 | + if (!$i) $totalarray['nbfield']++; |
|
819 | 819 | } |
820 | - if (! empty($arrayfields['t.lieuA']['checked'])) |
|
820 | + if (!empty($arrayfields['t.lieuA']['checked'])) |
|
821 | 821 | { |
822 | - print '<td>'.$obj->lieuA.'</td>'; |
|
822 | + print '<td>' . $obj->lieuA . '</td>'; |
|
823 | 823 | |
824 | - if (! $i) $totalarray['nbfield']++; |
|
824 | + if (!$i) $totalarray['nbfield']++; |
|
825 | 825 | } |
826 | - if (! empty($arrayfields['t.heureD']['checked'])) |
|
826 | + if (!empty($arrayfields['t.heureD']['checked'])) |
|
827 | 827 | { |
828 | - print '<td>'.$obj->heureD.'</td>'; |
|
828 | + print '<td>' . $obj->heureD . '</td>'; |
|
829 | 829 | |
830 | - if (! $i) $totalarray['nbfield']++; |
|
830 | + if (!$i) $totalarray['nbfield']++; |
|
831 | 831 | } |
832 | - if (! empty($arrayfields['t.heureA']['checked'])) |
|
832 | + if (!empty($arrayfields['t.heureA']['checked'])) |
|
833 | 833 | { |
834 | - print '<td>'.$obj->heureA.'</td>'; |
|
834 | + print '<td>' . $obj->heureA . '</td>'; |
|
835 | 835 | |
836 | - if (! $i) $totalarray['nbfield']++; |
|
836 | + if (!$i) $totalarray['nbfield']++; |
|
837 | 837 | } |
838 | - if (! empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked'])) |
|
838 | + if (!empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked'])) |
|
839 | 839 | { |
840 | - print '<td>'.$obj->bal.'</td>'; |
|
840 | + print '<td>' . $obj->bal . '</td>'; |
|
841 | 841 | |
842 | - if (! $i) $totalarray['nbfield']++; |
|
842 | + if (!$i) $totalarray['nbfield']++; |
|
843 | 843 | } |
844 | - if (! empty($arrayfields['t.nbrPax']['checked'])) |
|
844 | + if (!empty($arrayfields['t.nbrPax']['checked'])) |
|
845 | 845 | { |
846 | - print '<td>'.$obj->nbrPax.'</td>'; |
|
846 | + print '<td>' . $obj->nbrPax . '</td>'; |
|
847 | 847 | |
848 | - if (! $i) $totalarray['nbfield']++; |
|
848 | + if (!$i) $totalarray['nbfield']++; |
|
849 | 849 | } |
850 | - if (! empty($arrayfields['t.remarque']['checked'])) |
|
850 | + if (!empty($arrayfields['t.remarque']['checked'])) |
|
851 | 851 | { |
852 | - print '<td>'.$obj->remarque.'</td>'; |
|
852 | + print '<td>' . $obj->remarque . '</td>'; |
|
853 | 853 | |
854 | - if (! $i) $totalarray['nbfield']++; |
|
854 | + if (!$i) $totalarray['nbfield']++; |
|
855 | 855 | } |
856 | - if (! empty($arrayfields['t.incidents']['checked'])) |
|
856 | + if (!empty($arrayfields['t.incidents']['checked'])) |
|
857 | 857 | { |
858 | - print '<td>'.$obj->incidents.'</td>'; |
|
858 | + print '<td>' . $obj->incidents . '</td>'; |
|
859 | 859 | |
860 | - if (! $i) $totalarray['nbfield']++; |
|
860 | + if (!$i) $totalarray['nbfield']++; |
|
861 | 861 | } |
862 | - if (! empty($arrayfields['t.fk_type']['checked'])) |
|
862 | + if (!empty($arrayfields['t.fk_type']['checked'])) |
|
863 | 863 | { |
864 | - print '<td>'.$obj->flight_type.'</td>'; |
|
864 | + print '<td>' . $obj->flight_type . '</td>'; |
|
865 | 865 | |
866 | - if (! $i) $totalarray['nbfield']++; |
|
866 | + if (!$i) $totalarray['nbfield']++; |
|
867 | 867 | } |
868 | - if (! empty($arrayfields['t.fk_pilot']['checked'])) |
|
868 | + if (!empty($arrayfields['t.fk_pilot']['checked'])) |
|
869 | 869 | { |
870 | - print '<td>'.$obj->pilot.'</td>'; |
|
870 | + print '<td>' . $obj->pilot . '</td>'; |
|
871 | 871 | |
872 | - if (! $i) $totalarray['nbfield']++; |
|
872 | + if (!$i) $totalarray['nbfield']++; |
|
873 | 873 | } |
874 | - if (! empty($arrayfields['t.fk_organisateur']['checked'])) |
|
874 | + if (!empty($arrayfields['t.fk_organisateur']['checked'])) |
|
875 | 875 | { |
876 | - print '<td>'.$obj->organisator.'</td>'; |
|
876 | + print '<td>' . $obj->organisator . '</td>'; |
|
877 | 877 | |
878 | - if (! $i) $totalarray['nbfield']++; |
|
878 | + if (!$i) $totalarray['nbfield']++; |
|
879 | 879 | } |
880 | - if (! empty($arrayfields['t.is_facture']['checked'])) |
|
880 | + if (!empty($arrayfields['t.is_facture']['checked'])) |
|
881 | 881 | { |
882 | 882 | $flight->is_facture = $obj->is_facture; |
883 | - print '<td>'.$flight->getLibStatut(3).'</td>'; |
|
883 | + print '<td>' . $flight->getLibStatut(3) . '</td>'; |
|
884 | 884 | |
885 | - if (! $i) $totalarray['nbfield']++; |
|
885 | + if (!$i) $totalarray['nbfield']++; |
|
886 | 886 | } |
887 | - if (! empty($arrayfields['t.kilometers']['checked'])) |
|
887 | + if (!empty($arrayfields['t.kilometers']['checked'])) |
|
888 | 888 | { |
889 | - if($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot){ |
|
890 | - print '<td>'.$obj->kilometers.' KM</td>'; |
|
891 | - }else{ |
|
889 | + if ($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) { |
|
890 | + print '<td>' . $obj->kilometers . ' KM</td>'; |
|
891 | + } else { |
|
892 | 892 | print '<td> - Km</td>'; |
893 | 893 | } |
894 | 894 | |
895 | - if (! $i) $totalarray['nbfield']++; |
|
895 | + if (!$i) $totalarray['nbfield']++; |
|
896 | 896 | } |
897 | - if (! empty($arrayfields['t.cost']['checked'])) |
|
897 | + if (!empty($arrayfields['t.cost']['checked'])) |
|
898 | 898 | { |
899 | - if(($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0){ |
|
899 | + if (($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0) { |
|
900 | 900 | $nbrPax = $obj->nbrPax > 0 ? $obj->nbrPax : 1; |
901 | - print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost/$nbrPax, 0, $langs, -1, -1, -1, $conf->currency)); |
|
902 | - }else{ |
|
901 | + print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost / $nbrPax, 0, $langs, -1, -1, -1, $conf->currency)); |
|
902 | + } else { |
|
903 | 903 | print '<td> - €</td>'; |
904 | 904 | } |
905 | 905 | |
906 | - if (! $i) $totalarray['nbfield']++; |
|
906 | + if (!$i) $totalarray['nbfield']++; |
|
907 | 907 | } |
908 | - if (! empty($arrayfields['t.fk_receiver']['checked'])) |
|
908 | + if (!empty($arrayfields['t.fk_receiver']['checked'])) |
|
909 | 909 | { |
910 | - print '<td>'.$obj->receiver.'</td>'; |
|
910 | + print '<td>' . $obj->receiver . '</td>'; |
|
911 | 911 | |
912 | - if (! $i) $totalarray['nbfield']++; |
|
912 | + if (!$i) $totalarray['nbfield']++; |
|
913 | 913 | } |
914 | - if (! empty($arrayfields['t.justif_kilometers']['checked'])) |
|
914 | + if (!empty($arrayfields['t.justif_kilometers']['checked'])) |
|
915 | 915 | { |
916 | - print '<td>'.$obj->justif_kilometers.'</td>'; |
|
916 | + print '<td>' . $obj->justif_kilometers . '</td>'; |
|
917 | 917 | |
918 | - if (! $i) $totalarray['nbfield']++; |
|
918 | + if (!$i) $totalarray['nbfield']++; |
|
919 | 919 | } |
920 | 920 | |
921 | 921 | // Extra fields |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | // Fields from hook |
941 | 941 | $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj); |
942 | 942 | $reshook = $hookmanager->executeHooks('printFieldListValue', |
943 | - $parameters); // Note that $action and $object may have been modified by hook |
|
943 | + $parameters); // Note that $action and $object may have been modified by hook |
|
944 | 944 | print $hookmanager->resPrint; |
945 | 945 | // Date creation |
946 | 946 | if (!empty($arrayfields['t.datec']['checked'])) { |
@@ -1010,7 +1010,7 @@ discard block |
||
1010 | 1010 | |
1011 | 1011 | $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); |
1012 | 1012 | $reshook = $hookmanager->executeHooks('printFieldListFooter', |
1013 | - $parameters); // Note that $action and $object may have been modified by hook |
|
1013 | + $parameters); // Note that $action and $object may have been modified by hook |
|
1014 | 1014 | print $hookmanager->resPrint; |
1015 | 1015 | |
1016 | 1016 | print '</table>' . "\n"; |