Passed
Branch develop (fc1365)
by Laurent
84:32
created
htdocs/core/lib/files.lib.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1003,7 +1003,9 @@  discard block
 block discarded – undo
1003 1003
 				$files = dol_dir_list($newpathofdestdir);
1004 1004
 				if (!empty($files) && is_array($files)) {
1005 1005
 					foreach ($files as $key => $file) {
1006
-						if (!file_exists($file["fullname"])) continue;
1006
+						if (!file_exists($file["fullname"])) {
1007
+							continue;
1008
+						}
1007 1009
 						$filepath = $file["path"];
1008 1010
 						$oldname = $file["name"];
1009 1011
 
@@ -1718,7 +1720,9 @@  discard block
 block discarded – undo
1718 1720
 					// Update index table of files (llx_ecm_files)
1719 1721
 					if ($donotupdatesession == 1) {
1720 1722
 						$sharefile = 0;
1721
-						if ($TFile['type'][$i] == 'application/pdf' && strpos($_SERVER["REQUEST_URI"], 'product') !== false && !empty($conf->global->PRODUCT_ALLOW_EXTERNAL_DOWNLOAD)) $sharefile = 1;
1723
+						if ($TFile['type'][$i] == 'application/pdf' && strpos($_SERVER["REQUEST_URI"], 'product') !== false && !empty($conf->global->PRODUCT_ALLOW_EXTERNAL_DOWNLOAD)) {
1724
+							$sharefile = 1;
1725
+						}
1722 1726
 						$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', $sharefile, $object);
1723 1727
 						if ($result < 0) {
1724 1728
 							if ($allowoverwrite) {
@@ -1873,8 +1877,12 @@  discard block
 block discarded – undo
1873 1877
 				dol_syslog('Error: object ' . get_class($object) . ' has no table_element attribute.');
1874 1878
 				return -1;
1875 1879
 			}
1876
-			if (isset($object->src_object_description)) $ecmfile->description = $object->src_object_description;
1877
-			if (isset($object->src_object_keywords)) $ecmfile->keywords = $object->src_object_keywords;
1880
+			if (isset($object->src_object_description)) {
1881
+				$ecmfile->description = $object->src_object_description;
1882
+			}
1883
+			if (isset($object->src_object_keywords)) {
1884
+				$ecmfile->keywords = $object->src_object_keywords;
1885
+			}
1878 1886
 		}
1879 1887
 
1880 1888
 		if (!empty($conf->global->MAIN_FORCE_SHARING_ON_ANY_UPLOADED_FILE)) {
Please login to merge, or discard this patch.
htdocs/holiday/card_group.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -335,7 +335,9 @@
 block discarded – undo
335 335
 								if ($AutoSendMail && !$error) {
336 336
 									// send a mail to the user
337 337
 									$returnSendMail = sendMail($result, $cancreate, $now, $autoValidation);
338
-									if (!empty($returnSendMail->msg))  setEventMessage($returnSendMail->msg, $returnSendMail->style);
338
+									if (!empty($returnSendMail->msg)) {
339
+										setEventMessage($returnSendMail->msg, $returnSendMail->style);
340
+									}
339 341
 								}
340 342
 							}
341 343
 						}
Please login to merge, or discard this patch.
htdocs/product/stock/replenish.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -669,8 +669,12 @@  discard block
 block discarded – undo
669 669
 if ($limit > 0 && $limit != $conf->liste_limit) {
670 670
 	$filters .= '&limit='.urlencode($limit);
671 671
 }
672
-if (!empty($includeproductswithoutdesiredqty)) $filters .= '&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty);
673
-if (!empty($salert)) $filters .= '&salert='.urlencode($salert);
672
+if (!empty($includeproductswithoutdesiredqty)) {
673
+	$filters .= '&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty);
674
+}
675
+if (!empty($salert)) {
676
+	$filters .= '&salert='.urlencode($salert);
677
+}
674 678
 
675 679
 $param = (isset($type) ? '&type='.urlencode($type) : '');
676 680
 $param .= '&fourn_id='.urlencode($fourn_id).'&search_label='.urlencode($search_label).'&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty).'&salert='.urlencode($salert).'&draftorder='.urlencode($draftorder);
@@ -678,8 +682,12 @@  discard block
 block discarded – undo
678 682
 $param .= '&mode='.urlencode($mode);
679 683
 $param .= '&fk_supplier='.urlencode($fk_supplier);
680 684
 $param .= '&fk_entrepot='.urlencode($fk_entrepot);
681
-if (!empty($includeproductswithoutdesiredqty)) $param .= '&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty);
682
-if (!empty($salert)) $param .= '&salert='.urlencode($salert);
685
+if (!empty($includeproductswithoutdesiredqty)) {
686
+	$param .= '&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty);
687
+}
688
+if (!empty($salert)) {
689
+	$param .= '&salert='.urlencode($salert);
690
+}
683 691
 
684 692
 $stocklabel = $langs->trans('Stock');
685 693
 $stocklabelbis = $langs->trans('Stock');
Please login to merge, or discard this patch.
htdocs/compta/accounting-files.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -181,7 +181,9 @@  discard block
 block discarded – undo
181 181
 			$sql .= " WHERE datef between ".$wheretail;
182 182
 			$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
183 183
 			$sql .= " AND t.fk_statut <> ".Facture::STATUS_DRAFT;
184
-			if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid);
184
+			if (!empty($projectid)) {
185
+				$sql .= " AND fk_projet = ".((int) $projectid);
186
+			}
185 187
 		}
186 188
 		// Vendor invoices
187 189
 		if (GETPOST('selectsupplierinvoices') && !empty($listofchoices['selectsupplierinvoices']['perms'])) {
@@ -193,7 +195,9 @@  discard block
 block discarded – undo
193 195
 			$sql .= " WHERE datef between ".$wheretail;
194 196
 			$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
195 197
 			$sql .= " AND t.fk_statut <> ".FactureFournisseur::STATUS_DRAFT;
196
-			if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid);
198
+			if (!empty($projectid)) {
199
+				$sql .= " AND fk_projet = ".((int) $projectid);
200
+			}
197 201
 		}
198 202
 		// Expense reports
199 203
 		if (GETPOST('selectexpensereports') && !empty($listofchoices['selectexpensereports']['perms']) && empty($projectid)) {
@@ -216,7 +220,9 @@  discard block
 block discarded – undo
216 220
 			$sql .= " WHERE datedon between ".$wheretail;
217 221
 			$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
218 222
 			$sql .= " AND t.fk_statut <> ".Don::STATUS_DRAFT;
219
-			if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid);
223
+			if (!empty($projectid)) {
224
+				$sql .= " AND fk_projet = ".((int) $projectid);
225
+			}
220 226
 		}
221 227
 		// Payments of salaries
222 228
 		if (GETPOST('selectpaymentsofsalaries') && !empty($listofchoices['selectpaymentsofsalaries']['perms'])) {
@@ -228,7 +234,9 @@  discard block
 block discarded – undo
228 234
 			$sql .= " WHERE datep between ".$wheretail;
229 235
 			$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
230 236
 			//$sql.=" AND fk_statut <> ".PaymentSalary::STATUS_DRAFT;
231
-			if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid);
237
+			if (!empty($projectid)) {
238
+				$sql .= " AND fk_projet = ".((int) $projectid);
239
+			}
232 240
 		}
233 241
 		// Social contributions
234 242
 		if (GETPOST('selectsocialcontributions') && !empty($listofchoices['selectsocialcontributions']['perms'])) {
@@ -240,7 +248,9 @@  discard block
 block discarded – undo
240 248
 			$sql .= " WHERE t.date_ech between ".$wheretail;
241 249
 			$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
242 250
 			//$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT;
243
-			if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid);
251
+			if (!empty($projectid)) {
252
+				$sql .= " AND fk_projet = ".((int) $projectid);
253
+			}
244 254
 		}
245 255
 		// Various payments
246 256
 		if (GETPOST('selectvariouspayment') && !empty($listofchoices['selectvariouspayment']['perms'])) {
@@ -251,7 +261,9 @@  discard block
 block discarded – undo
251 261
 			$sql .= " FROM ".MAIN_DB_PREFIX."payment_various as t";
252 262
 			$sql .= " WHERE datep between ".$wheretail;
253 263
 			$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
254
-			if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid);
264
+			if (!empty($projectid)) {
265
+				$sql .= " AND fk_projet = ".((int) $projectid);
266
+			}
255 267
 		}
256 268
 		// Loan payments
257 269
 		if (GETPOST('selectloanspayment') && !empty($listofchoices['selectloanspayment']['perms']) && empty($projectid)) {
Please login to merge, or discard this patch.
htdocs/stripe/ajax/ajax.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,9 @@
 block discarded – undo
68 68
 		// The ConnectionToken's secret lets you connect to any Stripe Terminal reader
69 69
 		// and take payments with your Stripe account.
70 70
 		$array = array();
71
-		if (isset($location) && !empty($location))  $array['location'] = $location;
71
+		if (isset($location) && !empty($location)) {
72
+			$array['location'] = $location;
73
+		}
72 74
 		if (empty($stripeacc)) {				// If the Stripe connect account not set, we use common API usage
73 75
 			$connectionToken = \Stripe\Terminal\ConnectionToken::create($array);
74 76
 		} else {
Please login to merge, or discard this patch.
htdocs/commande/list.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -495,8 +495,10 @@
 block discarded – undo
495 495
 							);
496 496
 							if ($result > 0) {
497 497
 								$lineid = $result;
498
-								if (!empty($createbills_onebythird)) //increment rang to keep order
498
+								if (!empty($createbills_onebythird)) {
499
+									//increment rang to keep order
499 500
 									$TFactThirdNbLines[$rcp->socid]++;
501
+								}
500 502
 							} else {
501 503
 								$lineid = 0;
502 504
 								$error++;
Please login to merge, or discard this patch.
htdocs/core/class/extrafields.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1860,7 +1860,9 @@
 block discarded – undo
1860 1860
 						}
1861 1861
 					}
1862 1862
 				}
1863
-				if (!empty($toprint)) $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
1863
+				if (!empty($toprint)) {
1864
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
1865
+				}
1864 1866
 			} else {
1865 1867
 				dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
1866 1868
 			}
Please login to merge, or discard this patch.
htdocs/comm/action/card.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1404,7 +1404,9 @@  discard block
 block discarded – undo
1404 1404
 		if (GETPOST('contactid', 'int')) {
1405 1405
 			$preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int');
1406 1406
 		}
1407
-		if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int');
1407
+		if ($origin=='contact') {
1408
+			$preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int');
1409
+		}
1408 1410
 		print img_picto('', 'contact', 'class="paddingrightonly"');
1409 1411
 		print $form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid');
1410 1412
 		print '</td></tr>';
@@ -2089,8 +2091,11 @@  discard block
 block discarded – undo
2089 2091
 		// Call Hook formConfirm
2090 2092
 		$parameters = array();
2091 2093
 		$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
2092
-		if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
2093
-		elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
2094
+		if (empty($reshook)) {
2095
+			$formconfirm.=$hookmanager->resPrint;
2096
+		} elseif ($reshook > 0) {
2097
+			$formconfirm=$hookmanager->resPrint;
2098
+		}
2094 2099
 
2095 2100
 		// Print form confirm
2096 2101
 		print $formconfirm;
Please login to merge, or discard this patch.
htdocs/product/admin/product_lot.php 1 patch
Braces   +40 added lines, -17 removed lines patch added patch discarded remove patch
@@ -30,8 +30,9 @@  discard block
 block discarded – undo
30 30
 $langs->loadLangs(array("admin", "products", "productbatch"));
31 31
 
32 32
 // Security check
33
-if (!$user->admin || (empty($conf->productbatch->enabled)))
33
+if (!$user->admin || (empty($conf->productbatch->enabled))) {
34 34
 	accessforbidden();
35
+}
35 36
 
36 37
 $action = GETPOST('action', 'alpha');
37 38
 $value = GETPOST('value', 'alpha');
@@ -51,7 +52,9 @@  discard block
 block discarded – undo
51 52
 
52 53
 	if ($maskconstbatch) {
53 54
 		$res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
54
-		if ($res <= 0) $error++;
55
+		if ($res <= 0) {
56
+			$error++;
57
+		}
55 58
 	}
56 59
 
57 60
 	if (!$error) {
@@ -65,7 +68,9 @@  discard block
 block discarded – undo
65 68
 
66 69
 	if ($maskconstbatch) {
67 70
 		$res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
68
-		if ($res <= 0) $error++;
71
+		if ($res <= 0) {
72
+			$error++;
73
+		}
69 74
 	}
70 75
 
71 76
 	if (!$error) {
@@ -146,8 +151,12 @@  discard block
 block discarded – undo
146 151
 						$module = new $file($db);
147 152
 
148 153
 						// Show modules according to features level
149
-						if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
150
-						if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
154
+						if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
155
+							continue;
156
+						}
157
+						if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
158
+							continue;
159
+						}
151 160
 
152 161
 						if ($module->isEnabled()) {
153 162
 							print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
@@ -157,9 +166,13 @@  discard block
 block discarded – undo
157 166
 							// Show example of numbering model
158 167
 							print '<td class="nowrap">';
159 168
 							$tmp = $module->getExample();
160
-							if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
161
-							elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
162
-							else print $tmp;
169
+							if (preg_match('/^Error/', $tmp)) {
170
+								print '<div class="error">'.$langs->trans($tmp).'</div>';
171
+							} elseif ($tmp == 'NotConfigured') {
172
+								print $langs->trans($tmp);
173
+							} else {
174
+								print $tmp;
175
+							}
163 176
 							print '</td>'."\n";
164 177
 
165 178
 							print '<td class="center">';
@@ -182,8 +195,9 @@  discard block
 block discarded – undo
182 195
 							if ("$nextval" != $langs->trans("NotAvailable")) {  // Keep " on nextval
183 196
 								$htmltooltip .= ''.$langs->trans("NextValue").': ';
184 197
 								if ($nextval) {
185
-									if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured')
186
-										$nextval = $langs->trans($nextval);
198
+									if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
199
+																			$nextval = $langs->trans($nextval);
200
+									}
187 201
 									$htmltooltip .= $nextval.'<br>';
188 202
 								} else {
189 203
 									$htmltooltip .= $langs->trans($module->error).'<br>';
@@ -238,8 +252,12 @@  discard block
 block discarded – undo
238 252
 						$module = new $file($db);
239 253
 
240 254
 						// Show modules according to features level
241
-						if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
242
-						if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
255
+						if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
256
+							continue;
257
+						}
258
+						if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
259
+							continue;
260
+						}
243 261
 
244 262
 						if ($module->isEnabled()) {
245 263
 							print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
@@ -249,9 +267,13 @@  discard block
 block discarded – undo
249 267
 							// Show example of numbering model
250 268
 							print '<td class="nowrap">';
251 269
 							$tmp = $module->getExample();
252
-							if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
253
-							elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
254
-							else print $tmp;
270
+							if (preg_match('/^Error/', $tmp)) {
271
+								print '<div class="error">'.$langs->trans($tmp).'</div>';
272
+							} elseif ($tmp == 'NotConfigured') {
273
+								print $langs->trans($tmp);
274
+							} else {
275
+								print $tmp;
276
+							}
255 277
 							print '</td>'."\n";
256 278
 
257 279
 							print '<td class="center">';
@@ -274,8 +296,9 @@  discard block
 block discarded – undo
274 296
 							if ("$nextval" != $langs->trans("NotAvailable")) {  // Keep " on nextval
275 297
 								$htmltooltip .= ''.$langs->trans("NextValue").': ';
276 298
 								if ($nextval) {
277
-									if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured')
278
-										$nextval = $langs->trans($nextval);
299
+									if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
300
+																			$nextval = $langs->trans($nextval);
301
+									}
279 302
 									$htmltooltip .= $nextval.'<br>';
280 303
 								} else {
281 304
 									$htmltooltip .= $langs->trans($module->error).'<br>';
Please login to merge, or discard this patch.