@@ -189,10 +189,12 @@ discard block |
||
189 | 189 | include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
190 | 190 | |
191 | 191 | // Purge search criteria |
192 | - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers |
|
192 | + if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) { |
|
193 | + // All tests are required to be compatible with all browsers |
|
193 | 194 | { |
194 | 195 | |
195 | 196 | $search_idBBC_vols = ''; |
197 | + } |
|
196 | 198 | $search_date = ''; |
197 | 199 | $search_lieuD = ''; |
198 | 200 | $search_lieuA = ''; |
@@ -799,7 +801,9 @@ discard block |
||
799 | 801 | { |
800 | 802 | print '<td>'.$flight->getNomUrl(0).'</td>'; |
801 | 803 | |
802 | - if (! $i) $totalarray['nbfield']++; |
|
804 | + if (! $i) { |
|
805 | + $totalarray['nbfield']++; |
|
806 | + } |
|
803 | 807 | } |
804 | 808 | if (! empty($arrayfields['t.date']['checked'])) |
805 | 809 | { |
@@ -807,113 +811,147 @@ discard block |
||
807 | 811 | print dol_print_date($db->jdate($obj->date), '%d-%m-%y'); |
808 | 812 | print '</td>'; |
809 | 813 | |
810 | - if (! $i) $totalarray['nbfield']++; |
|
814 | + if (! $i) { |
|
815 | + $totalarray['nbfield']++; |
|
816 | + } |
|
811 | 817 | } |
812 | 818 | if (! empty($arrayfields['t.lieuD']['checked'])) |
813 | 819 | { |
814 | 820 | print '<td>'.$obj->lieuD.'</td>'; |
815 | 821 | |
816 | - if (! $i) $totalarray['nbfield']++; |
|
822 | + if (! $i) { |
|
823 | + $totalarray['nbfield']++; |
|
824 | + } |
|
817 | 825 | } |
818 | 826 | if (! empty($arrayfields['t.lieuA']['checked'])) |
819 | 827 | { |
820 | 828 | print '<td>'.$obj->lieuA.'</td>'; |
821 | 829 | |
822 | - if (! $i) $totalarray['nbfield']++; |
|
830 | + if (! $i) { |
|
831 | + $totalarray['nbfield']++; |
|
832 | + } |
|
823 | 833 | } |
824 | 834 | if (! empty($arrayfields['t.heureD']['checked'])) |
825 | 835 | { |
826 | 836 | print '<td>'.$obj->heureD.'</td>'; |
827 | 837 | |
828 | - if (! $i) $totalarray['nbfield']++; |
|
838 | + if (! $i) { |
|
839 | + $totalarray['nbfield']++; |
|
840 | + } |
|
829 | 841 | } |
830 | 842 | if (! empty($arrayfields['t.heureA']['checked'])) |
831 | 843 | { |
832 | 844 | print '<td>'.$obj->heureA.'</td>'; |
833 | 845 | |
834 | - if (! $i) $totalarray['nbfield']++; |
|
846 | + if (! $i) { |
|
847 | + $totalarray['nbfield']++; |
|
848 | + } |
|
835 | 849 | } |
836 | 850 | if (! empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked'])) |
837 | 851 | { |
838 | 852 | print '<td>'.$obj->bal.'</td>'; |
839 | 853 | |
840 | - if (! $i) $totalarray['nbfield']++; |
|
854 | + if (! $i) { |
|
855 | + $totalarray['nbfield']++; |
|
856 | + } |
|
841 | 857 | } |
842 | 858 | if (! empty($arrayfields['t.nbrPax']['checked'])) |
843 | 859 | { |
844 | 860 | print '<td>'.$obj->nbrPax.'</td>'; |
845 | 861 | |
846 | - if (! $i) $totalarray['nbfield']++; |
|
862 | + if (! $i) { |
|
863 | + $totalarray['nbfield']++; |
|
864 | + } |
|
847 | 865 | } |
848 | 866 | if (! empty($arrayfields['t.remarque']['checked'])) |
849 | 867 | { |
850 | 868 | print '<td>'.$obj->remarque.'</td>'; |
851 | 869 | |
852 | - if (! $i) $totalarray['nbfield']++; |
|
870 | + if (! $i) { |
|
871 | + $totalarray['nbfield']++; |
|
872 | + } |
|
853 | 873 | } |
854 | 874 | if (! empty($arrayfields['t.incidents']['checked'])) |
855 | 875 | { |
856 | 876 | print '<td>'.$obj->incidents.'</td>'; |
857 | 877 | |
858 | - if (! $i) $totalarray['nbfield']++; |
|
878 | + if (! $i) { |
|
879 | + $totalarray['nbfield']++; |
|
880 | + } |
|
859 | 881 | } |
860 | 882 | if (! empty($arrayfields['t.fk_type']['checked'])) |
861 | 883 | { |
862 | 884 | print '<td>'.$obj->flight_type.'</td>'; |
863 | 885 | |
864 | - if (! $i) $totalarray['nbfield']++; |
|
886 | + if (! $i) { |
|
887 | + $totalarray['nbfield']++; |
|
888 | + } |
|
865 | 889 | } |
866 | 890 | if (! empty($arrayfields['t.fk_pilot']['checked'])) |
867 | 891 | { |
868 | 892 | print '<td>'.$obj->pilot.'</td>'; |
869 | 893 | |
870 | - if (! $i) $totalarray['nbfield']++; |
|
894 | + if (! $i) { |
|
895 | + $totalarray['nbfield']++; |
|
896 | + } |
|
871 | 897 | } |
872 | 898 | if (! empty($arrayfields['t.fk_organisateur']['checked'])) |
873 | 899 | { |
874 | 900 | print '<td>'.$obj->organisator.'</td>'; |
875 | 901 | |
876 | - if (! $i) $totalarray['nbfield']++; |
|
902 | + if (! $i) { |
|
903 | + $totalarray['nbfield']++; |
|
904 | + } |
|
877 | 905 | } |
878 | 906 | if (! empty($arrayfields['t.is_facture']['checked'])) |
879 | 907 | { |
880 | 908 | $flight->is_facture = $obj->is_facture; |
881 | 909 | print '<td>'.$flight->getLibStatut(3).'</td>'; |
882 | 910 | |
883 | - if (! $i) $totalarray['nbfield']++; |
|
911 | + if (! $i) { |
|
912 | + $totalarray['nbfield']++; |
|
913 | + } |
|
884 | 914 | } |
885 | 915 | if (! empty($arrayfields['t.kilometers']['checked'])) |
886 | 916 | { |
887 | 917 | if($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot){ |
888 | 918 | print '<td>'.$obj->kilometers.' KM</td>'; |
889 | - }else{ |
|
919 | + } else{ |
|
890 | 920 | print '<td> - Km</td>'; |
891 | 921 | } |
892 | 922 | |
893 | - if (! $i) $totalarray['nbfield']++; |
|
923 | + if (! $i) { |
|
924 | + $totalarray['nbfield']++; |
|
925 | + } |
|
894 | 926 | } |
895 | 927 | if (! empty($arrayfields['t.cost']['checked'])) |
896 | 928 | { |
897 | 929 | if(($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0){ |
898 | 930 | $nbrPax = $obj->nbrPax > 0 ? $obj->nbrPax : 1; |
899 | 931 | 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)); |
900 | - }else{ |
|
932 | + } else{ |
|
901 | 933 | print '<td> - €</td>'; |
902 | 934 | } |
903 | 935 | |
904 | - if (! $i) $totalarray['nbfield']++; |
|
936 | + if (! $i) { |
|
937 | + $totalarray['nbfield']++; |
|
938 | + } |
|
905 | 939 | } |
906 | 940 | if (! empty($arrayfields['t.fk_receiver']['checked'])) |
907 | 941 | { |
908 | 942 | print '<td>'.$obj->receiver.'</td>'; |
909 | 943 | |
910 | - if (! $i) $totalarray['nbfield']++; |
|
944 | + if (! $i) { |
|
945 | + $totalarray['nbfield']++; |
|
946 | + } |
|
911 | 947 | } |
912 | 948 | if (! empty($arrayfields['t.justif_kilometers']['checked'])) |
913 | 949 | { |
914 | 950 | print '<td>'.$obj->justif_kilometers.'</td>'; |
915 | 951 | |
916 | - if (! $i) $totalarray['nbfield']++; |
|
952 | + if (! $i) { |
|
953 | + $totalarray['nbfield']++; |
|
954 | + } |
|
917 | 955 | } |
918 | 956 | |
919 | 957 | // Extra fields |
@@ -961,9 +999,11 @@ discard block |
||
961 | 999 | |
962 | 1000 | // Action column |
963 | 1001 | print '<td class="nowrap" align="center">'; |
964 | - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined |
|
1002 | + if ($massactionbutton || $massaction) { |
|
1003 | + // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined |
|
965 | 1004 | { |
966 | 1005 | $selected = 0; |
1006 | + } |
|
967 | 1007 | if (in_array($obj->idBBC_vols, $arrayofselected)) { |
968 | 1008 | $selected = 1; |
969 | 1009 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount, $nbrPax); |
129 | 129 | $handler->handle($command); |
130 | 130 | Header("Location: card.php?id=" . $flight->getId()); |
131 | - }catch (\Exception $e){ |
|
131 | + } catch (\Exception $e){ |
|
132 | 132 | dol_syslog($e->getMessage(),LOG_ERR); |
133 | 133 | dol_htmloutput_mesg("Facture non créée", '', 'error'); |
134 | 134 | } |
@@ -269,9 +269,12 @@ discard block |
||
269 | 269 | |
270 | 270 | <?php if (!$flightProduct || !$flight->hasReceiver()) : ?> |
271 | 271 | <a class="butActionRefused" href="#">Générer</a> |
272 | - <?php else: ?> |
|
272 | + <?php else { |
|
273 | + : ?> |
|
273 | 274 | <button class="butAction" type="submit">Générer</button> |
274 | - <?php endif; ?> |
|
275 | + <?php endif; |
|
276 | +} |
|
277 | +?> |
|
275 | 278 | |
276 | 279 | <a class="butAction" href="<?php echo DOL_URL_ROOT . '/flightlog/card.php?id=' . $flight->id; ?>">Retour au |
277 | 280 | vol</a> |