@@ -191,10 +191,12 @@ discard block |
||
191 | 191 | include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
192 | 192 | |
193 | 193 | // Purge search criteria |
194 | - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers |
|
194 | + if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) { |
|
195 | + // All tests are required to be compatible with all browsers |
|
195 | 196 | { |
196 | 197 | |
197 | 198 | $search_idBBC_vols = ''; |
199 | + } |
|
198 | 200 | $search_date = ''; |
199 | 201 | $search_lieuD = ''; |
200 | 202 | $search_lieuA = ''; |
@@ -801,7 +803,9 @@ discard block |
||
801 | 803 | { |
802 | 804 | print '<td>'.$flight->getNomUrl(0).'</td>'; |
803 | 805 | |
804 | - if (! $i) $totalarray['nbfield']++; |
|
806 | + if (! $i) { |
|
807 | + $totalarray['nbfield']++; |
|
808 | + } |
|
805 | 809 | } |
806 | 810 | if (! empty($arrayfields['t.date']['checked'])) |
807 | 811 | { |
@@ -809,112 +813,146 @@ discard block |
||
809 | 813 | print dol_print_date($db->jdate($obj->date), '%d-%m-%y'); |
810 | 814 | print '</td>'; |
811 | 815 | |
812 | - if (! $i) $totalarray['nbfield']++; |
|
816 | + if (! $i) { |
|
817 | + $totalarray['nbfield']++; |
|
818 | + } |
|
813 | 819 | } |
814 | 820 | if (! empty($arrayfields['t.lieuD']['checked'])) |
815 | 821 | { |
816 | 822 | print '<td>'.$obj->lieuD.'</td>'; |
817 | 823 | |
818 | - if (! $i) $totalarray['nbfield']++; |
|
824 | + if (! $i) { |
|
825 | + $totalarray['nbfield']++; |
|
826 | + } |
|
819 | 827 | } |
820 | 828 | if (! empty($arrayfields['t.lieuA']['checked'])) |
821 | 829 | { |
822 | 830 | print '<td>'.$obj->lieuA.'</td>'; |
823 | 831 | |
824 | - if (! $i) $totalarray['nbfield']++; |
|
832 | + if (! $i) { |
|
833 | + $totalarray['nbfield']++; |
|
834 | + } |
|
825 | 835 | } |
826 | 836 | if (! empty($arrayfields['t.heureD']['checked'])) |
827 | 837 | { |
828 | 838 | print '<td>'.$obj->heureD.'</td>'; |
829 | 839 | |
830 | - if (! $i) $totalarray['nbfield']++; |
|
840 | + if (! $i) { |
|
841 | + $totalarray['nbfield']++; |
|
842 | + } |
|
831 | 843 | } |
832 | 844 | if (! empty($arrayfields['t.heureA']['checked'])) |
833 | 845 | { |
834 | 846 | print '<td>'.$obj->heureA.'</td>'; |
835 | 847 | |
836 | - if (! $i) $totalarray['nbfield']++; |
|
848 | + if (! $i) { |
|
849 | + $totalarray['nbfield']++; |
|
850 | + } |
|
837 | 851 | } |
838 | 852 | if (! empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked'])) |
839 | 853 | { |
840 | 854 | print '<td>'.$obj->bal.'</td>'; |
841 | 855 | |
842 | - if (! $i) $totalarray['nbfield']++; |
|
856 | + if (! $i) { |
|
857 | + $totalarray['nbfield']++; |
|
858 | + } |
|
843 | 859 | } |
844 | 860 | if (! empty($arrayfields['t.nbrPax']['checked'])) |
845 | 861 | { |
846 | 862 | print '<td>'.$obj->nbrPax.'</td>'; |
847 | 863 | |
848 | - if (! $i) $totalarray['nbfield']++; |
|
864 | + if (! $i) { |
|
865 | + $totalarray['nbfield']++; |
|
866 | + } |
|
849 | 867 | } |
850 | 868 | if (! empty($arrayfields['t.remarque']['checked'])) |
851 | 869 | { |
852 | 870 | print '<td>'.$obj->remarque.'</td>'; |
853 | 871 | |
854 | - if (! $i) $totalarray['nbfield']++; |
|
872 | + if (! $i) { |
|
873 | + $totalarray['nbfield']++; |
|
874 | + } |
|
855 | 875 | } |
856 | 876 | if (! empty($arrayfields['t.incidents']['checked'])) |
857 | 877 | { |
858 | 878 | print '<td>'.$obj->incidents.'</td>'; |
859 | 879 | |
860 | - if (! $i) $totalarray['nbfield']++; |
|
880 | + if (! $i) { |
|
881 | + $totalarray['nbfield']++; |
|
882 | + } |
|
861 | 883 | } |
862 | 884 | if (! empty($arrayfields['t.fk_type']['checked'])) |
863 | 885 | { |
864 | 886 | print '<td>'.$obj->flight_type.'</td>'; |
865 | 887 | |
866 | - if (! $i) $totalarray['nbfield']++; |
|
888 | + if (! $i) { |
|
889 | + $totalarray['nbfield']++; |
|
890 | + } |
|
867 | 891 | } |
868 | 892 | if (! empty($arrayfields['t.fk_pilot']['checked'])) |
869 | 893 | { |
870 | 894 | print '<td>'.$obj->pilot.'</td>'; |
871 | 895 | |
872 | - if (! $i) $totalarray['nbfield']++; |
|
896 | + if (! $i) { |
|
897 | + $totalarray['nbfield']++; |
|
898 | + } |
|
873 | 899 | } |
874 | 900 | if (! empty($arrayfields['t.fk_organisateur']['checked'])) |
875 | 901 | { |
876 | 902 | print '<td>'.$obj->organisator.'</td>'; |
877 | 903 | |
878 | - if (! $i) $totalarray['nbfield']++; |
|
904 | + if (! $i) { |
|
905 | + $totalarray['nbfield']++; |
|
906 | + } |
|
879 | 907 | } |
880 | 908 | if (! empty($arrayfields['t.is_facture']['checked'])) |
881 | 909 | { |
882 | 910 | $flight->is_facture = $obj->is_facture; |
883 | 911 | print '<td>'.$flight->getLibStatut(3).'</td>'; |
884 | 912 | |
885 | - if (! $i) $totalarray['nbfield']++; |
|
913 | + if (! $i) { |
|
914 | + $totalarray['nbfield']++; |
|
915 | + } |
|
886 | 916 | } |
887 | 917 | if (! empty($arrayfields['t.kilometers']['checked'])) |
888 | 918 | { |
889 | 919 | if($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot){ |
890 | 920 | print '<td>'.$obj->kilometers.' KM</td>'; |
891 | - }else{ |
|
921 | + } else{ |
|
892 | 922 | print '<td> - Km</td>'; |
893 | 923 | } |
894 | 924 | |
895 | - if (! $i) $totalarray['nbfield']++; |
|
925 | + if (! $i) { |
|
926 | + $totalarray['nbfield']++; |
|
927 | + } |
|
896 | 928 | } |
897 | 929 | if (! empty($arrayfields['t.cost']['checked'])) |
898 | 930 | { |
899 | 931 | if(($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0){ |
900 | 932 | 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{ |
|
933 | + } else{ |
|
902 | 934 | print '<td> - €</td>'; |
903 | 935 | } |
904 | 936 | |
905 | - if (! $i) $totalarray['nbfield']++; |
|
937 | + if (! $i) { |
|
938 | + $totalarray['nbfield']++; |
|
939 | + } |
|
906 | 940 | } |
907 | 941 | if (! empty($arrayfields['t.fk_receiver']['checked'])) |
908 | 942 | { |
909 | 943 | print '<td>'.$obj->receiver.'</td>'; |
910 | 944 | |
911 | - if (! $i) $totalarray['nbfield']++; |
|
945 | + if (! $i) { |
|
946 | + $totalarray['nbfield']++; |
|
947 | + } |
|
912 | 948 | } |
913 | 949 | if (! empty($arrayfields['t.justif_kilometers']['checked'])) |
914 | 950 | { |
915 | 951 | print '<td>'.$obj->justif_kilometers.'</td>'; |
916 | 952 | |
917 | - if (! $i) $totalarray['nbfield']++; |
|
953 | + if (! $i) { |
|
954 | + $totalarray['nbfield']++; |
|
955 | + } |
|
918 | 956 | } |
919 | 957 | |
920 | 958 | // Extra fields |
@@ -962,9 +1000,11 @@ discard block |
||
962 | 1000 | |
963 | 1001 | // Action column |
964 | 1002 | print '<td class="nowrap" align="center">'; |
965 | - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined |
|
1003 | + if ($massactionbutton || $massaction) { |
|
1004 | + // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined |
|
966 | 1005 | { |
967 | 1006 | $selected = 0; |
1007 | + } |
|
968 | 1008 | if (in_array($obj->idBBC_vols, $arrayofselected)) { |
969 | 1009 | $selected = 1; |
970 | 1010 | } |
@@ -347,7 +347,7 @@ |
||
347 | 347 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'), |
348 | 348 | $langs->trans('êtes-vous sure de vouloir supprimer ce vol ?'), 'confirm_delete', '', 0, 1); |
349 | 349 | print $formconfirm; |
350 | - }elseif ($user->rights->flightlog->vol->financial && !$object->isBilled() && $action == ACTION_FLAG_BILLED) { |
|
350 | + } elseif ($user->rights->flightlog->vol->financial && !$object->isBilled() && $action == ACTION_FLAG_BILLED) { |
|
351 | 351 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Marque comme facturé'), |
352 | 352 | $langs->trans('Ce vol va être marqué comme facturé, est-ce bien le cas ?'), ACTION_CONFIRM_FLAG_BILLED, '', 0, 1); |
353 | 353 | print $formconfirm; |