Completed
Branch develop (b41ef2)
by
unknown
24:57
created
htdocs/admin/mails_emailing.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 		}
372 372
 		$htmltext = $langs->trans("ContactSuperAdminForChange");
373 373
 		print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
374
-		print '<input type="hidden" name="MAIN_MAIL_SENDMODE_EMAILING" value="' . getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING').'">';
374
+		print '<input type="hidden" name="MAIN_MAIL_SENDMODE_EMAILING" value="'.getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING').'">';
375 375
 	}
376 376
 	print '</td></tr>';
377 377
 
@@ -396,15 +396,15 @@  discard block
 block discarded – undo
396 396
 		print '</td><td>';
397 397
 		// SuperAdministrator access only
398 398
 		if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
399
-			print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="' . $mainserver . '">';
400
-			print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="' . $mainserver . '">';
401
-			print '<span id="smtp_server_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>';
402
-			print ' <span class="opacitymedium smtp_method">' . $langs->trans("SeeLinkToOnlineDocumentation") . '</span>';
399
+			print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">';
400
+			print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">';
401
+			print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
402
+			print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>';
403 403
 		} else {
404 404
 			$text = !empty($mainserver) ? $mainserver : $smtpserver;
405 405
 			$htmltext = $langs->trans("ContactSuperAdminForChange");
406 406
 			print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
407
-			print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="' . $mainserver . '">';
407
+			print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="'.$mainserver.'">';
408 408
 		}
409 409
 		print '</td>';
410 410
 	}
@@ -428,14 +428,14 @@  discard block
 block discarded – undo
428 428
 		print '</td><td>';
429 429
 		// SuperAdministrator access only
430 430
 		if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
431
-			print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="' . $mainport . '">';
432
-			print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="' . $mainport . '">';
433
-			print '<span id="smtp_port_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>';
431
+			print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="'.$mainport.'">';
432
+			print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">';
433
+			print '<span id="smtp_port_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
434 434
 		} else {
435 435
 			$text = (!empty($mainport) ? $mainport : $smtpport);
436 436
 			$htmltext = $langs->trans("ContactSuperAdminForChange");
437 437
 			print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
438
-			print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="' . $mainport . '">';
438
+			print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="'.$mainport.'">';
439 439
 		}
440 440
 	}
441 441
 	print '</td></tr>';
@@ -471,14 +471,14 @@  discard block
 block discarded – undo
471 471
 	// ID
472 472
 	if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) {
473 473
 		$mainstmpid = getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING');
474
-		print '<tr class="drag drop oddeven hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_ID") . '</td><td>';
474
+		print '<tr class="drag drop oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>';
475 475
 		// SuperAdministrator access only
476 476
 		if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
477
-			print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="' . $mainstmpid . '">';
477
+			print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="'.$mainstmpid.'">';
478 478
 		} else {
479 479
 			$htmltext = $langs->trans("ContactSuperAdminForChange");
480 480
 			print $form->textwithpicto(getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING'), $htmltext, 1, 'superadmin');
481
-			print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="' . $mainstmpid . '">';
481
+			print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="'.$mainstmpid.'">';
482 482
 		}
483 483
 		print '</td></tr>';
484 484
 	}
@@ -486,14 +486,14 @@  discard block
 block discarded – undo
486 486
 	// PW
487 487
 	if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) {
488 488
 		$mainsmtppw = getDolGlobalString('MAIN_MAIL_SMTPS_PW_EMAILING');
489
-		print '<tr class="drag drop oddeven smtp_pw hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_PW") . '</td><td>';
489
+		print '<tr class="drag drop oddeven smtp_pw hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_PW").'</td><td>';
490 490
 		// SuperAdministrator access only
491 491
 		if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
492
-			print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="' . $mainsmtppw . '">';
492
+			print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="'.$mainsmtppw.'">';
493 493
 		} else {
494 494
 			$htmltext = $langs->trans("ContactSuperAdminForChange");
495 495
 			print $form->textwithpicto(getDolGlobalString('MAIN_MAIL_SMTPS_PW_EMAILING'), $htmltext, 1, 'superadmin');
496
-			print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="' . $mainsmtppw . '">';
496
+			print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="'.$mainsmtppw.'">';
497 497
 		}
498 498
 		print '</td></tr>';
499 499
 	}
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 		print '<tr class="oddeven smtp_oauth_service hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>';
504 504
 
505 505
 		// SuperAdministrator access only
506
-		if (!isModEnabled('multicompany')  || ($user->admin && !$user->entity)) {
506
+		if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
507 507
 			// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
508 508
 			print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING', $oauthservices, getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING'));
509 509
 		} else {
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 			}
514 514
 			$htmltext = $langs->trans("ContactSuperAdminForChange");
515 515
 			print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
516
-			print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING" value="' . getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING').'">';
516
+			print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING" value="'.getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING').'">';
517 517
 		}
518 518
 		print '</td></tr>';
519 519
 	}
@@ -718,16 +718,16 @@  discard block
 block discarded – undo
718 718
 	if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') && getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') {
719 719
 		if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail' || !$linuxlike) {
720 720
 			if (function_exists('fsockopen') && $port && $server) {
721
-				print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testconnect">' . $langs->trans("DoTestServerAvailability") . '</a>';
721
+				print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect">'.$langs->trans("DoTestServerAvailability").'</a>';
722 722
 			}
723 723
 		} else {
724
-			print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("FeatureNotAvailableOnLinux") . '">' . $langs->trans("DoTestServerAvailability") . '</a>';
724
+			print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
725 725
 		}
726 726
 
727
-		print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=test&amp;mode=init">' . $langs->trans("DoTestSend") . '</a>';
727
+		print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&amp;mode=init">'.$langs->trans("DoTestSend").'</a>';
728 728
 
729 729
 		if (isModEnabled('fckeditor')) {
730
-			print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testhtml&amp;mode=init">' . $langs->trans("DoTestSendHTML") . '</a>';
730
+			print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testhtml&amp;mode=init">'.$langs->trans("DoTestSendHTML").'</a>';
731 731
 		}
732 732
 	}
733 733
 
Please login to merge, or discard this patch.
htdocs/admin/mails_ticket.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 		}
367 367
 		$htmltext = $langs->trans("ContactSuperAdminForChange");
368 368
 		print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
369
-		print '<input type="hidden" name="MAIN_MAIL_SENDMODE_TICKET" value="' . getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET').'">';
369
+		print '<input type="hidden" name="MAIN_MAIL_SENDMODE_TICKET" value="'.getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET').'">';
370 370
 	}
371 371
 	print '</td></tr>';
372 372
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 			print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_TICKET" name="MAIN_MAIL_SMTP_SERVER_TICKET" size="18" value="'.$mainserver.'">';
395 395
 			print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_TICKET_sav" name="MAIN_MAIL_SMTP_SERVER_TICKET_sav" value="'.$mainserver.'">';
396 396
 			print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
397
-			print ' <span class="opacitymedium smtp_method">' . $langs->trans("SeeLinkToOnlineDocumentation") . '</span>';
397
+			print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>';
398 398
 		} else {
399 399
 			$text = !empty($mainserver) ? $mainserver : $smtpserver;
400 400
 			$htmltext = $langs->trans("ContactSuperAdminForChange");
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 	if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) {
498 498
 		print '<tr class="oddeven smtp_oauth_service hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>';
499 499
 		// SuperAdministrator access only
500
-		if (!isModEnabled('multicompany')  || ($user->admin && !$user->entity)) {
500
+		if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
501 501
 			print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET', $oauthservices, getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET'));
502 502
 		} else {
503 503
 			$text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET')];
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 			}
507 507
 			$htmltext = $langs->trans("ContactSuperAdminForChange");
508 508
 			print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
509
-			print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET" value="' . getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET').'">';
509
+			print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET" value="'.getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET').'">';
510 510
 		}
511 511
 		print '</td></tr>';
512 512
 	}
Please login to merge, or discard this patch.
htdocs/admin/mails.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
390 390
 
391 391
 	// SuperAdministrator access only
392
-	if (!isModEnabled('multicompany')  || ($user->admin && !$user->entity)) {
392
+	if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
393 393
 		print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'));
394 394
 	} else {
395 395
 		$text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE')];
@@ -517,11 +517,11 @@  discard block
 block discarded – undo
517 517
 		print '</td><td>';
518 518
 		// SuperAdministrator access only
519 519
 		if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
520
-			print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW" size="32" value="' . htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8') . '" autocomplete="off">';
520
+			print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW" size="32" value="'.htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8').'" autocomplete="off">';
521 521
 		} else {
522 522
 			$htmltext = $langs->trans("ContactSuperAdminForChange");
523 523
 			print $form->textwithpicto(getDolGlobalString('MAIN_MAIL_SMTPS_PW'), $htmltext, 1, 'superadmin');
524
-			print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW" value="' . htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8') . '">';
524
+			print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW" value="'.htmlspecialchars($mainsmtppw, ENT_COMPAT, 'UTF-8').'">';
525 525
 		}
526 526
 		print '</td></tr>';
527 527
 	}
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 		print '<tr class="oddeven smtp_oauth_service"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>';
532 532
 
533 533
 		// SuperAdministrator access only
534
-		if (!isModEnabled('multicompany')  || ($user->admin && !$user->entity)) {
534
+		if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
535 535
 			print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE', $oauthservices, getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE'));
536 536
 		} else {
537 537
 			$text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE')];
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 			}
541 541
 			$htmltext = $langs->trans("ContactSuperAdminForChange");
542 542
 			print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
543
-			print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE" value="' . getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE').'">';
543
+			print '<input type="hidden" name="MAIN_MAIL_SMTPS_OAUTH_SERVICE" value="'.getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE').'">';
544 544
 		}
545 545
 		print '</td></tr>';
546 546
 	}
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 
744 744
 		// SMTPS ID
745 745
 		if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
746
-			print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>' . getDolGlobalString('MAIN_MAIL_SMTPS_ID').'</td></tr>';
746
+			print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>'.getDolGlobalString('MAIN_MAIL_SMTPS_ID').'</td></tr>';
747 747
 		}
748 748
 
749 749
 		// SMTPS PW
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
 	print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined"));
907 907
 	print ' '.$help;
908 908
 	print '</td>';
909
-	print '<td>' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
909
+	print '<td>'.getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
910 910
 	if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM')) {
911 911
 		print img_warning($langs->trans("Mandatory"));
912 912
 	} elseif (!isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))) {
@@ -1166,8 +1166,8 @@  discard block
 block discarded – undo
1166 1166
 		$formmail->withtopicreadonly = 0;
1167 1167
 		$formmail->withfile = 2;
1168 1168
 
1169
-		$formmail->withlayout = 'emailing';		// Note: MAIN_EMAIL_USE_LAYOUT must be set
1170
-		$formmail->withaiprompt = ($action == 'testhtml' ? 'html' : 'text');	// Note: Module AI must be enabled
1169
+		$formmail->withlayout = 'emailing'; // Note: MAIN_EMAIL_USE_LAYOUT must be set
1170
+		$formmail->withaiprompt = ($action == 'testhtml' ? 'html' : 'text'); // Note: Module AI must be enabled
1171 1171
 
1172 1172
 		$formmail->withbody = (GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
1173 1173
 		$formmail->withbodyreadonly = 0;
Please login to merge, or discard this patch.
htdocs/core/lib/payments.lib.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 	// Load translation files required by the page
214 214
 	$langs->loadLangs(array('payment', 'stripe'));
215 215
 
216
-	$servicename = '';	// Link is a generic link for all payments services (paypal, stripe, ...)
216
+	$servicename = ''; // Link is a generic link for all payments services (paypal, stripe, ...)
217 217
 
218 218
 	$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePayment", $servicename).'</span><br>';
219 219
 	$url = getOnlinePaymentUrl(0, $type, $ref, $amount);
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 	$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
264 264
 	//$urlwithroot=DOL_MAIN_URL_ROOT;					// This is to use same domain name than current
265 265
 
266
-	$urltouse = DOL_MAIN_URL_ROOT;						// Should be "https://www.mydomain.com/mydolibarr" for example
266
+	$urltouse = DOL_MAIN_URL_ROOT; // Should be "https://www.mydomain.com/mydolibarr" for example
267 267
 	//dol_syslog("getOnlinePaymentUrl DOL_MAIN_URL_ROOT=".DOL_MAIN_URL_ROOT);
268 268
 
269 269
 	if ($localorexternal) {
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 			} else {
296 296
 				$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
297 297
 				if ($mode == 1) {
298
-					$out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + order_ref)";
298
+					$out .= "hash('".getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + order_ref)";
299 299
 				}
300 300
 				if ($mode == 0) {
301 301
 					$out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$type.$ref, 'sha1md5');
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 			} else {
319 319
 				$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
320 320
 				if ($mode == 1) {
321
-					$out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + invoice_ref)";
321
+					$out .= "hash('".getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + invoice_ref)";
322 322
 				}
323 323
 				if ($mode == 0) {
324 324
 					$out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$type.$ref, 'sha1md5');
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 			} else {
342 342
 				$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
343 343
 				if ($mode == 1) {
344
-					$out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + contractline_ref)";
344
+					$out .= "hash('".getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + contractline_ref)";
345 345
 				}
346 346
 				if ($mode == 0) {
347 347
 					$out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$type.$ref, 'sha1md5');
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 			} else {
368 368
 				$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
369 369
 				if ($mode == 1) {	// mode tuto
370
-					$out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$newtype."' + member_ref)";
370
+					$out .= "hash('".getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$newtype."' + member_ref)";
371 371
 				}
372 372
 				if ($mode == 0) {	// mode real
373 373
 					$out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$newtype.$ref, 'sha1md5');
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 			} else {
391 391
 				$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
392 392
 				if ($mode == 1) {
393
-					$out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + donation_ref)";
393
+					$out .= "hash('".getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + donation_ref)";
394 394
 				}
395 395
 				if ($mode == 0) {
396 396
 					$out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$type.$ref, 'sha1md5');
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 			} else {
414 414
 				$out .= '&securekey='.($mode ? '<span style="color: #666666">' : '');
415 415
 				if ($mode == 1) {
416
-					$out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + invoice_ref)";
416
+					$out .= "hash('".getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + invoice_ref)";
417 417
 				}
418 418
 				if ($mode == 0) {
419 419
 					$out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$type.$ref, 'sha1md5');
Please login to merge, or discard this patch.
htdocs/core/class/html.formticket.class.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
  *    \brief      File of class to generate the form for creating a new ticket.
29 29
  */
30 30
 
31
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
32
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
31
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
32
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
34 34
 
35 35
 if (!class_exists('FormCompany')) {
36 36
 	include DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	/**
112 112
 	 * @var int<0,1>
113 113
 	 */
114
-	public $ispublic;  // to show information or not into public form
114
+	public $ispublic; // to show information or not into public form
115 115
 
116 116
 	/**
117 117
 	 * @var int<0,1>
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	/**
130 130
 	 * @var int<0,1>
131 131
 	 */
132
-	public $withcompany;  // to show company drop-down list
132
+	public $withcompany; // to show company drop-down list
133 133
 	/**
134 134
 	 * @var int<0,1>
135 135
 	 */
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	/**
146 146
 	 * @var int<0,1>
147 147
 	 */
148
-	public $withusercreate;  // to show name of creating user in form
148
+	public $withusercreate; // to show name of creating user in form
149 149
 	/**
150 150
 	 * @var int<0,1>
151 151
 	 */
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	/**
160 160
 	 * @var int<0,1>
161 161
 	 */
162
-	public $withref;  // to show ref field
162
+	public $withref; // to show ref field
163 163
 	/**
164 164
 	 * @var int<0,1>
165 165
 	 */
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 		$this->withcreatereadonly = 1;
223 223
 		$this->withemail = 0;
224 224
 		$this->withref = 0;
225
-		$this->withextrafields = 0;  // to show extrafields or not
225
+		$this->withextrafields = 0; // to show extrafields or not
226 226
 		//$this->withtopicreadonly=0;
227 227
 	}
228 228
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 		print '<input type="hidden" name="token" value="'.newToken().'">';
311 311
 		print '<input type="hidden" name="action" value="'.$this->action.'">';
312 312
 		if (!empty($object->id)) {
313
-			print '<input type="hidden" name="id" value="'. $object->id .'">';
313
+			print '<input type="hidden" name="id" value="'.$object->id.'">';
314 314
 		}
315 315
 		print '<input type="hidden" name="trackid" value="'.$this->trackid.'">';
316 316
 		foreach ($this->param as $key => $value) {
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 		// Title
336 336
 		if ($this->withemail) {
337 337
 			print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">'.$langs->trans("Email").'</span></label></td><td>';
338
-			print '<input class="text minwidth200" id="email" name="email" value="'.$email.'" autofocus>';	// Do not use "required", it breaks button cancel
338
+			print '<input class="text minwidth200" id="email" name="email" value="'.$email.'" autofocus>'; // Do not use "required", it breaks button cancel
339 339
 			print '</td></tr>';
340 340
 
341 341
 			if ($with_contact) {
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 				$html_contact_search = '';
344 344
 				$html_contact_search .= '<tr id="contact_search_line">';
345 345
 				$html_contact_search .= '<td class="titlefield">';
346
-				$html_contact_search .= '<label for="contact"><span class="fieldrequired">' . $langs->trans('Contact') . '</span></label>';
346
+				$html_contact_search .= '<label for="contact"><span class="fieldrequired">'.$langs->trans('Contact').'</span></label>';
347 347
 				$html_contact_search .= '<input type="hidden" id="contact_id" name="contact_id" value="" />';
348 348
 				$html_contact_search .= '</td>';
349 349
 				$html_contact_search .= '<td id="contact_search_result"></td>';
@@ -351,26 +351,26 @@  discard block
 block discarded – undo
351 351
 				print $html_contact_search;
352 352
 				// contact lastname
353 353
 				$html_contact_lastname = '';
354
-				$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>';
355
-				$html_contact_lastname .= '<input type="text" id="contact_lastname" name="contact_lastname" value="' . dol_escape_htmltag(GETPOSTISSET('contact_lastname') ? GETPOST('contact_lastname', 'alphanohtml') : '') . '" />';
354
+				$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>';
355
+				$html_contact_lastname .= '<input type="text" id="contact_lastname" name="contact_lastname" value="'.dol_escape_htmltag(GETPOSTISSET('contact_lastname') ? GETPOST('contact_lastname', 'alphanohtml') : '').'" />';
356 356
 				$html_contact_lastname .= '</td></tr>';
357 357
 				print $html_contact_lastname;
358 358
 				// contact firstname
359 359
 				$html_contact_firstname = '';
360
-				$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>';
361
-				$html_contact_firstname .= '<input type="text" id="contact_firstname" name="contact_firstname" value="' . dol_escape_htmltag(GETPOSTISSET('contact_firstname') ? GETPOST('contact_firstname', 'alphanohtml') : '') . '" />';
360
+				$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>';
361
+				$html_contact_firstname .= '<input type="text" id="contact_firstname" name="contact_firstname" value="'.dol_escape_htmltag(GETPOSTISSET('contact_firstname') ? GETPOST('contact_firstname', 'alphanohtml') : '').'" />';
362 362
 				$html_contact_firstname .= '</td></tr>';
363 363
 				print $html_contact_firstname;
364 364
 				// company name
365 365
 				$html_company_name = '';
366
-				$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>';
367
-				$html_company_name .= '<input type="text" id="company_name" name="company_name" value="' . dol_escape_htmltag(GETPOSTISSET('company_name') ? GETPOST('company_name', 'alphanohtml') : '') . '" />';
366
+				$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>';
367
+				$html_company_name .= '<input type="text" id="company_name" name="company_name" value="'.dol_escape_htmltag(GETPOSTISSET('company_name') ? GETPOST('company_name', 'alphanohtml') : '').'" />';
368 368
 				$html_company_name .= '</td></tr>';
369 369
 				print $html_company_name;
370 370
 				// contact phone
371 371
 				$html_contact_phone = '';
372
-				$html_contact_phone .= '<tr id="contact_phone_line" class="contact_field"><td><label for="contact_phone"><span>' . $langs->trans('Phone') . '</span></label></td><td>';
373
-				$html_contact_phone .= '<input type="text" id="contact_phone" name="contact_phone" value="' . dol_escape_htmltag(GETPOSTISSET('contact_phone') ? GETPOST('contact_phone', 'alphanohtml') : '') . '" />';
372
+				$html_contact_phone .= '<tr id="contact_phone_line" class="contact_field"><td><label for="contact_phone"><span>'.$langs->trans('Phone').'</span></label></td><td>';
373
+				$html_contact_phone .= '<input type="text" id="contact_phone" name="contact_phone" value="'.dol_escape_htmltag(GETPOSTISSET('contact_phone') ? GETPOST('contact_phone', 'alphanohtml') : '').'" />';
374 374
 				$html_contact_phone .= '</td></tr>';
375 375
 				print $html_contact_phone;
376 376
 
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 		// If public form, display more information
561 561
 		$toolbarname = 'dolibarr_notes';
562 562
 		if ($this->ispublic) {
563
-			$toolbarname = 'dolibarr_details';	// TODO Allow image so use can do paste of image into content but disallow file manager
563
+			$toolbarname = 'dolibarr_details'; // TODO Allow image so use can do paste of image into content but disallow file manager
564 564
 			print '<div class="warning hideonsmartphone">'.(getDolGlobalString("TICKET_PUBLIC_TEXT_HELP_MESSAGE", $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'))).'</div>';
565 565
 		}
566 566
 		include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 				$maxfilesizearray = getMaxFileSizeArray();
627 627
 				$maxmin = $maxfilesizearray['maxmin'];
628 628
 				if ($maxmin > 0) {
629
-					$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
629
+					$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
630 630
 				}
631 631
 				$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
632 632
 				$out .= ' ';
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 					'@phan-var-force ModeleCaptcha $captchaobj';
818 818
 
819 819
 					if (is_object($captchaobj) && method_exists($captchaobj, 'getCaptchaCodeForForm')) {
820
-						print $captchaobj->getCaptchaCodeForForm('');  // @phan-suppress-current-line PhanUndeclaredMethod
820
+						print $captchaobj->getCaptchaCodeForForm(''); // @phan-suppress-current-line PhanUndeclaredMethod
821 821
 					} else {
822 822
 						print 'Error, the captcha handler '.get_class($captchaobj).' does not have any method getCaptchaCodeForForm()';
823 823
 					}
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 		$selected = is_array($selected) ? $selected : (!empty($selected) ? explode(',', $selected) : array());
885 885
 		$ticketstat = new Ticket($this->db);
886 886
 
887
-		dol_syslog(get_class($this) . "::select_types_tickets " . implode(';', $selected) . ", " . $htmlname . ", " . $filtertype . ", " . $format . ", " . $multiselect, LOG_DEBUG);
887
+		dol_syslog(get_class($this)."::select_types_tickets ".implode(';', $selected).", ".$htmlname.", ".$filtertype.", ".$format.", ".$multiselect, LOG_DEBUG);
888 888
 
889 889
 		$filterarray = array();
890 890
 
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
 		$publicgroups = ($filtertype == 'public=1' || $filtertype == '(public:=:1)');
993 993
 
994 994
 		$ticketstat = new Ticket($this->db);
995
-		$ticketstat->loadCacheCategoriesTickets($publicgroups ? 1 : -1);	// get list of active ticket groups
995
+		$ticketstat->loadCacheCategoriesTickets($publicgroups ? 1 : -1); // get list of active ticket groups
996 996
 
997 997
 		if ($use_multilevel <= 0) {	// Only one combo list to select the group of ticket (default)
998 998
 			print '<select id="select'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
 			}
1166 1166
 			$stringtoprint .= '</select>&nbsp;';
1167 1167
 
1168
-			$levelid = 1;	// The first combobox
1168
+			$levelid = 1; // The first combobox
1169 1169
 			while ($levelid <= $use_multilevel) {	// Loop to take the child of the combo
1170 1170
 				$tabscript = array();
1171 1171
 				$stringtoprint .= '<select id="'.$htmlname.'_child_'.$levelid.'" class="maxwidth500 minwidth400 groupticketchild" child_id="'.$levelid.'">';
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 				$stringtoprint .= '</select>';
1243 1243
 
1244 1244
 				$stringtoprint .= '<script nonce="'.getNonce().'">';
1245
-				$stringtoprint .= 'arraynotparents = '.json_encode($arraycodenotparent).';';	// when the last visible combo list is number x, this is the array of group
1245
+				$stringtoprint .= 'arraynotparents = '.json_encode($arraycodenotparent).';'; // when the last visible combo list is number x, this is the array of group
1246 1246
 				$stringtoprint .= 'if (arraynotparents.includes($("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid - 1) : '').'").val())){
1247 1247
 					console.log("'.$htmlname.'_child_'.$levelid.'")
1248 1248
 					if($("#'.$htmlname.'_child_'.$levelid.'").val() == "" && ($("#'.$htmlname.'_child_'.$levelid.'").attr("child_id")>'.$child_id.')){
@@ -1682,7 +1682,7 @@  discard block
 block discarded – undo
1682 1682
 			}
1683 1683
 			print '<tr class="email_line"><td>'.$langs->trans('Subject').'</td>';
1684 1684
 			if (empty($topic)) {
1685
-				print '<td><input type="text" class="text minwidth500" name="subject" value="['.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '. $ticketstat->subject .'" />';
1685
+				print '<td><input type="text" class="text minwidth500" name="subject" value="['.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '.$ticketstat->subject.'" />';
1686 1686
 			} else {
1687 1687
 				print '<td><input type="text" class="text minwidth500" name="subject" value="'.make_substitutions($topic, $this->substit).'" />';
1688 1688
 			}
Please login to merge, or discard this patch.
htdocs/contrat/class/contrat.class.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		if (getDolGlobalString('CONTRACT_ADDON')) {
324 324
 			$mybool = false;
325 325
 
326
-			$file = getDolGlobalString('CONTRACT_ADDON') . ".php";
326
+			$file = getDolGlobalString('CONTRACT_ADDON').".php";
327 327
 			$classname = getDolGlobalString('CONTRACT_ADDON');
328 328
 
329 329
 			// Include file with class
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 			if ($contratline->statut != ContratLigne::STATUS_OPEN) {
434 434
 				$contratline->context = $this->context;
435 435
 
436
-				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment);	// This call trigger LINECONTRACT_ACTIVATE
436
+				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE
437 437
 				if ($result < 0) {
438 438
 					$error++;
439 439
 					$this->error = $contratline->error;
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 			// Close lines not already closed
484 484
 			if ($contratline->statut != ContratLigne::STATUS_CLOSED) {
485 485
 				$contratline->date_end_real = $now;
486
-				$contratline->date_cloture = $now;	// For backward compatibility
486
+				$contratline->date_cloture = $now; // For backward compatibility
487 487
 				$contratline->user_closing_id = $user->id;
488 488
 				$contratline->statut = ContratLigne::STATUS_CLOSED;
489 489
 
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 			if (!$error) {
624 624
 				$this->ref = $num;
625 625
 				$this->status = self::STATUS_VALIDATED;
626
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
626
+				$this->statut = self::STATUS_VALIDATED; // deprecated
627 627
 				$this->date_validation = $now;
628 628
 			}
629 629
 		} else {
@@ -897,10 +897,10 @@  discard block
 block discarded – undo
897 897
 				$line->localtax2_tx		= $objp->localtax2_tx;
898 898
 				$line->localtax1_type	= $objp->localtax1_type;
899 899
 				$line->localtax2_type	= $objp->localtax2_type;
900
-				$line->subprice			= $objp->subprice;
900
+				$line->subprice = $objp->subprice;
901 901
 				$line->statut = $objp->status;
902 902
 				$line->status = $objp->status;
903
-				$line->remise_percent	= $objp->remise_percent;
903
+				$line->remise_percent = $objp->remise_percent;
904 904
 				$line->price_ht			= $objp->price_ht;
905 905
 				$line->price = $objp->price_ht; // For backward compatibility
906 906
 				$line->total_ht			= $objp->total_ht;
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
 				//$line->date_fin_prevue   = $this->db->jdate($objp->date_fin_validite);
944 944
 				//$line->date_fin_reel     = $this->db->jdate($objp->date_cloture);
945 945
 
946
-				$line->rang     = $objp->rang;
946
+				$line->rang = $objp->rang;
947 947
 
948 948
 				// Retrieve all extrafields for contract line
949 949
 				// fetch optionals attributes and labels
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
 		}
1423 1423
 
1424 1424
 		if (!$error) {
1425
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
1425
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
1426 1426
 			if ($result < 0) {
1427 1427
 				$error++;
1428 1428
 			}
@@ -2065,7 +2065,7 @@  discard block
 block discarded – undo
2065 2065
 				}
2066 2066
 				$datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
2067 2067
 			}
2068
-			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer;
2068
+			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_customer;
2069 2069
 			if (!$nofetch) {
2070 2070
 				$langs->load('project');
2071 2071
 				if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) {
@@ -2489,7 +2489,7 @@  discard block
 block discarded – undo
2489 2489
 		$this->note_public = 'This is a comment (public)';
2490 2490
 		$this->fk_project = 0;
2491 2491
 		// Lines
2492
-		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
2492
+		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
2493 2493
 		$xnbp = 0;
2494 2494
 		while ($xnbp < $nbp) {
2495 2495
 			$line = new ContratLigne($this->db);
@@ -2535,7 +2535,7 @@  discard block
 block discarded – undo
2535 2535
 		global $user;
2536 2536
 
2537 2537
 		$ticket = new Ticket($this->db);
2538
-		$nbTicket =  $ticket->fetchAll($user, 'ASC', 't.datec', 0, 0, 0, array('t.fk_contract' => $this->id));
2538
+		$nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', 0, 0, 0, array('t.fk_contract' => $this->id));
2539 2539
 
2540 2540
 		return ($nbTicket < 0 ? $nbTicket : $ticket->lines);
2541 2541
 	}
@@ -2557,7 +2557,7 @@  discard block
 block discarded – undo
2557 2557
 		global $conf, $langs;
2558 2558
 
2559 2559
 		if (!dol_strlen($modele)) {
2560
-			$modele = '';	// No doc template/generation by default
2560
+			$modele = ''; // No doc template/generation by default
2561 2561
 
2562 2562
 			if (!empty($this->model_pdf)) {
2563 2563
 				$modele = $this->model_pdf;
@@ -2654,14 +2654,14 @@  discard block
 block discarded – undo
2654 2654
 			}
2655 2655
 		}
2656 2656
 
2657
-		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').".php")) {
2657
+		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').".php")) {
2658 2658
 			$this->error = 'ErrorSetupNotComplete';
2659 2659
 			dol_syslog($this->error);
2660 2660
 			return -1;
2661 2661
 		}
2662 2662
 
2663 2663
 		// Set ref
2664
-		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').'.php';
2664
+		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').'.php';
2665 2665
 		$obj = getDolGlobalString('CONTRACT_ADDON');
2666 2666
 		$modContract = new $obj();
2667 2667
 		'@phan-var-force ModelNumRefContracts $modContract';
@@ -2784,7 +2784,7 @@  discard block
 block discarded – undo
2784 2784
 
2785 2785
 					// Load contract
2786 2786
 					$object = new Contrat($this->db);
2787
-					$object->fetch($obj->rowid);		// fetch also lines
2787
+					$object->fetch($obj->rowid); // fetch also lines
2788 2788
 					//$object->fetch_thirdparty();
2789 2789
 
2790 2790
 					if ($object->id <= 0) {
@@ -2831,7 +2831,7 @@  discard block
 block discarded – undo
2831 2831
 					if ($expirationdate && $expirationdate < $enddatetoscan) {
2832 2832
 						dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate);
2833 2833
 						$newdate = $expirationdate;
2834
-						$protecti = 0;	// $protecti is to avoid infinite loop
2834
+						$protecti = 0; // $protecti is to avoid infinite loop
2835 2835
 						while ($newdate < $enddatetoscan && $protecti < 1000) {
2836 2836
 							$newdate = dol_time_plus_duree($newdate, (int) $duration_value, $duration_unit);
2837 2837
 							$protecti++;
@@ -2859,20 +2859,20 @@  discard block
 block discarded – undo
2859 2859
 
2860 2860
 								// Create an event
2861 2861
 								$actioncomm = new ActionComm($this->db);
2862
-								$actioncomm->type_code    = 'AC_OTH_AUTO';		// Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2862
+								$actioncomm->type_code    = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2863 2863
 								$actioncomm->code         = 'AC_'.$actioncode;
2864 2864
 								$actioncomm->label        = $label;
2865 2865
 								$actioncomm->datep        = $now;
2866 2866
 								$actioncomm->datef        = $now;
2867
-								$actioncomm->percentage   = -1;   // Not applicable
2867
+								$actioncomm->percentage   = -1; // Not applicable
2868 2868
 								$actioncomm->socid        = $object->socid;
2869
-								$actioncomm->authorid     = $user->id;   // User saving action
2870
-								$actioncomm->userownerid  = $user->id;	// Owner of action
2869
+								$actioncomm->authorid     = $user->id; // User saving action
2870
+								$actioncomm->userownerid  = $user->id; // Owner of action
2871 2871
 								$actioncomm->fk_element   = $object->id;
2872 2872
 								$actioncomm->elementtype  = 'contract';
2873 2873
 								$actioncomm->note_private = $comment;
2874 2874
 
2875
-								$ret = $actioncomm->create($user);       // User creating action
2875
+								$ret = $actioncomm->create($user); // User creating action
2876 2876
 							} else {
2877 2877
 								$contracterror[$object->id] = $object->ref;
2878 2878
 
@@ -2881,7 +2881,7 @@  discard block
 block discarded – undo
2881 2881
 								$this->error = $this->db->lasterror();
2882 2882
 							}
2883 2883
 
2884
-							if (! $errorforlocaltransaction) {
2884
+							if (!$errorforlocaltransaction) {
2885 2885
 								$this->db->commit();
2886 2886
 							} else {
2887 2887
 								$this->db->rollback();
Please login to merge, or discard this patch.
htdocs/eventorganization/class/conferenceorboothattendee.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 		if (isset($conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE)
266 266
 			&& getDolGlobalString('EVENTORGANIZATION_FILTERATTENDEES_TYPE') !== ''
267 267
 			&& getDolGlobalString('EVENTORGANIZATION_FILTERATTENDEES_TYPE') !== '-1') {
268
-			$this->fields['fk_soc']['type'] .= ' AND (client:=:'.((int) getDolGlobalInt('EVENTORGANIZATION_FILTERATTENDEES_TYPE', 0) . ')');
268
+			$this->fields['fk_soc']['type'] .= ' AND (client:=:'.((int) getDolGlobalInt('EVENTORGANIZATION_FILTERATTENDEES_TYPE', 0).')');
269 269
 		}
270 270
 
271 271
 		// Example to show how to set values of fields definition dynamically
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
 		if (getDolGlobalString('EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_ADDON')) {
1042 1042
 			$mybool = false;
1043 1043
 
1044
-			$file = getDolGlobalString('EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_ADDON') . ".php";
1044
+			$file = getDolGlobalString('EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_ADDON').".php";
1045 1045
 			$classname = getDolGlobalString('EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_ADDON');
1046 1046
 
1047 1047
 			// Include file with class
Please login to merge, or discard this patch.
htdocs/don/class/don.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
 		}
975 975
 		$result .= $linkend;
976 976
 		global $action;
977
-		$hookmanager->initHooks(array($this->element . 'dao'));
977
+		$hookmanager->initHooks(array($this->element.'dao'));
978 978
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
979 979
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
980 980
 		if ($reshook > 0) {
@@ -1185,7 +1185,7 @@  discard block
 block discarded – undo
1185 1185
 		$return .= img_picto('', $this->picto);
1186 1186
 		$return .= '</span>';
1187 1187
 		$return .= '<div class="info-box-content">';
1188
-		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl(1) . '</span>';
1188
+		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl(1).'</span>';
1189 1189
 		if ($selected >= 0) {
1190 1190
 			$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
1191 1191
 		}
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -477,11 +477,11 @@  discard block
 block discarded – undo
477 477
 	 *
478 478
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
479 479
 	 */
480
-	private $cond_reglement;  // Private to call DolDeprecationHandler
480
+	private $cond_reglement; // Private to call DolDeprecationHandler
481 481
 	/**
482 482
 	 * @var int|string Internal to detect deprecated access
483 483
 	 */
484
-	protected $depr_cond_reglement;  // Internal value for deprecation
484
+	protected $depr_cond_reglement; // Internal value for deprecation
485 485
 
486 486
 	/**
487 487
 	 * @var int 		Delivery address ID
@@ -538,12 +538,12 @@  discard block
 block discarded – undo
538 538
 	/**
539 539
 	 * @var float|string Multicurrency total localtax1
540 540
 	 */
541
-	public $multicurrency_total_localtax1;	// not in database
541
+	public $multicurrency_total_localtax1; // not in database
542 542
 
543 543
 	/**
544 544
 	 * @var float|string Multicurrency total localtax2
545 545
 	 */
546
-	public $multicurrency_total_localtax2;	// not in database
546
+	public $multicurrency_total_localtax2; // not in database
547 547
 
548 548
 	/**
549 549
 	 * @var ?string
@@ -1028,17 +1028,17 @@  discard block
 block discarded – undo
1028 1028
 				}
1029 1029
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1030 1030
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1031
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1031
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1032 1032
 				} else {
1033
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1034
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1033
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1034
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1035 1035
 					$count++;
1036 1036
 				}
1037 1037
 			}
1038 1038
 			$data['closedivextra'] = '</div>';
1039 1039
 		}
1040 1040
 
1041
-		$hookmanager->initHooks(array($this->element . 'dao'));
1041
+		$hookmanager->initHooks(array($this->element.'dao'));
1042 1042
 		$parameters = array(
1043 1043
 			'tooltipcontentarray' => &$data,
1044 1044
 			'params' => $params,
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
 			$sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")";
1539 1539
 		}
1540 1540
 		if ($status >= 0) {
1541
-			$sql .= " AND t.statut = ".((int) $status);	// t is llx_user or llx_socpeople
1541
+			$sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople
1542 1542
 		}
1543 1543
 		if ($statusoflink >= 0) {
1544 1544
 			$sql .= " AND ec.statut = ".((int) $statusoflink);
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
 		}
1923 1923
 
1924 1924
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1925
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1925
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1926 1926
 		$sql .= " LIMIT 1";
1927 1927
 
1928 1928
 		$query = $this->db->query($sql);
@@ -2241,9 +2241,9 @@  discard block
 block discarded – undo
2241 2241
 
2242 2242
 		$oldvalue = null;
2243 2243
 		if ($trigkey) {
2244
-			$sql = "SELECT " . $field;
2245
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2246
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2244
+			$sql = "SELECT ".$field;
2245
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2246
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2247 2247
 
2248 2248
 			$resql = $this->db->query($sql);
2249 2249
 			if ($resql) {
@@ -2623,7 +2623,7 @@  discard block
 block discarded – undo
2623 2623
 		// Triggers
2624 2624
 		if (!$error && !$notrigger) {
2625 2625
 			// Call triggers
2626
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2626
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2627 2627
 			if ($result < 0) {
2628 2628
 				$error++;
2629 2629
 			} //Do also here what you must do to rollback action if trigger fail
@@ -3001,7 +3001,7 @@  discard block
 block discarded – undo
3001 3001
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
3002 3002
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
3003 3003
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
3004
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
3004
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
3005 3005
 			}
3006 3006
 			$sql .= ' WHERE rowid='.((int) $this->id);
3007 3007
 
@@ -3349,10 +3349,10 @@  discard block
 block discarded – undo
3349 3349
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3350 3350
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3351 3351
 		if (!$renum) {
3352
-			$sql .= " AND " . $fieldposition . " = 0";
3352
+			$sql .= " AND ".$fieldposition." = 0";
3353 3353
 		}
3354 3354
 		if ($renum) {
3355
-			$sql .= " AND " . $fieldposition . " <> 0";
3355
+			$sql .= " AND ".$fieldposition." <> 0";
3356 3356
 		}
3357 3357
 
3358 3358
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3373,7 +3373,7 @@  discard block
 block discarded – undo
3373 3373
 			if ($fk_parent_line) {
3374 3374
 				$sql .= ' AND fk_parent_line IS NULL';
3375 3375
 			}
3376
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3376
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3377 3377
 
3378 3378
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3379 3379
 			$resql = $this->db->query($sql);
@@ -3425,7 +3425,7 @@  discard block
 block discarded – undo
3425 3425
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3426 3426
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3427 3427
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3428
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3428
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3429 3429
 
3430 3430
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3431 3431
 
@@ -3549,7 +3549,7 @@  discard block
 block discarded – undo
3549 3549
 
3550 3550
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3551 3551
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3552
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3552
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3553 3553
 			if ($this->db->query($sql)) {
3554 3554
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3555 3555
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3580,7 +3580,7 @@  discard block
 block discarded – undo
3580 3580
 
3581 3581
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3582 3582
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3583
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3583
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3584 3584
 			if ($this->db->query($sql)) {
3585 3585
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3586 3586
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3606,7 +3606,7 @@  discard block
 block discarded – undo
3606 3606
 			$fieldposition = 'position';
3607 3607
 		}
3608 3608
 
3609
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3609
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3610 3610
 		$sql .= " WHERE rowid = ".((int) $rowid);
3611 3611
 
3612 3612
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3634,7 +3634,7 @@  discard block
 block discarded – undo
3634 3634
 
3635 3635
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3636 3636
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3637
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3637
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3638 3638
 		$resql = $this->db->query($sql);
3639 3639
 		if ($resql) {
3640 3640
 			$row = $this->db->fetch_row($resql);
@@ -3753,7 +3753,7 @@  discard block
 block discarded – undo
3753 3753
 			$newsuffix = '';
3754 3754
 		}
3755 3755
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3756
-			$fieldusermod =  "fk_user_mod";
3756
+			$fieldusermod = "fk_user_mod";
3757 3757
 		} elseif ($this->table_element == 'ecm_files') {
3758 3758
 			$fieldusermod = "fk_user_m";
3759 3759
 		} else {
@@ -3795,7 +3795,7 @@  discard block
 block discarded – undo
3795 3795
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3796 3796
 						break;
3797 3797
 					default:
3798
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3798
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3799 3799
 				}
3800 3800
 				$ret = $this->call_trigger($trigger_name, $user);
3801 3801
 				if ($ret < 0) {
@@ -4093,7 +4093,7 @@  discard block
 block discarded – undo
4093 4093
 			// Situations totals
4094 4094
 			if (!empty($this->situation_cycle_ref) && !empty($this->situation_counter) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) {  // @phan-suppress-current-line PhanUndeclaredProperty
4095 4095
 				'@phan-var-force Facture $this';
4096
-				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';  // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4096
+				include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded
4097 4097
 				if ($this->type != Facture::TYPE_CREDIT_NOTE) {	// @phpstan-ignore-line
4098 4098
 					if (getDolGlobalInt('INVOICE_USE_SITUATION') != 2) {
4099 4099
 						$prev_sits = $this->get_prev_sits();
@@ -4215,19 +4215,19 @@  discard block
 block discarded – undo
4215 4215
 		$this->db->begin();
4216 4216
 		$error = 0;
4217 4217
 
4218
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4218
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4219 4219
 		$sql .= "fk_source";
4220 4220
 		$sql .= ", sourcetype";
4221 4221
 		$sql .= ", fk_target";
4222 4222
 		$sql .= ", targettype";
4223 4223
 		$sql .= ") VALUES (";
4224 4224
 		$sql .= ((int) $origin_id);
4225
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4226
-		$sql .= ", " . ((int) $this->id);
4227
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4225
+		$sql .= ", '".$this->db->escape($origin)."'";
4226
+		$sql .= ", ".((int) $this->id);
4227
+		$sql .= ", '".$this->db->escape($targettype)."'";
4228 4228
 		$sql .= ")";
4229 4229
 
4230
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4230
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4231 4231
 		if ($this->db->query($sql)) {
4232 4232
 			if (!$notrigger) {
4233 4233
 				// Call trigger
@@ -4480,20 +4480,20 @@  discard block
 block discarded – undo
4480 4480
 		$this->db->begin();
4481 4481
 		$error = 0;
4482 4482
 
4483
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4483
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4484 4484
 		if ($updatesource) {
4485
-			$sql .= "fk_source = " . ((int) $sourceid);
4486
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4487
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4488
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4485
+			$sql .= "fk_source = ".((int) $sourceid);
4486
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4487
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4488
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4489 4489
 		} elseif ($updatetarget) {
4490
-			$sql .= "fk_target = " . ((int) $targetid);
4491
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4492
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4493
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4490
+			$sql .= "fk_target = ".((int) $targetid);
4491
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4492
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4493
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4494 4494
 		}
4495 4495
 
4496
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4496
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4497 4497
 		if ($this->db->query($sql)) {
4498 4498
 			if (!$notrigger) {
4499 4499
 				// Call trigger
@@ -4569,25 +4569,25 @@  discard block
 block discarded – undo
4569 4569
 		}
4570 4570
 
4571 4571
 		if (!$error) {
4572
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4572
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4573 4573
 			$sql .= " WHERE";
4574 4574
 			if ($rowid > 0) {
4575
-				$sql .= " rowid = " . ((int) $rowid);
4575
+				$sql .= " rowid = ".((int) $rowid);
4576 4576
 			} else {
4577 4577
 				if ($deletesource) {
4578
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4579
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4578
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4579
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4580 4580
 				} elseif ($deletetarget) {
4581
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4582
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4581
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4582
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4583 4583
 				} else {
4584
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4584
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4585 4585
 					$sql .= " OR";
4586
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4586
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4587 4587
 				}
4588 4588
 			}
4589 4589
 
4590
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4590
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4591 4591
 			if (!$this->db->query($sql)) {
4592 4592
 				$this->error = $this->db->lasterror();
4593 4593
 				$this->errors[] = $this->error;
@@ -4752,14 +4752,14 @@  discard block
 block discarded – undo
4752 4752
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4753 4753
 		}
4754 4754
 		$sql .= " WHERE rowid = ".((int) $elementId);
4755
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4755
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4756 4756
 
4757 4757
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4758 4758
 		$resql = $this->db->query($sql);
4759 4759
 		if ($resql) {
4760 4760
 			$error = 0;
4761 4761
 
4762
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4762
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4763 4763
 
4764 4764
 			if ($nb_rows_affected > 0) {
4765 4765
 				if (empty($trigkey)) {
@@ -4806,7 +4806,7 @@  discard block
 block discarded – undo
4806 4806
 					if ($fieldstatus == 'tosell') {
4807 4807
 						$this->status = $status;
4808 4808
 					} elseif ($fieldstatus == 'tobuy') {
4809
-						$this->status_buy = $status;	// @phpstan-ignore-line
4809
+						$this->status_buy = $status; // @phpstan-ignore-line
4810 4810
 					} else {
4811 4811
 						$this->status = $status;
4812 4812
 					}
@@ -4914,7 +4914,7 @@  discard block
 block discarded – undo
4914 4914
 			return -1;
4915 4915
 		}
4916 4916
 
4917
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4917
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4918 4918
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4919 4919
 		$tmparray = array_keys($this->childtables);
4920 4920
 		if (is_numeric($tmparray[0])) {
@@ -6008,7 +6008,7 @@  discard block
 block discarded – undo
6008 6008
 			$setsharekey = false;
6009 6009
 			if ($this->element == 'propal' || $this->element == 'proposal') {
6010 6010
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
6011
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
6011
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
6012 6012
 				}
6013 6013
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
6014 6014
 					$setsharekey = true;
@@ -6068,7 +6068,7 @@  discard block
 block discarded – undo
6068 6068
 				$ecmfile->gen_or_uploaded = 'generated';
6069 6069
 				$ecmfile->description = ''; // indexed content
6070 6070
 				$ecmfile->keywords = ''; // keyword content
6071
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
6071
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
6072 6072
 				$ecmfile->src_object_id   = $this->id;
6073 6073
 
6074 6074
 				$result = $ecmfile->create($user);
@@ -6120,7 +6120,7 @@  discard block
 block discarded – undo
6120 6120
 			$maxwidthmini = $tmparraysize['maxwidthmini'];
6121 6121
 			$maxheightmini = $tmparraysize['maxheightmini'];
6122 6122
 			//$quality = $tmparraysize['quality'];
6123
-			$quality = 50;	// For thumbs, we force quality to 50
6123
+			$quality = 50; // For thumbs, we force quality to 50
6124 6124
 
6125 6125
 			// Create small thumbs for company (Ratio is near 16/9)
6126 6126
 			// Used on logon for example
@@ -6220,8 +6220,8 @@  discard block
 block discarded – undo
6220 6220
 		// phpcs:enable
6221 6221
 		global $langs, $conf;
6222 6222
 
6223
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6224
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6223
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6224
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6225 6225
 			exit;
6226 6226
 		}
6227 6227
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6413,7 +6413,7 @@  discard block
 block discarded – undo
6413 6413
 		$savDisableCompute = $conf->disable_compute;
6414 6414
 		$conf->disable_compute = 1;
6415 6415
 
6416
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6416
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6417 6417
 
6418 6418
 		$conf->disable_compute = $savDisableCompute;
6419 6419
 
@@ -6475,7 +6475,7 @@  discard block
 block discarded – undo
6475 6475
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6476 6476
 			$sql = "SELECT rowid";
6477 6477
 			foreach ($optionsArray as $name => $label) {
6478
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6478
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6479 6479
 					$sql .= ", ".$name;
6480 6480
 				}
6481 6481
 				// use geo sql fonction to read as text
@@ -6528,7 +6528,7 @@  discard block
 block discarded – undo
6528 6528
 					 **/
6529 6529
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6530 6530
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6531
-							$this->array_options['options_' . $key] = null;
6531
+							$this->array_options['options_'.$key] = null;
6532 6532
 						}
6533 6533
 					}
6534 6534
 				}
@@ -6540,9 +6540,9 @@  discard block
 block discarded – undo
6540 6540
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6541 6541
 							//var_dump($conf->disable_compute);
6542 6542
 							if (empty($conf->disable_compute)) {
6543
-								global $objectoffield;        // We set a global variable to $objectoffield so
6544
-								$objectoffield = $this;        // we can use it inside computed formula
6545
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6543
+								global $objectoffield; // We set a global variable to $objectoffield so
6544
+								$objectoffield = $this; // we can use it inside computed formula
6545
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6546 6546
 							}
6547 6547
 						}
6548 6548
 					}
@@ -6723,7 +6723,7 @@  discard block
 block discarded – undo
6723 6723
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6724 6724
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6725 6725
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6726
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6726
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6727 6727
 											} else {
6728 6728
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6729 6729
 											}
@@ -6734,7 +6734,7 @@  discard block
 block discarded – undo
6734 6734
 										// If value has changed
6735 6735
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6736 6736
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6737
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6737
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6738 6738
 											} else {
6739 6739
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6740 6740
 											}
@@ -6746,7 +6746,7 @@  discard block
 block discarded – undo
6746 6746
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6747 6747
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6748 6748
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6749
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6749
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6750 6750
 									} else {
6751 6751
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6752 6752
 									}
@@ -7196,7 +7196,7 @@  discard block
 block discarded – undo
7196 7196
 								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.
7197 7197
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7198 7198
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7199
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7199
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7200 7200
 										} else {
7201 7201
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7202 7202
 										}
@@ -7216,7 +7216,7 @@  discard block
 block discarded – undo
7216 7216
 								}
7217 7217
 							} else {
7218 7218
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7219
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7219
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7220 7220
 								} else {
7221 7221
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7222 7222
 								}
@@ -7620,7 +7620,7 @@  discard block
 block discarded – undo
7620 7620
 		} elseif (in_array($type, array('real'))) {
7621 7621
 			$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
7622 7622
 		} elseif (preg_match('/varchar/', (string) $type)) {
7623
-			$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'"'.($size > 0 ? ' maxlength="'.$size.'"' : '').' value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($placeholder?' placeholder="'.dolPrintHTMLForAttribute($placeholder).'"':'').($autofocusoncreate ? ' autofocus' : '').'>';
7623
+			$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'"'.($size > 0 ? ' maxlength="'.$size.'"' : '').' value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($placeholder ? ' placeholder="'.dolPrintHTMLForAttribute($placeholder).'"' : '').($autofocusoncreate ? ' autofocus' : '').'>';
7624 7624
 		} elseif (in_array($type, array('email', 'mail', 'phone', 'url', 'ip'))) {
7625 7625
 			$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
7626 7626
 		} elseif (preg_match('/^text/', (string) $type)) {
@@ -7804,7 +7804,7 @@  discard block
 block discarded – undo
7804 7804
 				// 7 : sort field
7805 7805
 
7806 7806
 				// If there is filter
7807
-				if (! empty($InfoFieldList[4])) {
7807
+				if (!empty($InfoFieldList[4])) {
7808 7808
 					$pos = 0;
7809 7809
 					$parenthesisopen = 0;
7810 7810
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7868,8 +7868,8 @@  discard block
 block discarded – undo
7868 7868
 					}
7869 7869
 
7870 7870
 					$sqlwhere = '';
7871
-					$sql = "SELECT " . $keyList;
7872
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7871
+					$sql = "SELECT ".$keyList;
7872
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7873 7873
 
7874 7874
 					if (!empty($InfoFieldList[4])) {
7875 7875
 						// can use SELECT request
@@ -7887,11 +7887,11 @@  discard block
 block discarded – undo
7887 7887
 						// We have to join on extrafield table
7888 7888
 						$errstr = '';
7889 7889
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7890
-							$sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra";
7891
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
7892
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7890
+							$sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra";
7891
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
7892
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7893 7893
 						} else {
7894
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7894
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7895 7895
 						}
7896 7896
 					} else {
7897 7897
 						$sqlwhere .= ' WHERE 1=1';
@@ -7912,7 +7912,7 @@  discard block
 block discarded – undo
7912 7912
 
7913 7913
 					// Some tables may have field, some other not. For the moment we disable it.
7914 7914
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7915
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7915
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7916 7916
 					}
7917 7917
 					$sql .= $sqlwhere;
7918 7918
 
@@ -7923,7 +7923,7 @@  discard block
 block discarded – undo
7923 7923
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7924 7924
 					}
7925 7925
 
7926
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7926
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7927 7927
 					$resql = $this->db->query($sql);
7928 7928
 					if ($resql) {
7929 7929
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7939,7 +7939,7 @@  discard block
 block discarded – undo
7939 7939
 							if (count($fields_label) > 1) {
7940 7940
 								$notrans = true;
7941 7941
 								foreach ($fields_label as $field_toshow) {
7942
-									$labeltoshow .= $obj->$field_toshow . ' ';
7942
+									$labeltoshow .= $obj->$field_toshow.' ';
7943 7943
 								}
7944 7944
 							} else {
7945 7945
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7950,12 +7950,12 @@  discard block
 block discarded – undo
7950 7950
 								foreach ($fields_label as $field_toshow) {
7951 7951
 									$translabel = $langs->trans($obj->$field_toshow);
7952 7952
 									if ($translabel != $obj->$field_toshow) {
7953
-										$labeltoshow = dol_trunc($translabel) . ' ';
7953
+										$labeltoshow = dol_trunc($translabel).' ';
7954 7954
 									} else {
7955
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7955
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7956 7956
 									}
7957 7957
 								}
7958
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7958
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7959 7959
 							} else {
7960 7960
 								if (!$notrans) {
7961 7961
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7969,34 +7969,34 @@  discard block
 block discarded – undo
7969 7969
 									$labeltoshow = '(not defined)';
7970 7970
 								}
7971 7971
 								if ($value == $obj->rowid) {
7972
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7972
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7973 7973
 								}
7974 7974
 
7975 7975
 								if (!empty($InfoFieldList[3]) && $parentField) {
7976
-									$parent = $parentName . ':' . $obj->{$parentField};
7976
+									$parent = $parentName.':'.$obj->{$parentField};
7977 7977
 									$isDependList = 1;
7978 7978
 								}
7979 7979
 
7980
-								$out .= '<option value="' . $obj->rowid . '"';
7980
+								$out .= '<option value="'.$obj->rowid.'"';
7981 7981
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7982
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7983
-								$out .= '>' . $labeltoshow . '</option>';
7982
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7983
+								$out .= '>'.$labeltoshow.'</option>';
7984 7984
 							}
7985 7985
 
7986 7986
 							$i++;
7987 7987
 						}
7988 7988
 						$this->db->free($resql);
7989 7989
 					} else {
7990
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7990
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7991 7991
 					}
7992 7992
 				} else {
7993 7993
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7994 7994
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7995 7995
 					$out .= '<option value="0">&nbsp;</option>';
7996 7996
 					foreach ($data as $data_key => $data_value) {
7997
-						$out .= '<option value="' . $data_key . '"';
7997
+						$out .= '<option value="'.$data_key.'"';
7998 7998
 						$out .= ($value == $data_key ? ' selected' : '');
7999
-						$out .= '>' . $data_value . '</option>';
7999
+						$out .= '>'.$data_value.'</option>';
8000 8000
 					}
8001 8001
 				}
8002 8002
 			}
@@ -8036,7 +8036,7 @@  discard block
 block discarded – undo
8036 8036
 				// 7 : sort field
8037 8037
 
8038 8038
 				// If there is a filter
8039
-				if (! empty($InfoFieldList[4])) {
8039
+				if (!empty($InfoFieldList[4])) {
8040 8040
 					$pos = 0;
8041 8041
 					$parenthesisopen = 0;
8042 8042
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -8102,8 +8102,8 @@  discard block
 block discarded – undo
8102 8102
 					}
8103 8103
 
8104 8104
 					$sqlwhere = '';
8105
-					$sql = "SELECT " . $keyList;
8106
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
8105
+					$sql = "SELECT ".$keyList;
8106
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
8107 8107
 
8108 8108
 					if (!empty($InfoFieldList[4])) {
8109 8109
 						// can use SELECT request
@@ -8121,11 +8121,11 @@  discard block
 block discarded – undo
8121 8121
 						// We have to join on extrafield table
8122 8122
 						$errstr = '';
8123 8123
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
8124
-							$sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra';
8125
-							$sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]);
8126
-							$sqlwhere .= " AND " . $InfoFieldList[4];
8124
+							$sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra';
8125
+							$sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]);
8126
+							$sqlwhere .= " AND ".$InfoFieldList[4];
8127 8127
 						} else {
8128
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
8128
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
8129 8129
 						}
8130 8130
 					} else {
8131 8131
 						$sqlwhere .= ' WHERE 1=1';
@@ -8146,14 +8146,14 @@  discard block
 block discarded – undo
8146 8146
 
8147 8147
 					// Some tables may have field, some other not. For the moment we disable it.
8148 8148
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
8149
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
8149
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
8150 8150
 					}
8151 8151
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
8152 8152
 					// print $sql;
8153 8153
 
8154 8154
 					$sql .= $sqlwhere;
8155 8155
 
8156
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
8156
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
8157 8157
 
8158 8158
 					$resql = $this->db->query($sql);
8159 8159
 					if ($resql) {
@@ -8172,7 +8172,7 @@  discard block
 block discarded – undo
8172 8172
 							if (count($fields_label) > 1) {
8173 8173
 								$notrans = true;
8174 8174
 								foreach ($fields_label as $field_toshow) {
8175
-									$labeltoshow .= $obj->$field_toshow . ' ';
8175
+									$labeltoshow .= $obj->$field_toshow.' ';
8176 8176
 								}
8177 8177
 							} else {
8178 8178
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -8183,9 +8183,9 @@  discard block
 block discarded – undo
8183 8183
 								foreach ($fields_label as $field_toshow) {
8184 8184
 									$translabel = $langs->trans($obj->$field_toshow);
8185 8185
 									if ($translabel != $obj->$field_toshow) {
8186
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
8186
+										$labeltoshow = dol_trunc($translabel, 18).' ';
8187 8187
 									} else {
8188
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
8188
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
8189 8189
 									}
8190 8190
 								}
8191 8191
 
@@ -8208,7 +8208,7 @@  discard block
 block discarded – undo
8208 8208
 								}
8209 8209
 
8210 8210
 								if (!empty($InfoFieldList[3]) && $parentField) {
8211
-									$parent = $parentName . ':' . $obj->{$parentField};
8211
+									$parent = $parentName.':'.$obj->{$parentField};
8212 8212
 									$isDependList = 1;
8213 8213
 								}
8214 8214
 
@@ -8219,14 +8219,14 @@  discard block
 block discarded – undo
8219 8219
 						}
8220 8220
 						$this->db->free($resql);
8221 8221
 
8222
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8222
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8223 8223
 					} else {
8224
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
8224
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
8225 8225
 					}
8226 8226
 				} else {
8227 8227
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8228 8228
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[(int) $InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
8229
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8229
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
8230 8230
 				}
8231 8231
 			}
8232 8232
 		} elseif ($type == 'link') {
@@ -8463,7 +8463,7 @@  discard block
 block discarded – undo
8463 8463
 			$value = $this->getLibStatut(3);
8464 8464
 		} elseif ($type == 'date') {
8465 8465
 			if (!empty($value)) {
8466
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8466
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8467 8467
 			} else {
8468 8468
 				$value = '';
8469 8469
 			}
@@ -8564,7 +8564,7 @@  discard block
 block discarded – undo
8564 8564
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8565 8565
 			if (strpos($value, "|") !== false) {
8566 8566
 				$value = $langs->trans(explode('|', $value)[0]);
8567
-			} elseif (! is_numeric($value)) {
8567
+			} elseif (!is_numeric($value)) {
8568 8568
 				$value = $langs->trans($value);
8569 8569
 			}
8570 8570
 		} elseif ($type == 'sellist') {
@@ -8626,9 +8626,9 @@  discard block
 block discarded – undo
8626 8626
 									$translabel = $langs->trans($obj->$field_toshow);
8627 8627
 								}
8628 8628
 								if ($translabel != $field_toshow) {
8629
-									$value .= dol_trunc($translabel, 18) . ' ';
8629
+									$value .= dol_trunc($translabel, 18).' ';
8630 8630
 								} else {
8631
-									$value .= $obj->$field_toshow . ' ';
8631
+									$value .= $obj->$field_toshow.' ';
8632 8632
 								}
8633 8633
 							}
8634 8634
 						} else {
@@ -8644,7 +8644,7 @@  discard block
 block discarded – undo
8644 8644
 						}
8645 8645
 					}
8646 8646
 				} else {
8647
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8647
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8648 8648
 
8649 8649
 					$toprint = array();
8650 8650
 					$obj = $this->db->fetch_object($resql);
@@ -8652,7 +8652,7 @@  discard block
 block discarded – undo
8652 8652
 					$c->fetch($obj->rowid);
8653 8653
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8654 8654
 					foreach ($ways as $way) {
8655
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8655
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8656 8656
 					}
8657 8657
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8658 8658
 				}
@@ -8668,11 +8668,11 @@  discard block
 block discarded – undo
8668 8668
 				$toprint = array();
8669 8669
 				foreach ($value_arr as $keyval => $valueval) {
8670 8670
 					if (!empty($valueval)) {
8671
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8671
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8672 8672
 					}
8673 8673
 				}
8674 8674
 				if (!empty($toprint)) {
8675
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8675
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8676 8676
 				}
8677 8677
 			}
8678 8678
 		} elseif ($type == 'chkbxlst') {
@@ -8727,9 +8727,9 @@  discard block
 block discarded – undo
8727 8727
 										$translabel = $langs->trans($obj->$field_toshow);
8728 8728
 									}
8729 8729
 									if ($translabel != $field_toshow) {
8730
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8730
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8731 8731
 									} else {
8732
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8732
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8733 8733
 									}
8734 8734
 								}
8735 8735
 							} else {
@@ -8738,15 +8738,15 @@  discard block
 block discarded – undo
8738 8738
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8739 8739
 								}
8740 8740
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8741
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8741
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8742 8742
 								} else {
8743
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8743
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8744 8744
 								}
8745 8745
 							}
8746 8746
 						}
8747 8747
 					}
8748 8748
 				} else {
8749
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8749
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8750 8750
 
8751 8751
 					$toprint = array();
8752 8752
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8755,7 +8755,7 @@  discard block
 block discarded – undo
8755 8755
 							$c->fetch($obj->rowid);
8756 8756
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8757 8757
 							foreach ($ways as $way) {
8758
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8758
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8759 8759
 							}
8760 8760
 						}
8761 8761
 					}
@@ -8925,7 +8925,7 @@  discard block
 block discarded – undo
8925 8925
 		global $langs;
8926 8926
 
8927 8927
 		if (!class_exists('Validate')) {
8928
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8928
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8929 8929
 		}
8930 8930
 
8931 8931
 		$this->clearFieldError($fieldKey);
@@ -9164,7 +9164,7 @@  discard block
 block discarded – undo
9164 9164
 				$out .= "\n";
9165 9165
 
9166 9166
 				$nbofextrafieldsshown = 0;
9167
-				$e = 0;	// var to manage the modulo (odd/even)
9167
+				$e = 0; // var to manage the modulo (odd/even)
9168 9168
 
9169 9169
 				$lastseparatorkeyfound = '';
9170 9170
 				$extrafields_collapse_num = '';
@@ -9202,9 +9202,9 @@  discard block
 block discarded – undo
9202 9202
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
9203 9203
 					} elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) {
9204 9204
 						// We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost
9205
-						$ef_name = 'options_' . $key;
9205
+						$ef_name = 'options_'.$key;
9206 9206
 						$ef_value = $this->array_options[$ef_name];
9207
-						$out .= '<input type="hidden" name="' . $ef_name . '" id="' . $ef_name . '" value="' . $ef_value . '" />' . "\n";
9207
+						$out .= '<input type="hidden" name="'.$ef_name.'" id="'.$ef_name.'" value="'.$ef_value.'" />'."\n";
9208 9208
 						continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation
9209 9209
 					} elseif ($mode == 'view' && empty($visibility)) {
9210 9210
 						continue;
@@ -10275,7 +10275,7 @@  discard block
 block discarded – undo
10275 10275
 						continue;
10276 10276
 					}
10277 10277
 				}
10278
-				$keys_with_alias[] = $alias . '.' . $fieldname;
10278
+				$keys_with_alias[] = $alias.'.'.$fieldname;
10279 10279
 			}
10280 10280
 			return implode(',', $keys_with_alias);
10281 10281
 		} else {
@@ -10410,7 +10410,7 @@  discard block
 block discarded – undo
10410 10410
 		if (!$error) {
10411 10411
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
10412 10412
 			$sql .= " (".implode(", ", $keys).')';
10413
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
10413
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
10414 10414
 
10415 10415
 			$res = $this->db->query($sql);
10416 10416
 			if (!$res) {
@@ -10713,7 +10713,7 @@  discard block
 block discarded – undo
10713 10713
 
10714 10714
 		// Update extrafield
10715 10715
 		if (!$error) {
10716
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10716
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10717 10717
 			if ($result < 0) {
10718 10718
 				$error++;
10719 10719
 			}
@@ -10915,12 +10915,12 @@  discard block
 block discarded – undo
10915 10915
 				$error++;
10916 10916
 			} else {
10917 10917
 				while ($obj = $this->db->fetch_object($resql)) {
10918
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10918
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10919 10919
 					if ($result < 0) {
10920 10920
 						$error++;
10921 10921
 						$this->errors[] = $this->error;
10922 10922
 					} else {
10923
-						$result = $this->delete($user);	// @phpstan-ignore-line
10923
+						$result = $this->delete($user); // @phpstan-ignore-line
10924 10924
 						if ($result < 0) {
10925 10925
 							$error++;
10926 10926
 							$this->errors[] = $this->error;
@@ -11086,7 +11086,7 @@  discard block
 block discarded – undo
11086 11086
 		);
11087 11087
 		foreach ($fields as $key => $value) {
11088 11088
 			if (array_key_exists($key, $this->fields)) {
11089
-				$this->{$key} = $value;		// @phpstan-ignore-line
11089
+				$this->{$key} = $value; // @phpstan-ignore-line
11090 11090
 			}
11091 11091
 		}
11092 11092
 
Please login to merge, or discard this patch.