Completed
Branch develop (c4712c)
by
unknown
22:15
created
htdocs/api/class/api_documents.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -639,7 +639,9 @@
 block discarded – undo
639 639
 								$filearray[$i] = array_merge($filearray[$i], (array) $line);
640 640
 							}
641 641
 						}
642
-						if (isset($line->filename)) $filearray[$i]['content-type'] = dol_mimetype($line->filename);
642
+						if (isset($line->filename)) {
643
+							$filearray[$i]['content-type'] = dol_mimetype($line->filename);
644
+						}
643 645
 						$arraycontenttype = explode(",", $content_type);
644 646
 						if (!empty($content_type) && isset($line->filename) && !in_array(dol_mimetype($line->filename), $arraycontenttype)) {
645 647
 							unset($filearray[$i]);
Please login to merge, or discard this patch.
htdocs/contrat/class/contrat.class.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1268,7 +1268,10 @@
 block discarded – undo
1268 1268
 		// Delete record into ECM index and physically
1269 1269
 		if (!$error) {
1270 1270
 			$res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
1271
-			if ($res) $res = $this->deleteEcmFiles(1); // Deleting files physically is done later with the dol_delete_dir_recursive
1271
+			if ($res) {
1272
+				$res = $this->deleteEcmFiles(1);
1273
+			}
1274
+			// Deleting files physically is done later with the dol_delete_dir_recursive
1272 1275
 			if (!$res) {
1273 1276
 				$error++;
1274 1277
 			}
Please login to merge, or discard this patch.
htdocs/accountancy/journal/bankjournal.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -404,7 +404,9 @@
 block discarded – undo
404 404
 			$resultamount = $db->query($sqlamount);
405 405
 			if ($resultamount) {
406 406
 				$objamount = $db->fetch_object($resultamount);
407
-				if (!empty($objamount->amount)) $amounttouse = $objamount->amount;
407
+				if (!empty($objamount->amount)) {
408
+					$amounttouse = $objamount->amount;
409
+				}
408 410
 			}
409 411
 		}
410 412
 
Please login to merge, or discard this patch.
htdocs/bom/tpl/objectline_view.tpl.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -223,7 +223,9 @@
 block discarded – undo
223 223
 print '<td id="costline_'.$line->id.'" class="linecolcost nowrap right">';
224 224
 
225 225
 $line->qty = (float) $line->qty;
226
-if ($tmpbom->id > 0) $line->qty /= $tmpbom->qty;
226
+if ($tmpbom->id > 0) {
227
+	$line->qty /= $tmpbom->qty;
228
+}
227 229
 
228 230
 $coldisplay++;
229 231
 if (!empty($line->fk_bom_child)) {
Please login to merge, or discard this patch.
htdocs/includes/tcpdi/fpdf_tpl.php 1 patch
Braces   +60 added lines, -40 removed lines patch added patch discarded remove patch
@@ -79,17 +79,22 @@  discard block
 block discarded – undo
79 79
             return;
80 80
         }
81 81
         
82
-        if ($this->page <= 0)
83
-            $this->error("You have to add a page to fpdf first!");
82
+        if ($this->page <= 0) {
83
+                    $this->error("You have to add a page to fpdf first!");
84
+        }
84 85
 
85
-        if ($x == null)
86
-            $x = 0;
87
-        if ($y == null)
88
-            $y = 0;
89
-        if ($w == null)
90
-            $w = $this->w;
91
-        if ($h == null)
92
-            $h = $this->h;
86
+        if ($x == null) {
87
+                    $x = 0;
88
+        }
89
+        if ($y == null) {
90
+                    $y = 0;
91
+        }
92
+        if ($w == null) {
93
+                    $w = $this->w;
94
+        }
95
+        if ($h == null) {
96
+                    $h = $this->h;
97
+        }
93 98
 
94 99
         // Save settings
95 100
         $this->tpl++;
@@ -165,8 +170,9 @@  discard block
 block discarded – undo
165 170
             $this->FontSize = $tpl['o_FontSize'];
166 171
             
167 172
             $fontkey = $this->FontFamily . $this->FontStyle;
168
-            if ($fontkey)
169
-                $this->CurrentFont =& $this->fonts[$fontkey];
173
+            if ($fontkey) {
174
+                            $this->CurrentFont =& $this->fonts[$fontkey];
175
+            }
170 176
             
171 177
             return $this->tpl;
172 178
         } else {
@@ -192,11 +198,13 @@  discard block
 block discarded – undo
192 198
      * @retrun array The height and width of the template
193 199
      */
194 200
     function useTemplate($tplidx, $_x = null, $_y = null, $_w = 0, $_h = 0) {
195
-        if ($this->page <= 0)
196
-            $this->error('You have to add a page first!');
201
+        if ($this->page <= 0) {
202
+                    $this->error('You have to add a page first!');
203
+        }
197 204
         
198
-        if (!isset($this->tpls[$tplidx]))
199
-            $this->error('Template does not exist!');
205
+        if (!isset($this->tpls[$tplidx])) {
206
+                    $this->error('Template does not exist!');
207
+        }
200 208
             
201 209
         if ($this->_intpl) {
202 210
             $this->_res['tpl'][$this->tpl]['tpls'][$tplidx] =& $this->tpls[$tplidx];
@@ -206,10 +214,12 @@  discard block
 block discarded – undo
206 214
         $w = $tpl['w'];
207 215
         $h = $tpl['h'];
208 216
         
209
-        if ($_x == null)
210
-            $_x = 0;
211
-        if ($_y == null)
212
-            $_y = 0;
217
+        if ($_x == null) {
218
+                    $_x = 0;
219
+        }
220
+        if ($_y == null) {
221
+                    $_y = 0;
222
+        }
213 223
             
214 224
         $_x += $tpl['x'];
215 225
         $_y += $tpl['y'];
@@ -249,8 +259,9 @@  discard block
 block discarded – undo
249 259
      * @return array The height and width of the template
250 260
      */
251 261
     function getTemplateSize($tplidx, $_w = 0, $_h = 0) {
252
-        if (!isset($this->tpls[$tplidx]))
253
-            return false;
262
+        if (!isset($this->tpls[$tplidx])) {
263
+                    return false;
264
+        }
254 265
 
255 266
         $tpl =& $this->tpls[$tplidx];
256 267
         $w = $tpl['w'];
@@ -261,10 +272,12 @@  discard block
 block discarded – undo
261 272
             $_h = $h;
262 273
         }
263 274
 
264
-        if($_w == 0)
265
-            $_w = $_h * $w / $h;
266
-        if($_h == 0)
267
-            $_h = $_w * $h / $w;
275
+        if($_w == 0) {
276
+                    $_w = $_h * $w / $h;
277
+        }
278
+        if($_h == 0) {
279
+                    $_h = $_w * $h / $w;
280
+        }
268 281
             
269 282
         return array("w" => $_w, "h" => $_h);
270 283
     }
@@ -323,8 +336,9 @@  discard block
 block discarded – undo
323 336
 			return parent::AddPage(...$args);
324 337
         }
325 338
         
326
-        if ($this->_intpl)
327
-            $this->Error('Adding pages in templates isn\'t possible!');
339
+        if ($this->_intpl) {
340
+                    $this->Error('Adding pages in templates isn\'t possible!');
341
+        }
328 342
             
329 343
         parent::AddPage($orientation, $format);
330 344
     }
@@ -338,8 +352,9 @@  discard block
 block discarded – undo
338 352
 			return parent::Link(...$args);
339 353
         }
340 354
         
341
-        if ($this->_intpl)
342
-            $this->Error('Using links in templates aren\'t possible!');
355
+        if ($this->_intpl) {
356
+                    $this->Error('Using links in templates aren\'t possible!');
357
+        }
343 358
             
344 359
         parent::Link($x, $y, $w, $h, $link);
345 360
     }
@@ -351,8 +366,9 @@  discard block
 block discarded – undo
351 366
 
352 367
         }
353 368
         
354
-        if ($this->_intpl)
355
-            $this->Error('Adding links in templates aren\'t possible!');
369
+        if ($this->_intpl) {
370
+                    $this->Error('Adding links in templates aren\'t possible!');
371
+        }
356 372
         return parent::AddLink();
357 373
     }
358 374
     
@@ -362,8 +378,9 @@  discard block
 block discarded – undo
362 378
 			return parent::SetLink(...$args);
363 379
         }
364 380
         
365
-        if ($this->_intpl)
366
-            $this->Error('Setting links in templates aren\'t possible!');
381
+        if ($this->_intpl) {
382
+                    $this->Error('Setting links in templates aren\'t possible!');
383
+        }
367 384
         parent::SetLink($link, $y, $page);
368 385
     }
369 386
     
@@ -403,8 +420,9 @@  discard block
 block discarded – undo
403 420
             $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
404 421
             if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {
405 422
                 $this->_out('/Font <<');
406
-                foreach($this->_res['tpl'][$tplidx]['fonts'] as $font)
407
-                    $this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');
423
+                foreach($this->_res['tpl'][$tplidx]['fonts'] as $font) {
424
+                                    $this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');
425
+                }
408 426
                 $this->_out('>>');
409 427
             }
410 428
             if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || 
@@ -412,12 +430,14 @@  discard block
 block discarded – undo
412 430
             {
413 431
                 $this->_out('/XObject <<');
414 432
                 if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {
415
-                    foreach($this->_res['tpl'][$tplidx]['images'] as $image)
416
-                          $this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');
433
+                    foreach($this->_res['tpl'][$tplidx]['images'] as $image) {
434
+                                              $this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');
435
+                    }
417 436
                 }
418 437
                 if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {
419
-                    foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl)
420
-                        $this->_out($this->tplprefix . $i . ' ' . $tpl['n'] . ' 0 R');
438
+                    foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) {
439
+                                            $this->_out($this->tplprefix . $i . ' ' . $tpl['n'] . ' 0 R');
440
+                    }
421 441
                 }
422 442
                 $this->_out('>>');
423 443
             }
Please login to merge, or discard this patch.
htdocs/core/lib/accounting.lib.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -175,7 +175,10 @@
 block discarded – undo
175 175
 {
176 176
 	global $conf;
177 177
 
178
-	if (empty($auxiliary_account)) return true; // No check needed if no auxiliary account used
178
+	if (empty($auxiliary_account)) {
179
+		return true;
180
+	}
181
+	// No check needed if no auxiliary account used
179 182
 
180 183
 	// Build SQL to get general account info based on rowid or account number
181 184
 	$sql = "SELECT rowid, account_number, centralized";
Please login to merge, or discard this patch.
htdocs/core/class/html.formmail.class.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -657,7 +657,10 @@
 block discarded – undo
657 657
 					if (in_array($key, array('__NEWREF__', '__REFCLIENT__', '__REFSUPPLIER__', '__SUPPLIER_ORDER_DATE_DELIVERY__', '__SUPPLIER_ORDER_DELAY_DELIVERY__'))) {
658 658
 						continue;
659 659
 					}
660
-					if (is_array($val)) $val = implode(', ', $val); // key __MULTICURRENCY_CODE__ is an array and crashes dolGetFirstLineOfText function which accept only text
660
+					if (is_array($val)) {
661
+						$val = implode(', ', $val);
662
+					}
663
+					// key __MULTICURRENCY_CODE__ is an array and crashes dolGetFirstLineOfText function which accept only text
661 664
 					$helpforsubstitution .= $key.' -> '.$langs->trans(dol_string_nohtmltag(dolGetFirstLineOfText($val))).'<br>';
662 665
 					$helpforsubstitution .= '</span>';
663 666
 				}
Please login to merge, or discard this patch.
htdocs/accountancy/class/accountingjournal.class.php 1 patch
Braces   +50 added lines, -18 removed lines patch added patch discarded remove patch
@@ -378,15 +378,21 @@  discard block
 block discarded – undo
378 378
 				case 1: // Various Journal
379 379
 					if (isModEnabled('asset') && !getDolGlobalInt('ACCOUNTING_DISABLE_TRANSFER_ON_ASSETS')) {
380 380
 						$tmp = $this->getAssetData($user, $type, $date_start, $date_end, $in_bookkeeping);
381
-						if (is_array($tmp)) $data = array_merge($data, $tmp);
381
+						if (is_array($tmp)) {
382
+							$data = array_merge($data, $tmp);
383
+						}
382 384
 					}
383 385
 					if (isModEnabled('invoice') && !getDolGlobalInt('ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS')) {
384 386
 						$tmp = $this->getDiscountCustomer($user, $type, $date_start, $date_end, $in_bookkeeping);
385
-						if (is_array($tmp)) $data = array_merge($data, $tmp);
387
+						if (is_array($tmp)) {
388
+							$data = array_merge($data, $tmp);
389
+						}
386 390
 					}
387 391
 					if (isModEnabled('supplier_invoice') && !getDolGlobalInt('ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS')) {
388 392
 						$tmp = $this->getDiscountSupplier($user, $type, $date_start, $date_end, $in_bookkeeping);
389
-						if (is_array($tmp)) $data = array_merge($data, $tmp);
393
+						if (is_array($tmp)) {
394
+							$data = array_merge($data, $tmp);
395
+						}
390 396
 					}
391 397
 					break;
392 398
 					//              case 2: // Sells Journal
@@ -745,8 +751,12 @@  discard block
 block discarded – undo
745 751
 		$langs->loadLangs(array('bills'));
746 752
 
747 753
 		// Clean parameters
748
-		if (empty($type)) $type = 'view';
749
-		if (empty($in_bookkeeping)) $in_bookkeeping = 'notyet';
754
+		if (empty($type)) {
755
+			$type = 'view';
756
+		}
757
+		if (empty($in_bookkeeping)) {
758
+			$in_bookkeeping = 'notyet';
759
+		}
750 760
 
751 761
 		// Build SQL - Customer invoices closed by discount
752 762
 		$sql = "SELECT f.rowid, f.ref, f.datef, f.fk_soc, f.total_ttc";
@@ -794,7 +804,9 @@  discard block
 block discarded – undo
794 804
 		$acc_vat_coll_def = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT');			// Normal to apply vat default account for buy with customer's discount
795 805
 
796 806
 		while ($obj = $this->db->fetch_object($resql)) {
797
-			if ($invoice_static->fetch((int) $obj->rowid) <= 0) continue;
807
+			if ($invoice_static->fetch((int) $obj->rowid) <= 0) {
808
+				continue;
809
+			}
798 810
 
799 811
 			$customer_static->fetch($invoice_static->socid);
800 812
 			$account_customer_general = !empty($customer_static->accountancy_code_customer_general) ? $customer_static->accountancy_code_customer_general : getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER');
@@ -808,7 +820,9 @@  discard block
 block discarded – undo
808 820
 			$useddep = (float) price2num($invoice_static->getSumDepositsUsed(), 'MT');
809 821
 			$ttc_inv = (float) price2num($invoice_static->total_ttc, 'MT');
810 822
 			$escompte_ttc = (float) price2num(max(0, $ttc_inv - $paid - $usedcn - $useddep), 'MT');
811
-			if ($escompte_ttc <= 0) continue;
823
+			if ($escompte_ttc <= 0) {
824
+				continue;
825
+			}
812 826
 
813 827
 			$bookkeeping_static = new BookKeeping($this->db);
814 828
 			$label_discount = $bookkeeping_static->accountingLabelForOperation($customer_static->getNomUrl(1, 'customer'), $invoice_static->ref, $langs->trans('DiscountGranted'));
@@ -817,9 +831,13 @@  discard block
 block discarded – undo
817 831
 			$ttcByRate = array(); $totalTTC = 0.0;
818 832
 			foreach ((array) $invoice_static->lines as $li) {
819 833
 				$ttc = (float) $li->total_ttc;
820
-				if (!$ttc) continue;
834
+				if (!$ttc) {
835
+					continue;
836
+				}
821 837
 				$key = number_format((float) $li->tva_tx, 3, '.', '');
822
-				if (!isset($ttcByRate[$key])) $ttcByRate[$key] = 0.0;
838
+				if (!isset($ttcByRate[$key])) {
839
+					$ttcByRate[$key] = 0.0;
840
+				}
823 841
 				$ttcByRate[$key] += $ttc;
824 842
 				$totalTTC += $ttc;
825 843
 			}
@@ -1035,8 +1053,12 @@  discard block
 block discarded – undo
1035 1053
 		$langs->loadLangs(array('suppliers'));
1036 1054
 
1037 1055
 		// Clean parameters
1038
-		if (empty($type)) $type = 'view';
1039
-		if (empty($in_bookkeeping)) $in_bookkeeping = 'notyet';
1056
+		if (empty($type)) {
1057
+			$type = 'view';
1058
+		}
1059
+		if (empty($in_bookkeeping)) {
1060
+			$in_bookkeeping = 'notyet';
1061
+		}
1040 1062
 
1041 1063
 		// SQL - Supplier invoices closed by discount
1042 1064
 		$sql = "SELECT ff.rowid, ff.ref, ff.datef, ff.fk_soc, ff.total_ttc";
@@ -1084,7 +1106,9 @@  discard block
 block discarded – undo
1084 1106
 		$acc_vat_ded_def  = getDolGlobalString('ACCOUNTING_VAT_SOLD_ACCOUNT');			// Normal to apply vat default account for sold with supplier's discount
1085 1107
 
1086 1108
 		while ($obj = $this->db->fetch_object($resql)) {
1087
-			if ($invoicesupplier_static->fetch((int) $obj->rowid) <= 0) continue;
1109
+			if ($invoicesupplier_static->fetch((int) $obj->rowid) <= 0) {
1110
+				continue;
1111
+			}
1088 1112
 
1089 1113
 			$supplier_static->fetch($invoicesupplier_static->socid);
1090 1114
 			$account_supplier_general = !empty($supplier_static->accountancy_code_supplier_general) ? $supplier_static->accountancy_code_supplier_general : getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER');
@@ -1098,7 +1122,9 @@  discard block
 block discarded – undo
1098 1122
 			$useddep = (float) price2num($invoicesupplier_static->getSumDepositsUsed(), 'MT');
1099 1123
 			$ttc_inv = (float) price2num($invoicesupplier_static->total_ttc, 'MT');
1100 1124
 			$escompte_ttc = (float) price2num(max(0, $ttc_inv - $paid - $usedcn - $useddep), 'MT');
1101
-			if ($escompte_ttc <= 0) continue;
1125
+			if ($escompte_ttc <= 0) {
1126
+				continue;
1127
+			}
1102 1128
 
1103 1129
 			$bookkeeping_static = new BookKeeping($this->db);
1104 1130
 			$label_discount = $bookkeeping_static->accountingLabelForOperation($supplier_static->getNomUrl(1, 'supplier'), $invoicesupplier_static->ref, $langs->trans('DiscountReceived'));
@@ -1107,9 +1133,13 @@  discard block
 block discarded – undo
1107 1133
 			$ttcByRate = array(); $totalTTC = 0.0;
1108 1134
 			foreach ((array) $invoicesupplier_static->lines as $li) {
1109 1135
 				$ttc = (float) $li->total_ttc;
1110
-				if (!$ttc) continue;
1136
+				if (!$ttc) {
1137
+					continue;
1138
+				}
1111 1139
 				$key = number_format((float) $li->tva_tx, 3, '.', '');
1112
-				if (!isset($ttcByRate[$key])) $ttcByRate[$key] = 0.0;
1140
+				if (!isset($ttcByRate[$key])) {
1141
+					$ttcByRate[$key] = 0.0;
1142
+				}
1113 1143
 				$ttcByRate[$key] += $ttc;
1114 1144
 				$totalTTC += $ttc;
1115 1145
 			}
@@ -1273,9 +1303,11 @@  discard block
 block discarded – undo
1273 1303
 					}
1274 1304
 				} else {
1275 1305
 					// si TVA = 0, pousser les 2 lignes view/bookkeeping déjà constituées
1276
-					if ($type == 'view') $element['blocks'][] = $lines_view;
1277
-					elseif ($type == 'bookkeeping') $element['blocks'][] = $lines_book;
1278
-					else { // csv
1306
+					if ($type == 'view') {
1307
+						$element['blocks'][] = $lines_view;
1308
+					} elseif ($type == 'bookkeeping') {
1309
+						$element['blocks'][] = $lines_book;
1310
+					} else { // csv
1279 1311
 						$element['blocks'][] = array($docdate, $invoicesupplier_static->ref, length_accountg($account_supplier_general), $label_discount.' - '.$langs->transnoentitiesnoconv('Supplier'), price($ttc_part), '');
1280 1312
 						$element['blocks'][] = array($docdate, $invoicesupplier_static->ref, length_accountg($acc_disc_recv), $label_discount.' ('.$rateStr.'%)', '', price($ht_part));
1281 1313
 					}
Please login to merge, or discard this patch.
htdocs/projet/class/api_tasks.class.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -608,8 +608,9 @@
 block discarded – undo
608 608
 		$this->task->timespent_duration = $duration;
609 609
 		$this->task->timespent_fk_user  = $uid;
610 610
 		$this->task->timespent_note     = $note;
611
-		if (!empty($this->task->progress))
612
-			$this->task->progress  		= $progress;
611
+		if (!empty($this->task->progress)) {
612
+					$this->task->progress  		= $progress;
613
+		}
613 614
 
614 615
 		$result = $this->task->addTimeSpent(DolibarrApiAccess::$user, 0);
615 616
 		if ($result == 0) {
Please login to merge, or discard this patch.