Completed
Branch develop (c87f24)
by
unknown
13:17
created
htdocs/core/lib/member.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@
 block discarded – undo
143 143
 			} else {
144 144
 				dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
145 145
 			}
146
-			dol_setcache($cachekey, $nbEvent, 120);		// If setting cache fails, this is not a problem, so we do not test result.
146
+			dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
147 147
 		}
148 148
 
149 149
 		$head[$h][1] .= '/';
Please login to merge, or discard this patch.
htdocs/core/lib/modulebuilder.lib.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -272,22 +272,22 @@  discard block
 block discarded – undo
272 272
 	// Edit .sql file
273 273
 	if ($moduletype == 'internal') {
274 274
 		$pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql';
275
-		if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
275
+		if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
276 276
 			$pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'-'.strtolower($module).'.sql';
277
-			if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
277
+			if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
278 278
 				$pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'-'.strtolower($module).'.sql';
279
-				if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
279
+				if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
280 280
 					$pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'.sql';
281 281
 				}
282 282
 			}
283 283
 		}
284 284
 	} else {
285 285
 		$pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql';
286
-		if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
286
+		if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
287 287
 			$pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'-'.strtolower($module).'.sql';
288
-			if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
288
+			if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
289 289
 				$pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'-'.strtolower($module).'.sql';
290
-				if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
290
+				if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
291 291
 					$pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'.sql';
292 292
 				}
293 293
 			}
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 {
725 725
 
726 726
 	// stock all properties in array
727
-	$attributesUnique = array('type','label', 'enabled', 'position', 'notnull', 'visible', 'noteditable', 'index', 'default' , 'foreignkey', 'arrayofkeyval', 'alwayseditable','validate', 'searchall','comment', 'isameasure', 'css', 'cssview','csslist', 'help', 'showoncombobox','picto' );
727
+	$attributesUnique = array('type', 'label', 'enabled', 'position', 'notnull', 'visible', 'noteditable', 'index', 'default', 'foreignkey', 'arrayofkeyval', 'alwayseditable', 'validate', 'searchall', 'comment', 'isameasure', 'css', 'cssview', 'csslist', 'help', 'showoncombobox', 'picto');
728 728
 
729 729
 	$start = "public \$fields=array(";
730 730
 	$end = ");";
@@ -794,8 +794,8 @@  discard block
 block discarded – undo
794 794
 				$valuesModif[$attUnique] = $values[$attUnique];
795 795
 			}
796 796
 		}
797
-		$table .= "|*" . $field[0] . "*|";
798
-		$table .= implode("|", $valuesModif) . "\n";
797
+		$table .= "|*".$field[0]."*|";
798
+		$table .= implode("|", $valuesModif)."\n";
799 799
 	}
800 800
 
801 801
 	// end table
@@ -826,13 +826,13 @@  discard block
 block discarded – undo
826 826
 
827 827
 		$str = file_get_contents($file);
828 828
 
829
-		$search = '/' . preg_quote($start, '/') . '(.*?)' . preg_quote($end, '/') . '/s';
829
+		$search = '/'.preg_quote($start, '/').'(.*?)'.preg_quote($end, '/').'/s';
830 830
 		$new_contents = preg_replace($search, '', $str);
831 831
 		file_put_contents($file, $new_contents);
832 832
 
833 833
 		//perms If Exist
834 834
 		$perms = "|*".strtolower($objectname)."*|";
835
-		$search_pattern_perms = '/' . preg_quote($perms, '/') . '.*?\n/';
835
+		$search_pattern_perms = '/'.preg_quote($perms, '/').'.*?\n/';
836 836
 		$new_contents = preg_replace($search_pattern_perms, '', $new_contents);
837 837
 		file_put_contents($file, $new_contents);
838 838
 	}
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 	$string = "[options='header',grid=rows,width=60%,caption=Organisation]\n";
891 891
 	$string .= "|===\n";
892 892
 	// header for table
893
-	$header = array($langs->trans('Objects'),$langs->trans('Permission'));
893
+	$header = array($langs->trans('Objects'), $langs->trans('Permission'));
894 894
 	foreach ($header as $h) {
895 895
 		$string .= "|".$h;
896 896
 	}
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
 	}
973 973
 
974 974
 	$now = dol_now();
975
-	$content = file($file);	// $content is an array
975
+	$content = file($file); // $content is an array
976 976
 
977 977
 	$includeClass = "dol_include_once\(\'\/\w+\/class\/\w+\.class\.php\'\);";
978 978
 	$props = 'public\s+\$\w+;';
@@ -984,23 +984,23 @@  discard block
 block discarded – undo
984 984
 		if (preg_match('/'.$varcommented.'/', $lineContent)) {
985 985
 			$lineContent = '';
986 986
 			foreach ($objects as $objectname) {
987
-				$lineContent .= "\t * @var ".$objectname." \$".strtolower($objectname)." {@type ".$objectname."}". PHP_EOL;
987
+				$lineContent .= "\t * @var ".$objectname." \$".strtolower($objectname)." {@type ".$objectname."}".PHP_EOL;
988 988
 			}
989 989
 			//var_dump($lineContent);exit;
990 990
 		} elseif (preg_match('/'.$props.'/', $lineContent)) {
991 991
 			$lineContent = '';
992 992
 			foreach ($objects as $objectname) {
993
-				$lineContent .= "\tpublic \$".strtolower($objectname).";". PHP_EOL;
993
+				$lineContent .= "\tpublic \$".strtolower($objectname).";".PHP_EOL;
994 994
 			}
995 995
 		} elseif (preg_match('/'.$constructObj.'/', $lineContent)) {
996 996
 			$lineContent = '';
997 997
 			foreach ($objects as $objectname) {
998
-				$lineContent .= "\t\t\$this->".strtolower($objectname)." = new ".$objectname."(\$this->db);". PHP_EOL;
998
+				$lineContent .= "\t\t\$this->".strtolower($objectname)." = new ".$objectname."(\$this->db);".PHP_EOL;
999 999
 			}
1000 1000
 		} elseif (preg_match('/'.$includeClass.'/', $lineContent)) {
1001 1001
 			$lineContent = '';
1002 1002
 			foreach ($objects as $objectname) {
1003
-				$lineContent .= "dol_include_once('/".strtolower($modulename)."/class/".strtolower($objectname).".class.php');". PHP_EOL;
1003
+				$lineContent .= "dol_include_once('/".strtolower($modulename)."/class/".strtolower($objectname).".class.php');".PHP_EOL;
1004 1004
 			}
1005 1005
 		}
1006 1006
 	}
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
 		return -1;
1055 1055
 	}
1056 1056
 
1057
-	$content = file($file);	// $content is an array
1057
+	$content = file($file); // $content is an array
1058 1058
 
1059 1059
 	$includeClass = "dol_include_once\(\'\/\w+\/class\/".strtolower($objectname)."\.class\.php\'\);";
1060 1060
 	$props = 'public\s+\$'.strtolower($objectname);
@@ -1217,33 +1217,33 @@  discard block
 block discarded – undo
1217 1217
 				 * @param bool|int|string $val
1218 1218
 				 * @return string|int
1219 1219
 				 */
1220
-				function ($val) use ($module) {
1220
+				function($val) use ($module) {
1221 1221
 					return is_bool($val) ? "isModEnabled('$module')" : $val;
1222 1222
 				},
1223 1223
 				$value
1224 1224
 			);
1225
-			$dicData .= "array(" . implode(",", $conditions) . ")";
1225
+			$dicData .= "array(".implode(",", $conditions).")";
1226 1226
 		} elseif ($key === 'tabhelp') {
1227 1227
 			$helpItems = array();
1228 1228
 			foreach ($value as $helpValue) {
1229 1229
 				$helpItems[] = "array('code'=>\$langs->trans('".$helpValue['code']."'), 'field2' => 'field2tooltip')";
1230 1230
 			}
1231
-			$dicData .= "array(" . implode(",", $helpItems) . ")";
1231
+			$dicData .= "array(".implode(",", $helpItems).")";
1232 1232
 		} else {
1233 1233
 			if (is_array($value)) {
1234
-				$dicData .= "array(" . implode(
1234
+				$dicData .= "array(".implode(
1235 1235
 					",",
1236 1236
 					array_map(
1237 1237
 						/**
1238 1238
 						 * @param string $val
1239 1239
 						 * @return string
1240 1240
 						 */
1241
-						static function ($val) {
1241
+						static function($val) {
1242 1242
 							return "'$val'";
1243 1243
 						},
1244 1244
 						$value
1245 1245
 					)
1246
-				) . ")";
1246
+				).")";
1247 1247
 			} else {
1248 1248
 				$dicData .= "'$value'";
1249 1249
 			}
@@ -1333,7 +1333,7 @@  discard block
 block discarded – undo
1333 1333
 	$dictionnaires['tabfieldvalue'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : '');
1334 1334
 	$dictionnaires['tabfieldinsert'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : '');
1335 1335
 	$dictionnaires['tabrowid'][] = $primaryKey;
1336
-	$dictionnaires['tabcond'][] = isModEnabled('$modulename');  // @phan-suppress-current-line UnknownModuleName
1336
+	$dictionnaires['tabcond'][] = isModEnabled('$modulename'); // @phan-suppress-current-line UnknownModuleName
1337 1337
 	$dictionnaires['tabhelp'][] = (array_key_exists('code', $columns) ? array('code' => $langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip') : '');
1338 1338
 
1339 1339
 	// Build the dictionary string
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 
1386 1386
 	// build format asciidoc for urls in table
1387 1387
 	if (!$error) {
1388
-		$asciiDocTable = "[options=\"header\"]\n|===\n|Object | URLs\n";  // phpcs:ignore
1388
+		$asciiDocTable = "[options=\"header\"]\n|===\n|Object | URLs\n"; // phpcs:ignore
1389 1389
 		foreach ($groupedUrls as $objectName => $urls) {
1390 1390
 			$urlsList = implode(" +\n*", $urls);
1391 1391
 			$asciiDocTable .= "|$objectName | \n*$urlsList +\n";
@@ -1418,9 +1418,9 @@  discard block
 block discarded – undo
1418 1418
 
1419 1419
 	foreach ($allFilesAndDirs as $item) {
1420 1420
 		if ($item != '.' && $item != '..') {
1421
-			if ($type == 1 && is_file($path . DIRECTORY_SEPARATOR . $item) && strpos($item, '.back') === false) {
1421
+			if ($type == 1 && is_file($path.DIRECTORY_SEPARATOR.$item) && strpos($item, '.back') === false) {
1422 1422
 				$count++;
1423
-			} elseif ($type == 2 && is_dir($path . DIRECTORY_SEPARATOR . $item)) {
1423
+			} elseif ($type == 2 && is_dir($path.DIRECTORY_SEPARATOR.$item)) {
1424 1424
 				$count++;
1425 1425
 			}
1426 1426
 		}
Please login to merge, or discard this patch.
htdocs/core/class/html.formmargin.class.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
 			setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
231 231
 		} elseif (empty($reshook)) {
232 232
 			if (getDolGlobalString('MARGIN_ADD_SHOWHIDE_BUTTON')) {
233
-				print $langs->trans('ShowMarginInfos') . ' ';
233
+				print $langs->trans('ShowMarginInfos').' ';
234 234
 				$hidemargininfos = preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']); // Clean cookie
235
-				print '<span id="showMarginInfos" class="linkobject valignmiddle ' . (!empty($hidemargininfos) ? '' : 'hideobject') . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</span>';
236
-				print '<span id="hideMarginInfos" class="linkobject valignmiddle ' . (!empty($hidemargininfos) ? 'hideobject' : '') . '">' . img_picto($langs->trans("Enabled"), 'switch_on') . '</span>';
235
+				print '<span id="showMarginInfos" class="linkobject valignmiddle '.(!empty($hidemargininfos) ? '' : 'hideobject').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</span>';
236
+				print '<span id="hideMarginInfos" class="linkobject valignmiddle '.(!empty($hidemargininfos) ? 'hideobject' : '').'">'.img_picto($langs->trans("Enabled"), 'switch_on').'</span>';
237 237
 
238 238
 				print '<script nonce="'.getNonce().'">$(document).ready(function() {';
239 239
 				print '$("span#showMarginInfos").click(function() { console.log("click on showMargininfos"); date = new Date(); date.setTime(date.getTime()+(30*86400000)); document.cookie = "DOLUSER_MARGININFO_HIDE_SHOW=0; expires=" + date.toGMTString() + "; path=/ "; $(".margintable").show(); $("span#showMarginInfos").addClass("hideobject"); $("span#hideMarginInfos").removeClass("hideobject"); });';
@@ -244,69 +244,69 @@  discard block
 block discarded – undo
244 244
 				print '});</script>';
245 245
 			}
246 246
 
247
-			print '<!-- displayMarginInfos() - Show margin table -->' . "\n";
247
+			print '<!-- displayMarginInfos() - Show margin table -->'."\n";
248 248
 			print '<div class="div-table-responsive-no-min">';
249 249
 
250 250
 			print '<table class="noborder margintable centpercent" id="margintable">';
251 251
 			print '<tr class="liste_titre">';
252
-			print '<td class="liste_titre">' . $langs->trans('Margins') . '</td>';
253
-			print '<td class="liste_titre right">' . $langs->trans('SellingPrice') . '</td>';
252
+			print '<td class="liste_titre">'.$langs->trans('Margins').'</td>';
253
+			print '<td class="liste_titre right">'.$langs->trans('SellingPrice').'</td>';
254 254
 			if (getDolGlobalString('MARGIN_TYPE') == "1") {
255
-				print '<td class="liste_titre right">' . $langs->trans('BuyingPrice') . '</td>';
255
+				print '<td class="liste_titre right">'.$langs->trans('BuyingPrice').'</td>';
256 256
 			} else {
257
-				print '<td class="liste_titre right">' . $langs->trans('CostPrice') . '</td>';
257
+				print '<td class="liste_titre right">'.$langs->trans('CostPrice').'</td>';
258 258
 			}
259
-			print '<td class="liste_titre right">' . $langs->trans('Margin') . '</td>';
259
+			print '<td class="liste_titre right">'.$langs->trans('Margin').'</td>';
260 260
 			if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
261
-				print '<td class="liste_titre right">' . $langs->trans('MarginRate') . '</td>';
261
+				print '<td class="liste_titre right">'.$langs->trans('MarginRate').'</td>';
262 262
 			}
263 263
 			if (getDolGlobalString('DISPLAY_MARK_RATES')) {
264
-				print '<td class="liste_titre right">' . $langs->trans('MarkRate') . '</td>';
264
+				print '<td class="liste_titre right">'.$langs->trans('MarkRate').'</td>';
265 265
 			}
266 266
 			print '</tr>';
267 267
 
268 268
 			if (isModEnabled("product")) {
269 269
 				//if ($marginInfo['margin_on_products'] != 0 && $marginInfo['margin_on_services'] != 0) {
270 270
 				print '<tr class="oddeven">';
271
-				print '<td>' . $langs->trans('MarginOnProducts') . '</td>';
272
-				print '<td class="right">' . price($marginInfo['pv_products']) . '</td>';
273
-				print '<td class="right">' . price($marginInfo['pa_products']) . '</td>';
274
-				print '<td class="right">' . price($marginInfo['margin_on_products']) . '</td>';
271
+				print '<td>'.$langs->trans('MarginOnProducts').'</td>';
272
+				print '<td class="right">'.price($marginInfo['pv_products']).'</td>';
273
+				print '<td class="right">'.price($marginInfo['pa_products']).'</td>';
274
+				print '<td class="right">'.price($marginInfo['margin_on_products']).'</td>';
275 275
 				if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
276
-					print '<td class="right">' . (($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], 0, '', 0, 0, 2) . '%') . '</td>';
276
+					print '<td class="right">'.(($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], 0, '', 0, 0, 2).'%').'</td>';
277 277
 				}
278 278
 				if (getDolGlobalString('DISPLAY_MARK_RATES')) {
279
-					print '<td class="right">' . (($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], 0, '', 0, 0, 2) . '%') . '</td>';
279
+					print '<td class="right">'.(($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], 0, '', 0, 0, 2).'%').'</td>';
280 280
 				}
281 281
 				print '</tr>';
282 282
 			}
283 283
 
284 284
 			if (isModEnabled("service")) {
285 285
 				print '<tr class="oddeven">';
286
-				print '<td>' . $langs->trans('MarginOnServices') . '</td>';
287
-				print '<td class="right">' . price($marginInfo['pv_services']) . '</td>';
288
-				print '<td class="right">' . price($marginInfo['pa_services']) . '</td>';
289
-				print '<td class="right">' . price($marginInfo['margin_on_services']) . '</td>';
286
+				print '<td>'.$langs->trans('MarginOnServices').'</td>';
287
+				print '<td class="right">'.price($marginInfo['pv_services']).'</td>';
288
+				print '<td class="right">'.price($marginInfo['pa_services']).'</td>';
289
+				print '<td class="right">'.price($marginInfo['margin_on_services']).'</td>';
290 290
 				if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
291
-					print '<td class="right">' . (($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], 0, '', 0, 0, 2) . '%') . '</td>';
291
+					print '<td class="right">'.(($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], 0, '', 0, 0, 2).'%').'</td>';
292 292
 				}
293 293
 				if (getDolGlobalString('DISPLAY_MARK_RATES')) {
294
-					print '<td class="right">' . (($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], 0, '', 0, 0, 2) . '%') . '</td>';
294
+					print '<td class="right">'.(($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], 0, '', 0, 0, 2).'%').'</td>';
295 295
 				}
296 296
 				print '</tr>';
297 297
 			}
298 298
 
299 299
 			if (isModEnabled("product") && isModEnabled("service")) {
300 300
 				print '<tr class="liste_total">';
301
-				print '<td>' . $langs->trans('TotalMargin') . '</td>';
302
-				print '<td class="right">' . price($marginInfo['pv_total']) . '</td>';
303
-				print '<td class="right">' . price($marginInfo['pa_total']) . '</td>';
304
-				print '<td class="right">' . price($marginInfo['total_margin']) . '</td>';
301
+				print '<td>'.$langs->trans('TotalMargin').'</td>';
302
+				print '<td class="right">'.price($marginInfo['pv_total']).'</td>';
303
+				print '<td class="right">'.price($marginInfo['pa_total']).'</td>';
304
+				print '<td class="right">'.price($marginInfo['total_margin']).'</td>';
305 305
 				if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
306
-					print '<td class="right">' . (($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, '', 0, 0, 2) . '%') . '</td>';
306
+					print '<td class="right">'.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, '', 0, 0, 2).'%').'</td>';
307 307
 				}
308 308
 				if (getDolGlobalString('DISPLAY_MARK_RATES')) {
309
-					print '<td class="right">' . (($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, '', 0, 0, 2) . '%') . '</td>';
309
+					print '<td class="right">'.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, '', 0, 0, 2).'%').'</td>';
310 310
 				}
311 311
 				print '</tr>';
312 312
 			}
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -474,11 +474,11 @@  discard block
 block discarded – undo
474 474
 	 *
475 475
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
476 476
 	 */
477
-	private $cond_reglement;  // Private to call DolDeprecationHandler
477
+	private $cond_reglement; // Private to call DolDeprecationHandler
478 478
 	/**
479 479
 	 * @var int|string Internal to detect deprecated access
480 480
 	 */
481
-	protected $depr_cond_reglement;  // Internal value for deprecation
481
+	protected $depr_cond_reglement; // Internal value for deprecation
482 482
 
483 483
 	/**
484 484
 	 * @var int 		Delivery address ID
@@ -535,12 +535,12 @@  discard block
 block discarded – undo
535 535
 	/**
536 536
 	 * @var float Multicurrency total localta1
537 537
 	 */
538
-	public $multicurrency_total_localtax1;	// not in database
538
+	public $multicurrency_total_localtax1; // not in database
539 539
 
540 540
 	/**
541 541
 	 * @var float Multicurrency total localtax2
542 542
 	 */
543
-	public $multicurrency_total_localtax2;	// not in database
543
+	public $multicurrency_total_localtax2; // not in database
544 544
 
545 545
 	/**
546 546
 	 * @var string
@@ -1014,17 +1014,17 @@  discard block
 block discarded – undo
1014 1014
 				}
1015 1015
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1016 1016
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1017
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1017
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1018 1018
 				} else {
1019
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1020
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1019
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1020
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1021 1021
 					$count++;
1022 1022
 				}
1023 1023
 			}
1024 1024
 			$data['closedivextra'] = '</div>';
1025 1025
 		}
1026 1026
 
1027
-		$hookmanager->initHooks(array($this->element . 'dao'));
1027
+		$hookmanager->initHooks(array($this->element.'dao'));
1028 1028
 		$parameters = array(
1029 1029
 			'tooltipcontentarray' => &$data,
1030 1030
 			'params' => $params,
@@ -1515,7 +1515,7 @@  discard block
 block discarded – undo
1515 1515
 		if ($source == 'external' || $source == 'thirdparty') {
1516 1516
 			$sql .= " AND tc.source = 'external'";
1517 1517
 			if ($status >= 0) {
1518
-				$sql .= " AND t.statut = ".((int) $status);	// t is llx_socpeople
1518
+				$sql .= " AND t.statut = ".((int) $status); // t is llx_socpeople
1519 1519
 			}
1520 1520
 		}
1521 1521
 		$sql .= " AND tc.active = 1";
@@ -1897,7 +1897,7 @@  discard block
 block discarded – undo
1897 1897
 		}
1898 1898
 
1899 1899
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1900
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1900
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1901 1901
 		$sql .= " LIMIT 1";
1902 1902
 
1903 1903
 		$query = $this->db->query($sql);
@@ -2187,9 +2187,9 @@  discard block
 block discarded – undo
2187 2187
 		if ($trigkey) {
2188 2188
 			$oldvalue = null;
2189 2189
 
2190
-			$sql = "SELECT " . $field;
2191
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2192
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2190
+			$sql = "SELECT ".$field;
2191
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2192
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2193 2193
 
2194 2194
 			$resql = $this->db->query($sql);
2195 2195
 			if ($resql) {
@@ -2568,7 +2568,7 @@  discard block
 block discarded – undo
2568 2568
 		// Triggers
2569 2569
 		if (!$error && !$notrigger) {
2570 2570
 			// Call triggers
2571
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2571
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2572 2572
 			if ($result < 0) {
2573 2573
 				$error++;
2574 2574
 			} //Do also here what you must do to rollback action if trigger fail
@@ -2934,7 +2934,7 @@  discard block
 block discarded – undo
2934 2934
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
2935 2935
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
2936 2936
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
2937
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2937
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2938 2938
 			}
2939 2939
 			$sql .= ' WHERE rowid='.((int) $this->id);
2940 2940
 
@@ -3282,10 +3282,10 @@  discard block
 block discarded – undo
3282 3282
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3283 3283
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3284 3284
 		if (!$renum) {
3285
-			$sql .= " AND " . $fieldposition . " = 0";
3285
+			$sql .= " AND ".$fieldposition." = 0";
3286 3286
 		}
3287 3287
 		if ($renum) {
3288
-			$sql .= " AND " . $fieldposition . " <> 0";
3288
+			$sql .= " AND ".$fieldposition." <> 0";
3289 3289
 		}
3290 3290
 
3291 3291
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3306,7 +3306,7 @@  discard block
 block discarded – undo
3306 3306
 			if ($fk_parent_line) {
3307 3307
 				$sql .= ' AND fk_parent_line IS NULL';
3308 3308
 			}
3309
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3309
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3310 3310
 
3311 3311
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3312 3312
 			$resql = $this->db->query($sql);
@@ -3357,7 +3357,7 @@  discard block
 block discarded – undo
3357 3357
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3358 3358
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3359 3359
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3360
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3360
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3361 3361
 
3362 3362
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3363 3363
 		$resql = $this->db->query($sql);
@@ -3480,7 +3480,7 @@  discard block
 block discarded – undo
3480 3480
 
3481 3481
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3482 3482
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3483
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3483
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3484 3484
 			if ($this->db->query($sql)) {
3485 3485
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3486 3486
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3511,7 +3511,7 @@  discard block
 block discarded – undo
3511 3511
 
3512 3512
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3513 3513
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3514
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3514
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3515 3515
 			if ($this->db->query($sql)) {
3516 3516
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3517 3517
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3537,7 +3537,7 @@  discard block
 block discarded – undo
3537 3537
 			$fieldposition = 'position';
3538 3538
 		}
3539 3539
 
3540
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3540
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3541 3541
 		$sql .= " WHERE rowid = ".((int) $rowid);
3542 3542
 
3543 3543
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3565,7 +3565,7 @@  discard block
 block discarded – undo
3565 3565
 
3566 3566
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3567 3567
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3568
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3568
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3569 3569
 		$resql = $this->db->query($sql);
3570 3570
 		if ($resql) {
3571 3571
 			$row = $this->db->fetch_row($resql);
@@ -3683,7 +3683,7 @@  discard block
 block discarded – undo
3683 3683
 			$newsuffix = '';
3684 3684
 		}
3685 3685
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3686
-			$fieldusermod =  "fk_user_mod";
3686
+			$fieldusermod = "fk_user_mod";
3687 3687
 		} elseif ($this->table_element == 'ecm_files') {
3688 3688
 			$fieldusermod = "fk_user_m";
3689 3689
 		} else {
@@ -3725,7 +3725,7 @@  discard block
 block discarded – undo
3725 3725
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3726 3726
 						break;
3727 3727
 					default:
3728
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3728
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3729 3729
 				}
3730 3730
 				$ret = $this->call_trigger($trigger_name, $user);
3731 3731
 				if ($ret < 0) {
@@ -4094,19 +4094,19 @@  discard block
 block discarded – undo
4094 4094
 		$this->db->begin();
4095 4095
 		$error = 0;
4096 4096
 
4097
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4097
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4098 4098
 		$sql .= "fk_source";
4099 4099
 		$sql .= ", sourcetype";
4100 4100
 		$sql .= ", fk_target";
4101 4101
 		$sql .= ", targettype";
4102 4102
 		$sql .= ") VALUES (";
4103 4103
 		$sql .= ((int) $origin_id);
4104
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4105
-		$sql .= ", " . ((int) $this->id);
4106
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4104
+		$sql .= ", '".$this->db->escape($origin)."'";
4105
+		$sql .= ", ".((int) $this->id);
4106
+		$sql .= ", '".$this->db->escape($targettype)."'";
4107 4107
 		$sql .= ")";
4108 4108
 
4109
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4109
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4110 4110
 		if ($this->db->query($sql)) {
4111 4111
 			if (!$notrigger) {
4112 4112
 				// Call trigger
@@ -4358,20 +4358,20 @@  discard block
 block discarded – undo
4358 4358
 		$this->db->begin();
4359 4359
 		$error = 0;
4360 4360
 
4361
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4361
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4362 4362
 		if ($updatesource) {
4363
-			$sql .= "fk_source = " . ((int) $sourceid);
4364
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4365
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4366
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4363
+			$sql .= "fk_source = ".((int) $sourceid);
4364
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4365
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4366
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4367 4367
 		} elseif ($updatetarget) {
4368
-			$sql .= "fk_target = " . ((int) $targetid);
4369
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4370
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4371
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4368
+			$sql .= "fk_target = ".((int) $targetid);
4369
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4370
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4371
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4372 4372
 		}
4373 4373
 
4374
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4374
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4375 4375
 		if ($this->db->query($sql)) {
4376 4376
 			if (!$notrigger) {
4377 4377
 				// Call trigger
@@ -4447,25 +4447,25 @@  discard block
 block discarded – undo
4447 4447
 		}
4448 4448
 
4449 4449
 		if (!$error) {
4450
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4450
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4451 4451
 			$sql .= " WHERE";
4452 4452
 			if ($rowid > 0) {
4453
-				$sql .= " rowid = " . ((int) $rowid);
4453
+				$sql .= " rowid = ".((int) $rowid);
4454 4454
 			} else {
4455 4455
 				if ($deletesource) {
4456
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4457
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4456
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4457
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4458 4458
 				} elseif ($deletetarget) {
4459
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4460
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4459
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4460
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4461 4461
 				} else {
4462
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4462
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4463 4463
 					$sql .= " OR";
4464
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4464
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4465 4465
 				}
4466 4466
 			}
4467 4467
 
4468
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4468
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4469 4469
 			if (!$this->db->query($sql)) {
4470 4470
 				$this->error = $this->db->lasterror();
4471 4471
 				$this->errors[] = $this->error;
@@ -4630,14 +4630,14 @@  discard block
 block discarded – undo
4630 4630
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4631 4631
 		}
4632 4632
 		$sql .= " WHERE rowid = ".((int) $elementId);
4633
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4633
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4634 4634
 
4635 4635
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4636 4636
 		$resql = $this->db->query($sql);
4637 4637
 		if ($resql) {
4638 4638
 			$error = 0;
4639 4639
 
4640
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4640
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4641 4641
 
4642 4642
 			if ($nb_rows_affected > 0) {
4643 4643
 				if (empty($trigkey)) {
@@ -4682,7 +4682,7 @@  discard block
 block discarded – undo
4682 4682
 					if ($fieldstatus == 'tosell') {
4683 4683
 						$this->status = $status;
4684 4684
 					} elseif ($fieldstatus == 'tobuy') {
4685
-						$this->status_buy = $status;	// @phpstan-ignore-line
4685
+						$this->status_buy = $status; // @phpstan-ignore-line
4686 4686
 					} else {
4687 4687
 						$this->status = $status;
4688 4688
 					}
@@ -4790,7 +4790,7 @@  discard block
 block discarded – undo
4790 4790
 			return -1;
4791 4791
 		}
4792 4792
 
4793
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4793
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4794 4794
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4795 4795
 		$tmparray = array_keys($this->childtables);
4796 4796
 		if (is_numeric($tmparray[0])) {
@@ -5859,7 +5859,7 @@  discard block
 block discarded – undo
5859 5859
 			$setsharekey = false;
5860 5860
 			if ($this->element == 'propal' || $this->element == 'proposal') {
5861 5861
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
5862
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
5862
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
5863 5863
 				}
5864 5864
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
5865 5865
 					$setsharekey = true;
@@ -5917,7 +5917,7 @@  discard block
 block discarded – undo
5917 5917
 				$ecmfile->gen_or_uploaded = 'generated';
5918 5918
 				$ecmfile->description = ''; // indexed content
5919 5919
 				$ecmfile->keywords = ''; // keyword content
5920
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
5920
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
5921 5921
 				$ecmfile->src_object_id   = $this->id;
5922 5922
 
5923 5923
 				$result = $ecmfile->create($user);
@@ -5969,7 +5969,7 @@  discard block
 block discarded – undo
5969 5969
 			$maxwidthmini = $tmparraysize['maxwidthmini'];
5970 5970
 			$maxheightmini = $tmparraysize['maxheightmini'];
5971 5971
 			//$quality = $tmparraysize['quality'];
5972
-			$quality = 50;	// For thumbs, we force quality to 50
5972
+			$quality = 50; // For thumbs, we force quality to 50
5973 5973
 
5974 5974
 			// Create small thumbs for company (Ratio is near 16/9)
5975 5975
 			// Used on logon for example
@@ -6071,8 +6071,8 @@  discard block
 block discarded – undo
6071 6071
 		// phpcs:enable
6072 6072
 		global $langs, $conf;
6073 6073
 
6074
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6075
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6074
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6075
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6076 6076
 			exit;
6077 6077
 		}
6078 6078
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6266,7 +6266,7 @@  discard block
 block discarded – undo
6266 6266
 		$savDisableCompute = $conf->disable_compute;
6267 6267
 		$conf->disable_compute = 1;
6268 6268
 
6269
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6269
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6270 6270
 
6271 6271
 		$conf->disable_compute = $savDisableCompute;
6272 6272
 
@@ -6370,9 +6370,9 @@  discard block
 block discarded – undo
6370 6370
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6371 6371
 							//var_dump($conf->disable_compute);
6372 6372
 							if (empty($conf->disable_compute)) {
6373
-								global $objectoffield;        // We set a global variable to $objectoffield so
6374
-								$objectoffield = $this;        // we can use it inside computed formula
6375
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6373
+								global $objectoffield; // We set a global variable to $objectoffield so
6374
+								$objectoffield = $this; // we can use it inside computed formula
6375
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6376 6376
 							}
6377 6377
 						}
6378 6378
 					}
@@ -6553,7 +6553,7 @@  discard block
 block discarded – undo
6553 6553
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6554 6554
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6555 6555
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6556
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6556
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6557 6557
 											} else {
6558 6558
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6559 6559
 											}
@@ -6564,7 +6564,7 @@  discard block
 block discarded – undo
6564 6564
 										// If value has changed
6565 6565
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6566 6566
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6567
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6567
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6568 6568
 											} else {
6569 6569
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6570 6570
 											}
@@ -6576,7 +6576,7 @@  discard block
 block discarded – undo
6576 6576
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6577 6577
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6578 6578
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6579
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6579
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6580 6580
 									} else {
6581 6581
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6582 6582
 									}
@@ -6973,7 +6973,7 @@  discard block
 block discarded – undo
6973 6973
 								if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) {	// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6974 6974
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6975 6975
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
6976
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
6976
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
6977 6977
 										} else {
6978 6978
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
6979 6979
 										}
@@ -6993,7 +6993,7 @@  discard block
 block discarded – undo
6993 6993
 								}
6994 6994
 							} else {
6995 6995
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
6996
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
6996
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
6997 6997
 								} else {
6998 6998
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
6999 6999
 								}
@@ -7377,7 +7377,7 @@  discard block
 block discarded – undo
7377 7377
 			}
7378 7378
 			$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> ';
7379 7379
 		} elseif ($type == 'select') {	// combo list
7380
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7380
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7381 7381
 			if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
7382 7382
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7383 7383
 				$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
@@ -7409,7 +7409,7 @@  discard block
 block discarded – undo
7409 7409
 			$out .= $tmpselect;
7410 7410
 			$out .= '</select>';
7411 7411
 		} elseif ($type == 'sellist') {
7412
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7412
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7413 7413
 			if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
7414 7414
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7415 7415
 				$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
@@ -7419,7 +7419,7 @@  discard block
 block discarded – undo
7419 7419
 			if (is_array($param['options'])) {
7420 7420
 				$param_list = array_keys($param['options']);
7421 7421
 				$InfoFieldList = explode(":", $param_list[0], 5);
7422
-				if (! empty($InfoFieldList[4])) {
7422
+				if (!empty($InfoFieldList[4])) {
7423 7423
 					$pos = 0;
7424 7424
 					$parenthesisopen = 0;
7425 7425
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7480,8 +7480,8 @@  discard block
 block discarded – undo
7480 7480
 					}
7481 7481
 
7482 7482
 					$sqlwhere = '';
7483
-					$sql = "SELECT " . $keyList;
7484
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7483
+					$sql = "SELECT ".$keyList;
7484
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7485 7485
 					if (!empty($InfoFieldList[4])) {
7486 7486
 						// can use SELECT request
7487 7487
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7498,18 +7498,18 @@  discard block
 block discarded – undo
7498 7498
 						// We have to join on extrafield table
7499 7499
 						$errstr = '';
7500 7500
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7501
-							$sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra";
7502
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2];
7503
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7501
+							$sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra";
7502
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2];
7503
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7504 7504
 						} else {
7505
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7505
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7506 7506
 						}
7507 7507
 					} else {
7508 7508
 						$sqlwhere .= ' WHERE 1=1';
7509 7509
 					}
7510 7510
 					// Some tables may have field, some other not. For the moment we disable it.
7511 7511
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7512
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7512
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7513 7513
 					}
7514 7514
 					$sql .= $sqlwhere;
7515 7515
 					//print $sql;
@@ -7521,7 +7521,7 @@  discard block
 block discarded – undo
7521 7521
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7522 7522
 					}
7523 7523
 
7524
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7524
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7525 7525
 					$resql = $this->db->query($sql);
7526 7526
 					if ($resql) {
7527 7527
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7537,7 +7537,7 @@  discard block
 block discarded – undo
7537 7537
 							if (count($fields_label) > 1) {
7538 7538
 								$notrans = true;
7539 7539
 								foreach ($fields_label as $field_toshow) {
7540
-									$labeltoshow .= $obj->$field_toshow . ' ';
7540
+									$labeltoshow .= $obj->$field_toshow.' ';
7541 7541
 								}
7542 7542
 							} else {
7543 7543
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7548,12 +7548,12 @@  discard block
 block discarded – undo
7548 7548
 								foreach ($fields_label as $field_toshow) {
7549 7549
 									$translabel = $langs->trans($obj->$field_toshow);
7550 7550
 									if ($translabel != $obj->$field_toshow) {
7551
-										$labeltoshow = dol_trunc($translabel) . ' ';
7551
+										$labeltoshow = dol_trunc($translabel).' ';
7552 7552
 									} else {
7553
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7553
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7554 7554
 									}
7555 7555
 								}
7556
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7556
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7557 7557
 							} else {
7558 7558
 								if (!$notrans) {
7559 7559
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7567,34 +7567,34 @@  discard block
 block discarded – undo
7567 7567
 									$labeltoshow = '(not defined)';
7568 7568
 								}
7569 7569
 								if ($value == $obj->rowid) {
7570
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7570
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7571 7571
 								}
7572 7572
 
7573 7573
 								if (!empty($InfoFieldList[3]) && $parentField) {
7574
-									$parent = $parentName . ':' . $obj->{$parentField};
7574
+									$parent = $parentName.':'.$obj->{$parentField};
7575 7575
 									$isDependList = 1;
7576 7576
 								}
7577 7577
 
7578
-								$out .= '<option value="' . $obj->rowid . '"';
7578
+								$out .= '<option value="'.$obj->rowid.'"';
7579 7579
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7580
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7581
-								$out .= '>' . $labeltoshow . '</option>';
7580
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7581
+								$out .= '>'.$labeltoshow.'</option>';
7582 7582
 							}
7583 7583
 
7584 7584
 							$i++;
7585 7585
 						}
7586 7586
 						$this->db->free($resql);
7587 7587
 					} else {
7588
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7588
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7589 7589
 					}
7590 7590
 				} else {
7591 7591
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7592 7592
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7593 7593
 					$out .= '<option value="0">&nbsp;</option>';
7594 7594
 					foreach ($data as $data_key => $data_value) {
7595
-						$out .= '<option value="' . $data_key . '"';
7595
+						$out .= '<option value="'.$data_key.'"';
7596 7596
 						$out .= ($value == $data_key ? ' selected' : '');
7597
-						$out .= '>' . $data_value . '</option>';
7597
+						$out .= '>'.$data_value.'</option>';
7598 7598
 					}
7599 7599
 				}
7600 7600
 			}
@@ -7603,7 +7603,7 @@  discard block
 block discarded – undo
7603 7603
 			$value_arr = explode(',', $value);
7604 7604
 			$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, '', 0, $morecss, 0, '100%');
7605 7605
 		} elseif ($type == 'radio') {
7606
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7606
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7607 7607
 			foreach ($param['options'] as $keyopt => $valopt) {
7608 7608
 				$out .= '<input class="flat '.$morecss.'" type="radio" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '');
7609 7609
 				$out .= ' value="'.$keyopt.'"';
@@ -7659,8 +7659,8 @@  discard block
 block discarded – undo
7659 7659
 					}
7660 7660
 
7661 7661
 					$sqlwhere = '';
7662
-					$sql = "SELECT " . $keyList;
7663
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
7662
+					$sql = "SELECT ".$keyList;
7663
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
7664 7664
 					if (!empty($InfoFieldList[4])) {
7665 7665
 						// can use SELECT request
7666 7666
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7676,23 +7676,23 @@  discard block
 block discarded – undo
7676 7676
 
7677 7677
 						// We have to join on extrafield table
7678 7678
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7679
-							$sql .= ' as main, ' . $this->db->prefix() . $InfoFieldList[0] . '_extrafields as extra';
7680
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4];
7679
+							$sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra';
7680
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
7681 7681
 						} else {
7682
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
7682
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
7683 7683
 						}
7684 7684
 					} else {
7685 7685
 						$sqlwhere .= ' WHERE 1=1';
7686 7686
 					}
7687 7687
 					// Some tables may have field, some other not. For the moment we disable it.
7688 7688
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7689
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7689
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7690 7690
 					}
7691 7691
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
7692 7692
 					// print $sql;
7693 7693
 
7694 7694
 					$sql .= $sqlwhere;
7695
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
7695
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
7696 7696
 					$resql = $this->db->query($sql);
7697 7697
 					if ($resql) {
7698 7698
 						$num = $this->db->num_rows($resql);
@@ -7710,7 +7710,7 @@  discard block
 block discarded – undo
7710 7710
 							if (count($fields_label) > 1) {
7711 7711
 								$notrans = true;
7712 7712
 								foreach ($fields_label as $field_toshow) {
7713
-									$labeltoshow .= $obj->$field_toshow . ' ';
7713
+									$labeltoshow .= $obj->$field_toshow.' ';
7714 7714
 								}
7715 7715
 							} else {
7716 7716
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7721,9 +7721,9 @@  discard block
 block discarded – undo
7721 7721
 								foreach ($fields_label as $field_toshow) {
7722 7722
 									$translabel = $langs->trans($obj->$field_toshow);
7723 7723
 									if ($translabel != $obj->$field_toshow) {
7724
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
7724
+										$labeltoshow = dol_trunc($translabel, 18).' ';
7725 7725
 									} else {
7726
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
7726
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
7727 7727
 									}
7728 7728
 								}
7729 7729
 
@@ -7746,7 +7746,7 @@  discard block
 block discarded – undo
7746 7746
 								}
7747 7747
 
7748 7748
 								if (!empty($InfoFieldList[3]) && $parentField) {
7749
-									$parent = $parentName . ':' . $obj->{$parentField};
7749
+									$parent = $parentName.':'.$obj->{$parentField};
7750 7750
 									$isDependList = 1;
7751 7751
 								}
7752 7752
 
@@ -7757,14 +7757,14 @@  discard block
 block discarded – undo
7757 7757
 						}
7758 7758
 						$this->db->free($resql);
7759 7759
 
7760
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7760
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7761 7761
 					} else {
7762
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7762
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7763 7763
 					}
7764 7764
 				} else {
7765 7765
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7766 7766
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7767
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7767
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7768 7768
 				}
7769 7769
 			}
7770 7770
 		} elseif ($type == 'link') {
@@ -7822,7 +7822,7 @@  discard block
 block discarded – undo
7822 7822
 			$newval = $val;
7823 7823
 			$newval['type'] = 'varchar(256)';
7824 7824
 
7825
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7825
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7826 7826
 			if (!empty($value)) {
7827 7827
 				foreach ($value as $option) {
7828 7828
 					$out .= '<span><a class="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_del" href="javascript:;"><span class="fa fa-minus-circle valignmiddle"></span></a> ';
@@ -7989,7 +7989,7 @@  discard block
 block discarded – undo
7989 7989
 			$value = $this->getLibStatut(3);
7990 7990
 		} elseif ($type == 'date') {
7991 7991
 			if (!empty($value)) {
7992
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
7992
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
7993 7993
 			} else {
7994 7994
 				$value = '';
7995 7995
 			}
@@ -8094,9 +8094,9 @@  discard block
 block discarded – undo
8094 8094
 									$translabel = $langs->trans($obj->$field_toshow);
8095 8095
 								}
8096 8096
 								if ($translabel != $field_toshow) {
8097
-									$value .= dol_trunc($translabel, 18) . ' ';
8097
+									$value .= dol_trunc($translabel, 18).' ';
8098 8098
 								} else {
8099
-									$value .= $obj->$field_toshow . ' ';
8099
+									$value .= $obj->$field_toshow.' ';
8100 8100
 								}
8101 8101
 							}
8102 8102
 						} else {
@@ -8112,7 +8112,7 @@  discard block
 block discarded – undo
8112 8112
 						}
8113 8113
 					}
8114 8114
 				} else {
8115
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8115
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8116 8116
 
8117 8117
 					$toprint = array();
8118 8118
 					$obj = $this->db->fetch_object($resql);
@@ -8120,7 +8120,7 @@  discard block
 block discarded – undo
8120 8120
 					$c->fetch($obj->rowid);
8121 8121
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8122 8122
 					foreach ($ways as $way) {
8123
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8123
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8124 8124
 					}
8125 8125
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8126 8126
 				}
@@ -8136,11 +8136,11 @@  discard block
 block discarded – undo
8136 8136
 				$toprint = array();
8137 8137
 				foreach ($value_arr as $keyval => $valueval) {
8138 8138
 					if (!empty($valueval)) {
8139
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8139
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8140 8140
 					}
8141 8141
 				}
8142 8142
 				if (!empty($toprint)) {
8143
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8143
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8144 8144
 				}
8145 8145
 			}
8146 8146
 		} elseif ($type == 'chkbxlst') {
@@ -8195,9 +8195,9 @@  discard block
 block discarded – undo
8195 8195
 										$translabel = $langs->trans($obj->$field_toshow);
8196 8196
 									}
8197 8197
 									if ($translabel != $field_toshow) {
8198
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8198
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8199 8199
 									} else {
8200
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8200
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8201 8201
 									}
8202 8202
 								}
8203 8203
 							} else {
@@ -8206,15 +8206,15 @@  discard block
 block discarded – undo
8206 8206
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8207 8207
 								}
8208 8208
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8209
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8209
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8210 8210
 								} else {
8211
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8211
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8212 8212
 								}
8213 8213
 							}
8214 8214
 						}
8215 8215
 					}
8216 8216
 				} else {
8217
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8217
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8218 8218
 
8219 8219
 					$toprint = array();
8220 8220
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8223,7 +8223,7 @@  discard block
 block discarded – undo
8223 8223
 							$c->fetch($obj->rowid);
8224 8224
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8225 8225
 							foreach ($ways as $way) {
8226
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8226
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8227 8227
 							}
8228 8228
 						}
8229 8229
 					}
@@ -8371,7 +8371,7 @@  discard block
 block discarded – undo
8371 8371
 		global $langs;
8372 8372
 
8373 8373
 		if (!class_exists('Validate')) {
8374
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8374
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8375 8375
 		}
8376 8376
 
8377 8377
 		$this->clearFieldError($fieldKey);
@@ -8603,7 +8603,7 @@  discard block
 block discarded – undo
8603 8603
 				$out .= "\n";
8604 8604
 
8605 8605
 				$nbofextrafieldsshown = 0;
8606
-				$e = 0;	// var to manage the modulo (odd/even)
8606
+				$e = 0; // var to manage the modulo (odd/even)
8607 8607
 
8608 8608
 				$lastseparatorkeyfound = '';
8609 8609
 				$extrafields_collapse_num = '';
@@ -9121,13 +9121,13 @@  discard block
 block discarded – undo
9121 9121
 		if (!empty($this->photo)) {
9122 9122
 			if (dolIsAllowedForPreview($this->photo)) {
9123 9123
 				if ((string) $imagesize == 'mini') {
9124
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini'));
9124
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini'));
9125 9125
 				} elseif ((string) $imagesize == 'small') {
9126
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small'));
9126
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small'));
9127 9127
 				} else {
9128
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo);
9128
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo);
9129 9129
 				}
9130
-				$originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo);
9130
+				$originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo);
9131 9131
 			}
9132 9132
 		}
9133 9133
 
@@ -9703,7 +9703,7 @@  discard block
 block discarded – undo
9703 9703
 						continue;
9704 9704
 					}
9705 9705
 				}
9706
-				$keys_with_alias[] = $alias . '.' . $fieldname;
9706
+				$keys_with_alias[] = $alias.'.'.$fieldname;
9707 9707
 			}
9708 9708
 			return implode(',', $keys_with_alias);
9709 9709
 		} else {
@@ -9832,7 +9832,7 @@  discard block
 block discarded – undo
9832 9832
 		if (!$error) {
9833 9833
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
9834 9834
 			$sql .= " (".implode(", ", $keys).')';
9835
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
9835
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
9836 9836
 
9837 9837
 			$res = $this->db->query($sql);
9838 9838
 			if (!$res) {
@@ -10125,7 +10125,7 @@  discard block
 block discarded – undo
10125 10125
 
10126 10126
 		// Update extrafield
10127 10127
 		if (!$error) {
10128
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10128
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10129 10129
 			if ($result < 0) {
10130 10130
 				$error++;
10131 10131
 			}
@@ -10326,12 +10326,12 @@  discard block
 block discarded – undo
10326 10326
 				$error++;
10327 10327
 			} else {
10328 10328
 				while ($obj = $this->db->fetch_object($resql)) {
10329
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10329
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10330 10330
 					if ($result < 0) {
10331 10331
 						$error++;
10332 10332
 						$this->errors[] = $this->error;
10333 10333
 					} else {
10334
-						$result = $this->delete($user);	// @phpstan-ignore-line
10334
+						$result = $this->delete($user); // @phpstan-ignore-line
10335 10335
 						if ($result < 0) {
10336 10336
 							$error++;
10337 10337
 							$this->errors[] = $this->error;
@@ -10546,7 +10546,7 @@  discard block
 block discarded – undo
10546 10546
 		);
10547 10547
 		foreach ($fields as $key => $value) {
10548 10548
 			if (array_key_exists($key, $this->fields)) {
10549
-				$this->{$key} = $value;		// @phpstan-ignore-line
10549
+				$this->{$key} = $value; // @phpstan-ignore-line
10550 10550
 			}
10551 10551
 		}
10552 10552
 
Please login to merge, or discard this patch.
htdocs/core/class/doldeprecationhandler.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
 			return $this->$newProperty;
52 52
 		}
53 53
 		if ($this->isDynamicPropertiesEnabled()) {
54
-			return null;  // If the property is set, then __get is not called.
54
+			return null; // If the property is set, then __get is not called.
55 55
 		}
56 56
 		$msg = "Undefined property '$name'".self::getCallerInfoString();
57 57
 		dol_syslog($msg);
58 58
 		trigger_error($msg, E_USER_NOTICE);
59
-		return $this->$name;  // Returning value anyway (graceful degradation)
59
+		return $this->$name; // Returning value anyway (graceful degradation)
60 60
 	}
61 61
 
62 62
 	/**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		if (!$this->isDynamicPropertiesEnabled()) {
84 84
 			$msg = "Undefined property '$name'".self::getCallerInfoString();
85 85
 			trigger_error("Undefined property '$name'".self::getCallerInfoString(), E_USER_NOTICE);
86
-			$this->$name = $value;  // Setting anyway for graceful degradation
86
+			$this->$name = $value; // Setting anyway for graceful degradation
87 87
 		} else {
88 88
 			$this->$name = $value;
89 89
 		}
Please login to merge, or discard this patch.
htdocs/core/class/html.formticket.class.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
  *    \brief      File of class to generate the form for creating a new ticket.
28 28
  */
29 29
 
30
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
31
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
32
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
30
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
31
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
32
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
33 33
 
34 34
 if (!class_exists('FormCompany')) {
35 35
 	include DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@@ -83,17 +83,17 @@  discard block
 block discarded – undo
83 83
 
84 84
 	public $backtopage;
85 85
 
86
-	public $ispublic;  // to show information or not into public form
86
+	public $ispublic; // to show information or not into public form
87 87
 
88 88
 	public $withtitletopic;
89 89
 	public $withtopicreadonly;
90 90
 	public $withreadid;
91 91
 
92
-	public $withcompany;  // to show company drop-down list
92
+	public $withcompany; // to show company drop-down list
93 93
 	public $withfromsocid;
94 94
 	public $withfromcontactid;
95 95
 	public $withnotifytiersatcreate;
96
-	public $withusercreate;  // to show name of creating user in form
96
+	public $withusercreate; // to show name of creating user in form
97 97
 	public $withcreatereadonly;
98 98
 
99 99
 	/**
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 */
102 102
 	public $withextrafields;
103 103
 
104
-	public $withref;  // to show ref field
104
+	public $withref; // to show ref field
105 105
 	public $withcancel;
106 106
 
107 107
 	public $type_code;
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$this->withcreatereadonly = 1;
147 147
 		$this->withemail = 0;
148 148
 		$this->withref = 0;
149
-		$this->withextrafields = 0;  // to show extrafields or not
149
+		$this->withextrafields = 0; // to show extrafields or not
150 150
 		//$this->withtopicreadonly=0;
151 151
 	}
152 152
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 				$html_contact_search  = '';
219 219
 				$html_contact_search .= '<tr id="contact_search_line">';
220 220
 				$html_contact_search .= '<td class="titlefield">';
221
-				$html_contact_search .= '<label for="contact"><span class="fieldrequired">' . $langs->trans('Contact') . '</span></label>';
221
+				$html_contact_search .= '<label for="contact"><span class="fieldrequired">'.$langs->trans('Contact').'</span></label>';
222 222
 				$html_contact_search .= '<input type="hidden" id="contact_id" name="contact_id" value="" />';
223 223
 				$html_contact_search .= '</td>';
224 224
 				$html_contact_search .= '<td id="contact_search_result"></td>';
@@ -226,26 +226,26 @@  discard block
 block discarded – undo
226 226
 				print $html_contact_search;
227 227
 				// contact lastname
228 228
 				$html_contact_lastname = '';
229
-				$html_contact_lastname .= '<tr id="contact_lastname_line" class="contact_field"><td class="titlefield"><label for="contact_lastname"><span class="fieldrequired">' . $langs->trans('Lastname') . '</span></label></td><td>';
230
-				$html_contact_lastname .= '<input type="text" id="contact_lastname" name="contact_lastname" value="' . dol_escape_htmltag(GETPOSTISSET('contact_lastname') ? GETPOST('contact_lastname', 'alphanohtml') : '') . '" />';
229
+				$html_contact_lastname .= '<tr id="contact_lastname_line" class="contact_field"><td class="titlefield"><label for="contact_lastname"><span class="fieldrequired">'.$langs->trans('Lastname').'</span></label></td><td>';
230
+				$html_contact_lastname .= '<input type="text" id="contact_lastname" name="contact_lastname" value="'.dol_escape_htmltag(GETPOSTISSET('contact_lastname') ? GETPOST('contact_lastname', 'alphanohtml') : '').'" />';
231 231
 				$html_contact_lastname .= '</td></tr>';
232 232
 				print $html_contact_lastname;
233 233
 				// contact firstname
234 234
 				$html_contact_firstname  = '';
235
-				$html_contact_firstname .= '<tr id="contact_firstname_line" class="contact_field"><td class="titlefield"><label for="contact_firstname"><span class="fieldrequired">' . $langs->trans('Firstname') . '</span></label></td><td>';
236
-				$html_contact_firstname .= '<input type="text" id="contact_firstname" name="contact_firstname" value="' . dol_escape_htmltag(GETPOSTISSET('contact_firstname') ? GETPOST('contact_firstname', 'alphanohtml') : '') . '" />';
235
+				$html_contact_firstname .= '<tr id="contact_firstname_line" class="contact_field"><td class="titlefield"><label for="contact_firstname"><span class="fieldrequired">'.$langs->trans('Firstname').'</span></label></td><td>';
236
+				$html_contact_firstname .= '<input type="text" id="contact_firstname" name="contact_firstname" value="'.dol_escape_htmltag(GETPOSTISSET('contact_firstname') ? GETPOST('contact_firstname', 'alphanohtml') : '').'" />';
237 237
 				$html_contact_firstname .= '</td></tr>';
238 238
 				print $html_contact_firstname;
239 239
 				// company name
240 240
 				$html_company_name  = '';
241
-				$html_company_name .= '<tr id="contact_company_name_line" class="contact_field"><td><label for="company_name"><span>' . $langs->trans('Company') . '</span></label></td><td>';
242
-				$html_company_name .= '<input type="text" id="company_name" name="company_name" value="' . dol_escape_htmltag(GETPOSTISSET('company_name') ? GETPOST('company_name', 'alphanohtml') : '') . '" />';
241
+				$html_company_name .= '<tr id="contact_company_name_line" class="contact_field"><td><label for="company_name"><span>'.$langs->trans('Company').'</span></label></td><td>';
242
+				$html_company_name .= '<input type="text" id="company_name" name="company_name" value="'.dol_escape_htmltag(GETPOSTISSET('company_name') ? GETPOST('company_name', 'alphanohtml') : '').'" />';
243 243
 				$html_company_name .= '</td></tr>';
244 244
 				print $html_company_name;
245 245
 				// contact phone
246 246
 				$html_contact_phone  = '';
247
-				$html_contact_phone .= '<tr id="contact_phone_line" class="contact_field"><td><label for="contact_phone"><span>' . $langs->trans('Phone') . '</span></label></td><td>';
248
-				$html_contact_phone .= '<input type="text" id="contact_phone" name="contact_phone" value="' . dol_escape_htmltag(GETPOSTISSET('contact_phone') ? GETPOST('contact_phone', 'alphanohtml') : '') . '" />';
247
+				$html_contact_phone .= '<tr id="contact_phone_line" class="contact_field"><td><label for="contact_phone"><span>'.$langs->trans('Phone').'</span></label></td><td>';
248
+				$html_contact_phone .= '<input type="text" id="contact_phone" name="contact_phone" value="'.dol_escape_htmltag(GETPOSTISSET('contact_phone') ? GETPOST('contact_phone', 'alphanohtml') : '').'" />';
249 249
 				$html_contact_phone .= '</td></tr>';
250 250
 				print $html_contact_phone;
251 251
 
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 				$maxfilesizearray = getMaxFileSizeArray();
520 520
 				$maxmin = $maxfilesizearray['maxmin'];
521 521
 				if ($maxmin > 0) {
522
-					$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
522
+					$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
523 523
 				}
524 524
 				$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
525 525
 				$out .= ' ';
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
 		$selected = is_array($selected) ? $selected : (!empty($selected) ? explode(',', $selected) : array());
719 719
 		$ticketstat = new Ticket($this->db);
720 720
 
721
-		dol_syslog(get_class($this) . "::select_types_tickets " . implode(';', $selected) . ", " . $htmlname . ", " . $filtertype . ", " . $format . ", " . $multiselect, LOG_DEBUG);
721
+		dol_syslog(get_class($this)."::select_types_tickets ".implode(';', $selected).", ".$htmlname.", ".$filtertype.", ".$format.", ".$multiselect, LOG_DEBUG);
722 722
 
723 723
 		$filterarray = array();
724 724
 
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 		$publicgroups = ($filtertype == 'public=1' || $filtertype == '(public:=:1)');
825 825
 
826 826
 		$ticketstat = new Ticket($this->db);
827
-		$ticketstat->loadCacheCategoriesTickets($publicgroups ? 1 : -1);	// get list of active ticket groups
827
+		$ticketstat->loadCacheCategoriesTickets($publicgroups ? 1 : -1); // get list of active ticket groups
828 828
 
829 829
 		if ($use_multilevel <= 0) {
830 830
 			print '<select id="select'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
 			}
997 997
 			$stringtoprint .= '</select>&nbsp;';
998 998
 
999
-			$levelid = 1;	// The first combobox
999
+			$levelid = 1; // The first combobox
1000 1000
 			while ($levelid <= $use_multilevel) {	// Loop to take the child of the combo
1001 1001
 				$tabscript = array();
1002 1002
 				$stringtoprint .= '<select id="'.$htmlname.'_child_'.$levelid.'" class="maxwidth500 minwidth400 groupticketchild" child_id="'.$levelid.'">';
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
 				$stringtoprint .= '</select>';
1073 1073
 
1074 1074
 				$stringtoprint .= '<script nonce="'.getNonce().'">';
1075
-				$stringtoprint .= 'arraynotparents = '.json_encode($arraycodenotparent).';';	// when the last visible combo list is number x, this is the array of group
1075
+				$stringtoprint .= 'arraynotparents = '.json_encode($arraycodenotparent).';'; // when the last visible combo list is number x, this is the array of group
1076 1076
 				$stringtoprint .= 'if (arraynotparents.includes($("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid - 1) : '').'").val())){
1077 1077
 					console.log("'.$htmlname.'_child_'.$levelid.'")
1078 1078
 					if($("#'.$htmlname.'_child_'.$levelid.'").val() == "" && ($("#'.$htmlname.'_child_'.$levelid.'").attr("child_id")>'.$child_id.')){
@@ -1510,7 +1510,7 @@  discard block
 block discarded – undo
1510 1510
 			}
1511 1511
 			print '<tr class="email_line"><td>'.$langs->trans('Subject').'</td>';
1512 1512
 			if (empty($topic)) {
1513
-				print '<td><input type="text" class="text minwidth500" name="subject" value="['.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '. $ticketstat->subject .'" />';
1513
+				print '<td><input type="text" class="text minwidth500" name="subject" value="['.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '.$ticketstat->subject.'" />';
1514 1514
 			} else {
1515 1515
 				print '<td><input type="text" class="text minwidth500" name="subject" value="['.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '.$topic.'" />';
1516 1516
 			}
Please login to merge, or discard this patch.
htdocs/projet/tasks.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 $confirm = GETPOST('confirm', 'alpha');
51 51
 $cancel = GETPOST('cancel', 'aZ09');
52 52
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'projecttasklist';
53
-$backtopage = GETPOST('backtopage', 'alpha');					// if not set, a default page will be used
53
+$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
54 54
 //$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
55 55
 //$backtopagejsfields = GETPOST('backtopagejsfields', 'alpha');
56 56
 $optioncss  = GETPOST('optioncss', 'aZ');
@@ -92,20 +92,20 @@  discard block
 block discarded – undo
92 92
 $search_date_start_startmonth = GETPOSTINT('search_date_start_startmonth');
93 93
 $search_date_start_startyear = GETPOSTINT('search_date_start_startyear');
94 94
 $search_date_start_startday = GETPOSTINT('search_date_start_startday');
95
-$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear);	// Use tzserver
95
+$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); // Use tzserver
96 96
 $search_date_start_endmonth = GETPOSTINT('search_date_start_endmonth');
97 97
 $search_date_start_endyear = GETPOSTINT('search_date_start_endyear');
98 98
 $search_date_start_endday = GETPOSTINT('search_date_start_endday');
99
-$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear);	// Use tzserver
99
+$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear); // Use tzserver
100 100
 
101 101
 $search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth');
102 102
 $search_date_end_startyear = GETPOSTINT('search_date_end_startyear');
103 103
 $search_date_end_startday = GETPOSTINT('search_date_end_startday');
104
-$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);	// Use tzserver
104
+$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver
105 105
 $search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth');
106 106
 $search_date_end_endyear = GETPOSTINT('search_date_end_endyear');
107 107
 $search_date_end_endday = GETPOSTINT('search_date_end_endday');
108
-$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);	// Use tzserver
108
+$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver
109 109
 
110 110
 //if (! $user->rights->projet->all->lire) $mine=1;	// Special for projects
111 111
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
184 184
 
185 185
 $arrayfields = dol_sort_array($arrayfields, 'position');
186
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
186
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
187 187
 
188 188
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
189 189
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 		$param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday));
540 540
 	}
541 541
 	if ($search_date_end_end) {
542
-		$param .= '&search_date_end_end=' . urlencode($search_date_end_end);
542
+		$param .= '&search_date_end_end='.urlencode($search_date_end_end);
543 543
 	}
544 544
 	if ($search_planedworkload) {
545 545
 		$param .= '&search_planedworkload='.urlencode($search_planedworkload);
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 	if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) {
580 580
 		$tmpurl = $_SESSION['pageforbacktolist']['project'];
581 581
 		$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl);
582
-		$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
582
+		$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
583 583
 	} else {
584 584
 		$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
585 585
 	}
@@ -744,8 +744,8 @@  discard block
 block discarded – undo
744 744
 
745 745
 	$defaultref = '';
746 746
 	$obj = !getDolGlobalString('PROJECT_TASK_ADDON') ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
747
-	if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
748
-		require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').'.php';
747
+	if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
748
+		require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').'.php';
749 749
 		$modTask = new $obj();
750 750
 		$defaultref = $modTask->getNextValue($object->thirdparty, null);
751 751
 	}
Please login to merge, or discard this patch.
htdocs/partnership/class/partnershiputils.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	public $error; //!< To return error code (or message)
43 43
 	public $errors = array(); //!< To return several error codes (or messages)
44 44
 
45
-	public $output;	// To store output of some cron methods
45
+	public $output; // To store output of some cron methods
46 46
 
47 47
 
48 48
 	/**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	{
67 67
 		global $conf, $langs, $user;
68 68
 
69
-		$managedfor	= getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty');
69
+		$managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty');
70 70
 
71 71
 		if ($managedfor != 'member') {
72 72
 			return 0; // If option 'PARTNERSHIP_IS_MANAGED_FOR' = 'thirdparty', this cron job does nothing.
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
 							$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
182 182
 							$msg     = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
183
-							$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
183
+							$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
184 184
 
185 185
 							// We are in the case of autocancellation subscription because of missing backlink
186 186
 							$fk_partner = $object->fk_member;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 									$object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref);
214 214
 									; // Short text ($langs->transnoentities('MailSentByTo')...);
215 215
 									if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) {
216
-										$object->actionmsg2		= $subject; // Short text
216
+										$object->actionmsg2 = $subject; // Short text
217 217
 									}
218 218
 
219 219
 									$object->trackid = $trackid;
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 
406 406
 									$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
407 407
 									$msg     = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
408
-									$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
408
+									$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
409 409
 
410 410
 									$sendto = $obj->email;
411 411
 
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 											$object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref);
437 437
 											; // Short text ($langs->transnoentities('MailSentByTo')...);
438 438
 											if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) {
439
-												$object->actionmsg2		= $subject; // Short text
439
+												$object->actionmsg2 = $subject; // Short text
440 440
 											}
441 441
 
442 442
 											$object->trackid = $trackid;
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 			}
550 550
 		}
551 551
 
552
-		if ($webcontent && getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK') && preg_match('/' . getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK').'/', $webcontent)) {
552
+		if ($webcontent && getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK') && preg_match('/'.getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK').'/', $webcontent)) {
553 553
 			$found = 1;
554 554
 		}
555 555
 
Please login to merge, or discard this patch.
htdocs/hrm/class/skill.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 	 */
228 228
 	public function create(User $user, $notrigger = 0)
229 229
 	{
230
-		global $langs,$conf;
230
+		global $langs, $conf;
231 231
 
232 232
 		$resultcreate = $this->createCommon($user, $notrigger);
233 233
 
@@ -255,18 +255,18 @@  discard block
 block discarded – undo
255 255
 
256 256
 		$error = 0;
257 257
 
258
-		require_once __DIR__ . '/skilldet.class.php';
258
+		require_once __DIR__.'/skilldet.class.php';
259 259
 
260 260
 		$this->db->begin();
261 261
 
262 262
 		// Create level of skills
263 263
 		while ($i <= $MaxNumberSkill) {
264 264
 			$skilldet = new Skilldet($this->db);
265
-			$skilldet->description = $defaultSkillDesc . " " . $i;
265
+			$skilldet->description = $defaultSkillDesc." ".$i;
266 266
 			$skilldet->rankorder = $i;
267 267
 			$skilldet->fk_skill = $this->id;
268 268
 
269
-			$result =  $skilldet->create($user);
269
+			$result = $skilldet->create($user);
270 270
 			if ($result <= 0) {
271 271
 				$error++;
272 272
 			}
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 	public function fetchLines()
407 407
 	{
408 408
 		$this->lines = array();
409
-		require_once __DIR__ . '/skilldet.class.php';
409
+		require_once __DIR__.'/skilldet.class.php';
410 410
 		$skilldet = new Skilldet($this->db);
411 411
 		$this->lines = $skilldet->fetchAll('ASC', '', '', '', 'fk_skill:=:'.$this->id, '');
412 412
 
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
 		if (getDolGlobalString('hrm_SKILL_ADDON')) {
993 993
 			$mybool = false;
994 994
 
995
-			$file = getDolGlobalString('hrm_SKILL_ADDON') . ".php";
995
+			$file = getDolGlobalString('hrm_SKILL_ADDON').".php";
996 996
 			$classname = getDolGlobalString('hrm_SKILL_ADDON');
997 997
 
998 998
 			// Include file with class
Please login to merge, or discard this patch.