Completed
Push — master ( f9e566...747eba )
by Laurent
03:05
created
listFact.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@
 block discarded – undo
61 61
 $form = new Form($db);
62 62
 print '<!-- debut cartouche rapport -->
63 63
 	<div class="tabs">
64
-	    <a  id="'.($viewSelection == 1 ? 'active' : '').'" class="tab" href="listFact.php?view=1">Facturation</a>
65
-	    <a  id="'.($viewSelection == 2 ? 'active' : '').'" class="tab" href="listFact.php?view=2">AVIABEL</a>
64
+	    <a  id="'.($viewSelection == 1 ? 'active' : '') . '" class="tab" href="listFact.php?view=1">Facturation</a>
65
+	    <a  id="'.($viewSelection == 2 ? 'active' : '') . '" class="tab" href="listFact.php?view=2">AVIABEL</a>
66 66
 	</div>';
67 67
 print '<div class="tabBar">';
68 68
 print "<form name='listFact' action=\"listFact.php\" method=\"get\">\n";
Please login to merge, or discard this patch.
readFlightsBalloon.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
     //il est titulaire d'un ballon
46 46
     $query = 'SELECT * FROM llx_bbc_ballons';
47 47
     if (!$user->rights->flightLog->vol->detail) {
48
-        $query.= ' WHERE `fk_responsable` = ' . $user->id;
49
-        $query.= ' OR `fk_co_responsable` = ' . $user->id;
48
+        $query .= ' WHERE `fk_responsable` = ' . $user->id;
49
+        $query .= ' OR `fk_co_responsable` = ' . $user->id;
50 50
     }
51 51
     $resql = $db->query($query);
52 52
     if ($resql) {
@@ -85,15 +85,15 @@  discard block
 block discarded – undo
85 85
     $titulaire->fetch($ballon->fk_responsable);
86 86
     //flight with balloon ID
87 87
     $query = 'SELECT *, TIMEDIFF(heureA,heureD) AS time FROM llx_bbc_vols';
88
-    $query.= ' WHERE `BBC_ballons_idBBC_ballons` = ' . $ballon->id;
88
+    $query .= ' WHERE `BBC_ballons_idBBC_ballons` = ' . $ballon->id;
89 89
     if ($datep) {
90
-        $query.= ' AND date >= \'' . dol_print_date($datep, 'dayrfc') . '\'';
90
+        $query .= ' AND date >= \'' . dol_print_date($datep, 'dayrfc') . '\'';
91 91
     }
92 92
     if ($datef) {
93
-        $query.= ' AND date <= \'' . dol_print_date($datef, 'dayrfc') . '\'';
93
+        $query .= ' AND date <= \'' . dol_print_date($datef, 'dayrfc') . '\'';
94 94
     }
95 95
 
96
-    $query.= ' ORDER BY date';
96
+    $query .= ' ORDER BY date';
97 97
 
98 98
     $resql = $db->query($query);
99 99
 }
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
         select_balloons($idBallon);
127 127
     } else {
128 128
         $query2 = 'SELECT * FROM llx_bbc_ballons';
129
-        $query2.= ' WHERE `fk_responsable` = ' . $user->id;
130
-        $query2.= ' OR `fk_co_responsable` = ' . $user->id;
129
+        $query2 .= ' WHERE `fk_responsable` = ' . $user->id;
130
+        $query2 .= ' OR `fk_co_responsable` = ' . $user->id;
131 131
         $resql2 = $db->query($query2);
132 132
         if ($resql2) {
133 133
             $num = $db->num_rows($resql2);
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
                 print '<td>' . $obj->fk_type . '</td>';
218 218
                 print '<td>' . $obj->date . '</td>';
219 219
                 print '<td>' . $ballon->immat . '</td>';
220
-                print '<td>' . $pilot->getNomUrl(). '</td>';
220
+                print '<td>' . $pilot->getNomUrl() . '</td>';
221 221
                 print '<td>' . $obj->lieuD . '</td>';
222 222
                 print '<td>' . $obj->lieuA . '</td>';
223 223
                 print '<td>' . $obj->heureD . '</td>';
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
                 if ($user->rights->flightLog->vol->status) {
232 232
                     $vol = new Bbcvols($db);
233 233
                     $vol->fetch($obj->idBBC_vols);
234
-                    print '<td>' . $vol->getStatus().'</td>';
234
+                    print '<td>' . $vol->getStatus() . '</td>';
235 235
                 }
236 236
             }
237 237
             print'</tr>';
Please login to merge, or discard this patch.
readFlightsPilot.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,10 +60,10 @@
 block discarded – undo
60 60
 $query = 'SELECT *,TIMEDIFF(heureA,heureD) AS time  FROM llx_bbc_vols WHERE 1=1';
61 61
 
62 62
 if ($datep) {
63
-    $query .= ' AND date >= \'' . dol_print_date($datep, 'dayrfc'). '\'';
63
+    $query .= ' AND date >= \'' . dol_print_date($datep, 'dayrfc') . '\'';
64 64
 }
65 65
 if ($datef) {
66
-    $query .= ' AND date <= \'' . dol_print_date($datef, 'dayrfc'). '\'';
66
+    $query .= ' AND date <= \'' . dol_print_date($datef, 'dayrfc') . '\'';
67 67
 }
68 68
 
69 69
 $query .= ' AND `fk_pilot` = ' . $bbcUser->id;
Please login to merge, or discard this patch.
generateExpenseNote.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 
82 82
         $missions = bbcKilometersByQuartil($year);
83 83
 
84
-        foreach($missions as $currentMissionUserId => $currentMission){
84
+        foreach ($missions as $currentMissionUserId => $currentMission) {
85 85
 
86
-            if($currentMission["quartil"][$quarter]["km"] == 0 && $currentMission["quartil"][$quarter]["flight"] == 0){
86
+            if ($currentMission["quartil"][$quarter]["km"] == 0 && $currentMission["quartil"][$quarter]["flight"] == 0) {
87 87
                 continue;
88 88
             }
89 89
 
@@ -97,18 +97,18 @@  discard block
 block discarded – undo
97 97
             $object->fk_statut = 1;
98 98
             $object->fk_user_validator = GETPOST("fk_user_validator", 'int');
99 99
             $object->note_public = GETPOST('public_note', 'alpha');
100
-            $object->note_private = GETPOST('private_note','alpha');
100
+            $object->note_private = GETPOST('private_note', 'alpha');
101 101
 
102 102
             $expenseNoteId = $object->create($expenseNoteUser);
103
-            if($expenseNoteId < 0){
104
-                dol_htmloutput_errors("Erreur lors de la création de la note de frais" , $object->errors);
103
+            if ($expenseNoteId < 0) {
104
+                dol_htmloutput_errors("Erreur lors de la création de la note de frais", $object->errors);
105 105
                 continue;
106 106
             }
107 107
 
108 108
 
109 109
             $flightsForQuarter = findFlightByPilotAndQuarter($currentMissionUserId, $year, $quarter);
110 110
 
111
-            foreach($flightsForQuarter as $currentFlightForQuarter) {
111
+            foreach ($flightsForQuarter as $currentFlightForQuarter) {
112 112
 
113 113
                 // Kilometers
114 114
                 $object_ligne = new ExpenseReportLine($db);
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
         if ($result > 0) {
170 170
             dol_htmloutput_mesg("Notes de frais créées");
171
-        }else{
171
+        } else {
172 172
             dol_htmloutput_errors("Note de frais non créée");
173 173
         }
174 174
     } else {
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
 $form = new Form($db);
188 188
 
189 189
 $tabLinks = [];
190
-foreach($flightYears as $currentFlightYear){
190
+foreach ($flightYears as $currentFlightYear) {
191 191
     $tabLinks[] = [
192
-        DOL_URL_ROOT."/flightLog/generateExpenseNote.php?year=".$currentFlightYear,
192
+        DOL_URL_ROOT . "/flightLog/generateExpenseNote.php?year=" . $currentFlightYear,
193 193
         $currentFlightYear,
194
-        "tab_".$currentFlightYear
194
+        "tab_" . $currentFlightYear
195 195
     ];
196 196
 }
197 197
 
198
-dol_fiche_head($tabLinks, "tab_".$year);
198
+dol_fiche_head($tabLinks, "tab_" . $year);
199 199
 
200 200
 ?>
201 201
     <form method="POST">
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         <select name="quarter" id="field_quarter">
212 212
             <option value="1" <?= ($year == $currentYear && $currentQuarter <= 1) ? 'disabled="disabled"' : "" ?>>1</option>
213 213
             <option value="2" <?= ($year == $currentYear && $currentQuarter <= 2) ? 'disabled="disabled"' : "" ?>>2</option>
214
-            <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"': "" ?>>3</option>
214
+            <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"' : "" ?>>3</option>
215 215
             <option value="4" <?= ($year == $currentYear && $currentQuarter <= 4) ? 'disabled="disabled"' : "" ?>>4</option>
216 216
         </select>
217 217
         <br/>
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         <label><?= $langs->trans("Validateur de la note de frais")?></label><br/>
221 221
         <?php
222 222
             $include_users = $object->fetch_users_approver_expensereport();
223
-            print $form->select_dolusers($user->id,"fk_user_validator",1,"",0,$include_users);
223
+            print $form->select_dolusers($user->id, "fk_user_validator", 1, "", 0, $include_users);
224 224
         ?>
225 225
         <br/>
226 226
 
Please login to merge, or discard this patch.
class/YearGraphicalData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
         $result = [$this->year];
70 70
 
71 71
         foreach ($this->graphData as $typeId => $data) {
72
-            if(!in_array($typeId, [1,2,3,6])){
72
+            if (!in_array($typeId, [1, 2, 3, 6])) {
73 73
                 continue;
74 74
             }
75 75
 
Please login to merge, or discard this patch.
class/GraphicalValueType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,14 +36,14 @@
 block discarded – undo
36 36
     /**
37 37
      * @param GraphicalValue $value
38 38
      */
39
-    public function addValue(GraphicalValue $value){
39
+    public function addValue(GraphicalValue $value) {
40 40
         $this->counter = $this->counter->add($value);
41 41
     }
42 42
 
43 43
     /**
44 44
      * @return int
45 45
      */
46
-    public function getValue(){
46
+    public function getValue() {
47 47
         return $this->counter->getValue();
48 48
     }
49 49
 
Please login to merge, or discard this patch.
class/GraphicalData.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function addValue($year, GraphicalValue $value)
42 42
     {
43
-        if(!isset($this->data[$year])){
43
+        if (!isset($this->data[$year])) {
44 44
             throw new \Exception("Year is not defined");
45 45
         }
46 46
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         $result = [];
56 56
 
57
-        foreach($this->data as $year){
57
+        foreach ($this->data as $year) {
58 58
             $result[] = $year->export();
59 59
         }
60 60
 
Please login to merge, or discard this patch.
class/bbcvols.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -701,7 +701,7 @@
 block discarded – undo
701 701
 
702 702
         $label = '<u>' . $langs->trans("MyModule") . '</u>';
703 703
         $label .= '<div width="100%">';
704
-        $label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref.'<br>';
704
+        $label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref . '<br>';
705 705
         $label .= '<b>' . $langs->trans('Date') . ':</b> ' . $this->date;
706 706
         $label .= '</div>';
707 707
 
Please login to merge, or discard this patch.
readBalloonInc.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 $langs->load("mymodule@mymodule");
24 24
 
25 25
 // Get parameters
26
-$myparam = isset($_GET["myparam"])?$_GET["myparam"]:'';
26
+$myparam = isset($_GET["myparam"]) ? $_GET["myparam"] : '';
27 27
 
28 28
 // Protection if the user can't acces to the module
29 29
 if (!$user->rights->flightLog->vol->access)
@@ -42,53 +42,53 @@  discard block
 block discarded – undo
42 42
 //l'utilisateur a le droit de selectionner le ballon qu'il veut
43 43
 if (($user->rights->flightLog->vol->detail))
44 44
 {
45
-	if(isset($_GET["ballon"])){
45
+	if (isset($_GET["ballon"])) {
46 46
 		$idBallon = $_GET['ballon'];
47
-	}else{
48
-		$idBallon =1;
47
+	} else {
48
+		$idBallon = 1;
49 49
 	}
50 50
 	
51
-}else{
51
+} else {
52 52
 	
53 53
 	//l'utilisateur n'a pas le choix du ballon
54 54
 	//il est titulaire d'un ballon
55 55
 	$query = 'SELECT * FROM llx_bbc_ballons';
56
-	$query.= ' WHERE `fk_responsable` = '.$user->id;
56
+	$query .= ' WHERE `fk_responsable` = ' . $user->id;
57 57
 	$resql = $db->query($query);
58
-	if($resql){
58
+	if ($resql) {
59 59
 		$num = $db->num_rows($resql);
60 60
 		$i = 0;
61
-		if($num){
61
+		if ($num) {
62 62
 			print'</tr>';
63
-			while($i <$num){
63
+			while ($i < $num) {
64 64
 				$obj = $db->fetch_object($resql); //vol
65
-				if($obj){
65
+				if ($obj) {
66 66
 					$idBallon = ($obj->rowid);
67 67
 				}
68 68
 			}
69
-		}else{
69
+		} else {
70 70
 			//il n'est pas titulaire d'un ballon
71 71
 			accessforbidden("Vous n'&ecirc;tes pas titulaire du ballon");
72 72
 		}
73 73
 	}
74 74
 }
75
-if($idBallon != -1){
75
+if ($idBallon != -1) {
76 76
 	
77 77
 	//balloon with ID
78 78
 	$ballon = New Bbc_ballons($db);
79 79
         
80
-	if($ballon->fetch($idBallon)==-1){
81
-		print "ERROR".$idBallon."<br/>";
80
+	if ($ballon->fetch($idBallon) == -1) {
81
+		print "ERROR" . $idBallon . "<br/>";
82 82
 	}
83 83
 	//titulaire with ballon ID
84 84
         $titulaire = new User($db);
85 85
         $titulaire->fetch($ballon->fk_responsable);
86 86
         //flight with balloon ID
87 87
 	$query = 'SELECT *, TIMEDIFF(heureA,heureD) AS time FROM llx_bbc_vols';
88
-	$query.= ' WHERE `BBC_ballons_idBBC_ballons` = '.$ballon->id;
89
-	$query.= ' AND `incidents` NOT LIKE \'RAS\'';
90
-	$query.= ' AND `incidents` NOT LIKE \'\'';
91
-	$query.= ' ORDER BY date';
88
+	$query .= ' WHERE `BBC_ballons_idBBC_ballons` = ' . $ballon->id;
89
+	$query .= ' AND `incidents` NOT LIKE \'RAS\'';
90
+	$query .= ' AND `incidents` NOT LIKE \'\'';
91
+	$query .= ' ORDER BY date';
92 92
 	$resql = $db->query($query);
93 93
 }
94 94
 
@@ -100,25 +100,25 @@  discard block
 block discarded – undo
100 100
 * Put here all code to build page
101 101
 ****************************************************/
102 102
 
103
-llxHeader('','Carnet de vol','');
104
-if($msg && $idBallon != -1){
103
+llxHeader('', 'Carnet de vol', '');
104
+if ($msg && $idBallon != -1) {
105 105
 	print $msg;
106
-}else{
107
-	$form=new Form($db);
106
+} else {
107
+	$form = new Form($db);
108 108
 	
109 109
 	print '<!-- debut cartouche rapport -->
110 110
 	<div class="tabs">
111
-	<a  class="tab" href="readFlightsBalloon.php?ballon='.$idBallon.'">Carnet de vol</a>
112
-	<a id="active" class="tab" href="readBalloonInc.php?ballon='.$idBallon.'">Incidents</a>
111
+	<a  class="tab" href="readFlightsBalloon.php?ballon='.$idBallon . '">Carnet de vol</a>
112
+	<a id="active" class="tab" href="readBalloonInc.php?ballon='.$idBallon . '">Incidents</a>
113 113
 	</div>';
114 114
 	print '<div class="tabBar">';
115 115
 	print "<form name='readBalloon' action=\"readFlightsBalloon.php\" method=\"get\">\n";
116 116
 	print '<input type="hidden" name="mode" value="SELECT">';
117 117
 	print '<table width="100%" class="border">';
118 118
 	print '<tr><td>Ballon</td><td colspan="3">';
119
-	if($user->rights->flightLog->vol->detail){
119
+	if ($user->rights->flightLog->vol->detail) {
120 120
 		select_balloons($idBallon);
121
-	}else{
121
+	} else {
122 122
 		print $ballon->immat;
123 123
 	}
124 124
 	
@@ -126,15 +126,15 @@  discard block
 block discarded – undo
126 126
         //titulaire
127 127
         print '<tr>';
128 128
         print '<td>Titulaire</td>';
129
-        print '<td>'.$titulaire->getLoginUrl(1).'</td>';
129
+        print '<td>' . $titulaire->getLoginUrl(1) . '</td>';
130 130
         print '</tr>';
131 131
         //Vol initial
132 132
         print '<tr>';
133 133
         print '<td>Bapteme</td>';
134
-        print '<td>'.dol_print_date($ballon->date, 'dayrfc').'</td>';
134
+        print '<td>' . dol_print_date($ballon->date, 'dayrfc') . '</td>';
135 135
         print '</tr>';
136 136
         $num = 0;
137
-	if($resql){
137
+	if ($resql) {
138 138
 		//fetch pilot
139 139
 		
140 140
 		$num = $db->num_rows($resql);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
                 print '<table class="border" width="100%">';
152 152
 		$i = 0;
153
-		if($num){
153
+		if ($num) {
154 154
 			print '<tr class="liste_titre">';
155 155
 			print '<td class="liste_titre"> identifiant </td>';
156 156
 			print '<td class="liste_titre"> Date </td>';
@@ -164,32 +164,32 @@  discard block
 block discarded – undo
164 164
 			print '<td class="liste_titre"> Nbr Pax </td>';
165 165
 			print '<td class="liste_titre"> Rem </td>';
166 166
 			print '<td class="liste_titre"> Incidents </td>';
167
-			if($user->rights->flightLog->vol->status){
167
+			if ($user->rights->flightLog->vol->status) {
168 168
 				print '<td class="liste_titre"> Statut </td>';
169 169
 			}
170 170
 			print'</tr>';
171
-			while($i <$num){
171
+			while ($i < $num) {
172 172
 				$obj = $db->fetch_object($resql); //vol
173 173
 				print '<tr>';
174
-				if($obj){
174
+				if ($obj) {
175 175
 					$pilot = New User($db); //pilot
176 176
 					$pilot->fetch($obj->fk_pilot);
177
-					print '<td><a href="fiche.php?vol='.$obj->idBBC_vols.'">'.$obj->idBBC_vols.'</a></td>';
178
-					print '<td>'.$obj->date.'</td>';
179
-					print '<td>'.$ballon->immat.'</td>';
180
-					print '<td>'.$pilot->getNomUrl().'</a></td>';
181
-					print '<td>'.$obj->lieuD.'</td>';
182
-					print '<td>'.$obj->lieuA.'</td>';
183
-					print '<td>'.$obj->heureD.'</td>';
184
-					print '<td>'.$obj->heureA.'</td>';
185
-					print '<td>'.$obj->time.'</td>';
186
-					print '<td>'.$obj->nbrPax.'</td>';
187
-					print '<td>'.$obj->remarque.'</td>';
188
-					print '<td>'.$obj->incidents.'</td>';
189
-					if($user->rights->flightLog->vol->status){
177
+					print '<td><a href="fiche.php?vol=' . $obj->idBBC_vols . '">' . $obj->idBBC_vols . '</a></td>';
178
+					print '<td>' . $obj->date . '</td>';
179
+					print '<td>' . $ballon->immat . '</td>';
180
+					print '<td>' . $pilot->getNomUrl() . '</a></td>';
181
+					print '<td>' . $obj->lieuD . '</td>';
182
+					print '<td>' . $obj->lieuA . '</td>';
183
+					print '<td>' . $obj->heureD . '</td>';
184
+					print '<td>' . $obj->heureA . '</td>';
185
+					print '<td>' . $obj->time . '</td>';
186
+					print '<td>' . $obj->nbrPax . '</td>';
187
+					print '<td>' . $obj->remarque . '</td>';
188
+					print '<td>' . $obj->incidents . '</td>';
189
+					if ($user->rights->flightLog->vol->status) {
190 190
 						$vol = new Bbcvols($db);
191 191
 						$vol->fetch($obj->idBBC_vols);
192
-                        print '<td>' . $vol->getStatus().'</td>';
192
+                        print '<td>' . $vol->getStatus() . '</td>';
193 193
 					}
194 194
 				}
195 195
 				print'</tr>';
Please login to merge, or discard this patch.