@@ -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'); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | $parameters = array(); |
183 | 183 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, |
184 | - $action); // Note that $action and $object may have been modified by some hooks |
|
184 | + $action); // Note that $action and $object may have been modified by some hooks |
|
185 | 185 | if ($reshook < 0) { |
186 | 186 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
187 | 187 | } |
@@ -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, |
@@ -710,7 +710,7 @@ discard block |
||
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,124 +797,124 @@ 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){ |
|
900 | - print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost/$obj->nbrPax, 0, $langs, -1, -1, -1, $conf->currency)); |
|
901 | - }else{ |
|
899 | + if (($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0) { |
|
900 | + print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost / $obj->nbrPax, 0, $langs, -1, -1, -1, $conf->currency)); |
|
901 | + } else { |
|
902 | 902 | print '<td> - €</td>'; |
903 | 903 | } |
904 | 904 | |
905 | - if (! $i) $totalarray['nbfield']++; |
|
905 | + if (!$i) $totalarray['nbfield']++; |
|
906 | 906 | } |
907 | - if (! empty($arrayfields['t.fk_receiver']['checked'])) |
|
907 | + if (!empty($arrayfields['t.fk_receiver']['checked'])) |
|
908 | 908 | { |
909 | - print '<td>'.$obj->receiver.'</td>'; |
|
909 | + print '<td>' . $obj->receiver . '</td>'; |
|
910 | 910 | |
911 | - if (! $i) $totalarray['nbfield']++; |
|
911 | + if (!$i) $totalarray['nbfield']++; |
|
912 | 912 | } |
913 | - if (! empty($arrayfields['t.justif_kilometers']['checked'])) |
|
913 | + if (!empty($arrayfields['t.justif_kilometers']['checked'])) |
|
914 | 914 | { |
915 | - print '<td>'.$obj->justif_kilometers.'</td>'; |
|
915 | + print '<td>' . $obj->justif_kilometers . '</td>'; |
|
916 | 916 | |
917 | - if (! $i) $totalarray['nbfield']++; |
|
917 | + if (!$i) $totalarray['nbfield']++; |
|
918 | 918 | } |
919 | 919 | |
920 | 920 | // Extra fields |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | // Fields from hook |
940 | 940 | $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj); |
941 | 941 | $reshook = $hookmanager->executeHooks('printFieldListValue', |
942 | - $parameters); // Note that $action and $object may have been modified by hook |
|
942 | + $parameters); // Note that $action and $object may have been modified by hook |
|
943 | 943 | print $hookmanager->resPrint; |
944 | 944 | // Date creation |
945 | 945 | if (!empty($arrayfields['t.datec']['checked'])) { |
@@ -1009,7 +1009,7 @@ discard block |
||
1009 | 1009 | |
1010 | 1010 | $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); |
1011 | 1011 | $reshook = $hookmanager->executeHooks('printFieldListFooter', |
1012 | - $parameters); // Note that $action and $object may have been modified by hook |
|
1012 | + $parameters); // Note that $action and $object may have been modified by hook |
|
1013 | 1013 | print $hookmanager->resPrint; |
1014 | 1014 | |
1015 | 1015 | print '</table>' . "\n"; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $isAllowedEdit = ($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)); |
71 | 71 | $isAllowedDelete = ($user->rights->flightlog->vol->delete || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id && !$object->is_facture)); |
72 | -$permissiondellink=$user->rights->flightlog->vol->financial; |
|
72 | +$permissiondellink = $user->rights->flightlog->vol->financial; |
|
73 | 73 | |
74 | 74 | $search_idBBC_vols = GETPOST('search_idBBC_vols', 'int'); |
75 | 75 | $search_lieuD = GETPOST('search_lieuD', 'alpha'); |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); |
117 | 117 | |
118 | 118 | // Load object |
119 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
120 | -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
119 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
120 | +include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
121 | 121 | |
122 | 122 | // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array |
123 | 123 | $hookmanager->initHooks(array('bbcvols')); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | $parameters = array(); |
144 | 144 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, |
145 | - $action); // Note that $action and $object may have been modified by some hooks |
|
145 | + $action); // Note that $action and $object may have been modified by some hooks |
|
146 | 146 | if ($reshook < 0) { |
147 | 147 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
148 | 148 | } |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | print '<div class="tabsAction">' . "\n"; |
377 | 377 | $parameters = array(); |
378 | 378 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, |
379 | - $action); // Note that $action and $object may have been modified by hook |
|
379 | + $action); // Note that $action and $object may have been modified by hook |
|
380 | 380 | if ($reshook < 0) { |
381 | 381 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
382 | 382 | } |
@@ -389,14 +389,14 @@ discard block |
||
389 | 389 | print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete">' . $langs->trans('Delete') . '</a></div>' . "\n"; |
390 | 390 | } |
391 | 391 | |
392 | - if($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()){ |
|
393 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/flightlog/facture.php?id=' . $object->id.'">' . $langs->trans("Facturer") . '</a></div>' . "\n"; |
|
392 | + if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()) { |
|
393 | + print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/flightlog/facture.php?id=' . $object->id . '">' . $langs->trans("Facturer") . '</a></div>' . "\n"; |
|
394 | 394 | } |
395 | 395 | ?> |
396 | 396 | |
397 | - <?php if($user->rights->flightlog->vol->financial && !$object->isBilled() ): ?> |
|
397 | + <?php if ($user->rights->flightlog->vol->financial && !$object->isBilled()): ?> |
|
398 | 398 | <div class="inline-block divButAction"> |
399 | - <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s' , $_SERVER["PHP_SELF"], $object->id, ACTION_FLAG_BILLED);?>"> |
|
399 | + <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s', $_SERVER["PHP_SELF"], $object->id, ACTION_FLAG_BILLED); ?>"> |
|
400 | 400 | <?php echo $langs->trans("Marqué comme facturé ") ?> |
401 | 401 | </a> |
402 | 402 | </div> |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | |
405 | 405 | </div> |
406 | 406 | <?php |
407 | - if($user->rights->flightlog->vol->financial){ |
|
407 | + if ($user->rights->flightlog->vol->financial) { |
|
408 | 408 | print '<div class="fichecenter"><div class="fichehalfleft">'; |
409 | 409 | $form->showLinkedObjectBlock($object); |
410 | 410 | print '</div></div>'; |