Completed
Branch develop (4d02ec)
by
unknown
24:02
created
htdocs/salaries/card.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -307,9 +307,9 @@  discard block
 block discarded – undo
307 307
 			// Create a line of payments
308 308
 			$paiement = new PaymentSalary($db);
309 309
 			$paiement->fk_salary    = $object->id;
310
-			$paiement->chid         = $object->id;	// deprecated
310
+			$paiement->chid         = $object->id; // deprecated
311 311
 			$paiement->datep        = $datep;
312
-			$paiement->datev		= $datev;
312
+			$paiement->datev = $datev;
313 313
 			$paiement->amounts      = array($object->id => $amount); // Tableau de montant
314 314
 			$paiement->fk_typepayment = $type_payment;
315 315
 			$paiement->num_payment  = GETPOST("num_payment", 'alphanohtml');
@@ -338,10 +338,10 @@  discard block
 block discarded – undo
338 338
 
339 339
 			if (GETPOST('saveandnew', 'alpha')) {
340 340
 				setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
341
-				header("Location: card.php?action=create&fk_project=" . urlencode((string) ($projectid)) . "&accountid=" . urlencode((string) ($accountid)) . '&paymenttype=' . urlencode((string) (GETPOSTINT('paymenttype'))) . '&datepday=' . GETPOSTINT("datepday") . '&datepmonth=' . GETPOSTINT("datepmonth") . '&datepyear=' . GETPOSTINT("datepyear"));
341
+				header("Location: card.php?action=create&fk_project=".urlencode((string) ($projectid))."&accountid=".urlencode((string) ($accountid)).'&paymenttype='.urlencode((string) (GETPOSTINT('paymenttype'))).'&datepday='.GETPOSTINT("datepday").'&datepmonth='.GETPOSTINT("datepmonth").'&datepyear='.GETPOSTINT("datepyear"));
342 342
 				exit;
343 343
 			} else {
344
-				header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $object->id);
344
+				header("Location: ".$_SERVER['PHP_SELF'].'?id='.$object->id);
345 345
 				exit;
346 346
 			}
347 347
 		} else {
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 
632 632
 	// Auto create payment
633 633
 	print '<tr><td><label for="auto_create_paiement">'.$langs->trans('AutomaticCreationPayment').'</label></td>';
634
-	print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" ' . (empty($auto_create_paiement) ? '' : 'checked="checked"') . ' value="1"></td></tr>'."\n";	// Date payment
634
+	print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" '.(empty($auto_create_paiement) ? '' : 'checked="checked"').' value="1"></td></tr>'."\n"; // Date payment
635 635
 
636 636
 	// Bank
637 637
 	if (isModEnabled("bank")) {
@@ -847,10 +847,10 @@  discard block
 block discarded – undo
847 847
 			$userstatic = new User($db);
848 848
 			$result = $userstatic->fetch($object->fk_user);
849 849
 			if ($result > 0) {
850
-				$morehtmlref .= '<br>' .$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1);
850
+				$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1);
851 851
 			}
852 852
 		} else {
853
-			$morehtmlref .= '<br>' . $form->editfieldkey("Employee", 'fk_user', $object->label, $object, $permissiontoadd, 'string', '', 0, 1);
853
+			$morehtmlref .= '<br>'.$form->editfieldkey("Employee", 'fk_user', $object->label, $object, $permissiontoadd, 'string', '', 0, 1);
854 854
 
855 855
 			if (!empty($object->fk_user)) {
856 856
 				$userstatic = new User($db);
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
 		print "</td></tr>";
918 918
 	} else {
919 919
 		print "<tr>";
920
-		print '<td class="titlefieldmiddle">' . $langs->trans("DateStartPeriod") . '</td><td>';
920
+		print '<td class="titlefieldmiddle">'.$langs->trans("DateStartPeriod").'</td><td>';
921 921
 		print dol_print_date($object->datesp, 'day');
922 922
 		print '</td></tr>';
923 923
 	}
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
 		print "</td></tr>";
929 929
 	} else {
930 930
 		print "<tr>";
931
-		print '<td>' . $langs->trans("DateEndPeriod") . '</td><td>';
931
+		print '<td>'.$langs->trans("DateEndPeriod").'</td><td>';
932 932
 		print dol_print_date($object->dateep, 'day');
933 933
 		print '</td></tr>';
934 934
 	}
@@ -943,9 +943,9 @@  discard block
 block discarded – undo
943 943
 	print '</td></tr>';*/
944 944
 
945 945
 	if ($action == 'edit') {
946
-		print '<tr><td class="fieldrequired">' . $langs->trans("Amount") . '</td><td><input name="amount" size="10" value="' . price($object->amount) . '"></td></tr>';
946
+		print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.price($object->amount).'"></td></tr>';
947 947
 	} else {
948
-		print '<tr><td>' . $langs->trans("Amount") . '</td><td><span class="amount">' . price($object->amount, 0, $langs, 1, -1, -1, $conf->currency) . '</span></td></tr>';
948
+		print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span></td></tr>';
949 949
 	}
950 950
 
951 951
 	// Default mode of payment
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
 			if (empty($user->socid)) {
1132 1132
 				$canSendMail = true;
1133 1133
 
1134
-				print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', $canSendMail);
1134
+				print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', $canSendMail);
1135 1135
 			}
1136 1136
 		}
1137 1137
 
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
 
1148 1148
 		// Emit payment
1149 1149
 		if ($object->status == $object::STATUS_UNPAID && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) {
1150
-			print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/paiement_salary.php?action=create&token='.newToken().'&id='. $object->id, '');
1150
+			print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/paiement_salary.php?action=create&token='.newToken().'&id='.$object->id, '');
1151 1151
 		}
1152 1152
 
1153 1153
 		// Classify 'paid'
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
 
1159 1159
 		// Transfer request
1160 1160
 		if ($object->status == $object::STATUS_UNPAID && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) {
1161
-			print dolGetButtonAction('', $langs->trans('MakeTransferRequest'), 'default', DOL_URL_ROOT . '/salaries/virement_request.php?id=' . $object->id, '');
1161
+			print dolGetButtonAction('', $langs->trans('MakeTransferRequest'), 'default', DOL_URL_ROOT.'/salaries/virement_request.php?id='.$object->id, '');
1162 1162
 		}
1163 1163
 
1164 1164
 		// Clone
Please login to merge, or discard this patch.
htdocs/salaries/virement_request.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	print "</td></tr>";
282 282
 } else {
283 283
 	print "<tr>";
284
-	print '<td class="titlefieldmiddle">' . $langs->trans("DateStartPeriod") . '</td><td>';
284
+	print '<td class="titlefieldmiddle">'.$langs->trans("DateStartPeriod").'</td><td>';
285 285
 	print dol_print_date($object->datesp, 'day');
286 286
 	print '</td></tr>';
287 287
 }
@@ -292,14 +292,14 @@  discard block
 block discarded – undo
292 292
 	print "</td></tr>";
293 293
 } else {
294 294
 	print "<tr>";
295
-	print '<td>' . $langs->trans("DateEndPeriod") . '</td><td>';
295
+	print '<td>'.$langs->trans("DateEndPeriod").'</td><td>';
296 296
 	print dol_print_date($object->dateep, 'day');
297 297
 	print '</td></tr>';
298 298
 }
299 299
 if ($action == 'edit') {
300
-	print '<tr><td class="fieldrequired">' . $langs->trans("Amount") . '</td><td><input name="amount" size="10" value="' . price($object->amount) . '"></td></tr>';
300
+	print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.price($object->amount).'"></td></tr>';
301 301
 } else {
302
-	print '<tr><td>' . $langs->trans("Amount") . '</td><td><span class="amount">' . price($object->amount, 0, $langs, 1, -1, -1, $conf->currency) . '</span></td></tr>';
302
+	print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span></td></tr>';
303 303
 }
304 304
 
305 305
 // Default mode of payment
Please login to merge, or discard this patch.
htdocs/website/index.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	}
351 351
 }
352 352
 
353
-$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid');	// or 'none', must be same then $searchstring
353
+$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring
354 354
 
355 355
 if ($action == 'replacesite' || $mode == 'replacesite') {	// Test on permission not required
356 356
 	$containertype = GETPOST('optioncontainertype', 'aZ09') != '-1' ? GETPOST('optioncontainertype', 'aZ09') : '';
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 }
365 365
 
366 366
 $usercanedit = $user->hasRight('website', 'write');
367
-$permissiontoadd = $user->hasRight('website', 'write');	// Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
367
+$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
368 368
 $permissiontodelete = $user->hasRight('website', 'delete');
369 369
 
370 370
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 if ($sortorder) {
432 432
 	$backtopage .= '&sortorder='.urlencode($sortorder);
433 433
 }
434
-include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';	// This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file.
434
+include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file.
435 435
 
436 436
 $backtopage = $savbacktopage;
437 437
 //var_dump($backtopage);
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 
597 597
 // Replacement of string into pages
598 598
 if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
599
-	$replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid');	// or 'none', must be same then $searchstring
599
+	$replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring
600 600
 
601 601
 	$dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT);
602 602
 	$allowimportsite = true;
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
 		$objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha');
1167 1167
 		$objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml'));
1168 1168
 		$objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09') ? 1 : 0;
1169
-		$objectpage->htmlheader = GETPOST('htmlheader', 'none');	// Must accept tags like '<script>' and '<link>'
1169
+		$objectpage->htmlheader = GETPOST('htmlheader', 'none'); // Must accept tags like '<script>' and '<link>'
1170 1170
 		$objectpage->author_alias = GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml');
1171 1171
 		$objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS');
1172 1172
 		$objectpage->fk_object = GETPOST('WEBSITE_OBJECTID');
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
 		$content = '';
1200 1200
 		if (GETPOSTISSET('content')) {
1201 1201
 			//$content = GETPOST('content', 'restricthtmlallowunvalid');	// @TODO Use a restricthtmlallowunvalidwithphp
1202
-			$content = GETPOST('content', 'none');	// @TODO Use a restricthtmlallowunvalidwithphp
1202
+			$content = GETPOST('content', 'none'); // @TODO Use a restricthtmlallowunvalidwithphp
1203 1203
 
1204 1204
 			$objectpage->content = make_substitutions($content, $substitutionarray);
1205 1205
 		} else {
@@ -1572,7 +1572,7 @@  discard block
 block discarded – undo
1572 1572
 					$error++;
1573 1573
 					setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors');
1574 1574
 				}
1575
-				if (! $error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) {
1575
+				if (!$error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) {
1576 1576
 					$error++;
1577 1577
 					setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors');
1578 1578
 				}
@@ -1584,7 +1584,7 @@  discard block
 block discarded – undo
1584 1584
 				if (!GETPOSTISSET('updateandstay')) {	// If we click on "Save And Stay", we don not make the redirect
1585 1585
 					$action = 'preview';
1586 1586
 					if ($backtopage) {
1587
-						$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage);	// Clean backtopage url
1587
+						$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url
1588 1588
 						header("Location: ".$backtopage);
1589 1589
 						exit;
1590 1590
 					}
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
 			}
1609 1609
 
1610 1610
 
1611
-			$dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript'));		// Must accept tags like '<script>' and '<link>'
1611
+			$dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>'
1612 1612
 			$dataposted = preg_replace(array('/<html>\n*/ims', '/<\/html>\n*/ims'), array('', ''), $dataposted);
1613 1613
 			$dataposted = str_replace('<?=', '<?php', $dataposted);
1614 1614
 
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1618 1618
 
1619 1619
 			// Security analysis
1620
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1620
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1621 1621
 
1622 1622
 			if (!$errorphpcheck) {
1623 1623
 				$htmlheadercontent = '';
@@ -1655,7 +1655,7 @@  discard block
 block discarded – undo
1655 1655
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1656 1656
 
1657 1657
 			// Security analysis
1658
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1658
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1659 1659
 
1660 1660
 			if (!$errorphpcheck) {
1661 1661
 				$csscontent = '';
@@ -1698,7 +1698,7 @@  discard block
 block discarded – undo
1698 1698
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1699 1699
 
1700 1700
 			// Security analysis
1701
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1701
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1702 1702
 
1703 1703
 			if (!$errorphpcheck) {
1704 1704
 				$jscontent = '';
@@ -1736,7 +1736,7 @@  discard block
 block discarded – undo
1736 1736
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1737 1737
 
1738 1738
 			// Security analysis
1739
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1739
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1740 1740
 
1741 1741
 			if (!$errorphpcheck) {
1742 1742
 				$robotcontent = '';
@@ -1774,7 +1774,7 @@  discard block
 block discarded – undo
1774 1774
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1775 1775
 
1776 1776
 			// Security analysis
1777
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1777
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1778 1778
 
1779 1779
 			if (!$errorphpcheck) {
1780 1780
 				if ($dataposted) {
@@ -1802,7 +1802,7 @@  discard block
 block discarded – undo
1802 1802
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1803 1803
 
1804 1804
 			// Security analysis
1805
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1805
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1806 1806
 
1807 1807
 			if (!$errorphpcheck) {
1808 1808
 				$manifestjsoncontent = '';
@@ -1841,7 +1841,7 @@  discard block
 block discarded – undo
1841 1841
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1842 1842
 
1843 1843
 			// Security analysis
1844
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1844
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1845 1845
 
1846 1846
 			if (!$errorphpcheck) {
1847 1847
 				$readmecontent = '';
@@ -1880,7 +1880,7 @@  discard block
 block discarded – undo
1880 1880
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1881 1881
 
1882 1882
 			// Security analysis
1883
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1883
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1884 1884
 
1885 1885
 			if (!$errorphpcheck) {
1886 1886
 				$licensecontent = '';
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
 			if (!GETPOSTISSET('updateandstay')) {	// If we click on "Save And Stay", we don not make the redirect
1923 1923
 				$action = 'preview';
1924 1924
 				if ($backtopage) {
1925
-					$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage);	// Clean backtopage url
1925
+					$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url
1926 1926
 					header("Location: ".$backtopage);
1927 1927
 					exit;
1928 1928
 				}
@@ -1941,7 +1941,7 @@  discard block
 block discarded – undo
1941 1941
 
1942 1942
 	$object->fk_default_home = $pageid;
1943 1943
 	$res = $object->update($user);
1944
-	if (! ($res > 0)) {
1944
+	if (!($res > 0)) {
1945 1945
 		$error++;
1946 1946
 		setEventMessages($object->error, $object->errors, 'errors');
1947 1947
 	}
@@ -2056,7 +2056,7 @@  discard block
 block discarded – undo
2056 2056
 		$objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha');
2057 2057
 		$objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml'));
2058 2058
 		$objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09') ? 1 : 0;
2059
-		$objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript'));		// Must accept tags like '<script>' and '<link>'
2059
+		$objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>'
2060 2060
 		$objectpage->fk_page = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0);
2061 2061
 		$objectpage->author_alias = trim(GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml'));
2062 2062
 		$objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS', 'alpha');
@@ -2332,7 +2332,7 @@  discard block
 block discarded – undo
2332 2332
 
2333 2333
 			$phpfullcodestringold = dolKeepOnlyPhpCode($objectpage->content);
2334 2334
 
2335
-			$objectpage->content = GETPOST('PAGE_CONTENT', 'none');	// any HTML content allowed
2335
+			$objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed
2336 2336
 
2337 2337
 			$phpfullcodestring = dolKeepOnlyPhpCode($objectpage->content);
2338 2338
 
@@ -2553,7 +2553,7 @@  discard block
 block discarded – undo
2553 2553
 				$fileofzip = '';
2554 2554
 				if (GETPOSTISSET('templateuserfile')) {
2555 2555
 					// Case we selected one template
2556
-					$fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha');	// $fileofzip will be sanitized later into the importWebSite()
2556
+					$fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite()
2557 2557
 				} elseif (!empty($_FILES) && is_array($_FILES['userfile'])) {
2558 2558
 					// Case we upload a new template
2559 2559
 					if (is_array($_FILES['userfile']['tmp_name'])) {
@@ -2635,7 +2635,7 @@  discard block
 block discarded – undo
2635 2635
 	if ($website->virtualhost) {
2636 2636
 		$domainname = $website->virtualhost;
2637 2637
 	}
2638
-	if (! preg_match('/^http/i', $domainname)) {
2638
+	if (!preg_match('/^http/i', $domainname)) {
2639 2639
 		$domainname = 'https://'.$domainname;
2640 2640
 	}
2641 2641
 
@@ -2701,7 +2701,7 @@  discard block
 block discarded – undo
2701 2701
 				$url->appendChild($lastmod);
2702 2702
 				// Add suggested frequency for refresh
2703 2703
 				if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) {
2704
-					$changefreq = $domtree->createElement('changefreq', 'weekly');	// TODO Manage other values
2704
+					$changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values
2705 2705
 					$url->appendChild($changefreq);
2706 2706
 				}
2707 2707
 				// Add higher priority for home page
@@ -2806,7 +2806,7 @@  discard block
 block discarded – undo
2806 2806
 				$url->appendChild($lastmod);
2807 2807
 				// Add suggested frequency for refresh
2808 2808
 				if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) {
2809
-					$changefreq = $domtree->createElement('changefreq', 'weekly');	// TODO Manage other values
2809
+					$changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values
2810 2810
 					$url->appendChild($changefreq);
2811 2811
 				}
2812 2812
 
@@ -3097,11 +3097,11 @@  discard block
 block discarded – undo
3097 3097
 
3098 3098
 			// // Export web site
3099 3099
 			$extraCssClass = getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE') ? 'hideobject' : '';
3100
-			print '<input type="submit" class="button bordertransp ' . $extraCssClass . '" ' . $disabledexport . ' value="' . dol_escape_htmltag($exportlabel) . '" name="exportsite">';
3100
+			print '<input type="submit" class="button bordertransp '.$extraCssClass.'" '.$disabledexport.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">';
3101 3101
 
3102 3102
 			if (getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')) {
3103 3103
 				// Overwrite template in sources
3104
-				$overwriteGitUrl = $_SERVER["PHP_SELF"] . '?action=overwritesite&website=' . urlencode($website->ref);
3104
+				$overwriteGitUrl = $_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref);
3105 3105
 				print dolButtonToOpenExportDialog('exportpopup', $langs->trans('ExportOptions'), $langs->trans('ExportSite'), 'exportsite', $overwriteGitUrl, $website);
3106 3106
 				//print '<a href="'.$_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref).'" class="button bordertransp hideobject" title="'.dol_escape_htmltag($langs->trans("ExportIntoGIT").". Directory ".getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')).'">'.dol_escape_htmltag($langs->trans("ExportIntoGIT")).'</a>';
3107 3107
 			}
@@ -3468,7 +3468,7 @@  discard block
 block discarded – undo
3468 3468
 				print '<!-- button EditInLine and ShowSubcontainers -->'."\n";
3469 3469
 				print '<div class="websiteselectionsection inline-block">';
3470 3470
 
3471
-				print '<div class="inline-block marginrightonly">';	// Button includes dynamic content
3471
+				print '<div class="inline-block marginrightonly">'; // Button includes dynamic content
3472 3472
 				print $langs->trans("ShowSubcontainers");
3473 3473
 				if (!getDolGlobalString('WEBSITE_SUBCONTAINERSINLINE')) {
3474 3474
 					print '<a class="nobordertransp nohoverborder marginleftonlyshort valignmiddle"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', 0, 0, 0, '', 'nomarginleft').'</a>';
@@ -3477,7 +3477,7 @@  discard block
 block discarded – undo
3477 3477
 				}
3478 3478
 				print '</div>';
3479 3479
 
3480
-				print '<div class="inline-block marginrightonly">';	// Button edit inline
3480
+				print '<div class="inline-block marginrightonly">'; // Button edit inline
3481 3481
 
3482 3482
 				print '<span id="switchckeditorinline">'."\n";
3483 3483
 				// Enable CKEditor inline with js on section and div with conteneditable=true
@@ -3577,15 +3577,15 @@  discard block
 block discarded – undo
3577 3577
 													// Sending data via AJAX to update section
3578 3578
 													$.ajax({
3579 3579
 														type: \'POST\',
3580
-														url: \'' . DOL_URL_ROOT . '/core/ajax/editinline.php\',
3580
+														url: \'' . DOL_URL_ROOT.'/core/ajax/editinline.php\',
3581 3581
 														data: {
3582 3582
 															website_ref: \''.dol_escape_js($website->ref).'\',
3583
-															page_id: \'' . ((int) $websitepage->id) . '\',
3583
+															page_id: \'' . ((int) $websitepage->id).'\',
3584 3584
 															content: content,
3585 3585
 															element_id: elementId,
3586 3586
 															element_type: elementType,
3587 3587
 															action: \'updatedElementContent\',
3588
-															token: \'' . newToken() . '\'
3588
+															token: \'' . newToken().'\'
3589 3589
 														},
3590 3590
 														success: function(response) {
3591 3591
 															console.log(response);
@@ -3676,7 +3676,7 @@  discard block
 block discarded – undo
3676 3676
 				} else {
3677 3677
 					$disabled = '';
3678 3678
 					$title = '';
3679
-					$url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref);	// action=delete for webpage, deletesite for website
3679
+					$url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website
3680 3680
 				}
3681 3681
 				print '<a href="'.$url.'" class="button buttonDelete bordertransp'.($disabled ? ' disabled' : '').'"'.$disabled.' title="'.dol_escape_htmltag($title).'">'.img_picto('', 'delete', 'class=""').'<span class="hideonsmartphone paddingleft">'.$langs->trans("Delete").'</span></a>';
3682 3682
 				print '</span>';
@@ -3866,7 +3866,7 @@  discard block
 block discarded – undo
3866 3866
 		// Clean the php htmlheader file to remove php code and get only html part
3867 3867
 		$htmlheadercontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htmlheadercontent);
3868 3868
 	} else {
3869
-		$htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none');		// Must accept tags like '<script>' and '<link>'
3869
+		$htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none'); // Must accept tags like '<script>' and '<link>'
3870 3870
 	}
3871 3871
 	if (!trim($htmlheadercontent)) {
3872 3872
 		$htmlheadercontent = "<html>\n";
@@ -3897,7 +3897,7 @@  discard block
 block discarded – undo
3897 3897
 		// Clean the php htaccesscontent file to remove php code and get only html part
3898 3898
 		$htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htaccesscontent);
3899 3899
 	} else {
3900
-		$htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml');	// We must use 'nohtml' and not 'alphanohtml' because we must accept "
3900
+		$htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept "
3901 3901
 	}
3902 3902
 
3903 3903
 	if (!GETPOSTISSET('WEBSITE_MANIFEST_JSON')) {
@@ -3994,7 +3994,7 @@  discard block
 block discarded – undo
3994 3994
 	$maxfilesizearray = getMaxFileSizeArray();
3995 3995
 	$maxmin = $maxfilesizearray['maxmin'];
3996 3996
 	if ($maxmin > 0) {
3997
-		print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
3997
+		print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
3998 3998
 	}
3999 3999
 	print '<input type="file" class="flat minwidth300" name="addedfile" id="addedfile"/>';
4000 4000
 
@@ -4036,7 +4036,7 @@  discard block
 block discarded – undo
4036 4036
 	print '<tr><td class="tdtop">';
4037 4037
 	print $langs->trans('WEBSITE_HTML_HEADER');
4038 4038
 	$htmlhelp = $langs->trans("Example").' :<br>';
4039
-	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault));	// do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4039
+	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4040 4040
 	$textwithhelp = $form->textwithpicto('', $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip');
4041 4041
 	$htmlhelp2 = $langs->trans("LinkAndScriptsHereAreNotLoadedInEditor").'<br>';
4042 4042
 	print $form->textwithpicto($textwithhelp, $htmlhelp2, 1, 'warning', '', 0, 2, 'htmlheadertooltip2');
@@ -4258,7 +4258,7 @@  discard block
 block discarded – undo
4258 4258
 		$maxfilesizearray = getMaxFileSizeArray();
4259 4259
 		$maxmin = $maxfilesizearray['maxmin'];
4260 4260
 		if ($maxmin > 0) {
4261
-			print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
4261
+			print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
4262 4262
 		}
4263 4263
 		print '<input class="flat minwidth400" type="file" name="userfile[]" accept=".zip">';
4264 4264
 		print '<input type="submit" class="button small" name="buttonsubmitimportfile" value="'.dol_escape_htmltag($langs->trans("Upload")).'">';
@@ -4779,7 +4779,7 @@  discard block
 block discarded – undo
4779 4779
 	print '<tr><td class="tdhtmlheader tdtop">';
4780 4780
 	$htmlhelp = $langs->trans("EditTheWebSiteForACommonHeader").'<br><br>';
4781 4781
 	$htmlhelp .= $langs->trans("Example").' :<br>';
4782
-	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault));	// do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4782
+	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4783 4783
 	print $form->textwithpicto($langs->transnoentitiesnoconv('HtmlHeaderPage'), $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip');
4784 4784
 	print '</td><td>';
4785 4785
 	$poscursor = array('x' => GETPOST('htmlheader_x'), 'y' => GETPOST('htmlheader_y'));
@@ -4916,7 +4916,7 @@  discard block
 block discarded – undo
4916 4916
 	print '<div class="fiche"><br>';
4917 4917
 
4918 4918
 	$module = 'medias';
4919
-	$formalreadyopen = 2;	// So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php
4919
+	$formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php
4920 4920
 	if (empty($url)) {
4921 4921
 		$url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param
4922 4922
 	}
@@ -5153,8 +5153,8 @@  discard block
 block discarded – undo
5153 5153
 			print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
5154 5154
 			print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
5155 5155
 			print getTitleFieldOfList("UserCreation", 0, $_SERVER['PHP_SELF'], 'fk_user_creat', '', $param, '', $sortfield, $sortorder, '')."\n";
5156
-			print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n";		// Date creation
5157
-			print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n";		// Date last modif
5156
+			print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date creation
5157
+			print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif
5158 5158
 			print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
5159 5159
 			// Action column
5160 5160
 			if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
Please login to merge, or discard this patch.
htdocs/datapolicy/class/datapolicycron.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -489,7 +489,7 @@
 block discarded – undo
489 489
 						$object->fetch($obj->rowid);
490 490
 						$object->id = $obj->rowid;
491 491
 
492
-						$action = 'anonymize';	// TODO Offer also action "delete" in the setup of the module
492
+						$action = 'anonymize'; // TODO Offer also action "delete" in the setup of the module
493 493
 
494 494
 						// Manage action 'anonymize'
495 495
 						if ($action == 'anonymize') {
Please login to merge, or discard this patch.
htdocs/core/class/html.formprojet.class.php 1 patch
Spacing   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
 				$project->fetch($selected);
108 108
 				$selected_input_value = $project->ref;
109 109
 			}
110
-			$urloption = 'socid=' . ((int) $socid) . '&htmlname=' . urlencode($htmlname) . '&discardclosed=' . ((int) $discard_closed);
110
+			$urloption = 'socid='.((int) $socid).'&htmlname='.urlencode($htmlname).'&discardclosed='.((int) $discard_closed);
111 111
 			if ($morefilter == 'usage_organize_event=1') {
112 112
 				$urloption .= '&usage_organize_event=1';
113 113
 			}
114
-			$out .= '<input type="text" class="minwidth200' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' />';
114
+			$out .= '<input type="text" class="minwidth200'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
115 115
 
116
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array());
116
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array());
117 117
 		} else {
118 118
 			$out .= $this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, abs($discard_closed), $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss, $morefilter);
119 119
 		}
@@ -185,26 +185,26 @@  discard block
 block discarded – undo
185 185
 
186 186
 		// Search all projects
187 187
 		$sql = "SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, s.nom as name, s.name_alias";
188
-		$sql .= " FROM " . $this->db->prefix() . "projet as p LEFT JOIN " . $this->db->prefix() . "societe as s ON s.rowid = p.fk_soc";
189
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
188
+		$sql .= " FROM ".$this->db->prefix()."projet as p LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc";
189
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
190 190
 		if ($projectsListId !== false) {
191
-			$sql .= " AND p.rowid IN (" . $this->db->sanitize($projectsListId) . ")";
191
+			$sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
192 192
 		}
193 193
 		if ($socid == 0) {
194 194
 			$sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
195 195
 		}
196 196
 		if ($socid > 0) {
197 197
 			if (!getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) {
198
-				$sql .= " AND (p.fk_soc=" . ((int) $socid) . " OR p.fk_soc IS NULL)";
198
+				$sql .= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)";
199 199
 			} elseif (getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY') != 'all') {    // PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
200
-				$sql .= " AND (p.fk_soc IN (" . $this->db->sanitize(((int) $socid) . ", " . getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) . ") OR p.fk_soc IS NULL)";
200
+				$sql .= " AND (p.fk_soc IN (".$this->db->sanitize(((int) $socid).", ".getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')).") OR p.fk_soc IS NULL)";
201 201
 			}
202 202
 		}
203 203
 		if (!empty($filterkey)) {
204 204
 			$sql .= natural_search(array('p.title', 'p.ref'), $filterkey);
205 205
 		}
206 206
 		if ($morefilter) {
207
-			$sql .= ' AND (' . $this->db->sanitize($morefilter, 0, 1) . ')';
207
+			$sql .= ' AND ('.$this->db->sanitize($morefilter, 0, 1).')';
208 208
 		}
209 209
 		$sql .= " ORDER BY p.ref ASC";
210 210
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 				$morecss .= ' minwidth100';
215 215
 			}
216 216
 			if (empty($option_only)) {
217
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlid . '" name="' . $htmlname . '">';
217
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlid.'" name="'.$htmlname.'">';
218 218
 			}
219 219
 			if (!empty($show_empty)) {
220 220
 				if (is_numeric($show_empty)) {
@@ -240,37 +240,37 @@  discard block
 block discarded – undo
240 240
 						$labeltoshow = dol_trunc($obj->ref, 18);
241 241
 						//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
242 242
 						//else $labeltoshow.=' ('.$langs->trans("Private").')';
243
-						$labeltoshow .= ', ' . dol_trunc($obj->title, $maxlength);
243
+						$labeltoshow .= ', '.dol_trunc($obj->title, $maxlength);
244 244
 						if ($obj->name) {
245
-							$labeltoshow .= ' - ' . $obj->name;
245
+							$labeltoshow .= ' - '.$obj->name;
246 246
 							if ($obj->name_alias) {
247
-								$labeltoshow .= ' (' . $obj->name_alias . ')';
247
+								$labeltoshow .= ' ('.$obj->name_alias.')';
248 248
 							}
249 249
 						}
250 250
 
251 251
 						$disabled = 0;
252 252
 						if ($obj->fk_statut == 0) {
253 253
 							$disabled = 1;
254
-							$labeltoshow .= ' - ' . $langs->trans("Draft");
254
+							$labeltoshow .= ' - '.$langs->trans("Draft");
255 255
 						} elseif ($obj->fk_statut == 2) {
256 256
 							if ($discard_closed == 2) {
257 257
 								$disabled = 1;
258 258
 							}
259
-							$labeltoshow .= ' - ' . $langs->trans("Closed");
259
+							$labeltoshow .= ' - '.$langs->trans("Closed");
260 260
 						} elseif (!getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY') && $socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
261 261
 							$disabled = 1;
262
-							$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
262
+							$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
263 263
 						}
264 264
 
265 265
 						if (!empty($selected) && $selected == $obj->rowid) {
266
-							$out .= '<option value="' . $obj->rowid . '" selected';
266
+							$out .= '<option value="'.$obj->rowid.'" selected';
267 267
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
268
-							$out .= '>' . $labeltoshow . '</option>';
268
+							$out .= '>'.$labeltoshow.'</option>';
269 269
 						} else {
270 270
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
271 271
 								$resultat = '';
272 272
 							} else {
273
-								$resultat = '<option value="' . $obj->rowid . '"';
273
+								$resultat = '<option value="'.$obj->rowid.'"';
274 274
 								if ($disabled) {
275 275
 									$resultat .= ' disabled';
276 276
 								}
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 								'value' => $obj->ref,
288 288
 								'ref' => $obj->ref,
289 289
 								'labelx' => $labeltoshow,
290
-								'label' => ($disabled ? '<span class="opacitymedium">' . $labeltoshow . '</span>' : $labeltoshow),
290
+								'label' => ($disabled ? '<span class="opacitymedium">'.$labeltoshow.'</span>' : $labeltoshow),
291 291
 								'disabled' => (bool) $disabled
292 292
 							);
293 293
 						}
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 
306 306
 				// Use select2 selector
307 307
 				if (!empty($conf->use_javascript_ajax)) {
308
-					include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
308
+					include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
309 309
 					$comboenhancement = ajax_combobox($htmlid, array(), 0, $forcefocus);
310 310
 					$out .= $comboenhancement;
311 311
 					$morecss .= ' minwidth100';
@@ -374,19 +374,19 @@  discard block
 block discarded – undo
374 374
 		$sql = "SELECT t.rowid, t.ref as tref, t.label as tlabel, t.progress,";
375 375
 		$sql .= " p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, p.usage_task,";
376 376
 		$sql .= " s.nom as name";
377
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
378
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON s.rowid = p.fk_soc,";
379
-		$sql .= " " . $this->db->prefix() . "projet_task as t";
380
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
377
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
378
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc,";
379
+		$sql .= " ".$this->db->prefix()."projet_task as t";
380
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
381 381
 		$sql .= " AND t.fk_projet = p.rowid";
382 382
 		if ($projectsListId) {
383
-			$sql .= " AND p.rowid IN (" . $this->db->sanitize($projectsListId) . ")";
383
+			$sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
384 384
 		}
385 385
 		if ($socid == 0) {
386 386
 			$sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
387 387
 		}
388 388
 		if ($socid > 0) {
389
-			$sql .= " AND (p.fk_soc=" . ((int) $socid) . " OR p.fk_soc IS NULL)";
389
+			$sql .= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)";
390 390
 		}
391 391
 		$sql .= " ORDER BY p.ref, t.ref ASC";
392 392
 
@@ -394,14 +394,14 @@  discard block
 block discarded – undo
394 394
 		if ($resql) {
395 395
 			// Use select2 selector
396 396
 			if (empty($option_only) && !empty($conf->use_javascript_ajax)) {
397
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
397
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
398 398
 				$comboenhancement = ajax_combobox($htmlname, [], 0, $forcefocus);
399 399
 				$out .= $comboenhancement;
400 400
 				$morecss .= ' minwidth150imp';
401 401
 			}
402 402
 
403 403
 			if (empty($option_only)) {
404
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
404
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
405 405
 			}
406 406
 			if (!empty($show_empty)) {
407 407
 				$out .= '<option value="0" class="optiongrey">';
@@ -447,58 +447,58 @@  discard block
 block discarded – undo
447 447
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Project ref
448 448
 							//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
449 449
 							//else $labeltoshow.=' ('.$langs->trans("Private").')';
450
-							$labeltoshow .= ' ' . dol_trunc($obj->title, $maxlength);
450
+							$labeltoshow .= ' '.dol_trunc($obj->title, $maxlength);
451 451
 							$labeltoshowhtml = $labeltoshow;
452 452
 
453 453
 							if ($obj->name) {
454
-								$labeltoshow .= ' (' . $obj->name . ')';
455
-								$labeltoshowhtml .= ' <span class="opacitymedium">(' . $obj->name . ')</span>';
454
+								$labeltoshow .= ' ('.$obj->name.')';
455
+								$labeltoshowhtml .= ' <span class="opacitymedium">('.$obj->name.')</span>';
456 456
 							}
457 457
 
458 458
 							$disabled = 0;
459 459
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
460 460
 								$disabled = 1;
461
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
462
-								$labeltoshowhtml .= ' -  <span class="opacitymedium">' . $langs->trans("Draft") . '</span>';
461
+								$labeltoshow .= ' - '.$langs->trans("Draft");
462
+								$labeltoshowhtml .= ' -  <span class="opacitymedium">'.$langs->trans("Draft").'</span>';
463 463
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
464 464
 								if ($discard_closed == 2) {
465 465
 									$disabled = 1;
466 466
 								}
467
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
468
-								$labeltoshowhtml .= ' - <span class="opacitymedium">' . $langs->trans("Closed") . '</span>';
467
+								$labeltoshow .= ' - '.$langs->trans("Closed");
468
+								$labeltoshowhtml .= ' - <span class="opacitymedium">'.$langs->trans("Closed").'</span>';
469 469
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
470 470
 								$disabled = 1;
471
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
472
-								$labeltoshowhtml .= ' - <span class="opacitymedium">' . $langs->trans("LinkedToAnotherCompany") . '</span>';
471
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
472
+								$labeltoshowhtml .= ' - <span class="opacitymedium">'.$langs->trans("LinkedToAnotherCompany").'</span>';
473 473
 							}
474 474
 							$labeltoshow .= ' - ';
475 475
 							$labeltoshowhtml .= ' - ';
476 476
 						}
477 477
 
478 478
 						// Label for task
479
-						$labeltoshow .= $obj->tref . ' ' . dol_trunc($obj->tlabel, $maxlength);
480
-						$labeltoshowhtml .= $obj->tref . ' - ' . dol_trunc($obj->tlabel, $maxlength);
479
+						$labeltoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength);
480
+						$labeltoshowhtml .= $obj->tref.' - '.dol_trunc($obj->tlabel, $maxlength);
481 481
 						if ($obj->usage_task && preg_match('/progress/', $showmore)) {
482
-							$labeltoshow .= ' <span class="opacitymedium">(' . $obj->progress . '%)</span>';
483
-							$labeltoshowhtml .= ' <span class="opacitymedium">(' . $obj->progress . '%)</span>';
482
+							$labeltoshow .= ' <span class="opacitymedium">('.$obj->progress.'%)</span>';
483
+							$labeltoshowhtml .= ' <span class="opacitymedium">('.$obj->progress.'%)</span>';
484 484
 						}
485 485
 
486 486
 						if (!empty($selected) && $selected == $obj->rowid) {
487
-							$out .= '<option value="' . $obj->rowid . '" selected';
488
-							$out .= ' data-html="' . dol_escape_htmltag($labeltoshowhtml) . '"';
487
+							$out .= '<option value="'.$obj->rowid.'" selected';
488
+							$out .= ' data-html="'.dol_escape_htmltag($labeltoshowhtml).'"';
489 489
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
490
-							$out .= '>' . $labeltoshow . '</option>';
490
+							$out .= '>'.$labeltoshow.'</option>';
491 491
 						} else {
492 492
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
493 493
 								$resultat = '';
494 494
 							} else {
495
-								$resultat = '<option value="' . $obj->rowid . '"';
495
+								$resultat = '<option value="'.$obj->rowid.'"';
496 496
 								if ($disabled) {
497 497
 									$resultat .= ' disabled';
498 498
 								}
499 499
 								//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
500 500
 								//else $labeltoshow.=' ('.$langs->trans("Private").')';
501
-								$resultat .= ' data-html="' . dol_escape_htmltag($labeltoshowhtml) . '"';
501
+								$resultat .= ' data-html="'.dol_escape_htmltag($labeltoshowhtml).'"';
502 502
 								$resultat .= '>';
503 503
 								$resultat .= $labeltoshow;
504 504
 								$resultat .= '</option>';
@@ -624,30 +624,30 @@  discard block
 block discarded – undo
624 624
 		if ($linkedtothirdparty) {
625 625
 			$sql .= ", s.nom as name";
626 626
 		}
627
-		$sql .= " FROM " . $this->db->prefix() . $table_element . " as t";
627
+		$sql .= " FROM ".$this->db->prefix().$table_element." as t";
628 628
 		if ($linkedtothirdparty) {
629
-			$sql .= ", " . $this->db->prefix() . "societe as s";
629
+			$sql .= ", ".$this->db->prefix()."societe as s";
630 630
 		}
631
-		$sql .= " WHERE " . $projectkey . " is null";
631
+		$sql .= " WHERE ".$projectkey." is null";
632 632
 		if (!empty($socid) && $linkedtothirdparty) {
633 633
 			if (is_numeric($socid)) {
634
-				$sql .= " AND t.fk_soc = " . ((int) $socid);
634
+				$sql .= " AND t.fk_soc = ".((int) $socid);
635 635
 			} else {
636
-				$sql .= " AND t.fk_soc IN (" . $this->db->sanitize($socid) . ")";
636
+				$sql .= " AND t.fk_soc IN (".$this->db->sanitize($socid).")";
637 637
 			}
638 638
 		}
639 639
 		if (!in_array($table_element, array('expensereport_det', 'stock_mouvement'))) {
640
-			$sql .= ' AND t.entity IN (' . getEntity('project') . ')';
640
+			$sql .= ' AND t.entity IN ('.getEntity('project').')';
641 641
 		}
642 642
 		if ($linkedtothirdparty) {
643 643
 			$sql .= " AND s.rowid = t.fk_soc";
644 644
 		}
645 645
 		if ($sqlfilter) {
646
-			$sql .= " AND " . $sqlfilter;
646
+			$sql .= " AND ".$sqlfilter;
647 647
 		}
648 648
 		$sql .= " ORDER BY ref DESC";
649 649
 
650
-		dol_syslog(get_class($this) . '::select_element', LOG_DEBUG);
650
+		dol_syslog(get_class($this).'::select_element', LOG_DEBUG);
651 651
 		$resql = $this->db->query($sql);
652 652
 		if ($resql) {
653 653
 			$num = $this->db->num_rows($resql);
@@ -655,18 +655,18 @@  discard block
 block discarded – undo
655 655
 			$sellist = '';
656 656
 
657 657
 			if ($num > 0) {
658
-				$sellist = '<select class="flat elementselect css' . $table_element . ($morecss ? ' ' . $morecss : '') . '" name="elementselect">';
659
-				$sellist .= '<option value="-1"' . ($placeholder ? ' class="optiongrey"' : '') . '>' . $placeholder . '</option>';
658
+				$sellist = '<select class="flat elementselect css'.$table_element.($morecss ? ' '.$morecss : '').'" name="elementselect">';
659
+				$sellist .= '<option value="-1"'.($placeholder ? ' class="optiongrey"' : '').'>'.$placeholder.'</option>';
660 660
 				while ($i < $num) {
661 661
 					$obj = $this->db->fetch_object($resql);
662 662
 					$ref = $obj->ref ? $obj->ref : $obj->rowid;
663 663
 					if (!empty($obj->ref_supplier)) {
664
-						$ref .= ' (' . $obj->ref_supplier . ')';
664
+						$ref .= ' ('.$obj->ref_supplier.')';
665 665
 					}
666 666
 					if (!empty($obj->name)) {
667
-						$ref .= ' - ' . $obj->name;
667
+						$ref .= ' - '.$obj->name;
668 668
 					}
669
-					$sellist .= '<option value="' . $obj->rowid . '">' . $ref . '</option>';
669
+					$sellist .= '<option value="'.$obj->rowid.'">'.$ref.'</option>';
670 670
 					$i++;
671 671
 				}
672 672
 				$sellist .= '</select>';
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 			dol_print_error($this->db);
685 685
 			$this->error = $this->db->lasterror();
686 686
 			$this->errors[] = $this->db->lasterror();
687
-			dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR);
687
+			dol_syslog(get_class($this)."::select_element ".$this->error, LOG_ERR);
688 688
 			return -1;
689 689
 		}
690 690
 	}
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 		global $conf, $langs, $user;
710 710
 
711 711
 		$sql = "SELECT rowid, code, label, percent";
712
-		$sql .= " FROM " . $this->db->prefix() . 'c_lead_status';
712
+		$sql .= " FROM ".$this->db->prefix().'c_lead_status';
713 713
 		$sql .= " WHERE active = 1";
714 714
 		$sql .= " ORDER BY position";
715 715
 
@@ -719,31 +719,31 @@  discard block
 block discarded – undo
719 719
 			$i = 0;
720 720
 			$sellist = '';
721 721
 			if ($num > 0) {
722
-				$sellist = '<select class="flat oppstatus' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
722
+				$sellist = '<select class="flat oppstatus'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
723 723
 				if ($showempty) {
724 724
 					// Without &nbsp, strange move of screen when switching value
725 725
 					$sellist .= '<option value="-1">&nbsp;</option>';
726 726
 				}
727 727
 				if ($showallnone) {
728
-					$sellist .= '<option value="all"' . ($preselected == 'all' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("OnlyOpportunitiesShort") . '</option>';
729
-					$sellist .= '<option value="openedopp"' . ($preselected == 'openedopp' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("OpenedOpportunitiesShort") . '</option>';
730
-					$sellist .= '<option value="notopenedopp"' . ($preselected == 'notopenedopp' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("NotOpenedOpportunitiesShort") . '</option>';
731
-					$sellist .= '<option value="none"' . ($preselected == 'none' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("NotAnOpportunityShort") . '</option>';
728
+					$sellist .= '<option value="all"'.($preselected == 'all' ? ' selected="selected"' : '').'>-- '.$langs->trans("OnlyOpportunitiesShort").'</option>';
729
+					$sellist .= '<option value="openedopp"'.($preselected == 'openedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("OpenedOpportunitiesShort").'</option>';
730
+					$sellist .= '<option value="notopenedopp"'.($preselected == 'notopenedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").'</option>';
731
+					$sellist .= '<option value="none"'.($preselected == 'none' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotAnOpportunityShort").'</option>';
732 732
 				}
733 733
 				while ($i < $num) {
734 734
 					$obj = $this->db->fetch_object($resql);
735 735
 
736
-					$sellist .= '<option value="' . $obj->rowid . '" defaultpercent="' . $obj->percent . '" elemcode="' . $obj->code . '"';
736
+					$sellist .= '<option value="'.$obj->rowid.'" defaultpercent="'.$obj->percent.'" elemcode="'.$obj->code.'"';
737 737
 					if ($obj->rowid == $preselected) {
738 738
 						$sellist .= ' selected="selected"';
739 739
 					}
740 740
 					$sellist .= '>';
741 741
 					if ($useshortlabel) {
742
-						$finallabel = ($langs->transnoentitiesnoconv("OppStatus" . $obj->code) != "OppStatus" . $obj->code ? $langs->transnoentitiesnoconv("OppStatus" . $obj->code) : $obj->label);
742
+						$finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label);
743 743
 					} else {
744
-						$finallabel = ($langs->transnoentitiesnoconv("OppStatus" . $obj->code) != "OppStatus" . $obj->code ? $langs->transnoentitiesnoconv("OppStatus" . $obj->code) : $obj->label);
744
+						$finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label);
745 745
 						if ($showpercent) {
746
-							$finallabel .= ' (' . $obj->percent . '%)';
746
+							$finallabel .= ' ('.$obj->percent.'%)';
747 747
 						}
748 748
 					}
749 749
 					$sellist .= $finallabel;
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 		} else {
773 773
 			$this->error = $this->db->lasterror();
774 774
 			$this->errors[] = $this->db->lasterror();
775
-			dol_syslog(get_class($this) . "::selectOpportunityStatus " . $this->error, LOG_ERR);
775
+			dol_syslog(get_class($this)."::selectOpportunityStatus ".$this->error, LOG_ERR);
776 776
 			return -1;
777 777
 		}
778 778
 	}
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 		$tmpproject = new Project($this->db);
801 801
 
802 802
 		foreach ($statustohow as $key => $value) {
803
-			$tmpproject->statut = $key;	// deprecated
803
+			$tmpproject->statut = $key; // deprecated
804 804
 			$tmpproject->status = $key;
805 805
 			$options[$value] = $tmpproject->getLibStatut($short);
806 806
 		}
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 		if (is_array($selected)) {
809 809
 			$selectedarray = $selected;
810 810
 		} elseif ($selected == 99) {
811
-			$selectedarray = array(0,1);
811
+			$selectedarray = array(0, 1);
812 812
 		} else {
813 813
 			$selectedarray = explode(',', $selected);
814 814
 		}
@@ -832,24 +832,24 @@  discard block
 block discarded – undo
832 832
 	{
833 833
 		global $user, $conf, $langs;
834 834
 
835
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
835
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
836 836
 
837 837
 		$out = '';
838 838
 		if (empty($lineOnly)) {
839 839
 			// Search Invoice
840 840
 			$sql = "SELECT f.rowid, f.ref as fref,";
841 841
 			$sql .= ' s.nom as name';
842
-			$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
843
-			$sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc';
844
-			$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid';
845
-			$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
842
+			$sql .= ' FROM '.$this->db->prefix().'projet as p';
843
+			$sql .= ' INNER JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc';
844
+			$sql .= ' INNER JOIN '.$this->db->prefix().'facture as f ON f.fk_projet = p.rowid';
845
+			$sql .= " WHERE p.entity IN (".getEntity('project').")";
846 846
 			if (!empty($filters)) {
847 847
 				foreach ($filters as $key => $value) {
848 848
 					if ($key == 'p.rowid') {
849
-						$sql .= " AND p.rowid=" . (int) $value;
849
+						$sql .= " AND p.rowid=".(int) $value;
850 850
 					}
851 851
 					if ($key == 'f.rowid') {
852
-						$sql .= " AND f.rowid=" . (int) $value;
852
+						$sql .= " AND f.rowid=".(int) $value;
853 853
 					}
854 854
 				}
855 855
 			}
@@ -859,26 +859,26 @@  discard block
 block discarded – undo
859 859
 			if ($resql) {
860 860
 				// Use select2 selector
861 861
 				if (!empty($conf->use_javascript_ajax)) {
862
-					include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
862
+					include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
863 863
 					$comboenhancement = ajax_combobox($htmlNameInvoice, array(array('method' => 'getLines', 'url' => dol_buildpath('/core/ajax/ajaxinvoiceline.php', 1), 'htmlname' => $htmlNameInvoiceLine)), 0, 0);
864 864
 					$out .= $comboenhancement;
865 865
 					$morecss = 'minwidth200imp maxwidth500';
866 866
 				}
867 867
 
868
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoice . '" name="' . $htmlNameInvoice . '">';
868
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlNameInvoice.'" name="'.$htmlNameInvoice.'">';
869 869
 				$num = $this->db->num_rows($resql);
870 870
 				if ($num) {
871 871
 					while ($obj = $this->db->fetch_object($resql)) {
872 872
 						$labeltoshow = $obj->fref; // Invoice ref
873 873
 						if ($obj->name) {
874
-							$labeltoshow .= ' - ' . $obj->name;
874
+							$labeltoshow .= ' - '.$obj->name;
875 875
 						}
876 876
 
877
-						$out .= '<option value="' . $obj->rowid . '" ';
877
+						$out .= '<option value="'.$obj->rowid.'" ';
878 878
 						if (!empty($selectedInvoiceId) && $selectedInvoiceId == $obj->rowid) {
879 879
 							$out .= ' selected ';
880 880
 						}
881
-						$out .= '>' . $labeltoshow . '</option>';
881
+						$out .= '>'.$labeltoshow.'</option>';
882 882
 					}
883 883
 				}
884 884
 				$out .= '</select>';
@@ -890,20 +890,20 @@  discard block
 block discarded – undo
890 890
 
891 891
 		// Search Invoice Line
892 892
 		$sql = "SELECT fd.rowid, fd.label, fd.description";
893
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
894
-		$sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc';
895
-		$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid';
896
-		$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facturedet as fd ON fd.fk_facture = f.rowid';
897
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
893
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
894
+		$sql .= ' INNER JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc';
895
+		$sql .= ' INNER JOIN '.$this->db->prefix().'facture as f ON f.fk_projet = p.rowid';
896
+		$sql .= ' INNER JOIN '.$this->db->prefix().'facturedet as fd ON fd.fk_facture = f.rowid';
897
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
898 898
 		if (!empty($filters)) {
899 899
 			foreach ($filters as $key => $value) {
900 900
 				if ($key == 'p.rowid') {
901
-					$sql .= " AND p.rowid=" . (int) $value;
901
+					$sql .= " AND p.rowid=".(int) $value;
902 902
 				}
903 903
 			}
904 904
 		}
905 905
 		if (!empty($selectedInvoiceId)) {
906
-			$sql .= " AND f.rowid=" . (int) $selectedInvoiceId;
906
+			$sql .= " AND f.rowid=".(int) $selectedInvoiceId;
907 907
 		}
908 908
 		$sql .= " ORDER BY p.ref, f.ref ASC";
909 909
 		$resql = $this->db->query($sql);
@@ -911,24 +911,24 @@  discard block
 block discarded – undo
911 911
 			// Use select2 selector
912 912
 			if (empty($lineOnly)) {
913 913
 				if (!empty($conf->use_javascript_ajax)) {
914
-					include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
914
+					include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
915 915
 					$comboenhancement = ajax_combobox($htmlNameInvoiceLine, [], 0, 0);
916 916
 					$out .= $comboenhancement;
917 917
 					$morecss = 'minwidth200imp maxwidth500';
918 918
 				}
919 919
 
920
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoiceLine . '" name="' . $htmlNameInvoiceLine . '">';
920
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlNameInvoiceLine.'" name="'.$htmlNameInvoiceLine.'">';
921 921
 			}
922 922
 			$num = $this->db->num_rows($resql);
923 923
 			if ($num) {
924 924
 				while ($obj = $this->db->fetch_object($resql)) {
925 925
 					$labeltoshow .= $obj->description; // Invoice ref
926 926
 
927
-					$out .= '<option value="' . $obj->rowid . '" ';
927
+					$out .= '<option value="'.$obj->rowid.'" ';
928 928
 					if (!empty($selectedLineId) && $selectedLineId == $obj->rowid) {
929 929
 						$out .= ' selected ';
930 930
 					}
931
-					$out .= '>' . $labeltoshow . '</option>';
931
+					$out .= '>'.$labeltoshow.'</option>';
932 932
 				}
933 933
 			}
934 934
 			if (empty($lineOnly)) {
@@ -961,14 +961,14 @@  discard block
 block discarded – undo
961 961
 
962 962
 		$out = '';
963 963
 		if ($htmlname_status != "none" && $htmlname_percent != 'none') {
964
-			$out .= '<form method="post" action="' . $page . '">';
964
+			$out .= '<form method="post" action="'.$page.'">';
965 965
 			$out .= '<input type="hidden" name="action" value="set_opp_status">';
966
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
966
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
967 967
 			$out .= $this-> selectOpportunityStatus($htmlname_status, $selected, 1, 0, 0, 0, 'minwidth150 inline-block valignmiddle', 1, 1);
968 968
 			$out .= ' / <span title="'.$langs->trans("OpportunityProbability").'"> ';
969 969
 			$out .= '<input class="width50 right" type="text" id="'.$htmlname_percent.'" name="'.$htmlname_percent.'" title="'.dol_escape_htmltag($langs->trans("OpportunityProbability")).'" value="'.$percent_value.'"> %';
970 970
 			$out .= '</span>';
971
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
971
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
972 972
 			$out .= '</form>';
973 973
 		} else {
974 974
 			if ($selected > 0) {
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1257 added lines, -1257 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
124 124
 			if (!empty($perm)) {
125 125
 				$tmp = explode(':', $typeofdata);
126
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
126
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
127 127
 				if ($fieldrequired) {
128 128
 					$ret .= '<span class="fieldrequired">';
129 129
 				}
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 				if ($fieldrequired) {
136 136
 					$ret .= '</span>';
137 137
 				}
138
-				$ret .= '</div>' . "\n";
138
+				$ret .= '</div>'."\n";
139 139
 			} else {
140 140
 				if ($fieldrequired) {
141 141
 					$ret .= '<span class="fieldrequired">';
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 			if (empty($notabletag) && $perm) {
174 174
 				$ret .= '<td class="right">';
175 175
 			}
176
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
177
-				$ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>';
176
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
177
+				$ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>';
178 178
 			}
179 179
 			if (!empty($notabletag) && $notabletag == 1) {
180 180
 				if ($text) {
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 			} elseif ($reg[1] == 'int') {
242 242
 				$typeofdata = 'numeric';
243 243
 			} else {
244
-				return 'ErrorBadParameter ' . $typeofdata;
244
+				return 'ErrorBadParameter '.$typeofdata;
245 245
 			}
246 246
 		}
247 247
 
@@ -252,13 +252,13 @@  discard block
 block discarded – undo
252 252
 			if ($editaction == '') {
253 253
 				$editaction = GETPOST('action', 'aZ09');
254 254
 			}
255
-			$editmode = ($editaction == 'edit' . $htmlname);
255
+			$editmode = ($editaction == 'edit'.$htmlname);
256 256
 			if ($editmode) {	// edit mode
257 257
 				$ret .= "<!-- formeditfieldval -->\n";
258
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
259
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
260
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
261
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
258
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
259
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
260
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
261
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
262 262
 				if (empty($notabletag)) {
263 263
 					$ret .= '<table class="nobordernopadding centpercent">';
264 264
 				}
@@ -267,28 +267,28 @@  discard block
 block discarded – undo
267 267
 				}
268 268
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
269 269
 					$tmp = explode(':', $typeofdata);
270
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
270
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
271 271
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
272 272
 					$tmp = explode(':', $typeofdata);
273 273
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
274
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
274
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
275 275
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
276 276
 					$tmp = explode(':', $typeofdata);
277 277
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
278
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
278
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
279 279
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
280 280
 					$tmp = explode(':', $typeofdata);
281
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
281
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
282 282
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
283 283
 					$tmp = explode(':', $typeofdata);
284 284
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
285 285
 					$morealt = '';
286 286
 					if (preg_match('/%/', $cols)) {
287
-						$morealt = ' style="width: ' . $cols . '"';
287
+						$morealt = ' style="width: '.$cols.'"';
288 288
 						$cols = '';
289 289
 					}
290 290
 					$valuetoshow = ($editvalue ? $editvalue : $value);
291
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
291
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
292 292
 					// textarea convert automatically entities chars into simple chars.
293 293
 					// So we convert & into &amp; so a string like 'a &lt; <b>b</b><br>é<br>&lt;script&gt;alert('X');&lt;script&gt;' stay a correct html and is not converted by textarea component when wysiwyg is off.
294 294
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -298,12 +298,12 @@  discard block
 block discarded – undo
298 298
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
299 299
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
300 300
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
301
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
301
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
302 302
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
303 303
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
304 304
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
305 305
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
306
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
306
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
307 307
 				} elseif (preg_match('/^select;/', $typeofdata)) {
308 308
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
309 309
 					$arraylist = array();
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 					// TODO Not yet implemented. See code for extrafields
318 318
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
319 319
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
320
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
320
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
321 321
 					$doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? 100 : (int) $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? false : (bool) $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? 20 : (int) $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7]));
322 322
 					$ret .= $doleditor->Create(1);
323 323
 				} elseif ($typeofdata == 'asis') {
@@ -332,19 +332,19 @@  discard block
 block discarded – undo
332 332
 					$ret .= '<td>';
333 333
 				}
334 334
 				//else $ret.='<div class="clearboth"></div>';
335
-				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
335
+				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
336 336
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
337
-					$ret .= '<br>' . "\n";
337
+					$ret .= '<br>'."\n";
338 338
 				}
339
-				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
339
+				$ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
340 340
 				if (empty($notabletag)) {
341 341
 					$ret .= '</td>';
342 342
 				}
343 343
 
344 344
 				if (empty($notabletag)) {
345
-					$ret .= '</tr></table>' . "\n";
345
+					$ret .= '</tr></table>'."\n";
346 346
 				}
347
-				$ret .= '</form>' . "\n";
347
+				$ret .= '</form>'."\n";
348 348
 			} else {		// view mode
349 349
 				if (preg_match('/^email/', $typeofdata)) {
350 350
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -356,15 +356,15 @@  discard block
 block discarded – undo
356 356
 					$ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : '');
357 357
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
358 358
 					$tmp = explode(':', $typeofdata);
359
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
359
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
360 360
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
361 361
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
362 362
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
363 363
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
364 364
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
365
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
365
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
366 366
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
367
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
367
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
368 368
 				} elseif (preg_match('/^select;/', $typeofdata)) {
369 369
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
370 370
 					$arraylist = array();
@@ -375,9 +375,9 @@  discard block
 block discarded – undo
375 375
 					$ret .= $arraylist[$value];
376 376
 					if ($htmlname == 'fk_product_type') {
377 377
 						if ($value == 0) {
378
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
378
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
379 379
 						} else {
380
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
380
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
381 381
 						}
382 382
 					}
383 383
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
386 386
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
387 387
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
388
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
388
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
389 389
 					}
390 390
 					// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also
391 391
 					// clean data from some dangerous html
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
395 395
 						$ret .= dol_escape_htmltag($value);
396 396
 					} else {
397
-						$ret .= $value;        // $value must be already html escaped.
397
+						$ret .= $value; // $value must be already html escaped.
398 398
 					}
399 399
 				}
400 400
 
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 
433 433
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
434 434
 			if (!is_object($extralanguages)) {
435
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
435
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
436 436
 				$extralanguages = new ExtraLanguages($this->db);
437 437
 			}
438 438
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -441,17 +441,17 @@  discard block
 block discarded – undo
441 441
 				return ''; // No extralang field to show
442 442
 			}
443 443
 
444
-			$result .= '<!-- Widget for translation -->' . "\n";
445
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
444
+			$result .= '<!-- Widget for translation -->'."\n";
445
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
446 446
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', 0, 0, 0, '', 'fa-15 editfieldlang');
447 447
 			$result .= $s;
448 448
 			$result .= '</div>';
449 449
 
450
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
450
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
451 451
 
452 452
 			$resultforextrlang = '';
453 453
 			foreach ($arrayoflangcode as $langcode) {
454
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
454
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
455 455
 				if (empty($valuetoshow)) {
456 456
 					$object->fetchValuesForExtraLanguages();
457 457
 					//var_dump($object->array_languages);
@@ -463,17 +463,17 @@  discard block
 block discarded – undo
463 463
 
464 464
 				// TODO Use the showInputField() method of ExtraLanguages object
465 465
 				if ($typeofdata == 'textarea') {
466
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
466
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
467 467
 					$resultforextrlang .= $valuetoshow;
468 468
 					$resultforextrlang .= '</textarea>';
469 469
 				} else {
470
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
470
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
471 471
 				}
472 472
 			}
473 473
 			$result .= $resultforextrlang;
474 474
 
475 475
 			$result .= '</div>';
476
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
476
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
477 477
 		}
478 478
 
479 479
 		return $result;
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 				if (!empty($tmp[2])) {
537 537
 					$savemethod = $tmp[2];
538 538
 				}
539
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
539
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
540 540
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
541 541
 				$tmp = explode(':', $inputType);
542 542
 				$inputType = $tmp[0];
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 					$savemethod = $tmp[2];
548 548
 				}
549 549
 
550
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
550
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
551 551
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
552 552
 				$tmp = explode(':', $inputType);
553 553
 				$inputType = $tmp[0];
@@ -578,40 +578,40 @@  discard block
 block discarded – undo
578 578
 				}
579 579
 
580 580
 				if (isModEnabled('fckeditor')) {
581
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
581
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
582 582
 				} else {
583 583
 					$inputType = 'textarea';
584 584
 				}
585 585
 			}
586 586
 
587
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
588
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
589
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
590
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
587
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
588
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
589
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
590
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
591 591
 			if (!empty($savemethod)) {
592
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
592
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
593 593
 			}
594 594
 			if (!empty($ext_element)) {
595
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
595
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
596 596
 			}
597 597
 			if (!empty($custommsg)) {
598 598
 				if (is_array($custommsg)) {
599 599
 					if (!empty($custommsg['success'])) {
600
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
600
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
601 601
 					}
602 602
 					if (!empty($custommsg['error'])) {
603
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
603
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
604 604
 					}
605 605
 				} else {
606
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
606
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
607 607
 				}
608 608
 			}
609 609
 			if ($inputType == 'textarea') {
610
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
611
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
610
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
611
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
612 612
 			}
613
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
614
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
613
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
614
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
615 615
 		} else {
616 616
 			$out = $value;
617 617
 		}
@@ -640,12 +640,12 @@  discard block
 block discarded – undo
640 640
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
641 641
 	{
642 642
 		if ($incbefore) {
643
-			$text = $incbefore . $text;
643
+			$text = $incbefore.$text;
644 644
 		}
645 645
 		if (!$htmltext) {
646 646
 			return $text;
647 647
 		}
648
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
648
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
649 649
 
650 650
 		$tag = 'td';
651 651
 		if ($notabs == 2) {
@@ -659,11 +659,11 @@  discard block
 block discarded – undo
659 659
 
660 660
 		$extrastyle = '';
661 661
 		if ($direction < 0) {
662
-			$extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : '');
662
+			$extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : '');
663 663
 			$extrastyle = 'padding: 0px; padding-left: 2px;';
664 664
 		}
665 665
 		if ($direction > 0) {
666
-			$extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : '');
666
+			$extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : '');
667 667
 			$extrastyle = 'padding: 0px; padding-right: 2px;';
668 668
 		}
669 669
 
@@ -676,53 +676,53 @@  discard block
 block discarded – undo
676 676
 			$htmltext = str_replace('"', '&quot;', $htmltext);
677 677
 		} else {
678 678
 			$classfortooltip = 'classfortooltiponclick';
679
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
679
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
680 680
 		}
681 681
 		if ($tooltipon == 2 || $tooltipon == 3) {
682
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
682
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
683 683
 			if ($tooltiptrigger == '') {
684
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip
684
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip
685 685
 			} else {
686
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
686
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
687 687
 			}
688 688
 		} else {
689
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
689
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
690 690
 		}
691 691
 		if ($tooltipon == 1 || $tooltipon == 3) {
692
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ($tag != 'td' ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
692
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.($tag != 'td' ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
693 693
 			if ($tooltiptrigger == '') {
694
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip
694
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip
695 695
 			} else {
696
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
696
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
697 697
 			}
698 698
 		} else {
699
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
699
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
700 700
 		}
701 701
 		if (empty($notabs)) {
702 702
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
703 703
 		} elseif ($notabs == 2) {
704
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
704
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
705 705
 		}
706 706
 		// Define value if value is before
707 707
 		if ($direction < 0) {
708
-			$s .= '<' . $tag . $paramfortooltipimg;
708
+			$s .= '<'.$tag.$paramfortooltipimg;
709 709
 			if ($tag == 'td') {
710 710
 				$s .= ' class="valigntop" width="14"';
711 711
 			}
712
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
712
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
713 713
 		}
714 714
 		// Use another method to help avoid having a space in value in order to use this value with jquery
715 715
 		// Define label
716 716
 		if ((string) $text != '') {
717
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
717
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
718 718
 		}
719 719
 		// Define value if value is after
720 720
 		if ($direction > 0) {
721
-			$s .= '<' . $tag . $paramfortooltipimg;
721
+			$s .= '<'.$tag.$paramfortooltipimg;
722 722
 			if ($tag == 'td') {
723 723
 				$s .= ' class="valignmiddle" width="14"';
724 724
 			}
725
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
725
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
726 726
 		}
727 727
 		if (empty($notabs)) {
728 728
 			$s .= '</tr></table>';
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 
830 830
 		$disabled = 0;
831 831
 		$ret = '<div class="centpercent center">';
832
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
832
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
833 833
 
834 834
 		// Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks.
835 835
 		$parameters = array();
@@ -840,10 +840,10 @@  discard block
 block discarded – undo
840 840
 			return;
841 841
 		}
842 842
 		if (empty($reshook)) {
843
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
843
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
844 844
 			if (is_array($arrayofaction)) {
845 845
 				foreach ($arrayofaction as $code => $label) {
846
-					$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
846
+					$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
847 847
 				}
848 848
 			}
849 849
 		}
@@ -852,17 +852,17 @@  discard block
 block discarded – undo
852 852
 		$ret .= '</select>';
853 853
 
854 854
 		if (empty($conf->dol_optimize_smallscreen)) {
855
-			$ret .= ajax_combobox('.' . $name . 'select');
855
+			$ret .= ajax_combobox('.'.$name.'select');
856 856
 		}
857 857
 
858 858
 		// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
859 859
 		$ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER.
860
-		$ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">';
860
+		$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
861 861
 		$ret .= '</div>';
862 862
 
863 863
 		if (!empty($conf->use_javascript_ajax)) {
864 864
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
865
-    		<script nonce="' . getNonce() . '">
865
+    		<script nonce="' . getNonce().'">
866 866
                         function initCheckForSelect(mode, name, cssclass)	/* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */
867 867
         		{
868 868
         			atleastoneselected=0;
@@ -873,11 +873,11 @@  discard block
 block discarded – undo
873 873
 
874 874
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
875 875
 
876
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
876
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
877 877
     	  			{
878 878
                                     jQuery("."+name).show();
879
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
880
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
879
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
880
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
881 881
     	  			}
882 882
     	  			else
883 883
     	  			{
@@ -887,26 +887,26 @@  discard block
 block discarded – undo
887 887
         		}
888 888
 
889 889
         	jQuery(document).ready(function () {
890
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
891
-                    jQuery(".' . $cssclass . '").click(function() {
892
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
890
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
891
+                    jQuery(".' . $cssclass.'").click(function() {
892
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
893 893
                     });
894
-                    jQuery(".' . $name . 'select").change(function() {
894
+                    jQuery(".' . $name.'select").change(function() {
895 895
         				var massaction = $( this ).val();
896 896
         				var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
897 897
         				if (massaction == "builddoc") {
898 898
                         	urlform = urlform + "#show_files";
899 899
     	            	}
900 900
         				$( this ).closest("form").attr("action", urlform);
901
-                    	console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
901
+                    	console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
902 902
         	        	/* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
903 903
         				if ($(this).val() != \'0\') {
904
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
905
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
906
-                                        jQuery(".' . $name . '"+massaction).show();
904
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
905
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
906
+                                        jQuery(".' . $name.'"+massaction).show();
907 907
     	  				} else {
908
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
909
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
908
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
909
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
910 910
     	  				}
911 911
     	        });
912 912
         	});
@@ -949,14 +949,14 @@  discard block
 block discarded – undo
949 949
 		$atleastonefavorite = 0;
950 950
 
951 951
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
952
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
952
+		$sql .= " FROM ".$this->db->prefix()."c_country";
953 953
 		$sql .= " WHERE active > 0";
954 954
 		//$sql.= " ORDER BY code ASC";
955 955
 
956
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
956
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
957 957
 		$resql = $this->db->query($sql);
958 958
 		if ($resql) {
959
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
959
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
960 960
 			$num = $this->db->num_rows($resql);
961 961
 			$i = 0;
962 962
 			if ($num) {
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 					$countryArray[$i]['rowid'] = $obj->rowid;
967 967
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
968 968
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
969
-					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
969
+					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
970 970
 					$countryArray[$i]['favorite'] = $obj->favorite;
971 971
 					$countryArray[$i]['eec'] = $obj->eec;
972 972
 					$favorite[$i] = $obj->favorite;
@@ -984,20 +984,20 @@  discard block
 block discarded – undo
984 984
 
985 985
 				if ($showempty) {
986 986
 					if (is_numeric($showempty)) {
987
-						$out .= '<option value="">&nbsp;</option>' . "\n";
987
+						$out .= '<option value="">&nbsp;</option>'."\n";
988 988
 					} else {
989
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
989
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
990 990
 					}
991 991
 				}
992 992
 
993 993
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
994 994
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
995
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
996
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
995
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
996
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
997 997
 					if ($mysoc->isInEEC()) {
998
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
998
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
999 999
 					}
1000
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
1000
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
1001 1001
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
1002 1002
 				}
1003 1003
 
@@ -1025,20 +1025,20 @@  discard block
 block discarded – undo
1025 1025
 						$labeltoshow .= '&nbsp;';
1026 1026
 					}
1027 1027
 					if ($row['code_iso']) {
1028
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1028
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1029 1029
 						if (empty($hideflags)) {
1030 1030
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1031
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1031
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1032 1032
 						}
1033 1033
 					}
1034 1034
 
1035 1035
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1036
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1036
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1037 1037
 					} else {
1038
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1038
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1039 1039
 					}
1040 1040
 					$out .= $labeltoshow;
1041
-					$out .= '</option>' . "\n";
1041
+					$out .= '</option>'."\n";
1042 1042
 				}
1043 1043
 			}
1044 1044
 			$out .= '</select>';
@@ -1047,8 +1047,8 @@  discard block
 block discarded – undo
1047 1047
 		}
1048 1048
 
1049 1049
 		// Make select dynamic
1050
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1051
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1050
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1051
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1052 1052
 
1053 1053
 		return $out;
1054 1054
 	}
@@ -1080,25 +1080,25 @@  discard block
 block discarded – undo
1080 1080
 		$incotermArray = array();
1081 1081
 
1082 1082
 		$sql = "SELECT rowid, code";
1083
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1083
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1084 1084
 		$sql .= " WHERE active > 0";
1085 1085
 		$sql .= " ORDER BY code ASC";
1086 1086
 
1087
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1087
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1088 1088
 		$resql = $this->db->query($sql);
1089 1089
 		if ($resql) {
1090 1090
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1091
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1091
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1092 1092
 				$out .= ajax_combobox($htmlname, $events);
1093 1093
 			}
1094 1094
 
1095 1095
 			if (!empty($page)) {
1096
-				$out .= '<form method="post" action="' . $page . '">';
1096
+				$out .= '<form method="post" action="'.$page.'">';
1097 1097
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1098
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1098
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1099 1099
 			}
1100 1100
 
1101
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1101
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1102 1102
 			$out .= '<option value="0">&nbsp;</option>';
1103 1103
 			$num = $this->db->num_rows($resql);
1104 1104
 			$i = 0;
@@ -1112,9 +1112,9 @@  discard block
 block discarded – undo
1112 1112
 
1113 1113
 				foreach ($incotermArray as $row) {
1114 1114
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1115
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1115
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1116 1116
 					} else {
1117
-						$out .= '<option value="' . $row['rowid'] . '">';
1117
+						$out .= '<option value="'.$row['rowid'].'">';
1118 1118
 					}
1119 1119
 
1120 1120
 					if ($row['code']) {
@@ -1128,13 +1128,13 @@  discard block
 block discarded – undo
1128 1128
 			$out .= ajax_combobox($htmlname);
1129 1129
 
1130 1130
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1131
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1131
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1132 1132
 				$moreattrib .= ' autocomplete="off"';
1133 1133
 			}
1134
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1134
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1135 1135
 
1136 1136
 			if (!empty($page)) {
1137
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1137
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1138 1138
 			}
1139 1139
 		} else {
1140 1140
 			dol_print_error($this->db);
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
 			if (empty($hidetext)) {
1170 1170
 				print $langs->trans("Type").'...';
1171 1171
 			}
1172
-			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1172
+			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1173 1173
 			if ($showempty) {
1174 1174
 				print '<option value="-1" class="opacitymedium"'.($useajaxcombo ? '' : ' disabled="disabled"');
1175 1175
 				if ($selected == -1) {
@@ -1188,31 +1188,31 @@  discard block
 block discarded – undo
1188 1188
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1189 1189
 				print ' selected';
1190 1190
 			}
1191
-			print '>' . $langs->trans("Product");
1191
+			print '>'.$langs->trans("Product");
1192 1192
 
1193 1193
 			print '<option value="1"';
1194 1194
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1195 1195
 				print ' selected';
1196 1196
 			}
1197
-			print '>' . $langs->trans("Service");
1197
+			print '>'.$langs->trans("Service");
1198 1198
 
1199 1199
 			print '</select>';
1200 1200
 
1201 1201
 			if ($useajaxcombo) {
1202
-				print ajax_combobox('select_' . $htmlname);
1202
+				print ajax_combobox('select_'.$htmlname);
1203 1203
 			}
1204 1204
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1205 1205
 		}
1206 1206
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1207 1207
 			print $langs->trans("Service");
1208
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1208
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1209 1209
 		}
1210 1210
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1211 1211
 			print $langs->trans("Product");
1212
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1212
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1213 1213
 		}
1214 1214
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1215
-			print '<input type="hidden" name="' . $htmlname . '" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1
1215
+			print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1
1216 1216
 		}
1217 1217
 	}
1218 1218
 
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
 		$langs->load("trips");
1239 1239
 
1240 1240
 		$sql = "SELECT c.code, c.label";
1241
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1241
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1242 1242
 		$sql .= " WHERE active > 0";
1243 1243
 
1244 1244
 		$resql = $this->db->query($sql);
@@ -1279,11 +1279,11 @@  discard block
 block discarded – undo
1279 1279
 		// phpcs:enable
1280 1280
 		global $user, $langs;
1281 1281
 
1282
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1282
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1283 1283
 
1284 1284
 		$this->load_cache_types_fees();
1285 1285
 
1286
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1286
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1287 1287
 		if ($showempty) {
1288 1288
 			print '<option value="-1"';
1289 1289
 			if ($selected == -1) {
@@ -1293,7 +1293,7 @@  discard block
 block discarded – undo
1293 1293
 		}
1294 1294
 
1295 1295
 		foreach ($this->cache_types_fees as $key => $value) {
1296
-			print '<option value="' . $key . '"';
1296
+			print '<option value="'.$key.'"';
1297 1297
 			if ($key == $selected) {
1298 1298
 				print ' selected';
1299 1299
 			}
@@ -1345,12 +1345,12 @@  discard block
 block discarded – undo
1345 1345
 				$ajaxoptions = array();
1346 1346
 			}
1347 1347
 
1348
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1348
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1349 1349
 
1350 1350
 			// No immediate load of all database
1351 1351
 			$placeholder = '';
1352 1352
 			if ($selected && empty($selected_input_value)) {
1353
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1353
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1354 1354
 				$societetmp = new Societe($this->db);
1355 1355
 				$societetmp->fetch($selected);
1356 1356
 				$selected_input_value = $societetmp->name;
@@ -1358,11 +1358,11 @@  discard block
 block discarded – undo
1358 1358
 			}
1359 1359
 
1360 1360
 			// mode 1
1361
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : '');
1361
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode((string) ($showtype)) : '').($showcode ? '&showcode='.urlencode((string) ($showcode)) : '');
1362 1362
 
1363 1363
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1364 1364
 			if (empty($hidelabel)) {
1365
-				$out .= $langs->trans("RefOrLabel") . ' : ';
1365
+				$out .= $langs->trans("RefOrLabel").' : ';
1366 1366
 			} elseif ($hidelabel == 1 && !is_numeric($showempty)) {
1367 1367
 				$placeholder = $langs->trans($showempty);
1368 1368
 			} elseif ($hidelabel > 1) {
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
 					$out .= img_picto($langs->trans("Search"), 'search');
1372 1372
 				}
1373 1373
 			}
1374
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
1374
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
1375 1375
 			if ($hidelabel == 3) {
1376 1376
 				$out .= img_picto($langs->trans("Search"), 'search');
1377 1377
 			}
@@ -1433,12 +1433,12 @@  discard block
 block discarded – undo
1433 1433
 				$events = array();
1434 1434
 			}
1435 1435
 
1436
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1436
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1437 1437
 
1438 1438
 			// No immediate load of all database
1439 1439
 			$placeholder = '';
1440 1440
 			if ($selected && empty($selected_input_value)) {
1441
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1441
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1442 1442
 				$contacttmp = new Contact($this->db);
1443 1443
 				$contacttmp->fetch($selected);
1444 1444
 				$selected_input_value = $contacttmp->getFullName($langs);
@@ -1449,11 +1449,11 @@  discard block
 block discarded – undo
1449 1449
 			}
1450 1450
 
1451 1451
 			// mode 1
1452
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($exclude) ? '' : '&exclude=' . urlencode($exclude)) . ($showsoc ? '&showsoc=' . urlencode((string) ($showsoc)) : '');
1452
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($exclude) ? '' : '&exclude='.urlencode($exclude)).($showsoc ? '&showsoc='.urlencode((string) ($showsoc)) : '');
1453 1453
 
1454 1454
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1455 1455
 
1456
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
1456
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
1457 1457
 
1458 1458
 			$out .= ajax_event($htmlname, $events);
1459 1459
 
@@ -1552,30 +1552,30 @@  discard block
 block discarded – undo
1552 1552
 			$sql .= ", s.address, s.zip, s.town";
1553 1553
 			$sql .= ", dictp.code as country_code";
1554 1554
 		}
1555
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1555
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1556 1556
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1557
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1557
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1558 1558
 		}
1559 1559
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1560
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1560
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1561 1561
 		}
1562
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1562
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1563 1563
 		if (!empty($user->socid)) {
1564
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1564
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1565 1565
 		}
1566 1566
 		if ($filter) {
1567 1567
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1568 1568
 			// if not, by testSqlAndScriptInject() only.
1569
-			$sql .= " AND (" . $filter . ")";
1569
+			$sql .= " AND (".$filter.")";
1570 1570
 		}
1571 1571
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1572
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1572
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1573 1573
 		}
1574 1574
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1575 1575
 			$sql .= " AND s.status <> 0";
1576 1576
 		}
1577 1577
 		if (!empty($excludeids)) {
1578
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")";
1578
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")";
1579 1579
 		}
1580 1580
 		// Add where from hooks
1581 1581
 		$parameters = array();
@@ -1595,17 +1595,17 @@  discard block
 block discarded – undo
1595 1595
 				if ($i > 0) {
1596 1596
 					$sql .= " AND ";
1597 1597
 				}
1598
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1598
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1599 1599
 				$i++;
1600 1600
 			}
1601 1601
 			if (count($search_crit) > 1) {
1602 1602
 				$sql .= ")";
1603 1603
 			}
1604 1604
 			if (isModEnabled('barcode')) {
1605
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1605
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1606 1606
 			}
1607
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1608
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1607
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1608
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1609 1609
 			$sql .= ")";
1610 1610
 		}
1611 1611
 		$sql .= $this->db->order("nom", "ASC");
@@ -1616,7 +1616,7 @@  discard block
 block discarded – undo
1616 1616
 		$resql = $this->db->query($sql);
1617 1617
 		if ($resql) {
1618 1618
 			// Construct $out and $outarray
1619
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1619
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1620 1620
 
1621 1621
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1622 1622
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1629,7 +1629,7 @@  discard block
 block discarded – undo
1629 1629
 				}
1630 1630
 			}
1631 1631
 			if ($showempty) {
1632
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1632
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1633 1633
 			}
1634 1634
 
1635 1635
 			$companytemp = new Societe($this->db);
@@ -1642,18 +1642,18 @@  discard block
 block discarded – undo
1642 1642
 					$label = '';
1643 1643
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1644 1644
 						if (($obj->client) && (!empty($obj->code_client))) {
1645
-							$label = $obj->code_client . ' - ';
1645
+							$label = $obj->code_client.' - ';
1646 1646
 						}
1647 1647
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1648
-							$label .= $obj->code_fournisseur . ' - ';
1648
+							$label .= $obj->code_fournisseur.' - ';
1649 1649
 						}
1650
-						$label .= ' ' . $obj->name;
1650
+						$label .= ' '.$obj->name;
1651 1651
 					} else {
1652 1652
 						$label = $obj->name;
1653 1653
 					}
1654 1654
 
1655 1655
 					if (!empty($obj->name_alias)) {
1656
-						$label .= ' (' . $obj->name_alias . ')';
1656
+						$label .= ' ('.$obj->name_alias.')';
1657 1657
 					}
1658 1658
 
1659 1659
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1668,7 +1668,7 @@  discard block
 block discarded – undo
1668 1668
 						$companytemp->fournisseur = $obj->fournisseur;
1669 1669
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1670 1670
 						if ($tmptype) {
1671
-							$labelhtml .= ' ' . $tmptype;
1671
+							$labelhtml .= ' '.$tmptype;
1672 1672
 						}
1673 1673
 
1674 1674
 						if ($obj->client || $obj->fournisseur) {
@@ -1678,10 +1678,10 @@  discard block
 block discarded – undo
1678 1678
 							$label .= $langs->trans("Customer");
1679 1679
 						}
1680 1680
 						if ($obj->client == 2 || $obj->client == 3) {
1681
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1681
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1682 1682
 						}
1683 1683
 						if ($obj->fournisseur) {
1684
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1684
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1685 1685
 						}
1686 1686
 						if ($obj->client || $obj->fournisseur) {
1687 1687
 							$label .= ')';
@@ -1689,9 +1689,9 @@  discard block
 block discarded – undo
1689 1689
 					}
1690 1690
 
1691 1691
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1692
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1692
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1693 1693
 						if (!empty($obj->country_code)) {
1694
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1694
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1695 1695
 						}
1696 1696
 						$label .= $s;
1697 1697
 						$labelhtml .= $s;
@@ -1699,9 +1699,9 @@  discard block
 block discarded – undo
1699 1699
 
1700 1700
 					if (empty($outputmode)) {
1701 1701
 						if (in_array($obj->rowid, $selected)) {
1702
-							$out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1702
+							$out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1703 1703
 						} else {
1704
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1704
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1705 1705
 						}
1706 1706
 					} else {
1707 1707
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1713,9 +1713,9 @@  discard block
 block discarded – undo
1713 1713
 					}
1714 1714
 				}
1715 1715
 			}
1716
-			$out .= '</select>' . "\n";
1716
+			$out .= '</select>'."\n";
1717 1717
 			if (!$forcecombo) {
1718
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1718
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1719 1719
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("COMPANY_USE_SEARCH_TO_SELECT"));
1720 1720
 			}
1721 1721
 		} else {
@@ -1804,7 +1804,7 @@  discard block
 block discarded – undo
1804 1804
 		}
1805 1805
 
1806 1806
 		if (!is_object($hookmanager)) {
1807
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1807
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1808 1808
 			$hookmanager = new HookManager($this->db);
1809 1809
 		}
1810 1810
 
@@ -1813,14 +1813,14 @@  discard block
 block discarded – undo
1813 1813
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1814 1814
 			$sql .= ", s.nom as company, s.town AS company_town";
1815 1815
 		}
1816
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1816
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1817 1817
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1818
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1818
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1819 1819
 		}
1820
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1820
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1821 1821
 		$sql .= " AND ((sp.fk_user_creat = ".((int) $user->id)." AND sp.priv = 1) OR sp.priv = 0)"; // check if this is a private contact
1822 1822
 		if ($socid > 0 || $socid == -1) {
1823
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1823
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1824 1824
 		}
1825 1825
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1826 1826
 			$sql .= " AND sp.statut <> 0";
@@ -1828,7 +1828,7 @@  discard block
 block discarded – undo
1828 1828
 		if ($filter) {
1829 1829
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1830 1830
 			// if not, by testSqlAndScriptInject() only.
1831
-			$sql .= " AND (" . $filter . ")";
1831
+			$sql .= " AND (".$filter.")";
1832 1832
 		}
1833 1833
 		// Add where from hooks
1834 1834
 		$parameters = array();
@@ -1836,30 +1836,30 @@  discard block
 block discarded – undo
1836 1836
 		$sql .= $hookmanager->resPrint;
1837 1837
 		$sql .= " ORDER BY sp.lastname ASC";
1838 1838
 
1839
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1839
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1840 1840
 		$resql = $this->db->query($sql);
1841 1841
 		if ($resql) {
1842 1842
 			$num = $this->db->num_rows($resql);
1843 1843
 
1844 1844
 			if ($htmlname != 'none' && !$options_only) {
1845
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1845
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1846 1846
 			}
1847 1847
 
1848 1848
 			if ($showempty && !is_numeric($showempty)) {
1849 1849
 				$textforempty = $showempty;
1850
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1850
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1851 1851
 			} else {
1852 1852
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1853
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1853
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1854 1854
 				}
1855 1855
 				if ($showempty == 2) {
1856
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1856
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1857 1857
 				}
1858 1858
 			}
1859 1859
 
1860 1860
 			$i = 0;
1861 1861
 			if ($num) {
1862
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1862
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1863 1863
 				$contactstatic = new Contact($this->db);
1864 1864
 
1865 1865
 				while ($i < $num) {
@@ -1895,7 +1895,7 @@  discard block
 block discarded – undo
1895 1895
 						}
1896 1896
 						$extendedInfos = implode(' - ', $extendedInfos);
1897 1897
 						if (!empty($extendedInfos)) {
1898
-							$extendedInfos = ' - ' . $extendedInfos;
1898
+							$extendedInfos = ' - '.$extendedInfos;
1899 1899
 						}
1900 1900
 					}
1901 1901
 
@@ -1913,35 +1913,35 @@  discard block
 block discarded – undo
1913 1913
 								$disabled = 1;
1914 1914
 							}
1915 1915
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1916
-								$out .= '<option value="' . $obj->rowid . '"';
1916
+								$out .= '<option value="'.$obj->rowid.'"';
1917 1917
 								if ($disabled) {
1918 1918
 									$out .= ' disabled';
1919 1919
 								}
1920 1920
 								$out .= ' selected>';
1921 1921
 
1922
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1922
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1923 1923
 								if ($showfunction && $obj->poste) {
1924
-									$tmplabel .= ' (' . $obj->poste . ')';
1924
+									$tmplabel .= ' ('.$obj->poste.')';
1925 1925
 								}
1926 1926
 								if (($showsoc > 0) && $obj->company) {
1927
-									$tmplabel .= ' - (' . $obj->company . ')';
1927
+									$tmplabel .= ' - ('.$obj->company.')';
1928 1928
 								}
1929 1929
 
1930 1930
 								$out .= $tmplabel;
1931 1931
 								$out .= '</option>';
1932 1932
 							} else {
1933
-								$out .= '<option value="' . $obj->rowid . '"';
1933
+								$out .= '<option value="'.$obj->rowid.'"';
1934 1934
 								if ($disabled) {
1935 1935
 									$out .= ' disabled';
1936 1936
 								}
1937 1937
 								$out .= '>';
1938 1938
 
1939
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1939
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1940 1940
 								if ($showfunction && $obj->poste) {
1941
-									$tmplabel .= ' (' . $obj->poste . ')';
1941
+									$tmplabel .= ' ('.$obj->poste.')';
1942 1942
 								}
1943 1943
 								if (($showsoc > 0) && $obj->company) {
1944
-									$tmplabel .= ' - (' . $obj->company . ')';
1944
+									$tmplabel .= ' - ('.$obj->company.')';
1945 1945
 								}
1946 1946
 
1947 1947
 								$out .= $tmplabel;
@@ -1949,12 +1949,12 @@  discard block
 block discarded – undo
1949 1949
 							}
1950 1950
 						} else {
1951 1951
 							if (in_array($obj->rowid, $selected)) {
1952
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1952
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1953 1953
 								if ($showfunction && $obj->poste) {
1954
-									$tmplabel .= ' (' . $obj->poste . ')';
1954
+									$tmplabel .= ' ('.$obj->poste.')';
1955 1955
 								}
1956 1956
 								if (($showsoc > 0) && $obj->company) {
1957
-									$tmplabel .= ' - (' . $obj->company . ')';
1957
+									$tmplabel .= ' - ('.$obj->company.')';
1958 1958
 								}
1959 1959
 
1960 1960
 								$out .= $tmplabel;
@@ -1969,7 +1969,7 @@  discard block
 block discarded – undo
1969 1969
 				}
1970 1970
 			} else {
1971 1971
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1972
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1972
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1973 1973
 				$out .= $labeltoshow;
1974 1974
 				$out .= '</option>';
1975 1975
 			}
@@ -1990,7 +1990,7 @@  discard block
 block discarded – undo
1990 1990
 			}
1991 1991
 
1992 1992
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1993
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1993
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1994 1994
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalInt("CONTACT_USE_SEARCH_TO_SELECT"));
1995 1995
 			}
1996 1996
 
@@ -2029,18 +2029,18 @@  discard block
 block discarded – undo
2029 2029
 		// On recherche les remises
2030 2030
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
2031 2031
 		$sql .= " re.description, re.fk_facture_source";
2032
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
2033
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
2034
-		$sql .= " AND re.entity = " . $conf->entity;
2032
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
2033
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
2034
+		$sql .= " AND re.entity = ".$conf->entity;
2035 2035
 		if ($filter) {
2036
-			$sql .= " AND " . $filter;
2036
+			$sql .= " AND ".$filter;
2037 2037
 		}
2038 2038
 		$sql .= " ORDER BY re.description ASC";
2039 2039
 
2040
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
2040
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
2041 2041
 		$resql = $this->db->query($sql);
2042 2042
 		if ($resql) {
2043
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
2043
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
2044 2044
 			$num = $this->db->num_rows($resql);
2045 2045
 
2046 2046
 			$qualifiedlines = $num;
@@ -2078,16 +2078,16 @@  discard block
 block discarded – undo
2078 2078
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
2079 2079
 						$tmpfac = new Facture($this->db);
2080 2080
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
2081
-							$desc = $desc . ' - ' . $tmpfac->ref;
2081
+							$desc = $desc.' - '.$tmpfac->ref;
2082 2082
 						}
2083 2083
 					}
2084 2084
 
2085
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
2085
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
2086 2086
 					$i++;
2087 2087
 				}
2088 2088
 			}
2089 2089
 			print '</select>';
2090
-			print ajax_combobox('select_' . $htmlname);
2090
+			print ajax_combobox('select_'.$htmlname);
2091 2091
 
2092 2092
 			return $qualifiedlines;
2093 2093
 		} else {
@@ -2196,14 +2196,14 @@  discard block
 block discarded – undo
2196 2196
 		if ($showlabelofentity) {
2197 2197
 			$sql .= ", e.label";
2198 2198
 		}
2199
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2199
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2200 2200
 		if ($showlabelofentity) {
2201
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2201
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2202 2202
 		}
2203 2203
 		// Condition here should be the same than into societe->getSalesRepresentatives().
2204 2204
 		if ($userissuperadminentityone && $force_entity != 'default') {
2205 2205
 			if (!empty($force_entity)) {
2206
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2206
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2207 2207
 			} else {
2208 2208
 				$sql .= " WHERE u.entity IS NOT NULL";
2209 2209
 			}
@@ -2211,18 +2211,18 @@  discard block
 block discarded – undo
2211 2211
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2212 2212
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2213 2213
 			} else {
2214
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2214
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2215 2215
 			}
2216 2216
 		}
2217 2217
 
2218 2218
 		if (!empty($user->socid)) {
2219
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2219
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2220 2220
 		}
2221 2221
 		if (is_array($exclude) && $excludeUsers) {
2222
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2222
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2223 2223
 		}
2224 2224
 		if ($includeUsers) {
2225
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2225
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2226 2226
 		}
2227 2227
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2228 2228
 			$sql .= " AND u.statut <> 0";
@@ -2259,7 +2259,7 @@  discard block
 block discarded – undo
2259 2259
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2260 2260
 		}
2261 2261
 
2262
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2262
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2263 2263
 
2264 2264
 		$resql = $this->db->query($sql);
2265 2265
 		if ($resql) {
@@ -2267,7 +2267,7 @@  discard block
 block discarded – undo
2267 2267
 			$i = 0;
2268 2268
 			if ($num) {
2269 2269
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2270
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2270
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2271 2271
 				if ($show_empty && !$multiple) {
2272 2272
 					$textforempty = ' ';
2273 2273
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2276,7 +2276,7 @@  discard block
 block discarded – undo
2276 2276
 					if (!is_numeric($show_empty)) {
2277 2277
 						$textforempty = $show_empty;
2278 2278
 					}
2279
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2279
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2280 2280
 
2281 2281
 					$outarray[($show_empty < 0 ? $show_empty : -1)] = $textforempty;
2282 2282
 					$outarray2[($show_empty < 0 ? $show_empty : -1)] = array(
@@ -2288,13 +2288,13 @@  discard block
 block discarded – undo
2288 2288
 					);
2289 2289
 				}
2290 2290
 				if ($show_every) {
2291
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2291
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2292 2292
 
2293
-					$outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --';
2293
+					$outarray[-2] = '-- '.$langs->trans("Everybody").' --';
2294 2294
 					$outarray2[-2] = array(
2295 2295
 						'id' => -2,
2296
-						'label' => '-- ' . $langs->trans("Everybody") . ' --',
2297
-						'labelhtml' => '-- ' . $langs->trans("Everybody") . ' --',
2296
+						'label' => '-- '.$langs->trans("Everybody").' --',
2297
+						'labelhtml' => '-- '.$langs->trans("Everybody").' --',
2298 2298
 						'color' => '',
2299 2299
 						'picto' => ''
2300 2300
 					);
@@ -2345,21 +2345,21 @@  discard block
 block discarded – undo
2345 2345
 					}
2346 2346
 					if ($showstatus >= 0) {
2347 2347
 						if ($obj->status == 1 && $showstatus == 1) {
2348
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2349
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2348
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2349
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2350 2350
 						}
2351 2351
 						if ($obj->status == 0 && $showstatus == 1) {
2352
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2353
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2352
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2353
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2354 2354
 						}
2355 2355
 					}
2356 2356
 					if ($showlabelofentity) {
2357 2357
 						if (empty($obj->entity)) {
2358
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2359
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2358
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2359
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2360 2360
 						} else {
2361 2361
 							if ($obj->entity != $conf->entity) {
2362
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2362
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2363 2363
 								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2364 2364
 							}
2365 2365
 						}
@@ -2368,13 +2368,13 @@  discard block
 block discarded – undo
2368 2368
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2369 2369
 					if (!empty($disableline) && $disableline != '1') {
2370 2370
 						// Add text from $enableonlytext parameter
2371
-						$moreinfo .= ' - ' . $disableline;
2372
-						$moreinfohtml .= ' - ' . $disableline;
2371
+						$moreinfo .= ' - '.$disableline;
2372
+						$moreinfohtml .= ' - '.$disableline;
2373 2373
 					}
2374 2374
 					$labeltoshow .= $moreinfo;
2375 2375
 					$labeltoshowhtml .= $moreinfohtml;
2376 2376
 
2377
-					$out .= '<option value="' . $obj->rowid . '"';
2377
+					$out .= '<option value="'.$obj->rowid.'"';
2378 2378
 					if (!empty($disableline)) {
2379 2379
 						$out .= ' disabled';
2380 2380
 					}
@@ -2383,7 +2383,7 @@  discard block
 block discarded – undo
2383 2383
 					}
2384 2384
 					$out .= ' data-html="';
2385 2385
 
2386
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2386
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2387 2387
 					if ($showstatus >= 0 && $obj->status == 0) {
2388 2388
 						$outhtml .= '<strike class="opacitymediumxxx">';
2389 2389
 					}
@@ -2398,7 +2398,7 @@  discard block
 block discarded – undo
2398 2398
 					$out .= $labeltoshow;
2399 2399
 					$out .= '</option>';
2400 2400
 
2401
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2401
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2402 2402
 					$outarray2[$userstatic->id] = array(
2403 2403
 						'id' => $userstatic->id,
2404 2404
 						'label' => $labeltoshow,
@@ -2410,14 +2410,14 @@  discard block
 block discarded – undo
2410 2410
 					$i++;
2411 2411
 				}
2412 2412
 			} else {
2413
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2414
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2413
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2414
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2415 2415
 			}
2416 2416
 			$out .= '</select>';
2417 2417
 
2418 2418
 			if ($num && !$forcecombo) {
2419 2419
 				// Enhance with select2
2420
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2420
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2421 2421
 				$out .= ajax_combobox($htmlname);
2422 2422
 			}
2423 2423
 		} else {
@@ -2494,7 +2494,7 @@  discard block
 block discarded – undo
2494 2494
 			$out .= $userstatic->getNomUrl(-1);
2495 2495
 			if ($i == 0) {
2496 2496
 				$ownerid = $value['id'];
2497
-				$out .= ' (' . $langs->trans("Owner") . ')';
2497
+				$out .= ' ('.$langs->trans("Owner").')';
2498 2498
 			}
2499 2499
 			// Add picto to delete owner/assignee
2500 2500
 			if ($nbassignetouser > 1 && $action != 'view') {
@@ -2505,7 +2505,7 @@  discard block
 block discarded – undo
2505 2505
 						$canremoveassignee = 0;
2506 2506
 					}
2507 2507
 					if (!$user->hasRight('agenda', 'allactions', 'create')) {
2508
-						$canremoveassignee = 0;		// Can't remove the owner
2508
+						$canremoveassignee = 0; // Can't remove the owner
2509 2509
 					}
2510 2510
 				} else {
2511 2511
 					// We are not on the owner of the event but on a secondary assignee
@@ -2513,14 +2513,14 @@  discard block
 block discarded – undo
2513 2513
 				if ($canremoveassignee) {
2514 2514
 					// If user has all permission, he should be ableto remove a assignee.
2515 2515
 					// If user has not all permission, he can onlyremove assignee of other (he can't remove itself)
2516
-					$out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $userstatic->id . '" class="removedassigned reposition" id="removedassigned_' . $userstatic->id . '" name="removedassigned_' . $userstatic->id . '">';
2516
+					$out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned reposition" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">';
2517 2517
 				}
2518 2518
 			}
2519 2519
 			// Show my availability
2520 2520
 			if ($showproperties) {
2521 2521
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2522 2522
 					$out .= '<div class="myavailability inline-block">';
2523
-					$out .= '<span class="hideonsmartphone">&nbsp;-&nbsp;<span class="opacitymedium">' . $langs->trans("Availability") . ':</span>  </span><input id="transparency" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofuserid[$ownerid]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>';
2523
+					$out .= '<span class="hideonsmartphone">&nbsp;-&nbsp;<span class="opacitymedium">'.$langs->trans("Availability").':</span>  </span><input id="transparency" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofuserid[$ownerid]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>';
2524 2524
 					$out .= '</div>';
2525 2525
 				}
2526 2526
 			}
@@ -2537,15 +2537,15 @@  discard block
 block discarded – undo
2537 2537
 		// Method with no ajax
2538 2538
 		if ($action != 'view') {
2539 2539
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2540
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2540
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2541 2541
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2542 2542
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2543
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2544
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2543
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2544
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2545 2545
 			$out .= '});';
2546 2546
 			$out .= '})</script>';
2547 2547
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2548
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2548
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2549 2549
 			$out .= '<br>';
2550 2550
 		}
2551 2551
 
@@ -2604,13 +2604,13 @@  discard block
 block discarded – undo
2604 2604
 			$resourcestatic->fetch($value['id']);
2605 2605
 			$out .= $resourcestatic->getNomUrl(-1);
2606 2606
 			if ($nbassignetoresource >= 1 && $action != 'view') {
2607
-				$out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassignedresource reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">';
2607
+				$out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassignedresource reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">';
2608 2608
 			}
2609 2609
 			// Show my availability
2610 2610
 			if ($showproperties) {
2611 2611
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2612 2612
 					$out .= '<div class="myavailability inline-block">';
2613
-					$out .= '<span class="hideonsmartphone">&nbsp;-&nbsp;<span class="opacitymedium">' . $langs->trans("Availability") . ':</span>  </span><input id="transparencyresource" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofresourceid[$value['id']]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>';
2613
+					$out .= '<span class="hideonsmartphone">&nbsp;-&nbsp;<span class="opacitymedium">'.$langs->trans("Availability").':</span>  </span><input id="transparencyresource" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofresourceid[$value['id']]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>';
2614 2614
 					$out .= '</div>';
2615 2615
 				}
2616 2616
 			}
@@ -2627,11 +2627,11 @@  discard block
 block discarded – undo
2627 2627
 		// Method with no ajax
2628 2628
 		if ($action != 'view') {
2629 2629
 			$out .= '<input type="hidden" class="removedassignedresourcehidden" name="removedassignedresource" value="">';
2630
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2630
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2631 2631
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2632 2632
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2633
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2634
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2633
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2634
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2635 2635
 			$out .= '});';
2636 2636
 			$out .= '})</script>';
2637 2637
 
@@ -2639,7 +2639,7 @@  discard block
 block discarded – undo
2639 2639
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2640 2640
 			$out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0);
2641 2641
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2642
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2642
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2643 2643
 			$out .= '<br>';
2644 2644
 		}
2645 2645
 
@@ -2702,7 +2702,7 @@  discard block
 block discarded – undo
2702 2702
 			$placeholder = (is_numeric($showempty) ? '' : 'placeholder="'.dolPrintHTML($showempty).'"');
2703 2703
 
2704 2704
 			if ($selected && empty($selected_input_value)) {
2705
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2705
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2706 2706
 				$producttmpselect = new Product($this->db);
2707 2707
 				$producttmpselect->fetch($selected);
2708 2708
 				$selected_input_value = $producttmpselect->ref;
@@ -2717,21 +2717,21 @@  discard block
 block discarded – undo
2717 2717
 				}
2718 2718
 			}
2719 2719
 			// mode=1 means customers products
2720
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=1&status=' . $status . '&status_purchase=' . $status_purchase . '&finished=' . $finished . '&hidepriceinlabel=' . $hidepriceinlabel . '&warehousestatus=' . $warehouseStatus;
2720
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&status_purchase='.$status_purchase.'&finished='.$finished.'&hidepriceinlabel='.$hidepriceinlabel.'&warehousestatus='.$warehouseStatus;
2721 2721
 			if ((int) $warehouseId > 0) {
2722
-				$urloption .= '&warehouseid=' . (int) $warehouseId;
2722
+				$urloption .= '&warehouseid='.(int) $warehouseId;
2723 2723
 			}
2724 2724
 
2725
-			$out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions);
2725
+			$out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions);
2726 2726
 
2727 2727
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2728 2728
 				// Code to automatically insert with javascript the select of attributes under the select of product
2729 2729
 				// when a parent of variant has been selected.
2730 2730
 				$out .= '
2731 2731
 				<!-- script to auto show attributes select tags if a variant was selected -->
2732
-				<script nonce="' . getNonce() . '">
2732
+				<script nonce="' . getNonce().'">
2733 2733
 					// auto show attributes fields
2734
-					selected = ' . json_encode($selected_combinations) . ';
2734
+					selected = ' . json_encode($selected_combinations).';
2735 2735
 					combvalues = {};
2736 2736
 
2737 2737
 					jQuery(document).ready(function () {
@@ -2742,7 +2742,7 @@  discard block
 block discarded – undo
2742 2742
 							}
2743 2743
 						});
2744 2744
 
2745
-						jQuery("input#' . $htmlname . '").change(function () {
2745
+						jQuery("input#' . $htmlname.'").change(function () {
2746 2746
 
2747 2747
 							if (!jQuery(this).val()) {
2748 2748
 								jQuery(\'div#attributes_box\').empty();
@@ -2751,7 +2751,7 @@  discard block
 block discarded – undo
2751 2751
 
2752 2752
 							console.log("A change has started. We get variants fields to inject html select");
2753 2753
 
2754
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2754
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2755 2755
 								id: jQuery(this).val()
2756 2756
 							}, function (data) {
2757 2757
 								jQuery(\'div#attributes_box\').empty();
@@ -2794,22 +2794,22 @@  discard block
 block discarded – undo
2794 2794
 							})
2795 2795
 						});
2796 2796
 
2797
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2797
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2798 2798
 					});
2799 2799
 				</script>
2800 2800
                 ';
2801 2801
 			}
2802 2802
 
2803 2803
 			if (empty($hidelabel)) {
2804
-				$placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"';
2804
+				$placeholder = ' placeholder="'.dolPrintHTMLForAttribute($langs->trans("RefOrLabel")).'"';
2805 2805
 			} elseif ($hidelabel > 1) {
2806
-				$placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"';
2806
+				$placeholder = ' placeholder="'.dolPrintHTMLForAttribute($langs->trans("RefOrLabel")).'"';
2807 2807
 				if ($hidelabel == 2) {
2808 2808
 					$out .= img_picto($langs->trans("Search"), 'search');
2809 2809
 				}
2810 2810
 			}
2811 2811
 
2812
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2812
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2813 2813
 			if ($hidelabel == 3) {
2814 2814
 				$out .= img_picto($langs->trans("Search"), 'search');
2815 2815
 			}
@@ -2846,33 +2846,33 @@  discard block
 block discarded – undo
2846 2846
 		// phpcs:enable
2847 2847
 		global $db;
2848 2848
 
2849
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2849
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2850 2850
 
2851 2851
 		$error = 0;
2852 2852
 		$out = '';
2853 2853
 
2854 2854
 		if (!$forcecombo) {
2855
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2855
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2856 2856
 			$events = array();
2857 2857
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2858 2858
 		}
2859 2859
 
2860
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2860
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2861 2861
 
2862 2862
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2863
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2864
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2863
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2864
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2865 2865
 		if (!empty($status)) {
2866
-			$sql .= ' AND status = ' . (int) $status;
2866
+			$sql .= ' AND status = '.(int) $status;
2867 2867
 		}
2868 2868
 		if (!empty($type)) {
2869
-			$sql .= ' AND bomtype = ' . (int) $type;
2869
+			$sql .= ' AND bomtype = '.(int) $type;
2870 2870
 		}
2871 2871
 		if (!empty($TProducts)) {
2872
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2872
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2873 2873
 		}
2874 2874
 		if (!empty($limit)) {
2875
-			$sql .= ' LIMIT ' . (int) $limit;
2875
+			$sql .= ' LIMIT '.(int) $limit;
2876 2876
 		}
2877 2877
 		$resql = $db->query($sql);
2878 2878
 		if ($resql) {
@@ -2886,11 +2886,11 @@  discard block
 block discarded – undo
2886 2886
 			while ($obj = $db->fetch_object($resql)) {
2887 2887
 				$product = new Product($db);
2888 2888
 				$res = $product->fetch($obj->fk_product);
2889
-				$out .= '<option value="' . $obj->rowid . '"';
2889
+				$out .= '<option value="'.$obj->rowid.'"';
2890 2890
 				if ($obj->rowid == $selected) {
2891 2891
 					$out .= 'selected';
2892 2892
 				}
2893
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2893
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2894 2894
 			}
2895 2895
 		} else {
2896 2896
 			$error++;
@@ -2948,7 +2948,7 @@  discard block
 block discarded – undo
2948 2948
 
2949 2949
 		$warehouseStatusArray = array();
2950 2950
 		if (!empty($warehouseStatus)) {
2951
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2951
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2952 2952
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2953 2953
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2954 2954
 			}
@@ -2962,9 +2962,9 @@  discard block
 block discarded – undo
2962 2962
 
2963 2963
 		$selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_country, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.duration, p.fk_price_expression";
2964 2964
 		if (count($warehouseStatusArray)) {
2965
-			$selectFieldsGrouped = ", sum(" . $this->db->ifsql("e.statut IS NULL", "0", "ps.reel") . ") as stock"; // e.statut is null if there is no record in stock
2965
+			$selectFieldsGrouped = ", sum(".$this->db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock
2966 2966
 		} else {
2967
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2967
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2968 2968
 		}
2969 2969
 
2970 2970
 		$sql = "SELECT ";
@@ -2980,9 +2980,9 @@  discard block
 block discarded – undo
2980 2980
 
2981 2981
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2982 2982
 			//Product category
2983
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2984
-						FROM " . $this->db->prefix() . "categorie_product
2985
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2983
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2984
+						FROM " . $this->db->prefix()."categorie_product
2985
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2986 2986
 						LIMIT 1
2987 2987
 				) AS categorie_product_id ";
2988 2988
 		}
@@ -3008,15 +3008,15 @@  discard block
 block discarded – undo
3008 3008
 		}
3009 3009
 		// Price by quantity
3010 3010
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
3011
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
3011
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
3012 3012
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
3013
-				$sql .= " AND price_level = " . ((int) $price_level);
3013
+				$sql .= " AND price_level = ".((int) $price_level);
3014 3014
 			}
3015 3015
 			$sql .= " ORDER BY date_price";
3016 3016
 			$sql .= " DESC LIMIT 1) as price_rowid";
3017
-			$sql .= ", (SELECT pp.price_by_qty FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable
3017
+			$sql .= ", (SELECT pp.price_by_qty FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable
3018 3018
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
3019
-				$sql .= " AND price_level = " . ((int) $price_level);
3019
+				$sql .= " AND price_level = ".((int) $price_level);
3020 3020
 			}
3021 3021
 			$sql .= " ORDER BY date_price";
3022 3022
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -3026,7 +3026,7 @@  discard block
 block discarded – undo
3026 3026
 		$sql .= " FROM ".$this->db->prefix()."product as p";
3027 3027
 
3028 3028
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_FORCE_INDEX')) {
3029
-			$sql .= " USE INDEX (" . $this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')) . ")";
3029
+			$sql .= " USE INDEX (".$this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')).")";
3030 3030
 		}
3031 3031
 
3032 3032
 		// Add from (left join) from hooks
@@ -3035,53 +3035,53 @@  discard block
 block discarded – undo
3035 3035
 		$sql .= $hookmanager->resPrint;
3036 3036
 
3037 3037
 		if (count($warehouseStatusArray)) {
3038
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
3039
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
3040
-			$sql .= ' AND e.statut IN (' . $this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))) . ')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0.
3038
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
3039
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
3040
+			$sql .= ' AND e.statut IN ('.$this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0.
3041 3041
 		}
3042 3042
 
3043 3043
 		// include search in supplier ref
3044 3044
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
3045
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3045
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3046 3046
 		}
3047 3047
 
3048 3048
 		//Price by customer
3049 3049
 		if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
3050
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
3050
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
3051 3051
 		}
3052 3052
 		// Units
3053 3053
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3054
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3054
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3055 3055
 		}
3056 3056
 		// Multilang : we add translation
3057 3057
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
3058
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
3058
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
3059 3059
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
3060
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
3060
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
3061 3061
 				$soc = new Societe($this->db);
3062 3062
 				$result = $soc->fetch($socid);
3063 3063
 				if ($result > 0 && !empty($soc->default_lang)) {
3064
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
3064
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
3065 3065
 				} else {
3066
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
3066
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
3067 3067
 				}
3068 3068
 			} else {
3069
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
3069
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
3070 3070
 			}
3071 3071
 		}
3072 3072
 
3073 3073
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
3074
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
3074
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
3075 3075
 		}
3076 3076
 
3077
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
3077
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
3078 3078
 
3079 3079
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
3080 3080
 			$sql .= " AND pac.rowid IS NULL";
3081 3081
 		}
3082 3082
 
3083 3083
 		if ($finished == 0) {
3084
-			$sql .= " AND p.finished = " . ((int) $finished);
3084
+			$sql .= " AND p.finished = ".((int) $finished);
3085 3085
 		} elseif ($finished == 1) {
3086 3086
 			$sql .= " AND p.finished = ".((int) $finished);
3087 3087
 		}
@@ -3089,11 +3089,11 @@  discard block
 block discarded – undo
3089 3089
 			$sql .= " AND p.tosell = ".((int) $status);
3090 3090
 		}
3091 3091
 		if ($status_purchase >= 0) {
3092
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
3092
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
3093 3093
 		}
3094 3094
 		// Filter by product type
3095 3095
 		if (strval($filtertype) != '') {
3096
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3096
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3097 3097
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
3098 3098
 			$sql .= " AND p.fk_product_type = 1";
3099 3099
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
@@ -3101,7 +3101,7 @@  discard block
 block discarded – undo
3101 3101
 		}
3102 3102
 
3103 3103
 		if ((int) $warehouseId > 0) {
3104
-			$sql .= " AND EXISTS (SELECT psw.fk_product FROM " . $this->db->prefix() . "product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)";
3104
+			$sql .= " AND EXISTS (SELECT psw.fk_product FROM ".$this->db->prefix()."product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)";
3105 3105
 		}
3106 3106
 
3107 3107
 		// Add where from hooks
@@ -3122,21 +3122,21 @@  discard block
 block discarded – undo
3122 3122
 				if ($i > 0) {
3123 3123
 					$sql .= " AND ";
3124 3124
 				}
3125
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3125
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
3126 3126
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
3127
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3127
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
3128 3128
 				}
3129 3129
 				if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
3130
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3130
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
3131 3131
 				}
3132 3132
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
3133
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3133
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
3134 3134
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
3135
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3135
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
3136 3136
 					}
3137 3137
 				}
3138 3138
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
3139
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3139
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3140 3140
 				}
3141 3141
 				$sql .= ")";
3142 3142
 				$i++;
@@ -3145,12 +3145,12 @@  discard block
 block discarded – undo
3145 3145
 				$sql .= ")";
3146 3146
 			}
3147 3147
 			if (isModEnabled('barcode')) {
3148
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3148
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3149 3149
 			}
3150 3150
 			$sql .= ')';
3151 3151
 		}
3152 3152
 		if (count($warehouseStatusArray)) {
3153
-			$sql .= " GROUP BY " . $selectFields;
3153
+			$sql .= " GROUP BY ".$selectFields;
3154 3154
 		}
3155 3155
 
3156 3156
 		//Sort by category
@@ -3165,23 +3165,23 @@  discard block
 block discarded – undo
3165 3165
 		$sql .= $this->db->plimit($limit, 0);
3166 3166
 
3167 3167
 		// Build output string
3168
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
3168
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
3169 3169
 		$result = $this->db->query($sql);
3170 3170
 		if ($result) {
3171
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3172
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3173
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3171
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3172
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3173
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3174 3174
 
3175 3175
 			$num = $this->db->num_rows($result);
3176 3176
 
3177 3177
 			$events = array();
3178 3178
 
3179 3179
 			if (!$forcecombo) {
3180
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3180
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3181 3181
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
3182 3182
 			}
3183 3183
 
3184
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
3184
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
3185 3185
 
3186 3186
 			$textifempty = '';
3187 3187
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -3198,7 +3198,7 @@  discard block
 block discarded – undo
3198 3198
 				}
3199 3199
 			}
3200 3200
 			if ($showempty) {
3201
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
3201
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
3202 3202
 			}
3203 3203
 
3204 3204
 			$i = 0;
@@ -3209,11 +3209,11 @@  discard block
 block discarded – undo
3209 3209
 
3210 3210
 				if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product
3211 3211
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
3212
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
3213
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
3212
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
3213
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
3214 3214
 					$sql .= " ORDER BY quantity ASC";
3215 3215
 
3216
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
3216
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
3217 3217
 					$result2 = $this->db->query($sql);
3218 3218
 					if ($result2) {
3219 3219
 						$nb_prices = $this->db->num_rows($result2);
@@ -3251,7 +3251,7 @@  discard block
 block discarded – undo
3251 3251
 						$price_product = new Product($this->db);
3252 3252
 						$price_product->fetch($objp->rowid, '', '', 1);
3253 3253
 
3254
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3254
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3255 3255
 						$priceparser = new PriceParser($this->db);
3256 3256
 						$price_result = $priceparser->parseProduct($price_product);
3257 3257
 						if ($price_result >= 0) {
@@ -3337,7 +3337,7 @@  discard block
 block discarded – undo
3337 3337
 			$label = $objp->label_translated;
3338 3338
 		}
3339 3339
 		if (!empty($filterkey) && $filterkey != '') {
3340
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3340
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3341 3341
 		}
3342 3342
 
3343 3343
 		$outkey = $objp->rowid;
@@ -3358,32 +3358,32 @@  discard block
 block discarded – undo
3358 3358
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3359 3359
 
3360 3360
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3361
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3361
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3362 3362
 		}
3363 3363
 
3364 3364
 		// Units
3365 3365
 		$outvalUnits = '';
3366 3366
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3367 3367
 			if (!empty($objp->unit_short)) {
3368
-				$outvalUnits .= ' - ' . $objp->unit_short;
3368
+				$outvalUnits .= ' - '.$objp->unit_short;
3369 3369
 			}
3370 3370
 		}
3371 3371
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3372 3372
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3373 3373
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3374
-				$outvalUnits .= ' - ' . $unitToShow;
3374
+				$outvalUnits .= ' - '.$unitToShow;
3375 3375
 			}
3376 3376
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3377
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3378
-				$outvalUnits .= ' - ' . $unitToShow;
3377
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3378
+				$outvalUnits .= ' - '.$unitToShow;
3379 3379
 			}
3380 3380
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3381 3381
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3382
-				$outvalUnits .= ' - ' . $unitToShow;
3382
+				$outvalUnits .= ' - '.$unitToShow;
3383 3383
 			}
3384 3384
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3385 3385
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3386
-				$outvalUnits .= ' - ' . $unitToShow;
3386
+				$outvalUnits .= ' - '.$unitToShow;
3387 3387
 			}
3388 3388
 		}
3389 3389
 		if ($outdurationvalue && $outdurationunit) {
@@ -3395,7 +3395,7 @@  discard block
 block discarded – undo
3395 3395
 				'y' => $langs->trans('Year')
3396 3396
 			);
3397 3397
 			if (isset($da[$outdurationunit])) {
3398
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3398
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3399 3399
 			}
3400 3400
 		}
3401 3401
 
@@ -3415,31 +3415,31 @@  discard block
 block discarded – undo
3415 3415
 		$labeltoshow = '';
3416 3416
 		$labeltoshow .= $objp->ref;
3417 3417
 		if (!empty($objp->custref)) {
3418
-			$labeltoshow .= ' (' . $objp->custref . ')';
3418
+			$labeltoshow .= ' ('.$objp->custref.')';
3419 3419
 		}
3420 3420
 		if ($outbarcode) {
3421
-			$labeltoshow .= ' (' . $outbarcode . ')';
3421
+			$labeltoshow .= ' ('.$outbarcode.')';
3422 3422
 		}
3423
-		$labeltoshow .= ' - ' . dol_trunc($label, $maxlengtharticle);
3423
+		$labeltoshow .= ' - '.dol_trunc($label, $maxlengtharticle);
3424 3424
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3425
-			$labeltoshow .= ' (' . getCountry($outorigin, '1') . ')';
3425
+			$labeltoshow .= ' ('.getCountry($outorigin, '1').')';
3426 3426
 		}
3427 3427
 
3428 3428
 		// Set $labltoshowhtml
3429 3429
 		$labeltoshowhtml = '';
3430 3430
 		$labeltoshowhtml .= $objp->ref;
3431 3431
 		if (!empty($objp->custref)) {
3432
-			$labeltoshowhtml .= ' (' . $objp->custref . ')';
3432
+			$labeltoshowhtml .= ' ('.$objp->custref.')';
3433 3433
 		}
3434 3434
 		if (!empty($filterkey) && $filterkey != '') {
3435
-			$labeltoshowhtml = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $labeltoshowhtml, 1);
3435
+			$labeltoshowhtml = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $labeltoshowhtml, 1);
3436 3436
 		}
3437 3437
 		if ($outbarcode) {
3438
-			$labeltoshowhtml .= ' (' . $outbarcode . ')';
3438
+			$labeltoshowhtml .= ' ('.$outbarcode.')';
3439 3439
 		}
3440
-		$labeltoshowhtml .= ' - ' . dol_trunc($label, $maxlengtharticle);
3440
+		$labeltoshowhtml .= ' - '.dol_trunc($label, $maxlengtharticle);
3441 3441
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3442
-			$labeltoshowhtml .= ' (' . getCountry($outorigin, '1') . ')';
3442
+			$labeltoshowhtml .= ' ('.getCountry($outorigin, '1').')';
3443 3443
 		}
3444 3444
 
3445 3445
 		// Stock
@@ -3447,14 +3447,14 @@  discard block
 block discarded – undo
3447 3447
 		$labeltoshowhtmlstock = '';
3448 3448
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3449 3449
 			if ($user->hasRight('stock', 'lire')) {
3450
-				$labeltoshowstock .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3450
+				$labeltoshowstock .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3451 3451
 
3452 3452
 				if ($objp->stock > 0) {
3453 3453
 					$labeltoshowhtmlstock .= ' - <span class="product_line_stock_ok">';
3454 3454
 				} elseif ($objp->stock <= 0) {
3455 3455
 					$labeltoshowhtmlstock .= ' - <span class="product_line_stock_too_low">';
3456 3456
 				}
3457
-				$labeltoshowhtmlstock .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3457
+				$labeltoshowhtmlstock .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
3458 3458
 				$labeltoshowhtmlstock .= '</span>';
3459 3459
 
3460 3460
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
@@ -3465,9 +3465,9 @@  discard block
 block discarded – undo
3465 3465
 					$tmpproduct->load_virtual_stock();
3466 3466
 					$virtualstock = $tmpproduct->stock_theorique;
3467 3467
 
3468
-					$labeltoshowstock .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3468
+					$labeltoshowstock .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3469 3469
 
3470
-					$labeltoshowhtmlstock .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3470
+					$labeltoshowhtmlstock .= ' - '.$langs->transnoentities("VirtualStock").':';
3471 3471
 					if ($virtualstock > 0) {
3472 3472
 						$labeltoshowhtmlstock .= '<span class="product_line_stock_ok">';
3473 3473
 					} elseif ($virtualstock <= 0) {
@@ -3488,35 +3488,35 @@  discard block
 block discarded – undo
3488 3488
 		// If we need a particular price level (from 1 to n)
3489 3489
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) {
3490 3490
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3491
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3492
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3493
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3494
-			$sql .= " AND price_level = " . ((int) $price_level);
3491
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3492
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3493
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3494
+			$sql .= " AND price_level = ".((int) $price_level);
3495 3495
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3496 3496
 			$sql .= " LIMIT 1";
3497 3497
 
3498
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3498
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3499 3499
 			$result2 = $this->db->query($sql);
3500 3500
 			if ($result2) {
3501 3501
 				$objp2 = $this->db->fetch_object($result2);
3502 3502
 				if ($objp2) {
3503 3503
 					$found = 1;
3504 3504
 					if ($objp2->price_base_type == 'HT') {
3505
-						$labeltoshowprice .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3506
-						$labeltoshowhtmlprice .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3505
+						$labeltoshowprice .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3506
+						$labeltoshowhtmlprice .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3507 3507
 					} else {
3508
-						$labeltoshowprice .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3509
-						$labeltoshowhtmlprice .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3508
+						$labeltoshowprice .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3509
+						$labeltoshowhtmlprice .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3510 3510
 					}
3511 3511
 					$outprice_ht = price($objp2->price);
3512 3512
 					$outprice_ttc = price($objp2->price_ttc);
3513 3513
 					$outpricebasetype = $objp2->price_base_type;
3514 3514
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3515
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3516
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3515
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3516
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3517 3517
 					} else {
3518
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3519
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3518
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3519
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3520 3520
 					}
3521 3521
 				}
3522 3522
 			} else {
@@ -3530,13 +3530,13 @@  discard block
 block discarded – undo
3530 3530
 			$outqty = $objp->quantity;
3531 3531
 			$outdiscount = $objp->remise_percent;
3532 3532
 			if ($objp->quantity == 1) {
3533
-				$labeltoshowprice .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3534
-				$labeltoshowhtmlprice .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3533
+				$labeltoshowprice .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3534
+				$labeltoshowhtmlprice .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3535 3535
 				$labeltoshowprice .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3536 3536
 				$labeltoshowhtmlprice .= $langs->transnoentities("Unit");
3537 3537
 			} else {
3538
-				$labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3539
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3538
+				$labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3539
+				$labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3540 3540
 				$labeltoshowprice .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3541 3541
 				$labeltoshowhtmlprice .= $langs->transnoentities("Units");
3542 3542
 			}
@@ -3544,16 +3544,16 @@  discard block
 block discarded – undo
3544 3544
 			$outprice_ht = price($objp->unitprice);
3545 3545
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3546 3546
 			$outpricebasetype = $objp->price_base_type;
3547
-			$outtva_tx = $objp->tva_tx;                            // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty
3548
-			$outdefault_vat_code = $objp->default_vat_code;        // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty
3547
+			$outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty
3548
+			$outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty
3549 3549
 		}
3550 3550
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3551
-			$labeltoshowprice .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3552
-			$labeltoshowhtmlprice .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3551
+			$labeltoshowprice .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3552
+			$labeltoshowhtmlprice .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3553 3553
 		}
3554 3554
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3555
-			$labeltoshowprice .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3556
-			$labeltoshowhtmlprice .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3555
+			$labeltoshowprice .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3556
+			$labeltoshowhtmlprice .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3557 3557
 		}
3558 3558
 
3559 3559
 		// Price by customer
@@ -3562,11 +3562,11 @@  discard block
 block discarded – undo
3562 3562
 				$found = 1;
3563 3563
 
3564 3564
 				if ($objp->custprice_base_type == 'HT') {
3565
-					$labeltoshowprice .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3566
-					$labeltoshowhtmlprice .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3565
+					$labeltoshowprice .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3566
+					$labeltoshowhtmlprice .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3567 3567
 				} else {
3568
-					$labeltoshowprice .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3569
-					$labeltoshowhtmlprice .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3568
+					$labeltoshowprice .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3569
+					$labeltoshowhtmlprice .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3570 3570
 				}
3571 3571
 
3572 3572
 				$outprice_ht = price($objp->custprice);
@@ -3580,11 +3580,11 @@  discard block
 block discarded – undo
3580 3580
 		// If level no defined or multiprice not found, we used the default price
3581 3581
 		if (empty($hidepriceinlabel) && !$found) {
3582 3582
 			if ($objp->price_base_type == 'HT') {
3583
-				$labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3584
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3583
+				$labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3584
+				$labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3585 3585
 			} else {
3586
-				$labeltoshowprice .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3587
-				$labeltoshowhtmlprice .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3586
+				$labeltoshowprice .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3587
+				$labeltoshowhtmlprice .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3588 3588
 			}
3589 3589
 			$outprice_ht = price($objp->price);
3590 3590
 			$outprice_ttc = price($objp->price_ttc);
@@ -3594,14 +3594,14 @@  discard block
 block discarded – undo
3594 3594
 		}
3595 3595
 
3596 3596
 		// Build options
3597
-		$opt = '<option value="' . $objp->rowid . '"';
3597
+		$opt = '<option value="'.$objp->rowid.'"';
3598 3598
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3599 3599
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3600
-			$opt .= ' pbq="' . $objp->price_by_qty_rowid . '" data-pbq="' . $objp->price_by_qty_rowid . '" data-pbqup="' . $objp->price_by_qty_unitprice . '" data-pbqbase="' . $objp->price_by_qty_price_base_type . '" data-pbqqty="' . $objp->price_by_qty_quantity . '" data-pbqpercent="' . $objp->price_by_qty_remise_percent . '"';
3600
+			$opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"';
3601 3601
 		}
3602 3602
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3603
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3604
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3603
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3604
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3605 3605
 		}
3606 3606
 
3607 3607
 		if ($stocktag == 1) {
@@ -3696,7 +3696,7 @@  discard block
 block discarded – undo
3696 3696
 		$selected_input_value = '';
3697 3697
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3698 3698
 			if ($selected > 0) {
3699
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3699
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3700 3700
 				$producttmpselect = new Product($this->db);
3701 3701
 				$producttmpselect->fetch($selected);
3702 3702
 				$selected_input_value = $producttmpselect->ref;
@@ -3704,10 +3704,10 @@  discard block
 block discarded – undo
3704 3704
 			}
3705 3705
 
3706 3706
 			// mode=2 means suppliers products
3707
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3708
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions);
3707
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3708
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions);
3709 3709
 
3710
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="'.$morecss.'" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3710
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3711 3711
 		} else {
3712 3712
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3713 3713
 		}
@@ -3765,25 +3765,25 @@  discard block
 block discarded – undo
3765 3765
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3766 3766
 			$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
3767 3767
 		}
3768
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3769
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3768
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3769
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3770 3770
 		if ($socid > 0) {
3771
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3771
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3772 3772
 		}
3773
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3773
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3774 3774
 		// Units
3775 3775
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3776
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3776
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3777 3777
 		}
3778
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3778
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3779 3779
 		if ($statut != -1) {
3780
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3780
+			$sql .= " AND p.tobuy = ".((int) $statut);
3781 3781
 		}
3782 3782
 		if (strval($filtertype) != '') {
3783
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3783
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3784 3784
 		}
3785 3785
 		if (!empty($filtre)) {
3786
-			$sql .= " " . $filtre;
3786
+			$sql .= " ".$filtre;
3787 3787
 		}
3788 3788
 		// Add where from hooks
3789 3789
 		$parameters = array();
@@ -3803,9 +3803,9 @@  discard block
 block discarded – undo
3803 3803
 				if ($i > 0) {
3804 3804
 					$sql .= " AND ";
3805 3805
 				}
3806
-				$sql .= "(pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3806
+				$sql .= "(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
3807 3807
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3808
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3808
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3809 3809
 				}
3810 3810
 				$sql .= ")";
3811 3811
 				$i++;
@@ -3814,8 +3814,8 @@  discard block
 block discarded – undo
3814 3814
 				$sql .= ")";
3815 3815
 			}
3816 3816
 			if (isModEnabled('barcode')) {
3817
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3818
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3817
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3818
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3819 3819
 			}
3820 3820
 			$sql .= ')';
3821 3821
 		}
@@ -3824,20 +3824,20 @@  discard block
 block discarded – undo
3824 3824
 
3825 3825
 		// Build output string
3826 3826
 
3827
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3827
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3828 3828
 		$result = $this->db->query($sql);
3829 3829
 		if ($result) {
3830
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3831
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3830
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3831
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3832 3832
 
3833 3833
 			$num = $this->db->num_rows($result);
3834 3834
 
3835 3835
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3836
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3836
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3837 3837
 			if (!$selected) {
3838
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3838
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3839 3839
 			} else {
3840
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3840
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3841 3841
 			}
3842 3842
 
3843 3843
 			$i = 0;
@@ -3852,7 +3852,7 @@  discard block
 block discarded – undo
3852 3852
 
3853 3853
 				$outkey = $objp->idprodfournprice; // id in table of price
3854 3854
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3855
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3855
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3856 3856
 				}
3857 3857
 
3858 3858
 				$outref = $objp->ref;
@@ -3867,23 +3867,23 @@  discard block
 block discarded – undo
3867 3867
 				$outvalUnits = '';
3868 3868
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3869 3869
 					if (!empty($objp->unit_short)) {
3870
-						$outvalUnits .= ' - ' . $objp->unit_short;
3870
+						$outvalUnits .= ' - '.$objp->unit_short;
3871 3871
 					}
3872 3872
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3873 3873
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3874
-						$outvalUnits .= ' - ' . $unitToShow;
3874
+						$outvalUnits .= ' - '.$unitToShow;
3875 3875
 					}
3876 3876
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3877
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3878
-						$outvalUnits .= ' - ' . $unitToShow;
3877
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3878
+						$outvalUnits .= ' - '.$unitToShow;
3879 3879
 					}
3880 3880
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3881 3881
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3882
-						$outvalUnits .= ' - ' . $unitToShow;
3882
+						$outvalUnits .= ' - '.$unitToShow;
3883 3883
 					}
3884 3884
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3885 3885
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3886
-						$outvalUnits .= ' - ' . $unitToShow;
3886
+						$outvalUnits .= ' - '.$unitToShow;
3887 3887
 					}
3888 3888
 					if ($outdurationvalue && $outdurationunit) {
3889 3889
 						$da = array(
@@ -3894,22 +3894,22 @@  discard block
 block discarded – undo
3894 3894
 							'y' => $langs->trans('Year')
3895 3895
 						);
3896 3896
 						if (isset($da[$outdurationunit])) {
3897
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3897
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3898 3898
 						}
3899 3899
 					}
3900 3900
 				}
3901 3901
 
3902 3902
 				$objRef = $objp->ref;
3903 3903
 				if ($filterkey && $filterkey != '') {
3904
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3904
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3905 3905
 				}
3906 3906
 				$objRefFourn = $objp->ref_fourn;
3907 3907
 				if ($filterkey && $filterkey != '') {
3908
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3908
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3909 3909
 				}
3910 3910
 				$label = $objp->label;
3911 3911
 				if ($filterkey && $filterkey != '') {
3912
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3912
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3913 3913
 				}
3914 3914
 
3915 3915
 				switch ($objp->fk_product_type) {
@@ -3932,21 +3932,21 @@  discard block
 block discarded – undo
3932 3932
 
3933 3933
 				$optlabel .= $objp->ref;
3934 3934
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3935
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3935
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3936 3936
 				}
3937 3937
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3938
-					$optlabel .= ' (' . $outbarcode . ')';
3938
+					$optlabel .= ' ('.$outbarcode.')';
3939 3939
 				}
3940
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3940
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3941 3941
 
3942 3942
 				$outvallabel = $objRef;
3943 3943
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3944
-					$outvallabel .= ' (' . $objRefFourn . ')';
3944
+					$outvallabel .= ' ('.$objRefFourn.')';
3945 3945
 				}
3946 3946
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3947
-					$outvallabel .= ' (' . $outbarcode . ')';
3947
+					$outvallabel .= ' ('.$outbarcode.')';
3948 3948
 				}
3949
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3949
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3950 3950
 
3951 3951
 				// Units
3952 3952
 				$optlabel .= $outvalUnits;
@@ -3963,7 +3963,7 @@  discard block
 block discarded – undo
3963 3963
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3964 3964
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3965 3965
 
3966
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3966
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3967 3967
 						$priceparser = new PriceParser($this->db);
3968 3968
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3969 3969
 						if ($price_result >= 0) {
@@ -3974,57 +3974,57 @@  discard block
 block discarded – undo
3974 3974
 						}
3975 3975
 					}
3976 3976
 					if ($objp->quantity == 1) {
3977
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3978
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3977
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3978
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3979 3979
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3980 3980
 						$outvallabel .= $langs->transnoentities("Unit");
3981 3981
 					} else {
3982
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3983
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3984
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3985
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3982
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3983
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3984
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3985
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3986 3986
 					}
3987 3987
 
3988 3988
 					if ($objp->quantity > 1) {
3989
-						$optlabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3990
-						$outvallabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3989
+						$optlabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3990
+						$outvallabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3991 3991
 					}
3992 3992
 					if ($objp->remise_percent >= 1) {
3993
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3994
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3993
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3994
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3995 3995
 					}
3996 3996
 					if ($objp->duration) {
3997
-						$optlabel .= " - " . $objp->duration;
3998
-						$outvallabel .= " - " . $objp->duration;
3997
+						$optlabel .= " - ".$objp->duration;
3998
+						$outvallabel .= " - ".$objp->duration;
3999 3999
 					}
4000 4000
 					if (!$socid) {
4001
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
4002
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
4001
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
4002
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
4003 4003
 					}
4004 4004
 					if ($objp->supplier_reputation) {
4005 4005
 						//TODO dictionary
4006 4006
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
4007 4007
 
4008
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
4009
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
4008
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
4009
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
4010 4010
 					}
4011 4011
 				} else {
4012
-					$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
4013
-					$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
4012
+					$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
4013
+					$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
4014 4014
 				}
4015 4015
 
4016 4016
 				if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
4017 4017
 					$novirtualstock = ($showstockinlist == 2);
4018 4018
 
4019 4019
 					if ($user->hasRight('stock', 'lire')) {
4020
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
4020
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0);
4021 4021
 
4022 4022
 						if ($objp->stock > 0) {
4023 4023
 							$optlabel .= ' - <span class="product_line_stock_ok">';
4024 4024
 						} elseif ($objp->stock <= 0) {
4025 4025
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
4026 4026
 						}
4027
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
4027
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
4028 4028
 						$optlabel .= '</span>';
4029 4029
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
4030 4030
 							$langs->load("stocks");
@@ -4034,9 +4034,9 @@  discard block
 block discarded – undo
4034 4034
 							$tmpproduct->load_virtual_stock();
4035 4035
 							$virtualstock = $tmpproduct->stock_theorique;
4036 4036
 
4037
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
4037
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
4038 4038
 
4039
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
4039
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
4040 4040
 							if ($virtualstock > 0) {
4041 4041
 								$optlabel .= '<span class="product_line_stock_ok">';
4042 4042
 							} elseif ($virtualstock <= 0) {
@@ -4050,7 +4050,7 @@  discard block
 block discarded – undo
4050 4050
 					}
4051 4051
 				}
4052 4052
 
4053
-				$optstart = '<option value="' . $outkey . '"';
4053
+				$optstart = '<option value="'.$outkey.'"';
4054 4054
 				if ($selected && $selected == $objp->idprodfournprice) {
4055 4055
 					$optstart .= ' selected';
4056 4056
 				}
@@ -4059,22 +4059,22 @@  discard block
 block discarded – undo
4059 4059
 				}
4060 4060
 
4061 4061
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
4062
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
4063
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
4064
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
4065
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
4066
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
4067
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
4068
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
4069
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
4070
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
4071
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
4062
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
4063
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
4064
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
4065
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
4066
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
4067
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
4068
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
4069
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
4070
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
4071
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
4072 4072
 					if (isModEnabled('multicurrency')) {
4073
-						$optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"';
4074
-						$optstart .= ' data-multicurrency-unitprice="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"';
4073
+						$optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"';
4074
+						$optstart .= ' data-multicurrency-unitprice="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"';
4075 4075
 					}
4076 4076
 				}
4077
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
4077
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
4078 4078
 
4079 4079
 				// set $parameters to call hook
4080 4080
 				$outarrayentry = array(
@@ -4083,9 +4083,9 @@  discard block
 block discarded – undo
4083 4083
 					'label' => $outvallabel,
4084 4084
 					'labelhtml' => $optlabel,
4085 4085
 					'qty' => $outqty,
4086
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
4087
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
4088
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
4086
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
4087
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
4088
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
4089 4089
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
4090 4090
 					'tva_tx' => price2num($objp->tva_tx),
4091 4091
 					'default_vat_code' => $objp->default_vat_code,
@@ -4115,18 +4115,18 @@  discard block
 block discarded – undo
4115 4115
 				// Add new entry
4116 4116
 				// "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax
4117 4117
 				// "label" value of json key array is used by jQuery automatically as text for combo box
4118
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
4118
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
4119 4119
 				$outarraypush = array(
4120 4120
 					'key' => $outkey,
4121 4121
 					'value' => $outref,
4122 4122
 					'label' => $outvallabel,
4123 4123
 					'labelhtml' => $optlabel,
4124 4124
 					'qty' => $outqty,
4125
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
4125
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
4126 4126
 					'price_qty_ht_locale' => price($objp->fprice),
4127
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
4127
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
4128 4128
 					'price_unit_ht_locale' => price($objp->unitprice),
4129
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
4129
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
4130 4130
 					'tva_tx_formated' => price($objp->tva_tx),
4131 4131
 					'tva_tx' => price2num($objp->tva_tx),
4132 4132
 					'default_vat_code' => $objp->default_vat_code,
@@ -4159,7 +4159,7 @@  discard block
 block discarded – undo
4159 4159
 
4160 4160
 			$this->db->free($result);
4161 4161
 
4162
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
4162
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
4163 4163
 			$out .= ajax_combobox($htmlname);
4164 4164
 		} else {
4165 4165
 			dol_print_error($this->db);
@@ -4191,43 +4191,43 @@  discard block
 block discarded – undo
4191 4191
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
4192 4192
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
4193 4193
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
4194
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
4195
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
4196
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
4197
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
4194
+		$sql .= " FROM ".$this->db->prefix()."product as p";
4195
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
4196
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
4197
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
4198 4198
 		$sql .= " AND p.tobuy = 1";
4199 4199
 		$sql .= " AND s.fournisseur = 1";
4200
-		$sql .= " AND p.rowid = " . ((int) $productid);
4200
+		$sql .= " AND p.rowid = ".((int) $productid);
4201 4201
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
4202 4202
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
4203 4203
 		} else {
4204 4204
 			$sql .= " ORDER BY pfp.unitprice ASC";
4205 4205
 		}
4206 4206
 
4207
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
4207
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
4208 4208
 		$result = $this->db->query($sql);
4209 4209
 
4210 4210
 		if ($result) {
4211 4211
 			$num = $this->db->num_rows($result);
4212 4212
 
4213
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4213
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4214 4214
 
4215 4215
 			if (!$num) {
4216
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
4216
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
4217 4217
 			} else {
4218
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4218
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4219 4219
 				$form .= '<option value="0">&nbsp;</option>';
4220 4220
 
4221 4221
 				$i = 0;
4222 4222
 				while ($i < $num) {
4223 4223
 					$objp = $this->db->fetch_object($result);
4224 4224
 
4225
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
4225
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
4226 4226
 					//if there is only one supplier, preselect it
4227 4227
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
4228 4228
 						$opt .= ' selected';
4229 4229
 					}
4230
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
4230
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
4231 4231
 
4232 4232
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
4233 4233
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -4237,7 +4237,7 @@  discard block
 block discarded – undo
4237 4237
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
4238 4238
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
4239 4239
 
4240
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4240
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4241 4241
 						$priceparser = new PriceParser($this->db);
4242 4242
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
4243 4243
 						if ($price_result >= 0) {
@@ -4248,10 +4248,10 @@  discard block
 block discarded – undo
4248 4248
 						}
4249 4249
 					}
4250 4250
 					if ($objp->quantity == 1) {
4251
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
4251
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
4252 4252
 					}
4253 4253
 
4254
-					$opt .= $objp->quantity . ' ';
4254
+					$opt .= $objp->quantity.' ';
4255 4255
 
4256 4256
 					if ($objp->quantity == 1) {
4257 4257
 						$opt .= $langs->trans("Unit");
@@ -4260,10 +4260,10 @@  discard block
 block discarded – undo
4260 4260
 					}
4261 4261
 					if ($objp->quantity > 1) {
4262 4262
 						$opt .= " - ";
4263
-						$opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit");
4263
+						$opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit");
4264 4264
 					}
4265 4265
 					if ($objp->duration) {
4266
-						$opt .= " - " . $objp->duration;
4266
+						$opt .= " - ".$objp->duration;
4267 4267
 					}
4268 4268
 					$opt .= "</option>\n";
4269 4269
 
@@ -4301,8 +4301,8 @@  discard block
 block discarded – undo
4301 4301
 		dol_syslog(__METHOD__, LOG_DEBUG);
4302 4302
 
4303 4303
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4304
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4305
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4304
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4305
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4306 4306
 		$sql .= " AND active > 0";
4307 4307
 		$sql .= " ORDER BY sortorder";
4308 4308
 
@@ -4314,7 +4314,7 @@  discard block
 block discarded – undo
4314 4314
 				$obj = $this->db->fetch_object($resql);
4315 4315
 
4316 4316
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4317
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4317
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4318 4318
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4319 4319
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4320 4320
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4342,7 +4342,7 @@  discard block
 block discarded – undo
4342 4342
 		// phpcs:enable
4343 4343
 		global $langs;
4344 4344
 
4345
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4345
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4346 4346
 		if ($num > 0) {
4347 4347
 			return 0; // Cache already loaded
4348 4348
 		}
@@ -4352,7 +4352,7 @@  discard block
 block discarded – undo
4352 4352
 		$langs->load('propal');
4353 4353
 
4354 4354
 		$sql = "SELECT rowid, code, label, position";
4355
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4355
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4356 4356
 		$sql .= " WHERE active > 0";
4357 4357
 
4358 4358
 		$resql = $this->db->query($sql);
@@ -4363,7 +4363,7 @@  discard block
 block discarded – undo
4363 4363
 				$obj = $this->db->fetch_object($resql);
4364 4364
 
4365 4365
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4366
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4366
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4367 4367
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4368 4368
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4369 4369
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4395,17 +4395,17 @@  discard block
 block discarded – undo
4395 4395
 
4396 4396
 		$this->load_cache_availability();
4397 4397
 
4398
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4398
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4399 4399
 
4400
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4400
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4401 4401
 		if ($addempty) {
4402 4402
 			print '<option value="0">&nbsp;</option>';
4403 4403
 		}
4404 4404
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4405 4405
 			if ($selected == $id) {
4406
-				print '<option value="' . $id . '" selected>';
4406
+				print '<option value="'.$id.'" selected>';
4407 4407
 			} else {
4408
-				print '<option value="' . $id . '">';
4408
+				print '<option value="'.$id.'">';
4409 4409
 			}
4410 4410
 			print dol_escape_htmltag($arrayavailability['label']);
4411 4411
 			print '</option>';
@@ -4426,13 +4426,13 @@  discard block
 block discarded – undo
4426 4426
 	{
4427 4427
 		global $langs;
4428 4428
 
4429
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4429
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4430 4430
 		if ($num > 0) {
4431 4431
 			return 0; // Cache already loaded
4432 4432
 		}
4433 4433
 
4434 4434
 		$sql = "SELECT rowid, code, label";
4435
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4435
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4436 4436
 		$sql .= " WHERE active > 0";
4437 4437
 
4438 4438
 		$resql = $this->db->query($sql);
@@ -4445,8 +4445,8 @@  discard block
 block discarded – undo
4445 4445
 
4446 4446
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4447 4447
 				$label = ($obj->label != '-' ? $obj->label : '');
4448
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4449
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4448
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4449
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4450 4450
 				}
4451 4451
 				if ($langs->trans($obj->code) != $obj->code) {
4452 4452
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4486,9 +4486,9 @@  discard block
 block discarded – undo
4486 4486
 
4487 4487
 		$this->loadCacheInputReason();
4488 4488
 
4489
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4489
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4490 4490
 		if ($addempty) {
4491
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4491
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4492 4492
 		}
4493 4493
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4494 4494
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4496,9 +4496,9 @@  discard block
 block discarded – undo
4496 4496
 			}
4497 4497
 
4498 4498
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4499
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4499
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4500 4500
 			} else {
4501
-				print '<option value="' . $arraydemandreason['id'] . '">';
4501
+				print '<option value="'.$arraydemandreason['id'].'">';
4502 4502
 			}
4503 4503
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4504 4504
 			print $langs->trans($label);
@@ -4508,7 +4508,7 @@  discard block
 block discarded – undo
4508 4508
 		if ($user->admin && empty($notooltip)) {
4509 4509
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4510 4510
 		}
4511
-		print ajax_combobox('select_' . $htmlname);
4511
+		print ajax_combobox('select_'.$htmlname);
4512 4512
 	}
4513 4513
 
4514 4514
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4523,7 +4523,7 @@  discard block
 block discarded – undo
4523 4523
 		// phpcs:enable
4524 4524
 		global $langs;
4525 4525
 
4526
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4526
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4527 4527
 		if ($num > 0) {
4528 4528
 			return $num; // Cache already loaded
4529 4529
 		}
@@ -4533,8 +4533,8 @@  discard block
 block discarded – undo
4533 4533
 		$this->cache_types_paiements = array();
4534 4534
 
4535 4535
 		$sql = "SELECT id, code, libelle as label, type, active";
4536
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4537
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4536
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4537
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4538 4538
 
4539 4539
 		$resql = $this->db->query($sql);
4540 4540
 		if ($resql) {
@@ -4544,7 +4544,7 @@  discard block
 block discarded – undo
4544 4544
 				$obj = $this->db->fetch_object($resql);
4545 4545
 
4546 4546
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4547
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4547
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4548 4548
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4549 4549
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4550 4550
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4616,17 +4616,17 @@  discard block
 block discarded – undo
4616 4616
 		global $langs, $user, $conf;
4617 4617
 
4618 4618
 		$out = '';
4619
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4619
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4620 4620
 
4621 4621
 		$this->load_cache_conditions_paiements();
4622 4622
 
4623 4623
 		// Set default value if not already set by caller
4624 4624
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4625
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4625
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4626 4626
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4627 4627
 		}
4628 4628
 
4629
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4629
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4630 4630
 		if ($addempty) {
4631 4631
 			$out .= '<option value="0">&nbsp;</option>';
4632 4632
 		}
@@ -4640,9 +4640,9 @@  discard block
 block discarded – undo
4640 4640
 
4641 4641
 			if ($selected == $id) {
4642 4642
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4643
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4643
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4644 4644
 			} else {
4645
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4645
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4646 4646
 			}
4647 4647
 			$label = $arrayconditions['label'];
4648 4648
 
@@ -4660,21 +4660,21 @@  discard block
 block discarded – undo
4660 4660
 		$out .= ajax_combobox($htmlname);
4661 4661
 
4662 4662
 		if ($deposit_percent >= 0) {
4663
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4664
-			$out .= $langs->trans('DepositPercent') . ' : ';
4665
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4663
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4664
+			$out .= $langs->trans('DepositPercent').' : ';
4665
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4666 4666
 			$out .= '</span>';
4667 4667
 			$out .= '
4668
-				<script nonce="' . getNonce() . '">
4668
+				<script nonce="' . getNonce().'">
4669 4669
 					$(document).ready(function () {
4670
-						$("#' . $htmlname . '").change(function () {
4670
+						$("#' . $htmlname.'").change(function () {
4671 4671
 							let $selected = $(this).find("option:selected");
4672 4672
 							let depositPercent = $selected.attr("data-deposit_percent");
4673 4673
 
4674 4674
 							if (depositPercent.length > 0) {
4675
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4675
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4676 4676
 							} else {
4677
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4677
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4678 4678
 							}
4679 4679
 
4680 4680
 							return true;
@@ -4712,7 +4712,7 @@  discard block
 block discarded – undo
4712 4712
 
4713 4713
 		$out = '';
4714 4714
 
4715
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4715
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4716 4716
 
4717 4717
 		$filterarray = array();
4718 4718
 		if ($filtertype == 'CRDT') {
@@ -4727,11 +4727,11 @@  discard block
 block discarded – undo
4727 4727
 
4728 4728
 		// Set default value if not already set by caller
4729 4729
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4730
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4730
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4731 4731
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4732 4732
 		}
4733 4733
 
4734
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4734
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4735 4735
 		if ($empty) {
4736 4736
 			$out .= '<option value="">&nbsp;</option>';
4737 4737
 		}
@@ -4752,13 +4752,13 @@  discard block
 block discarded – undo
4752 4752
 			}
4753 4753
 
4754 4754
 			if ($format == 0) {
4755
-				$out .= '<option value="' . $id . '" data-code="'.$arraytypes['code'].'"';
4755
+				$out .= '<option value="'.$id.'" data-code="'.$arraytypes['code'].'"';
4756 4756
 			} elseif ($format == 1) {
4757
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4757
+				$out .= '<option value="'.$arraytypes['code'].'"';
4758 4758
 			} elseif ($format == 2) {
4759
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4759
+				$out .= '<option value="'.$arraytypes['code'].'"';
4760 4760
 			} elseif ($format == 3) {
4761
-				$out .= '<option value="' . $id . '"';
4761
+				$out .= '<option value="'.$id.'"';
4762 4762
 			}
4763 4763
 			// Print attribute selected or not
4764 4764
 			if ($format == 1 || $format == 2) {
@@ -4788,7 +4788,7 @@  discard block
 block discarded – undo
4788 4788
 		if ($user->admin && !$noadmininfo) {
4789 4789
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4790 4790
 		}
4791
-		$out .= ajax_combobox('select' . $htmlname);
4791
+		$out .= ajax_combobox('select'.$htmlname);
4792 4792
 
4793 4793
 		if (empty($nooutput)) {
4794 4794
 			print $out;
@@ -4810,22 +4810,22 @@  discard block
 block discarded – undo
4810 4810
 	{
4811 4811
 		global $langs;
4812 4812
 
4813
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4813
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4814 4814
 		$options = array(
4815 4815
 			'HT' => $langs->trans("HT"),
4816 4816
 			'TTC' => $langs->trans("TTC")
4817 4817
 		);
4818 4818
 		foreach ($options as $id => $value) {
4819 4819
 			if ($selected == $id) {
4820
-				$return .= '<option value="' . $id . '" selected>' . $value;
4820
+				$return .= '<option value="'.$id.'" selected>'.$value;
4821 4821
 			} else {
4822
-				$return .= '<option value="' . $id . '">' . $value;
4822
+				$return .= '<option value="'.$id.'">'.$value;
4823 4823
 			}
4824 4824
 			$return .= '</option>';
4825 4825
 		}
4826 4826
 		$return .= '</select>';
4827 4827
 		if ($addjscombo) {
4828
-			$return .= ajax_combobox('select_' . $htmlname);
4828
+			$return .= ajax_combobox('select_'.$htmlname);
4829 4829
 		}
4830 4830
 
4831 4831
 		return $return;
@@ -4843,7 +4843,7 @@  discard block
 block discarded – undo
4843 4843
 		// phpcs:enable
4844 4844
 		global $langs;
4845 4845
 
4846
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4846
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4847 4847
 		if ($num > 0) {
4848 4848
 			return $num; // Cache already loaded
4849 4849
 		}
@@ -4853,8 +4853,8 @@  discard block
 block discarded – undo
4853 4853
 		$this->cache_transport_mode = array();
4854 4854
 
4855 4855
 		$sql = "SELECT rowid, code, label, active";
4856
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4857
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4856
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4857
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4858 4858
 
4859 4859
 		$resql = $this->db->query($sql);
4860 4860
 		if ($resql) {
@@ -4864,7 +4864,7 @@  discard block
 block discarded – undo
4864 4864
 				$obj = $this->db->fetch_object($resql);
4865 4865
 
4866 4866
 				// If traduction exist, we use it else we take the default label
4867
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4867
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4868 4868
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4869 4869
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4870 4870
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4898,11 +4898,11 @@  discard block
 block discarded – undo
4898 4898
 	{
4899 4899
 		global $langs, $user;
4900 4900
 
4901
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4901
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4902 4902
 
4903 4903
 		$this->load_cache_transport_mode();
4904 4904
 
4905
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4905
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4906 4906
 		if ($empty) {
4907 4907
 			print '<option value="">&nbsp;</option>';
4908 4908
 		}
@@ -4918,13 +4918,13 @@  discard block
 block discarded – undo
4918 4918
 			}
4919 4919
 
4920 4920
 			if ($format == 0) {
4921
-				print '<option value="' . $id . '"';
4921
+				print '<option value="'.$id.'"';
4922 4922
 			} elseif ($format == 1) {
4923
-				print '<option value="' . $arraytypes['code'] . '"';
4923
+				print '<option value="'.$arraytypes['code'].'"';
4924 4924
 			} elseif ($format == 2) {
4925
-				print '<option value="' . $arraytypes['code'] . '"';
4925
+				print '<option value="'.$arraytypes['code'].'"';
4926 4926
 			} elseif ($format == 3) {
4927
-				print '<option value="' . $id . '"';
4927
+				print '<option value="'.$id.'"';
4928 4928
 			}
4929 4929
 			// If text is selected, we compare with code, else with id
4930 4930
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4975,31 +4975,31 @@  discard block
 block discarded – undo
4975 4975
 		$langs->load("deliveries");
4976 4976
 
4977 4977
 		$sql = "SELECT rowid, code, libelle as label";
4978
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4978
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4979 4979
 		$sql .= " WHERE active > 0";
4980 4980
 		if ($filtre) {
4981
-			$sql .= " AND " . $filtre;
4981
+			$sql .= " AND ".$filtre;
4982 4982
 		}
4983 4983
 		$sql .= " ORDER BY libelle ASC";
4984 4984
 
4985
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4985
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4986 4986
 		$result = $this->db->query($sql);
4987 4987
 		if ($result) {
4988 4988
 			$num = $this->db->num_rows($result);
4989 4989
 			$i = 0;
4990 4990
 			if ($num) {
4991
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4991
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4992 4992
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4993 4993
 					print '<option value="-1">&nbsp;</option>';
4994 4994
 				}
4995 4995
 				while ($i < $num) {
4996 4996
 					$obj = $this->db->fetch_object($result);
4997 4997
 					if ($selected == $obj->rowid) {
4998
-						print '<option value="' . $obj->rowid . '" selected>';
4998
+						print '<option value="'.$obj->rowid.'" selected>';
4999 4999
 					} else {
5000
-						print '<option value="' . $obj->rowid . '">';
5000
+						print '<option value="'.$obj->rowid.'">';
5001 5001
 					}
5002
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
5002
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
5003 5003
 					print '</option>';
5004 5004
 					$i++;
5005 5005
 				}
@@ -5008,7 +5008,7 @@  discard block
 block discarded – undo
5008 5008
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
5009 5009
 				}
5010 5010
 
5011
-				print ajax_combobox('select' . $htmlname);
5011
+				print ajax_combobox('select'.$htmlname);
5012 5012
 			} else {
5013 5013
 				print $langs->trans("NoShippingMethodDefined");
5014 5014
 			}
@@ -5033,16 +5033,16 @@  discard block
 block discarded – undo
5033 5033
 		$langs->load("deliveries");
5034 5034
 
5035 5035
 		if ($htmlname != "none") {
5036
-			print '<form method="POST" action="' . $page . '">';
5036
+			print '<form method="POST" action="'.$page.'">';
5037 5037
 			print '<input type="hidden" name="action" value="setshippingmethod">';
5038
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5038
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5039 5039
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
5040
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
5040
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
5041 5041
 			print '</form>';
5042 5042
 		} else {
5043 5043
 			if ($selected) {
5044 5044
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
5045
-				print $langs->trans("SendingMethod" . strtoupper($code));
5045
+				print $langs->trans("SendingMethod".strtoupper($code));
5046 5046
 			} else {
5047 5047
 				print "&nbsp;";
5048 5048
 			}
@@ -5065,10 +5065,10 @@  discard block
 block discarded – undo
5065 5065
 
5066 5066
 		$opt = '<option value="" selected></option>';
5067 5067
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
5068
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
5069
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
5068
+		$sql .= ' FROM '.$this->db->prefix().'facture';
5069
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
5070 5070
 		$sql .= ' AND situation_counter >= 1';
5071
-		$sql .= ' AND fk_soc = ' . (int) $socid;
5071
+		$sql .= ' AND fk_soc = '.(int) $socid;
5072 5072
 		$sql .= ' AND type <> 2';
5073 5073
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
5074 5074
 		$resql = $this->db->query($sql);
@@ -5086,19 +5086,19 @@  discard block
 block discarded – undo
5086 5086
 						//Not prov?
5087 5087
 						if (substr($obj->ref, 1, 4) != 'PROV') {
5088 5088
 							if ($selected == $obj->rowid) {
5089
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
5089
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
5090 5090
 							} else {
5091
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
5091
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
5092 5092
 							}
5093 5093
 						}
5094 5094
 					}
5095 5095
 				}
5096 5096
 			}
5097 5097
 		} else {
5098
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
5098
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
5099 5099
 		}
5100 5100
 		if ($opt == '<option value ="" selected></option>') {
5101
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
5101
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
5102 5102
 		}
5103 5103
 		return $opt;
5104 5104
 	}
@@ -5118,12 +5118,12 @@  discard block
 block discarded – undo
5118 5118
 
5119 5119
 		$langs->load('products');
5120 5120
 
5121
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
5121
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
5122 5122
 
5123
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
5123
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
5124 5124
 		$sql .= ' WHERE active > 0';
5125 5125
 		if (!empty($unit_type)) {
5126
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
5126
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
5127 5127
 		}
5128 5128
 		$sql .= " ORDER BY sortorder";
5129 5129
 
@@ -5135,14 +5135,14 @@  discard block
 block discarded – undo
5135 5135
 
5136 5136
 			while ($res = $this->db->fetch_object($resql)) {
5137 5137
 				$unitLabel = $res->label;
5138
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
5139
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
5138
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
5139
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
5140 5140
 				}
5141 5141
 
5142 5142
 				if ($selected == $res->rowid) {
5143
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
5143
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
5144 5144
 				} else {
5145
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
5145
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
5146 5146
 				}
5147 5147
 			}
5148 5148
 			$return .= '</select>';
@@ -5179,29 +5179,29 @@  discard block
 block discarded – undo
5179 5179
 		$num = 0;
5180 5180
 
5181 5181
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
5182
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
5183
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
5182
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
5183
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
5184 5184
 		if ($status != 2) {
5185
-			$sql .= " AND clos = " . (int) $status;
5185
+			$sql .= " AND clos = ".(int) $status;
5186 5186
 		}
5187 5187
 		if ($filtre) {	// TODO Support USF
5188
-			$sql .= " AND " . $filtre;
5188
+			$sql .= " AND ".$filtre;
5189 5189
 		}
5190 5190
 		$sql .= " ORDER BY label";
5191 5191
 
5192
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
5192
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
5193 5193
 		$result = $this->db->query($sql);
5194 5194
 		if ($result) {
5195 5195
 			$num = $this->db->num_rows($result);
5196 5196
 			$i = 0;
5197 5197
 
5198
-			$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5198
+			$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5199 5199
 
5200 5200
 			if ($num == 0) {
5201 5201
 				if ($status == 0) {
5202
-					$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
5202
+					$out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
5203 5203
 				} else {
5204
-					$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>';
5204
+					$out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountDefined").'</span>';
5205 5205
 				}
5206 5206
 			} else {
5207 5207
 				if (!empty($useempty) && !is_numeric($useempty)) {
@@ -5217,25 +5217,25 @@  discard block
 block discarded – undo
5217 5217
 				$labeltoshow = trim($obj->label);
5218 5218
 				$labeltoshowhtml = trim($obj->label);
5219 5219
 				if ($showcurrency) {
5220
-					$labeltoshow .= ' (' . $obj->currency_code . ')';
5221
-					$labeltoshowhtml .= ' <span class="opacitymedium">(' . $obj->currency_code . ')</span>';
5220
+					$labeltoshow .= ' ('.$obj->currency_code.')';
5221
+					$labeltoshowhtml .= ' <span class="opacitymedium">('.$obj->currency_code.')</span>';
5222 5222
 				}
5223 5223
 				if ($status == 2 && $obj->status == 1) {
5224
-					$labeltoshow .= ' (' . $langs->trans("Closed") . ')';
5225
-					$labeltoshowhtml .= ' <span class="opacitymedium">(' . $langs->trans("Closed") . ')</span>';
5224
+					$labeltoshow .= ' ('.$langs->trans("Closed").')';
5225
+					$labeltoshowhtml .= ' <span class="opacitymedium">('.$langs->trans("Closed").')</span>';
5226 5226
 				}
5227 5227
 
5228 5228
 				if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
5229
-					$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'" selected>';
5229
+					$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'" selected>';
5230 5230
 				} else {
5231
-					$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'">';
5231
+					$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'">';
5232 5232
 				}
5233 5233
 				$out .= $labeltoshow;
5234 5234
 				$out .= '</option>';
5235 5235
 				$i++;
5236 5236
 			}
5237 5237
 			$out .= "</select>";
5238
-			$out .= ajax_combobox('select' . $htmlname);
5238
+			$out .= ajax_combobox('select'.$htmlname);
5239 5239
 		} else {
5240 5240
 			dol_print_error($this->db);
5241 5241
 		}
@@ -5274,22 +5274,22 @@  discard block
 block discarded – undo
5274 5274
 		$num = 0;
5275 5275
 
5276 5276
 		$sql = "SELECT rowid, label, bank, status, iban_prefix, bic";
5277
-		$sql .= " FROM " . $this->db->prefix() . "societe_rib";
5278
-		$sql.=  " WHERE type = 'ban'";
5277
+		$sql .= " FROM ".$this->db->prefix()."societe_rib";
5278
+		$sql .= " WHERE type = 'ban'";
5279 5279
 		if ($filtre) {	// TODO Support USF
5280
-			$sql .= " AND " . $filtre;
5280
+			$sql .= " AND ".$filtre;
5281 5281
 		}
5282 5282
 		$sql .= " ORDER BY label";
5283
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
5283
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
5284 5284
 		$result = $this->db->query($sql);
5285 5285
 		if ($result) {
5286 5286
 			$num = $this->db->num_rows($result);
5287 5287
 			$i = 0;
5288 5288
 
5289
-			$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5289
+			$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5290 5290
 
5291 5291
 			if ($num == 0) {
5292
-				$out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>';
5292
+				$out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountDefined").'</span>';
5293 5293
 			} else {
5294 5294
 				if (!empty($useempty) && !is_numeric($useempty)) {
5295 5295
 					$out .= '<option value="-1">'.$langs->trans($useempty).'</option>';
@@ -5302,19 +5302,19 @@  discard block
 block discarded – undo
5302 5302
 				$obj = $this->db->fetch_object($result);
5303 5303
 				$iban = dolDecrypt($obj->iban_prefix);
5304 5304
 				if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
5305
-					$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '" selected>';
5305
+					$out .= '<option value="'.$obj->rowid.'" data-iban-prefix="'.$iban.' data-bic="'.$obj->bic.'" selected>';
5306 5306
 				} else {
5307
-					$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '">';
5307
+					$out .= '<option value="'.$obj->rowid.'" data-iban-prefix="'.$iban.' data-bic="'.$obj->bic.'">';
5308 5308
 				}
5309 5309
 				$out .= trim($obj->label);
5310 5310
 				if ($showibanbic) {
5311
-					$out .= ' (' . $iban . '/' .$obj->bic. ')';
5311
+					$out .= ' ('.$iban.'/'.$obj->bic.')';
5312 5312
 				}
5313 5313
 				$out .= '</option>';
5314 5314
 				$i++;
5315 5315
 			}
5316 5316
 			$out .= "</select>";
5317
-			$out .= ajax_combobox('select' . $htmlname);
5317
+			$out .= ajax_combobox('select'.$htmlname);
5318 5318
 		} else {
5319 5319
 			dol_print_error($this->db);
5320 5320
 		}
@@ -5348,23 +5348,23 @@  discard block
 block discarded – undo
5348 5348
 		$num = 0;
5349 5349
 
5350 5350
 		$sql = "SELECT rowid, name, fk_country, status, entity";
5351
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
5351
+		$sql .= " FROM ".$this->db->prefix()."establishment";
5352 5352
 		$sql .= " WHERE 1=1";
5353 5353
 		if ($status != 2) {
5354
-			$sql .= " AND status = " . (int) $status;
5354
+			$sql .= " AND status = ".(int) $status;
5355 5355
 		}
5356 5356
 		if ($filtre) {	// TODO Support USF
5357
-			$sql .= " AND " . $filtre;
5357
+			$sql .= " AND ".$filtre;
5358 5358
 		}
5359 5359
 		$sql .= " ORDER BY name";
5360 5360
 
5361
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
5361
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
5362 5362
 		$result = $this->db->query($sql);
5363 5363
 		if ($result) {
5364 5364
 			$num = $this->db->num_rows($result);
5365 5365
 			$i = 0;
5366 5366
 			if ($num) {
5367
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5367
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5368 5368
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5369 5369
 					print '<option value="-1">&nbsp;</option>';
5370 5370
 				}
@@ -5372,13 +5372,13 @@  discard block
 block discarded – undo
5372 5372
 				while ($i < $num) {
5373 5373
 					$obj = $this->db->fetch_object($result);
5374 5374
 					if ($selected == $obj->rowid) {
5375
-						print '<option value="' . $obj->rowid . '" selected>';
5375
+						print '<option value="'.$obj->rowid.'" selected>';
5376 5376
 					} else {
5377
-						print '<option value="' . $obj->rowid . '">';
5377
+						print '<option value="'.$obj->rowid.'">';
5378 5378
 					}
5379 5379
 					print trim($obj->name);
5380 5380
 					if ($status == 2 && $obj->status == 1) {
5381
-						print ' (' . $langs->trans("Closed") . ')';
5381
+						print ' ('.$langs->trans("Closed").')';
5382 5382
 					}
5383 5383
 					print '</option>';
5384 5384
 					$i++;
@@ -5386,9 +5386,9 @@  discard block
 block discarded – undo
5386 5386
 				print "</select>";
5387 5387
 			} else {
5388 5388
 				if ($status == 0) {
5389
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5389
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5390 5390
 				} else {
5391
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5391
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5392 5392
 				}
5393 5393
 			}
5394 5394
 
@@ -5412,20 +5412,20 @@  discard block
 block discarded – undo
5412 5412
 	{
5413 5413
 		global $langs;
5414 5414
 		if ($htmlname != "none") {
5415
-			print '<form method="POST" action="' . $page . '">';
5415
+			print '<form method="POST" action="'.$page.'">';
5416 5416
 			print '<input type="hidden" name="action" value="setbankaccount">';
5417
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5417
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5418 5418
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5419 5419
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5420 5420
 			if ($nbaccountfound > 0) {
5421
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5421
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5422 5422
 			}
5423 5423
 			print '</form>';
5424 5424
 		} else {
5425 5425
 			$langs->load('banks');
5426 5426
 
5427 5427
 			if ($selected) {
5428
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5428
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5429 5429
 				$bankstatic = new Account($this->db);
5430 5430
 				$result = $bankstatic->fetch($selected);
5431 5431
 				if ($result) {
@@ -5452,24 +5452,24 @@  discard block
 block discarded – undo
5452 5452
 	{
5453 5453
 		global $langs;
5454 5454
 		if ($htmlname != "none") {
5455
-			print '<form method="POST" action="' . $page . '">';
5455
+			print '<form method="POST" action="'.$page.'">';
5456 5456
 			print '<input type="hidden" name="action" value="setbankaccountcustomer">';
5457
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5457
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5458 5458
 			$nbaccountfound = $this->selectRib($selected, $htmlname, $filtre, $addempty, '', $showibanbic);
5459 5459
 			if ($nbaccountfound > 0) {
5460
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5460
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5461 5461
 			}
5462 5462
 			print '</form>';
5463 5463
 		} else {
5464 5464
 			$langs->load('banks');
5465 5465
 
5466 5466
 			if ($selected) {
5467
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
5467
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
5468 5468
 				$bankstatic = new CompanyBankAccount($this->db);
5469 5469
 				$result = $bankstatic->fetch($selected);
5470 5470
 				if ($result) {
5471 5471
 					print $bankstatic->label;
5472
-					if ($showibanbic) print ' (' . $bankstatic->iban . '/' .$bankstatic->bic. ')';
5472
+					if ($showibanbic) print ' ('.$bankstatic->iban.'/'.$bankstatic->bic.')';
5473 5473
 				}
5474 5474
 			} else {
5475 5475
 				print "&nbsp;";
@@ -5504,11 +5504,11 @@  discard block
 block discarded – undo
5504 5504
 		global $conf, $langs;
5505 5505
 		$langs->load("categories");
5506 5506
 
5507
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5507
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5508 5508
 
5509 5509
 		// For backward compatibility
5510 5510
 		if (is_numeric($type)) {
5511
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5511
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5512 5512
 		}
5513 5513
 
5514 5514
 		if ($type === Categorie::TYPE_BANK_LINE) {
@@ -5516,8 +5516,8 @@  discard block
 block discarded – undo
5516 5516
 			$cat = new Categorie($this->db);
5517 5517
 			$cate_arbo = array();
5518 5518
 			$sql = "SELECT c.label, c.rowid";
5519
-			$sql .= " FROM " . $this->db->prefix() . "categorie as c";
5520
-			$sql .= " WHERE entity = " . $conf->entity . " AND type = " . ((int) $cat->getMapId()[$type]);
5519
+			$sql .= " FROM ".$this->db->prefix()."categorie as c";
5520
+			$sql .= " WHERE entity = ".$conf->entity." AND type = ".((int) $cat->getMapId()[$type]);
5521 5521
 			$sql .= " ORDER BY c.label";
5522 5522
 			$result = $this->db->query($sql);
5523 5523
 			if ($result) {
@@ -5543,12 +5543,12 @@  discard block
 block discarded – undo
5543 5543
 		$outarrayrichhtml = array();
5544 5544
 
5545 5545
 
5546
-		$output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5546
+		$output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5547 5547
 		if (is_array($cate_arbo)) {
5548 5548
 			$num = count($cate_arbo);
5549 5549
 
5550 5550
 			if (!$num) {
5551
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5551
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5552 5552
 			} else {
5553 5553
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5554 5554
 					$output .= '<option value="-1">&nbsp;</option>';
@@ -5560,15 +5560,15 @@  discard block
 block discarded – undo
5560 5560
 						$add = '';
5561 5561
 					}
5562 5562
 
5563
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5563
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5564 5564
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5565 5565
 
5566 5566
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5567 5567
 
5568 5568
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5569 5569
 
5570
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5571
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5570
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5571
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5572 5572
 					$output .= '>';
5573 5573
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5574 5574
 					$output .= '</option>';
@@ -5614,7 +5614,7 @@  discard block
 block discarded – undo
5614 5614
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5615 5615
 	{
5616 5616
 		// phpcs:enable
5617
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5617
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5618 5618
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5619 5619
 	}
5620 5620
 
@@ -5649,7 +5649,7 @@  discard block
 block discarded – undo
5649 5649
 	{
5650 5650
 		global $langs, $conf;
5651 5651
 
5652
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5652
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5653 5653
 		$formconfirm = '';
5654 5654
 		$inputok = array();
5655 5655
 		$inputko = array();
@@ -5673,27 +5673,27 @@  discard block
 block discarded – undo
5673 5673
 			foreach ($formquestion as $key => $input) {
5674 5674
 				if (is_array($input) && !empty($input)) {
5675 5675
 					if ($input['type'] == 'hidden') {
5676
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5677
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5676
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5677
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5678 5678
 
5679
-						$more .= '<input type="hidden" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . dol_escape_htmltag($input['value']) . '" class="' . $morecss . '"' . $moreattr . '>' . "\n";
5679
+						$more .= '<input type="hidden" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'" value="'.dol_escape_htmltag($input['value']).'" class="'.$morecss.'"'.$moreattr.'>'."\n";
5680 5680
 					}
5681 5681
 				}
5682 5682
 			}
5683 5683
 
5684 5684
 			// Now add questions
5685 5685
 			$moreonecolumn = '';
5686
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5686
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5687 5687
 			foreach ($formquestion as $key => $input) {
5688 5688
 				if (is_array($input) && !empty($input)) {
5689
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5690
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5691
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5689
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5690
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5691
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5692 5692
 
5693 5693
 					if ($input['type'] == 'text') {
5694
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="text" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n";
5694
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n";
5695 5695
 					} elseif ($input['type'] == 'password') {
5696
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="password" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n";
5696
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n";
5697 5697
 					} elseif ($input['type'] == 'textarea') {
5698 5698
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5699 5699
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5701,8 +5701,8 @@  discard block
 block discarded – undo
5701 5701
 						$more .= '</textarea>';
5702 5702
 						$more .= '</div></div>'."\n";*/
5703 5703
 						$moreonecolumn .= '<div class="margintoponly">';
5704
-						$moreonecolumn .= $input['label'] . '<br>';
5705
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5704
+						$moreonecolumn .= $input['label'].'<br>';
5705
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5706 5706
 						$moreonecolumn .= $input['value'];
5707 5707
 						$moreonecolumn .= '</textarea>';
5708 5708
 						$moreonecolumn .= '</div>';
@@ -5719,20 +5719,20 @@  discard block
 block discarded – undo
5719 5719
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5720 5720
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5721 5721
 
5722
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5722
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5723 5723
 						if (!empty($input['label'])) {
5724
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5724
+							$more .= $input['label'].'</div><div class="tagtd left">';
5725 5725
 						}
5726 5726
 						if ($input['type'] == 'select') {
5727 5727
 							$more .= $this->selectarray($input['name'], $input['values'], isset($input['default']) ? $input['default'] : '-1', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss);
5728 5728
 						} else {
5729 5729
 							$more .= $this->multiselectarray($input['name'], $input['values'], is_array($input['default']) ? $input['default'] : [$input['default']], $key_in_label, $value_as_key, $morecss, $translate, $maxlen, $moreattr);
5730 5730
 						}
5731
-						$more .= '</div></div>' . "\n";
5731
+						$more .= '</div></div>'."\n";
5732 5732
 					} elseif ($input['type'] == 'checkbox') {
5733 5733
 						$more .= '<div class="tagtr">';
5734
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5735
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5734
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5735
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5736 5736
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5737 5737
 							$more .= ' checked';
5738 5738
 						}
@@ -5743,19 +5743,19 @@  discard block
 block discarded – undo
5743 5743
 							$more .= ' disabled';
5744 5744
 						}
5745 5745
 						$more .= ' /></div>';
5746
-						$more .= '</div>' . "\n";
5746
+						$more .= '</div>'."\n";
5747 5747
 					} elseif ($input['type'] == 'radio') {
5748 5748
 						$i = 0;
5749 5749
 						foreach ($input['values'] as $selkey => $selval) {
5750 5750
 							$more .= '<div class="tagtr">';
5751 5751
 							if (isset($input['label'])) {
5752 5752
 								if ($i == 0) {
5753
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5753
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5754 5754
 								} else {
5755
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5755
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5756 5756
 								}
5757 5757
 							}
5758
-							$more .= '<div class="tagtd' . ($i == 0 ? ' tdtop' : '') . '"><input type="radio" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name'] . $selkey) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . $selkey . '"' . $moreattr;
5758
+							$more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name'].$selkey).'" name="'.dol_escape_htmltag($input['name']).'" value="'.$selkey.'"'.$moreattr;
5759 5759
 							if (!empty($input['disabled'])) {
5760 5760
 								$more .= ' disabled';
5761 5761
 							}
@@ -5763,12 +5763,12 @@  discard block
 block discarded – undo
5763 5763
 								$more .= ' checked="checked"';
5764 5764
 							}
5765 5765
 							$more .= ' /> ';
5766
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5767
-							$more .= '</div></div>' . "\n";
5766
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5767
+							$more .= '</div></div>'."\n";
5768 5768
 							$i++;
5769 5769
 						}
5770 5770
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5771
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5771
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5772 5772
 						$more .= '<div class="tagtd">';
5773 5773
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5774 5774
 						$h = $m = 0;
@@ -5786,24 +5786,24 @@  discard block
 block discarded – undo
5786 5786
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5787 5787
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5788 5788
 						if (!empty($input['label'])) {
5789
-							$more .= $input['label'] . '</div><div class="tagtd">';
5789
+							$more .= $input['label'].'</div><div class="tagtd">';
5790 5790
 						}
5791 5791
 						$more .= $input['value'];
5792
-						$more .= '</div></div>' . "\n";
5792
+						$more .= '</div></div>'."\n";
5793 5793
 					} elseif ($input['type'] == 'onecolumn') {
5794 5794
 						$moreonecolumn .= '<div class="margintoponly">';
5795 5795
 						$moreonecolumn .= $input['value'];
5796
-						$moreonecolumn .= '</div>' . "\n";
5796
+						$moreonecolumn .= '</div>'."\n";
5797 5797
 					} elseif ($input['type'] == 'hidden') {
5798 5798
 						// Do nothing more, already added by a previous loop
5799 5799
 					} elseif ($input['type'] == 'separator') {
5800 5800
 						$more .= '<br>';
5801 5801
 					} else {
5802
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5802
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5803 5803
 					}
5804 5804
 				}
5805 5805
 			}
5806
-			$more .= '</div>' . "\n";
5806
+			$more .= '</div>'."\n";
5807 5807
 			$more .= $moreonecolumn;
5808 5808
 		}
5809 5809
 
@@ -5825,10 +5825,10 @@  discard block
 block discarded – undo
5825 5825
 				$button = $useajax;
5826 5826
 				$useajax = 1;
5827 5827
 				$autoOpen = false;
5828
-				$dialogconfirm .= '-' . $button;
5828
+				$dialogconfirm .= '-'.$button;
5829 5829
 			}
5830
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5831
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5830
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5831
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5832 5832
 
5833 5833
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5834 5834
 			if (is_array($formquestion)) {
@@ -5851,24 +5851,24 @@  discard block
 block discarded – undo
5851 5851
 			}
5852 5852
 
5853 5853
 			// Show JQuery confirm box.
5854
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5854
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5855 5855
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5856
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5856
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5857 5857
 			}
5858 5858
 			if (!empty($more)) {
5859
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5859
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5860 5860
 			}
5861
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : '');
5862
-			$formconfirm .= '</div>' . "\n";
5861
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : '');
5862
+			$formconfirm .= '</div>'."\n";
5863 5863
 
5864
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5865
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5864
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5865
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5866 5866
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5867 5867
 			$formconfirm .= 'jQuery(document).ready(function() {
5868 5868
             $(function() {
5869
-            	$( "#' . $dialogconfirm . '" ).dialog(
5869
+            	$( "#' . $dialogconfirm.'" ).dialog(
5870 5870
             	{
5871
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5871
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5872 5872
 			if ($newselectedchoice == 'no') {
5873 5873
 				$formconfirm .= '
5874 5874
 						open: function() {
@@ -5878,24 +5878,24 @@  discard block
 block discarded – undo
5878 5878
 
5879 5879
 			$jsforcursor = '';
5880 5880
 			if ($useajax == 1) {
5881
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5882
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5881
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5882
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5883 5883
 			}
5884 5884
 
5885 5885
 			$postconfirmas = 'GET';
5886 5886
 
5887 5887
 			$formconfirm .= '
5888 5888
                     resizable: false,
5889
-                    height: "' . $height . '",
5890
-                    width: "' . $width . '",
5889
+                    height: "' . $height.'",
5890
+                    width: "' . $width.'",
5891 5891
                     modal: true,
5892 5892
                     closeOnEscape: false,
5893 5893
                     buttons: {
5894
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5895
-							var options = "token=' . urlencode(newToken()) . '";
5896
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5897
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5898
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5894
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5895
+							var options = "token=' . urlencode(newToken()).'";
5896
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5897
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5898
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5899 5899
 
5900 5900
                          	if (inputok.length > 0) {
5901 5901
                          		$.each(inputok, function(i, inputname) {
@@ -5929,11 +5929,11 @@  discard block
 block discarded – undo
5929 5929
 							}
5930 5930
 	                        $(this).dialog("close");
5931 5931
                         },
5932
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5933
-                        	var options = "token=' . urlencode(newToken()) . '";
5934
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5935
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5936
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5932
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5933
+                        	var options = "token=' . urlencode(newToken()).'";
5934
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5935
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5936
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5937 5937
                          	if (inputko.length > 0) {
5938 5938
                          		$.each(inputko, function(i, inputname) {
5939 5939
                          			var more = "";
@@ -5965,10 +5965,10 @@  discard block
 block discarded – undo
5965 5965
                 }
5966 5966
                 );
5967 5967
 
5968
-            	var button = "' . $button . '";
5968
+            	var button = "' . $button.'";
5969 5969
             	if (button.length > 0) {
5970 5970
                 	$( "#" + button ).click(function() {
5971
-                		$("#' . $dialogconfirm . '").dialog("open");
5971
+                		$("#' . $dialogconfirm.'").dialog("open");
5972 5972
         			});
5973 5973
                 }
5974 5974
             });
@@ -5976,44 +5976,44 @@  discard block
 block discarded – undo
5976 5976
             </script>';
5977 5977
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5978 5978
 		} else {
5979
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5979
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5980 5980
 
5981 5981
 			if (empty($disableformtag)) {
5982
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftnoright">' . "\n";
5982
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftnoright">'."\n";
5983 5983
 			}
5984 5984
 
5985
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5986
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5985
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5986
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5987 5987
 
5988
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5988
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5989 5989
 
5990 5990
 			// Line title
5991 5991
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5992
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5993
-			$formconfirm .= '</td></tr>' . "\n";
5992
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5993
+			$formconfirm .= '</td></tr>'."\n";
5994 5994
 
5995 5995
 			// Line text
5996 5996
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5997
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5997
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5998 5998
 			}
5999 5999
 
6000 6000
 			// Line form fields
6001 6001
 			if ($more) {
6002
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
6002
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
6003 6003
 				$formconfirm .= $more;
6004
-				$formconfirm .= '</td></tr>' . "\n";
6004
+				$formconfirm .= '</td></tr>'."\n";
6005 6005
 			}
6006 6006
 
6007 6007
 			// Line with question
6008 6008
 			$formconfirm .= '<tr class="valid">';
6009
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
6009
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
6010 6010
 			$formconfirm .= '<td class="valid center">';
6011 6011
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
6012
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
6012
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
6013 6013
 			$formconfirm .= '</td>';
6014
-			$formconfirm .= '</tr>' . "\n";
6014
+			$formconfirm .= '</tr>'."\n";
6015 6015
 
6016
-			$formconfirm .= '</table>' . "\n";
6016
+			$formconfirm .= '</table>'."\n";
6017 6017
 
6018 6018
 			if (empty($disableformtag)) {
6019 6019
 				$formconfirm .= "</form>\n";
@@ -6022,7 +6022,7 @@  discard block
 block discarded – undo
6022 6022
 
6023 6023
 			if (!empty($conf->use_javascript_ajax)) {
6024 6024
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
6025
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
6025
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
6026 6026
 				$formconfirm .= '
6027 6027
 				$(document).ready(function () {
6028 6028
 					$(".confirmvalidatebutton").on("click", function() {
@@ -6034,7 +6034,7 @@  discard block
 block discarded – undo
6034 6034
 					});
6035 6035
 				});
6036 6036
 				';
6037
-				$formconfirm .= '</script>' . "\n";
6037
+				$formconfirm .= '</script>'."\n";
6038 6038
 			}
6039 6039
 
6040 6040
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -6066,8 +6066,8 @@  discard block
 block discarded – undo
6066 6066
 		// phpcs:enable
6067 6067
 		global $langs;
6068 6068
 
6069
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
6070
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
6069
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
6070
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
6071 6071
 
6072 6072
 		$out = '';
6073 6073
 
@@ -6075,11 +6075,11 @@  discard block
 block discarded – undo
6075 6075
 
6076 6076
 		$langs->load("project");
6077 6077
 		if ($htmlname != "none") {
6078
-			$out .= '<form method="post" action="' . $page . '">';
6078
+			$out .= '<form method="post" action="'.$page.'">';
6079 6079
 			$out .= '<input type="hidden" name="action" value="classin">';
6080
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6080
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6081 6081
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
6082
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6082
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
6083 6083
 			$out .= '</form>';
6084 6084
 		} else {
6085 6085
 			$out .= '<span class="project_head_block">';
@@ -6088,7 +6088,7 @@  discard block
 block discarded – undo
6088 6088
 				$projet->fetch($selected);
6089 6089
 				$out .= $projet->getNomUrl(0, '', 1);
6090 6090
 			} else {
6091
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
6091
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
6092 6092
 			}
6093 6093
 			$out .= '</span>';
6094 6094
 		}
@@ -6125,14 +6125,14 @@  discard block
 block discarded – undo
6125 6125
 		$out = '';
6126 6126
 
6127 6127
 		if ($htmlname != "none") {
6128
-			$out .= '<form method="POST" action="' . $page . '">';
6128
+			$out .= '<form method="POST" action="'.$page.'">';
6129 6129
 			$out .= '<input type="hidden" name="action" value="setconditions">';
6130
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6130
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6131 6131
 			if ($type) {
6132
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6132
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6133 6133
 			}
6134 6134
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
6135
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6135
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
6136 6136
 			$out .= '</form>';
6137 6137
 		} else {
6138 6138
 			if ($selected) {
@@ -6177,12 +6177,12 @@  discard block
 block discarded – undo
6177 6177
 		// phpcs:enable
6178 6178
 		global $langs;
6179 6179
 		if ($htmlname != "none") {
6180
-			print '<form method="post" action="' . $page . '">';
6180
+			print '<form method="post" action="'.$page.'">';
6181 6181
 			print '<input type="hidden" name="action" value="setavailability">';
6182
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6182
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6183 6183
 			$this->selectAvailabilityDelay($selected, $htmlname, '', $addempty);
6184
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6185
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
6184
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
6185
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
6186 6186
 			print '</form>';
6187 6187
 		} else {
6188 6188
 			if ($selected) {
@@ -6208,11 +6208,11 @@  discard block
 block discarded – undo
6208 6208
 	{
6209 6209
 		global $langs;
6210 6210
 		if ($htmlname != "none") {
6211
-			print '<form method="post" action="' . $page . '">';
6211
+			print '<form method="post" action="'.$page.'">';
6212 6212
 			print '<input type="hidden" name="action" value="setdemandreason">';
6213
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6213
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6214 6214
 			$this->selectInputReason($selected, $htmlname, '-1', $addempty);
6215
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
6215
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
6216 6216
 			print '</form>';
6217 6217
 		} else {
6218 6218
 			if ($selected) {
@@ -6252,17 +6252,17 @@  discard block
 block discarded – undo
6252 6252
 		$ret = '';
6253 6253
 
6254 6254
 		if ($htmlname != "none") {
6255
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
6256
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
6257
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
6255
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
6256
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
6257
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
6258 6258
 			if ($type) {
6259
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6259
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6260 6260
 			}
6261 6261
 			$ret .= '<table class="nobordernopadding">';
6262 6262
 			$ret .= '<tr><td>';
6263
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
6263
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
6264 6264
 			$ret .= '</td>';
6265
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6265
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6266 6266
 			$ret .= '</tr></table></form>';
6267 6267
 		} else {
6268 6268
 			if ($displayhour) {
@@ -6297,15 +6297,15 @@  discard block
 block discarded – undo
6297 6297
 		global $langs;
6298 6298
 
6299 6299
 		if ($htmlname != "none") {
6300
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
6301
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
6302
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6300
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
6301
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
6302
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6303 6303
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
6304
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6304
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6305 6305
 			print '</form>';
6306 6306
 		} else {
6307 6307
 			if ($selected) {
6308
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
6308
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
6309 6309
 				$theuser = new User($this->db);
6310 6310
 				$theuser->fetch($selected);
6311 6311
 				print $theuser->getNomUrl(1);
@@ -6338,14 +6338,14 @@  discard block
 block discarded – undo
6338 6338
 
6339 6339
 		$out = '';
6340 6340
 		if ($htmlname != "none") {
6341
-			$out .= '<form method="POST" action="' . $page . '">';
6341
+			$out .= '<form method="POST" action="'.$page.'">';
6342 6342
 			$out .= '<input type="hidden" name="action" value="setmode">';
6343
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6343
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6344 6344
 			if ($type) {
6345
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6345
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6346 6346
 			}
6347 6347
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
6348
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6348
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6349 6349
 			$out .= '</form>';
6350 6350
 		} else {
6351 6351
 			if ($selected) {
@@ -6378,11 +6378,11 @@  discard block
 block discarded – undo
6378 6378
 	{
6379 6379
 		global $langs;
6380 6380
 		if ($htmlname != "none") {
6381
-			print '<form method="POST" action="' . $page . '">';
6381
+			print '<form method="POST" action="'.$page.'">';
6382 6382
 			print '<input type="hidden" name="action" value="settransportmode">';
6383
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6383
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6384 6384
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
6385
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6385
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6386 6386
 			print '</form>';
6387 6387
 		} else {
6388 6388
 			if ($selected) {
@@ -6409,14 +6409,14 @@  discard block
 block discarded – undo
6409 6409
 		// phpcs:enable
6410 6410
 		global $langs;
6411 6411
 		if ($htmlname != "none") {
6412
-			print '<form method="POST" action="' . $page . '">';
6412
+			print '<form method="POST" action="'.$page.'">';
6413 6413
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
6414
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6414
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6415 6415
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
6416
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6416
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6417 6417
 			print '</form>';
6418 6418
 		} else {
6419
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6419
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6420 6420
 			print !empty($selected) ? currency_name($selected, 1) : '&nbsp;';
6421 6421
 		}
6422 6422
 	}
@@ -6438,22 +6438,22 @@  discard block
 block discarded – undo
6438 6438
 		global $langs, $mysoc, $conf;
6439 6439
 
6440 6440
 		if ($htmlname != "none") {
6441
-			print '<form method="POST" action="' . $page . '">';
6441
+			print '<form method="POST" action="'.$page.'">';
6442 6442
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6443
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6444
-			print '<input type="text" class="maxwidth75" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6443
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6444
+			print '<input type="text" class="maxwidth75" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6445 6445
 			print '<select name="calculation_mode" id="calculation_mode">';
6446
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6447
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6446
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6447
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6448 6448
 			print '</select> ';
6449 6449
 			print ajax_combobox("calculation_mode");
6450
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6450
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6451 6451
 			print '</form>';
6452 6452
 		} else {
6453 6453
 			if (!empty($rate)) {
6454 6454
 				print price($rate, 1, $langs, 0, 0);
6455 6455
 				if ($currency && $rate != 1) {
6456
-					print ' &nbsp; <span class="opacitymedium">(' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')</span>';
6456
+					print ' &nbsp; <span class="opacitymedium">('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')</span>';
6457 6457
 				}
6458 6458
 			} else {
6459 6459
 				print 1;
@@ -6483,9 +6483,9 @@  discard block
 block discarded – undo
6483 6483
 		// phpcs:enable
6484 6484
 		global $conf, $langs;
6485 6485
 		if ($htmlname != "none") {
6486
-			print '<form method="post" action="' . $page . '">';
6486
+			print '<form method="post" action="'.$page.'">';
6487 6487
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6488
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6488
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6489 6489
 			print '<div class="inline-block">';
6490 6490
 			if (!empty($discount_type)) {
6491 6491
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6523,24 +6523,24 @@  discard block
 block discarded – undo
6523 6523
 			print '</div>';
6524 6524
 			if (empty($hidelist)) {
6525 6525
 				print '<div class="inline-block" style="padding-right: 10px">';
6526
-				$newfilter = 'discount_type=' . intval($discount_type);
6526
+				$newfilter = 'discount_type='.intval($discount_type);
6527 6527
 				if (!empty($discount_type)) {
6528 6528
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6529 6529
 				} else {
6530 6530
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6531 6531
 				}
6532 6532
 				if ($filter) {
6533
-					$newfilter .= ' AND (' . $filter . ')';
6533
+					$newfilter .= ' AND ('.$filter.')';
6534 6534
 				}
6535 6535
 				// output the combo of discounts
6536 6536
 				$nbqualifiedlines = $this->select_remises((string) $selected, $htmlname, $newfilter, $socid, $maxvalue);
6537 6537
 				if ($nbqualifiedlines > 0) {
6538
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6538
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6539 6539
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6540
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6540
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6541 6541
 					}
6542 6542
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6543
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6543
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6544 6544
 					}
6545 6545
 
6546 6546
 					print '>';
@@ -6580,23 +6580,23 @@  discard block
 block discarded – undo
6580 6580
 		global $langs;
6581 6581
 
6582 6582
 		if ($htmlname != "none") {
6583
-			print '<form method="post" action="' . $page . '">';
6583
+			print '<form method="post" action="'.$page.'">';
6584 6584
 			print '<input type="hidden" name="action" value="set_contact">';
6585
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6585
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6586 6586
 			print '<table class="nobordernopadding">';
6587 6587
 			print '<tr><td>';
6588 6588
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6589 6589
 			$num = $this->num;
6590 6590
 			if ($num == 0) {
6591 6591
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6592
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6592
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6593 6593
 			}
6594 6594
 			print '</td>';
6595
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6595
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6596 6596
 			print '</tr></table></form>';
6597 6597
 		} else {
6598 6598
 			if ($selected) {
6599
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6599
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6600 6600
 				$contact = new Contact($this->db);
6601 6601
 				$contact->fetch($selected);
6602 6602
 				print $contact->getFullName($langs);
@@ -6631,20 +6631,20 @@  discard block
 block discarded – undo
6631 6631
 
6632 6632
 		$out = '';
6633 6633
 		if ($htmlname != "none") {
6634
-			$out .= '<form method="post" action="' . $page . '">';
6634
+			$out .= '<form method="post" action="'.$page.'">';
6635 6635
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6636
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6636
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6637 6637
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6638
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6638
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6639 6639
 			$out .= '</form>';
6640 6640
 		} else {
6641 6641
 			if ($selected) {
6642
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6642
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6643 6643
 				$soc = new Societe($this->db);
6644 6644
 				$soc->fetch($selected);
6645 6645
 				$out .= $soc->getNomUrl(0, '');
6646 6646
 			} else {
6647
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6647
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6648 6648
 			}
6649 6649
 		}
6650 6650
 
@@ -6694,22 +6694,22 @@  discard block
 block discarded – undo
6694 6694
 			$selected = 'EUR'; // Pour compatibilite
6695 6695
 		}
6696 6696
 
6697
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6697
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6698 6698
 		if ($useempty) {
6699 6699
 			$out .= '<option value="-1" selected></option>';
6700 6700
 		}
6701 6701
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6702 6702
 			$labeltoshow = $currency['label'];
6703 6703
 			if ($mode == 1) {
6704
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6704
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6705 6705
 			} else {
6706
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6706
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6707 6707
 			}
6708 6708
 
6709 6709
 			if ($selected && $selected == $code_iso) {
6710
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6710
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6711 6711
 			} else {
6712
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6712
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6713 6713
 			}
6714 6714
 			$out .= $labeltoshow;
6715 6715
 			$out .= '</option>';
@@ -6720,7 +6720,7 @@  discard block
 block discarded – undo
6720 6720
 		}
6721 6721
 
6722 6722
 		// Make select dynamic
6723
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6723
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6724 6724
 		$out .= ajax_combobox($htmlname);
6725 6725
 
6726 6726
 		return $out;
@@ -6746,10 +6746,10 @@  discard block
 block discarded – undo
6746 6746
 
6747 6747
 		$TCurrency = array();
6748 6748
 
6749
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6750
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6749
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6750
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6751 6751
 		if ($filter) {
6752
-			$sql .= " AND " . $filter;
6752
+			$sql .= " AND ".$filter;
6753 6753
 		}
6754 6754
 		$resql = $this->db->query($sql);
6755 6755
 		if ($resql) {
@@ -6759,7 +6759,7 @@  discard block
 block discarded – undo
6759 6759
 		}
6760 6760
 
6761 6761
 		$out = '';
6762
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6762
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6763 6763
 		if ($useempty) {
6764 6764
 			$out .= '<option value="">&nbsp;</option>';
6765 6765
 		}
@@ -6771,13 +6771,13 @@  discard block
 block discarded – undo
6771 6771
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6772 6772
 				if (isset($TCurrency[$code_iso])) {
6773 6773
 					if (!empty($selected) && $selected == $code_iso) {
6774
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6774
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6775 6775
 					} else {
6776
-						$out .= '<option value="' . $code_iso . '">';
6776
+						$out .= '<option value="'.$code_iso.'">';
6777 6777
 					}
6778 6778
 
6779 6779
 					$out .= $currency['label'];
6780
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6780
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6781 6781
 					$out .= '</option>';
6782 6782
 				}
6783 6783
 			}
@@ -6786,7 +6786,7 @@  discard block
 block discarded – undo
6786 6786
 		$out .= '</select>';
6787 6787
 
6788 6788
 		// Make select dynamic
6789
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6789
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6790 6790
 		$out .= ajax_combobox($htmlname);
6791 6791
 
6792 6792
 		return $out;
@@ -6817,7 +6817,7 @@  discard block
 block discarded – undo
6817 6817
 		$sql .= " WHERE t.fk_pays = c.rowid";
6818 6818
 		$sql .= " AND t.active > 0";
6819 6819
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6820
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6820
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6821 6821
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6822 6822
 
6823 6823
 		$resql = $this->db->query($sql);
@@ -6829,30 +6829,30 @@  discard block
 block discarded – undo
6829 6829
 
6830 6830
 					$tmparray = array();
6831 6831
 					$tmparray['rowid']			= $obj->rowid;
6832
-					$tmparray['type_vat']		= $obj->type_vat;
6833
-					$tmparray['code']			= $obj->code;
6832
+					$tmparray['type_vat'] = $obj->type_vat;
6833
+					$tmparray['code'] = $obj->code;
6834 6834
 					$tmparray['txtva']			= $obj->taux;
6835
-					$tmparray['nprtva']			= $obj->recuperableonly;
6835
+					$tmparray['nprtva'] = $obj->recuperableonly;
6836 6836
 					$tmparray['localtax1']	    = $obj->localtax1;
6837 6837
 					$tmparray['localtax1_type']	= $obj->localtax1_type;
6838 6838
 					$tmparray['localtax2']	    = $obj->localtax2;
6839 6839
 					$tmparray['localtax2_type']	= $obj->localtax1_type;
6840
-					$tmparray['label']			= $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6841
-					$tmparray['labelallrates']	= $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6840
+					$tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6841
+					$tmparray['labelallrates']	= $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6842 6842
 					$positiverates = '';
6843 6843
 					if ($obj->taux) {
6844
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6844
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6845 6845
 					}
6846 6846
 					if ($obj->localtax1) {
6847
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6847
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6848 6848
 					}
6849 6849
 					if ($obj->localtax2) {
6850
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6850
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6851 6851
 					}
6852 6852
 					if (empty($positiverates)) {
6853 6853
 						$positiverates = '0';
6854 6854
 					}
6855
-					$tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6855
+					$tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6856 6856
 
6857 6857
 					$this->cache_vatrates[$obj->rowid] = $tmparray;
6858 6858
 				}
@@ -6872,7 +6872,7 @@  discard block
 block discarded – undo
6872 6872
 				return -1;
6873 6873
 			}
6874 6874
 		} else {
6875
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6875
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6876 6876
 			return -2;
6877 6877
 		}
6878 6878
 	}
@@ -6925,9 +6925,9 @@  discard block
 block discarded – undo
6925 6925
 		// Check parameters
6926 6926
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6927 6927
 			if ($societe_vendeuse->id == $mysoc->id) {
6928
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6928
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6929 6929
 			} else {
6930
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6930
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6931 6931
 			}
6932 6932
 			return $return;
6933 6933
 		}
@@ -6939,12 +6939,12 @@  discard block
 block discarded – undo
6939 6939
 		// Define list of countries to use to search VAT rates to show
6940 6940
 		// First we defined code_country to use to find list
6941 6941
 		if (is_object($societe_vendeuse)) {
6942
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6942
+			$code_country = "'".$societe_vendeuse->country_code."'";
6943 6943
 		} else {
6944
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6944
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6945 6945
 		}
6946 6946
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6947
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6947
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6948 6948
 			// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
6949 6949
 			// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
6950 6950
 			$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
@@ -6954,27 +6954,27 @@  discard block
 block discarded – undo
6954 6954
 					if ($type == 1) { // We know product is a service
6955 6955
 						switch ($selectVatComboMode) {
6956 6956
 							case '1':
6957
-								$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6957
+								$code_country .= ",'".$societe_acheteuse->country_code."'";
6958 6958
 								break;
6959 6959
 							case '2':
6960
-								$code_country = "'" . $societe_acheteuse->country_code . "'";
6960
+								$code_country = "'".$societe_acheteuse->country_code."'";
6961 6961
 								break;
6962 6962
 						}
6963 6963
 					}
6964 6964
 				} elseif (!$idprod) {  // We don't know type of product
6965 6965
 					switch ($selectVatComboMode) {
6966 6966
 						case '1':
6967
-							$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6967
+							$code_country .= ",'".$societe_acheteuse->country_code."'";
6968 6968
 							break;
6969 6969
 						case '2':
6970
-							$code_country = "'" . $societe_acheteuse->country_code . "'";
6970
+							$code_country = "'".$societe_acheteuse->country_code."'";
6971 6971
 							break;
6972 6972
 					}
6973 6973
 				} else {
6974 6974
 					$prodstatic = new Product($this->db);
6975 6975
 					$prodstatic->fetch($idprod);
6976 6976
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6977
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6977
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6978 6978
 					}
6979 6979
 				}
6980 6980
 			}
@@ -7036,13 +7036,13 @@  discard block
 block discarded – undo
7036 7036
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
7037 7037
 				// of using supplier invoices (this is a very bad idea !)
7038 7038
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
7039
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
7039
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
7040 7040
 					$disabled = true;
7041 7041
 				}
7042 7042
 			}
7043 7043
 
7044 7044
 			if (!$options_only) {
7045
-				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
7045
+				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
7046 7046
 			}
7047 7047
 
7048 7048
 			$selectedfound = false;
@@ -7056,13 +7056,13 @@  discard block
 block discarded – undo
7056 7056
 				$key = $rate['txtva'];
7057 7057
 				$key .= $rate['nprtva'] ? '*' : '';
7058 7058
 				if ($mode > 0 && $rate['code']) {
7059
-					$key .= ' (' . $rate['code'] . ')';
7059
+					$key .= ' ('.$rate['code'].')';
7060 7060
 				}
7061 7061
 				if ($mode < 0) {
7062 7062
 					$key = $rate['rowid'];
7063 7063
 				}
7064 7064
 
7065
-				$return .= '<option value="' . $key . '"';
7065
+				$return .= '<option value="'.$key.'"';
7066 7066
 				if (!$selectedfound) {
7067 7067
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
7068 7068
 						if ($defaultcode == $rate['code']) {
@@ -7133,7 +7133,7 @@  discard block
 block discarded – undo
7133 7133
 	public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = 0, $addplusone = '', $adddateof = '')
7134 7134
 	{
7135 7135
 		// phpcs:enable
7136
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
7136
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
7137 7137
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
7138 7138
 		if (!empty($nooutput)) {
7139 7139
 			return $retstring;
@@ -7162,11 +7162,11 @@  discard block
 block discarded – undo
7162 7162
 	{
7163 7163
 		global $langs;
7164 7164
 
7165
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
7165
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
7166 7166
 		if ($forcenewline) {
7167 7167
 			$ret .= '<br>';
7168 7168
 		}
7169
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
7169
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
7170 7170
 		return $ret;
7171 7171
 	}
7172 7172
 
@@ -7233,7 +7233,7 @@  discard block
 block discarded – undo
7233 7233
 		$orig_set_time = $set_time;
7234 7234
 
7235 7235
 		if ($set_time === '' && $emptydate == 0) {
7236
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7236
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7237 7237
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
7238 7238
 				$set_time = dol_now($gm);
7239 7239
 			} else {
@@ -7305,38 +7305,38 @@  discard block
 block discarded – undo
7305 7305
 				// Calendrier popup version eldy
7306 7306
 				if ($usecalendar == "eldy") {
7307 7307
 					// Input area to enter date manually
7308
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate center" maxlength="11" value="' . $formated_date . '"';
7308
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"';
7309 7309
 					$retstring .= ($disabled ? ' disabled' : '');
7310
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7310
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7311 7311
 					$retstring .= ' autocomplete="off">';
7312 7312
 
7313 7313
 					// Icon calendar
7314 7314
 					$retstringbuttom = '';
7315 7315
 					if (!$disabled) {
7316
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
7317
-						$base = DOL_URL_ROOT . '/core/';
7318
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
7319
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
7316
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
7317
+						$base = DOL_URL_ROOT.'/core/';
7318
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
7319
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
7320 7320
 					} else {
7321
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
7321
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
7322 7322
 					}
7323
-					$retstring = $retstringbuttom . $retstring;
7323
+					$retstring = $retstringbuttom.$retstring;
7324 7324
 
7325
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7326
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7327
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7325
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7326
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7327
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7328 7328
 				} elseif ($usecalendar == 'jquery' || $usecalendar == 'html') {
7329 7329
 					if (!$disabled && $usecalendar != 'html') {
7330 7330
 						// Output javascript for datepicker
7331 7331
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100));
7332 7332
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100));
7333 7333
 
7334
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
7335
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
7336
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
7334
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
7335
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
7336
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
7337 7337
 							autoclose: true,
7338 7338
 							todayHighlight: true,
7339
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
7339
+							yearRange: '" . $minYear.":".$maxYear."',";
7340 7340
 						if (!empty($conf->dol_use_jmobile)) {
7341 7341
 							$retstring .= "
7342 7342
 								beforeShow: function (input, datePicker) {
@@ -7349,10 +7349,10 @@  discard block
 block discarded – undo
7349 7349
 						}
7350 7350
 						// Note: We don't need monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, they are set globally on datepicker component in lib_head.js.php
7351 7351
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
7352
-							$buttonImage = $calendarpicto ?: DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png";
7352
+							$buttonImage = $calendarpicto ?: DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png";
7353 7353
 							$retstring .= "
7354 7354
 								showOn: 'button',	/* both has problem with autocompletion */
7355
-								buttonImage: '" . $buttonImage . "',
7355
+								buttonImage: '" . $buttonImage."',
7356 7356
 								buttonImageOnly: true";
7357 7357
 						}
7358 7358
 						$retstring .= "
@@ -7364,46 +7364,46 @@  discard block
 block discarded – undo
7364 7364
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
7365 7365
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"';
7366 7366
 					$retstring .= ($disabled ? ' disabled' : '');
7367
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
7368
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7367
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
7368
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7369 7369
 					$retstring .= ' autocomplete="off">';
7370 7370
 
7371 7371
 					// Icone calendrier
7372 7372
 					if ($disabled) {
7373
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
7374
-						$retstring = $retstringbutton . $retstring;
7373
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
7374
+						$retstring = $retstringbutton.$retstring;
7375 7375
 					}
7376 7376
 
7377 7377
 					$retstring .= '</div>';
7378
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7379
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7380
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7378
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7379
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7380
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7381 7381
 				} else {
7382 7382
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
7383 7383
 				}
7384 7384
 			} else {
7385 7385
 				// Show date with combo selects
7386 7386
 				// Day
7387
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
7387
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
7388 7388
 
7389 7389
 				if ($emptydate || $set_time == -1) {
7390 7390
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7391 7391
 				}
7392 7392
 
7393 7393
 				for ($day = 1; $day <= 31; $day++) {
7394
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
7394
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
7395 7395
 				}
7396 7396
 
7397 7397
 				$retstring .= "</select>";
7398 7398
 
7399
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
7399
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
7400 7400
 				if ($emptydate || $set_time == -1) {
7401 7401
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7402 7402
 				}
7403 7403
 
7404 7404
 				// Month
7405 7405
 				for ($month = 1; $month <= 12; $month++) {
7406
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
7406
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
7407 7407
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
7408 7408
 					$retstring .= "</option>";
7409 7409
 				}
@@ -7411,13 +7411,13 @@  discard block
 block discarded – undo
7411 7411
 
7412 7412
 				// Year
7413 7413
 				if ($emptydate || $set_time == -1) {
7414
-					$retstring .= '<input' . ($disabled ? ' disabled' : '') . ' placeholder="' . dol_escape_htmltag($langs->trans("Year")) . '" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">';
7414
+					$retstring .= '<input'.($disabled ? ' disabled' : '').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">';
7415 7415
 				} else {
7416
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
7416
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
7417 7417
 
7418 7418
 					$syear = (int) $syear;
7419 7419
 					for ($year = $syear - 10; $year < (int) $syear + 10; $year++) {
7420
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
7420
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
7421 7421
 					}
7422 7422
 					$retstring .= "</select>\n";
7423 7423
 				}
@@ -7442,15 +7442,15 @@  discard block
 block discarded – undo
7442 7442
 			}
7443 7443
 
7444 7444
 			// Show hour
7445
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
7445
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
7446 7446
 			if ($emptyhours) {
7447 7447
 				$retstring .= '<option value="-1">&nbsp;</option>';
7448 7448
 			}
7449 7449
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
7450 7450
 				if (strlen($hour) < 2) {
7451
-					$hour = "0" . $hour;
7451
+					$hour = "0".$hour;
7452 7452
 				}
7453
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7453
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7454 7454
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7455 7455
 				$retstring .= '</option>';
7456 7456
 			}
@@ -7463,17 +7463,17 @@  discard block
 block discarded – undo
7463 7463
 
7464 7464
 		if ($m) {
7465 7465
 			// Show minutes
7466
-			$retstring .= '<select ' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7466
+			$retstring .= '<select '.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7467 7467
 			if ($emptyhours) {
7468 7468
 				$retstring .= '<option value="-1">&nbsp;</option>';
7469 7469
 			}
7470 7470
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7471 7471
 				$min_str = sprintf("%02d", $min);
7472
-				$retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>';
7472
+				$retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>';
7473 7473
 			}
7474 7474
 			$retstring .= '</select>';
7475 7475
 
7476
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7476
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7477 7477
 		}
7478 7478
 
7479 7479
 		if ($d && $h) {
@@ -7496,10 +7496,10 @@  discard block
 block discarded – undo
7496 7496
 
7497 7497
 			// Generate the date part, depending on the use or not of the javascript calendar
7498 7498
 			if ($addnowlink == 1) { // server time expressed in user time setup
7499
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7500
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7501
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7502
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7499
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7500
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7501
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7502
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7503 7503
 			} elseif ($addnowlink == 2) {
7504 7504
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7505 7505
 				 * This break application for foreign languages.
@@ -7508,10 +7508,10 @@  discard block
 block discarded – undo
7508 7508
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7509 7509
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7510 7510
 				*/
7511
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7512
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7513
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7514
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7511
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7512
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7513
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7514
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7515 7515
 			}
7516 7516
 			/*if ($usecalendar == "eldy")
7517 7517
 			{
@@ -7531,11 +7531,11 @@  discard block
 block discarded – undo
7531 7531
 				}
7532 7532
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7533 7533
 				if ($addnowlink == 1) {
7534
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7535
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7534
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7535
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7536 7536
 				} elseif ($addnowlink == 2) {
7537
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7538
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7537
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7538
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7539 7539
 				}
7540 7540
 
7541 7541
 				if ($fullday) {
@@ -7549,11 +7549,11 @@  discard block
 block discarded – undo
7549 7549
 				}
7550 7550
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7551 7551
 				if ($addnowlink == 1) {
7552
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7553
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7552
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7553
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7554 7554
 				} elseif ($addnowlink == 2) {
7555
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7556
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7555
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7556
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7557 7557
 				}
7558 7558
 				if ($fullday) {
7559 7559
 					$reset_scripts .= ' } ';
@@ -7561,7 +7561,7 @@  discard block
 block discarded – undo
7561 7561
 			}
7562 7562
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7563 7563
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7564
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7564
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7565 7565
 				$retstring .= $langs->trans("Now");
7566 7566
 				$retstring .= '</button> ';
7567 7567
 			}
@@ -7573,16 +7573,16 @@  discard block
 block discarded – undo
7573 7573
 			$reset_scripts = "";
7574 7574
 
7575 7575
 			// Generate the date part, depending on the use or not of the javascript calendar
7576
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7577
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7578
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7579
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7576
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7577
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7578
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7579
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7580 7580
 			// Update the hour part
7581 7581
 			if ($h) {
7582 7582
 				if ($fullday) {
7583 7583
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7584 7584
 				}
7585
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7585
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7586 7586
 				if ($fullday) {
7587 7587
 					$reset_scripts .= ' } ';
7588 7588
 				}
@@ -7592,14 +7592,14 @@  discard block
 block discarded – undo
7592 7592
 				if ($fullday) {
7593 7593
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7594 7594
 				}
7595
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7595
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7596 7596
 				if ($fullday) {
7597 7597
 					$reset_scripts .= ' } ';
7598 7598
 				}
7599 7599
 			}
7600 7600
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7601 7601
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7602
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7602
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7603 7603
 				$retstring .= $langs->trans("DateStartPlusOne");
7604 7604
 				$retstring .= '</button> ';
7605 7605
 			}
@@ -7657,17 +7657,17 @@  discard block
 block discarded – undo
7657 7657
 			unset($TDurationTypes[$value]);
7658 7658
 		}
7659 7659
 
7660
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7660
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7661 7661
 		foreach ($TDurationTypes as $key => $typeduration) {
7662
-			$retstring .= '<option value="' . $key . '"';
7662
+			$retstring .= '<option value="'.$key.'"';
7663 7663
 			if ($key == $selected) {
7664 7664
 				$retstring .= " selected";
7665 7665
 			}
7666
-			$retstring .= ">" . $typeduration . "</option>";
7666
+			$retstring .= ">".$typeduration."</option>";
7667 7667
 		}
7668 7668
 		$retstring .= "</select>";
7669 7669
 
7670
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7670
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7671 7671
 
7672 7672
 		return $retstring;
7673 7673
 	}
@@ -7699,30 +7699,30 @@  discard block
 block discarded – undo
7699 7699
 
7700 7700
 		// Hours
7701 7701
 		if ($iSecond != '') {
7702
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7702
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7703 7703
 
7704 7704
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7705 7705
 			$minSelected = convertSecondToTime($iSecond, 'min');
7706 7706
 		}
7707 7707
 
7708 7708
 		if ($typehour == 'select') {
7709
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7709
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7710 7710
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7711
-				$retstring .= '<option value="' . $hour . '"';
7711
+				$retstring .= '<option value="'.$hour.'"';
7712 7712
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7713 7713
 					$retstring .= " selected";
7714 7714
 				}
7715
-				$retstring .= ">" . $hour . "</option>";
7715
+				$retstring .= ">".$hour."</option>";
7716 7716
 			}
7717 7717
 			$retstring .= "</select>";
7718 7718
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7719
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7719
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7720 7720
 		} else {
7721 7721
 			return 'BadValueForParameterTypeHour';
7722 7722
 		}
7723 7723
 
7724 7724
 		if ($typehour != 'text') {
7725
-			$retstring .= ' ' . $langs->trans('HourShort');
7725
+			$retstring .= ' '.$langs->trans('HourShort');
7726 7726
 		} else {
7727 7727
 			$retstring .= '<span class="">:</span>';
7728 7728
 		}
@@ -7737,21 +7737,21 @@  discard block
 block discarded – undo
7737 7737
 		}
7738 7738
 
7739 7739
 		if ($typehour == 'select' || $typehour == 'textselect') {
7740
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7740
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7741 7741
 			for ($min = 0; $min <= 55; $min += 5) {
7742
-				$retstring .= '<option value="' . $min . '"';
7742
+				$retstring .= '<option value="'.$min.'"';
7743 7743
 				if (is_numeric($minSelected) && $minSelected == $min) {
7744 7744
 					$retstring .= ' selected';
7745 7745
 				}
7746
-				$retstring .= '>' . $min . '</option>';
7746
+				$retstring .= '>'.$min.'</option>';
7747 7747
 			}
7748 7748
 			$retstring .= "</select>";
7749 7749
 		} elseif ($typehour == 'text') {
7750
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7750
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7751 7751
 		}
7752 7752
 
7753 7753
 		if ($typehour != 'text') {
7754
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7754
+			$retstring .= ' '.$langs->trans('MinuteShort');
7755 7755
 		}
7756 7756
 
7757 7757
 		$retstring .= "</span>";
@@ -7799,7 +7799,7 @@  discard block
 block discarded – undo
7799 7799
 			$placeholder = '';
7800 7800
 
7801 7801
 			if ($selected && empty($selected_input_value)) {
7802
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7802
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7803 7803
 				$tickettmpselect = new Ticket($this->db);
7804 7804
 				$tickettmpselect->fetch($selected);
7805 7805
 				$selected_input_value = $tickettmpselect->ref;
@@ -7807,17 +7807,17 @@  discard block
 block discarded – undo
7807 7807
 			}
7808 7808
 
7809 7809
 			$urloption = '';
7810
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7810
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7811 7811
 
7812 7812
 			if (empty($hidelabel)) {
7813
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7813
+				$out .= $langs->trans("RefOrLabel").' : ';
7814 7814
 			} elseif ($hidelabel > 1) {
7815
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7815
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7816 7816
 				if ($hidelabel == 2) {
7817 7817
 					$out .= img_picto($langs->trans("Search"), 'search');
7818 7818
 				}
7819 7819
 			}
7820
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7820
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7821 7821
 			if ($hidelabel == 3) {
7822 7822
 				$out .= img_picto($langs->trans("Search"), 'search');
7823 7823
 			}
@@ -7861,8 +7861,8 @@  discard block
 block discarded – undo
7861 7861
 
7862 7862
 		$sql = "SELECT ";
7863 7863
 		$sql .= $selectFields;
7864
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7865
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7864
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7865
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7866 7866
 
7867 7867
 		// Add criteria on ref/label
7868 7868
 		if ($filterkey != '') {
@@ -7878,7 +7878,7 @@  discard block
 block discarded – undo
7878 7878
 				if ($i > 0) {
7879 7879
 					$sql .= " AND ";
7880 7880
 				}
7881
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7881
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7882 7882
 				$sql .= ")";
7883 7883
 				$i++;
7884 7884
 			}
@@ -7891,22 +7891,22 @@  discard block
 block discarded – undo
7891 7891
 		$sql .= $this->db->plimit($limit, 0);
7892 7892
 
7893 7893
 		// Build output string
7894
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7894
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7895 7895
 		$result = $this->db->query($sql);
7896 7896
 		if ($result) {
7897
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7898
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7897
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7898
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7899 7899
 
7900 7900
 			$num = $this->db->num_rows($result);
7901 7901
 
7902 7902
 			$events = array();
7903 7903
 
7904 7904
 			if (!$forcecombo) {
7905
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7905
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7906 7906
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt('TICKET_USE_SEARCH_TO_SELECT'));
7907 7907
 			}
7908 7908
 
7909
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7909
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7910 7910
 
7911 7911
 			$textifempty = '';
7912 7912
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7923,7 +7923,7 @@  discard block
 block discarded – undo
7923 7923
 				}
7924 7924
 			}
7925 7925
 			if ($showempty) {
7926
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7926
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7927 7927
 			}
7928 7928
 
7929 7929
 			$i = 0;
@@ -7978,13 +7978,13 @@  discard block
 block discarded – undo
7978 7978
 		$outkey = $objp->rowid;
7979 7979
 		$outref = $objp->ref;
7980 7980
 
7981
-		$opt = '<option value="' . $objp->rowid . '"';
7981
+		$opt = '<option value="'.$objp->rowid.'"';
7982 7982
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7983 7983
 		$opt .= '>';
7984 7984
 		$opt .= $objp->ref;
7985 7985
 		$objRef = $objp->ref;
7986 7986
 		if (!empty($filterkey) && $filterkey != '') {
7987
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7987
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7988 7988
 		}
7989 7989
 
7990 7990
 		$opt .= "</option>\n";
@@ -8025,7 +8025,7 @@  discard block
 block discarded – undo
8025 8025
 			$placeholder = '';
8026 8026
 
8027 8027
 			if ($selected && empty($selected_input_value)) {
8028
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
8028
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
8029 8029
 				$projecttmpselect = new Project($this->db);
8030 8030
 				$projecttmpselect->fetch($selected);
8031 8031
 				$selected_input_value = $projecttmpselect->ref;
@@ -8033,17 +8033,17 @@  discard block
 block discarded – undo
8033 8033
 			}
8034 8034
 
8035 8035
 			$urloption = '';
8036
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8036
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8037 8037
 
8038 8038
 			if (empty($hidelabel)) {
8039
-				$out .= $langs->trans("RefOrLabel") . ' : ';
8039
+				$out .= $langs->trans("RefOrLabel").' : ';
8040 8040
 			} elseif ($hidelabel > 1) {
8041
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
8041
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
8042 8042
 				if ($hidelabel == 2) {
8043 8043
 					$out .= img_picto($langs->trans("Search"), 'search');
8044 8044
 				}
8045 8045
 			}
8046
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
8046
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
8047 8047
 			if ($hidelabel == 3) {
8048 8048
 				$out .= img_picto($langs->trans("Search"), 'search');
8049 8049
 			}
@@ -8086,8 +8086,8 @@  discard block
 block discarded – undo
8086 8086
 
8087 8087
 		$sql = "SELECT ";
8088 8088
 		$sql .= $selectFields;
8089
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
8090
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
8089
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
8090
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
8091 8091
 
8092 8092
 		// Add criteria on ref/label
8093 8093
 		if ($filterkey != '') {
@@ -8103,7 +8103,7 @@  discard block
 block discarded – undo
8103 8103
 				if ($i > 0) {
8104 8104
 					$sql .= " AND ";
8105 8105
 				}
8106
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
8106
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
8107 8107
 				$sql .= "";
8108 8108
 				$i++;
8109 8109
 			}
@@ -8116,22 +8116,22 @@  discard block
 block discarded – undo
8116 8116
 		$sql .= $this->db->plimit($limit, 0);
8117 8117
 
8118 8118
 		// Build output string
8119
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
8119
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
8120 8120
 		$result = $this->db->query($sql);
8121 8121
 		if ($result) {
8122
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
8123
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
8122
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
8123
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
8124 8124
 
8125 8125
 			$num = $this->db->num_rows($result);
8126 8126
 
8127 8127
 			$events = array();
8128 8128
 
8129 8129
 			if (!$forcecombo) {
8130
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8130
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8131 8131
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT'));
8132 8132
 			}
8133 8133
 
8134
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
8134
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
8135 8135
 
8136 8136
 			$textifempty = '';
8137 8137
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -8148,7 +8148,7 @@  discard block
 block discarded – undo
8148 8148
 				}
8149 8149
 			}
8150 8150
 			if ($showempty) {
8151
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
8151
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
8152 8152
 			}
8153 8153
 
8154 8154
 			$i = 0;
@@ -8206,13 +8206,13 @@  discard block
 block discarded – undo
8206 8206
 		$outlabel = $objp->label;
8207 8207
 		$outtype = $objp->fk_product_type;
8208 8208
 
8209
-		$opt = '<option value="' . $objp->rowid . '"';
8209
+		$opt = '<option value="'.$objp->rowid.'"';
8210 8210
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8211 8211
 		$opt .= '>';
8212 8212
 		$opt .= $objp->ref;
8213 8213
 		$objRef = $objp->ref;
8214 8214
 		if (!empty($filterkey) && $filterkey != '') {
8215
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
8215
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
8216 8216
 		}
8217 8217
 
8218 8218
 		$opt .= "</option>\n";
@@ -8254,7 +8254,7 @@  discard block
 block discarded – undo
8254 8254
 			$placeholder = '';
8255 8255
 
8256 8256
 			if ($selected && empty($selected_input_value)) {
8257
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
8257
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
8258 8258
 				$adherenttmpselect = new Adherent($this->db);
8259 8259
 				$adherenttmpselect->fetch($selected);
8260 8260
 				$selected_input_value = $adherenttmpselect->ref;
@@ -8263,17 +8263,17 @@  discard block
 block discarded – undo
8263 8263
 
8264 8264
 			$urloption = '';
8265 8265
 
8266
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8266
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8267 8267
 
8268 8268
 			if (empty($hidelabel)) {
8269
-				$out .= $langs->trans("RefOrLabel") . ' : ';
8269
+				$out .= $langs->trans("RefOrLabel").' : ';
8270 8270
 			} elseif ($hidelabel > 1) {
8271
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
8271
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
8272 8272
 				if ($hidelabel == 2) {
8273 8273
 					$out .= img_picto($langs->trans("Search"), 'search');
8274 8274
 				}
8275 8275
 			}
8276
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
8276
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
8277 8277
 			if ($hidelabel == 3) {
8278 8278
 				$out .= img_picto($langs->trans("Search"), 'search');
8279 8279
 			}
@@ -8318,8 +8318,8 @@  discard block
 block discarded – undo
8318 8318
 
8319 8319
 		$sql = "SELECT ";
8320 8320
 		$sql .= $selectFields;
8321
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
8322
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
8321
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
8322
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
8323 8323
 
8324 8324
 		// Add criteria on ref/label
8325 8325
 		if ($filterkey != '') {
@@ -8335,8 +8335,8 @@  discard block
 block discarded – undo
8335 8335
 				if ($i > 0) {
8336 8336
 					$sql .= " AND ";
8337 8337
 				}
8338
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
8339
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
8338
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
8339
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
8340 8340
 				$i++;
8341 8341
 			}
8342 8342
 			if (count($search_crit) > 1) {
@@ -8345,27 +8345,27 @@  discard block
 block discarded – undo
8345 8345
 			$sql .= ')';
8346 8346
 		}
8347 8347
 		if ($status != -1) {
8348
-			$sql .= ' AND statut = ' . ((int) $status);
8348
+			$sql .= ' AND statut = '.((int) $status);
8349 8349
 		}
8350 8350
 		$sql .= $this->db->plimit($limit, 0);
8351 8351
 
8352 8352
 		// Build output string
8353
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
8353
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
8354 8354
 		$result = $this->db->query($sql);
8355 8355
 		if ($result) {
8356
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
8357
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
8356
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
8357
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
8358 8358
 
8359 8359
 			$num = $this->db->num_rows($result);
8360 8360
 
8361 8361
 			$events = array();
8362 8362
 
8363 8363
 			if (!$forcecombo) {
8364
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8364
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8365 8365
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
8366 8366
 			}
8367 8367
 
8368
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
8368
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
8369 8369
 
8370 8370
 			$textifempty = '';
8371 8371
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -8382,7 +8382,7 @@  discard block
 block discarded – undo
8382 8382
 				}
8383 8383
 			}
8384 8384
 			if ($showempty) {
8385
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
8385
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
8386 8386
 			}
8387 8387
 
8388 8388
 			$i = 0;
@@ -8438,11 +8438,11 @@  discard block
 block discarded – undo
8438 8438
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
8439 8439
 		$outtype = $objp->fk_adherent_type;
8440 8440
 
8441
-		$opt = '<option value="' . $objp->rowid . '"';
8441
+		$opt = '<option value="'.$objp->rowid.'"';
8442 8442
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8443 8443
 		$opt .= '>';
8444 8444
 		if (!empty($filterkey) && $filterkey != '') {
8445
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
8445
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
8446 8446
 		}
8447 8447
 		$opt .= $outlabel;
8448 8448
 		$opt .= "</option>\n";
@@ -8497,8 +8497,8 @@  discard block
 block discarded – undo
8497 8497
 		$objecttmp = null;
8498 8498
 		$InfoFieldList = array();
8499 8499
 		$classname = '';
8500
-		$filter = '';  // Ensure filter has value (for static analysis)
8501
-		$sortfield = '';  // Ensure filter has value (for static analysis)
8500
+		$filter = ''; // Ensure filter has value (for static analysis)
8501
+		$sortfield = ''; // Ensure filter has value (for static analysis)
8502 8502
 
8503 8503
 		if ($objectfield) {	// We must retrieve the objectdesc from the field or extrafield
8504 8504
 			// Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield'
@@ -8542,9 +8542,9 @@  discard block
 block discarded – undo
8542 8542
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8543 8543
 			$reg = array();
8544 8544
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8545
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8545
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8546 8546
 			}
8547
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8547
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8548 8548
 
8549 8549
 			$classname = $InfoFieldList[0];
8550 8550
 			$classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1];
@@ -8575,8 +8575,8 @@  discard block
 block discarded – undo
8575 8575
 		);
8576 8576
 
8577 8577
 		if (!is_object($objecttmp)) {
8578
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8579
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8578
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8579
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8580 8580
 		}
8581 8581
 		'@phan-var-force CommonObject $objecttmp';
8582 8582
 		/** @var CommonObject $objecttmp */
@@ -8588,9 +8588,9 @@  discard block
 block discarded – undo
8588 8588
 		if ($prefixforautocompletemode == 'product') {
8589 8589
 			$prefixforautocompletemode = 'produit';
8590 8590
 		}
8591
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8591
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8592 8592
 
8593
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8593
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8594 8594
 
8595 8595
 		// Generate the combo HTML component
8596 8596
 		$out = '';
@@ -8619,13 +8619,13 @@  discard block
 block discarded – undo
8619 8619
 			}
8620 8620
 
8621 8621
 			// Set url and param to call to get json of the search results
8622
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8623
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8622
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8623
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8624 8624
 
8625 8625
 			// Activate the auto complete using ajax call.
8626 8626
 			$out .= ajax_autocompleter((string) $preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalInt($confkeyforautocompletemode), 0);
8627 8627
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8628
-			$out .= '<input type="text" class="' . $morecss . '"' . ($disabled ? ' disabled="disabled"' : '') . ' name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' />';
8628
+			$out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' />';
8629 8629
 		} else {
8630 8630
 			// Immediate load of table record.
8631 8631
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8665,16 +8665,16 @@  discard block
 block discarded – undo
8665 8665
 		if ($prefixforautocompletemode == 'societe') {
8666 8666
 			$prefixforautocompletemode = 'company';
8667 8667
 		}
8668
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8668
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8669 8669
 
8670 8670
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8671 8671
 			$tmpfieldstoshow = '';
8672 8672
 			foreach ($objecttmp->fields as $key => $val) {
8673
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
8673
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
8674 8674
 					continue;
8675 8675
 				}
8676 8676
 				if (!empty($val['showoncombobox'])) {
8677
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8677
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8678 8678
 				}
8679 8679
 			}
8680 8680
 			if ($tmpfieldstoshow) {
@@ -8711,25 +8711,25 @@  discard block
 block discarded – undo
8711 8711
 		$num = 0;
8712 8712
 
8713 8713
 		// Search data
8714
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $this->db->sanitize($objecttmp->table_element) . " as t";
8714
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$this->db->sanitize($objecttmp->table_element)." as t";
8715 8715
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8716
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($objecttmp->table_element) . "_extrafields as e ON t.rowid = e.fk_object";
8716
+			$sql .= " LEFT JOIN ".$this->db->prefix().$this->db->sanitize($objecttmp->table_element)."_extrafields as e ON t.rowid = e.fk_object";
8717 8717
 		}
8718 8718
 		if (!empty($objecttmp->parent_element)) {
8719 8719
 			$parent_properties = getElementProperties($objecttmp->parent_element);
8720
-			$sql .= " INNER JOIN " . $this->db->prefix() . $this->db->sanitize($parent_properties['table_element']) . " as o ON o.rowid = t.".$objecttmp->fk_parent_attribute;
8720
+			$sql .= " INNER JOIN ".$this->db->prefix().$this->db->sanitize($parent_properties['table_element'])." as o ON o.rowid = t.".$objecttmp->fk_parent_attribute;
8721 8721
 		}
8722 8722
 		if (in_array($objecttmp->parent_element, ['commande', 'propal', 'facture', 'expedition'])) {
8723
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product as p ON p.rowid = t.fk_product";
8723
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product as p ON p.rowid = t.fk_product";
8724 8724
 		}
8725 8725
 		if (isset($objecttmp->ismultientitymanaged)) {
8726 8726
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8727 8727
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8728
-				$sql .= " INNER JOIN " . $this->db->prefix() . $this->db->sanitize($tmparray[1]) . " as parenttable ON parenttable.rowid = t." . $this->db->sanitize($tmparray[0]);
8728
+				$sql .= " INNER JOIN ".$this->db->prefix().$this->db->sanitize($tmparray[1])." as parenttable ON parenttable.rowid = t.".$this->db->sanitize($tmparray[0]);
8729 8729
 			}
8730 8730
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8731 8731
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8732
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8732
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8733 8733
 				}
8734 8734
 			}
8735 8735
 		}
@@ -8749,27 +8749,27 @@  discard block
 block discarded – undo
8749 8749
 			$sql .= " WHERE 1=1";
8750 8750
 			if (isset($objecttmp->ismultientitymanaged)) {
8751 8751
 				if ($objecttmp->ismultientitymanaged == 1) {
8752
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8752
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8753 8753
 				}
8754 8754
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8755
-					$sql .= " AND parenttable.entity = t." . $this->db->sanitize($tmparray[0]);
8755
+					$sql .= " AND parenttable.entity = t.".$this->db->sanitize($tmparray[0]);
8756 8756
 				}
8757 8757
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8758 8758
 					if ($objecttmp->element == 'societe') {
8759
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8759
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8760 8760
 					} else {
8761
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8761
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8762 8762
 					}
8763 8763
 				}
8764 8764
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8765 8765
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8766
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8766
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8767 8767
 					}
8768 8768
 				}
8769 8769
 			}
8770 8770
 			$splittedfieldstoshow = explode(',', $fieldstoshow);
8771 8771
 			foreach ($splittedfieldstoshow as &$field2) {
8772
-				if (is_numeric($pos=strpos($field2, ' '))) {
8772
+				if (is_numeric($pos = strpos($field2, ' '))) {
8773 8773
 					$field2 = substr($field2, 0, $pos);
8774 8774
 				}
8775 8775
 			}
@@ -8781,7 +8781,7 @@  discard block
 block discarded – undo
8781 8781
 				$errormessage = '';
8782 8782
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8783 8783
 				if ($errormessage) {
8784
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8784
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8785 8785
 				}
8786 8786
 			}
8787 8787
 		}
@@ -8793,7 +8793,7 @@  discard block
 block discarded – undo
8793 8793
 		$resql = $this->db->query($sql);
8794 8794
 		if ($resql) {
8795 8795
 			// Construct $out and $outarray
8796
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8796
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8797 8797
 
8798 8798
 			// Warning: Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4
8799 8799
 			$textifempty = '&nbsp;';
@@ -8807,7 +8807,7 @@  discard block
 block discarded – undo
8807 8807
 				}
8808 8808
 			}
8809 8809
 			if ($showempty) {
8810
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8810
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8811 8811
 			}
8812 8812
 
8813 8813
 			$num = $this->db->num_rows($resql);
@@ -8830,9 +8830,9 @@  discard block
 block discarded – undo
8830 8830
 					}
8831 8831
 					if (empty($outputmode)) {
8832 8832
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8833
-							$out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8833
+							$out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8834 8834
 						} else {
8835
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8835
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8836 8836
 						}
8837 8837
 					} else {
8838 8838
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8845,10 +8845,10 @@  discard block
 block discarded – undo
8845 8845
 				}
8846 8846
 			}
8847 8847
 
8848
-			$out .= '</select>' . "\n";
8848
+			$out .= '</select>'."\n";
8849 8849
 
8850 8850
 			if (!$forcecombo) {
8851
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8851
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8852 8852
 				$out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0));
8853 8853
 			}
8854 8854
 		} else {
@@ -8912,8 +8912,8 @@  discard block
 block discarded – undo
8912 8912
 			}
8913 8913
 		}
8914 8914
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8915
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8916
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8915
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8916
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8917 8917
 		$out .= '>'."\n";
8918 8918
 
8919 8919
 		if ($show_empty) {
@@ -8924,7 +8924,7 @@  discard block
 block discarded – undo
8924 8924
 			if (!is_numeric($show_empty)) {
8925 8925
 				$textforempty = $show_empty;
8926 8926
 			}
8927
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8927
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8928 8928
 		}
8929 8929
 		if (is_array($array)) {
8930 8930
 			// Translate
@@ -8949,7 +8949,7 @@  discard block
 block discarded – undo
8949 8949
 					$value = $tmpvalue['label'];
8950 8950
 					//$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html'];
8951 8951
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8952
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8952
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8953 8953
 				} else {
8954 8954
 					$value = $tmpvalue;
8955 8955
 					//$valuehtml = $tmpvalue;
@@ -8965,9 +8965,9 @@  discard block
 block discarded – undo
8965 8965
 				}
8966 8966
 				if ($key_in_label) {
8967 8967
 					if (empty($nohtmlescape)) {
8968
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8968
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8969 8969
 					} else {
8970
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8970
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8971 8971
 					}
8972 8972
 				} else {
8973 8973
 					if (empty($nohtmlescape)) {
@@ -8979,8 +8979,8 @@  discard block
 block discarded – undo
8979 8979
 						$selectOptionValue = '&nbsp;';
8980 8980
 					}
8981 8981
 				}
8982
-				$out .= '<option value="' . $key . '"';
8983
-				$out .= $style . $disabled;
8982
+				$out .= '<option value="'.$key.'"';
8983
+				$out .= $style.$disabled;
8984 8984
 				if (is_array($id)) {
8985 8985
 					if (in_array($key, $id) && !$disabled) {
8986 8986
 						$out .= ' selected'; // To preselect a value
@@ -8992,7 +8992,7 @@  discard block
 block discarded – undo
8992 8992
 					}
8993 8993
 				}
8994 8994
 				if (!empty($nohtmlescape)) {	// deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content.
8995
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8995
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8996 8996
 				}
8997 8997
 
8998 8998
 				if (is_array($tmpvalue)) {
@@ -9015,7 +9015,7 @@  discard block
 block discarded – undo
9015 9015
 		// Add code for jquery to use multiselect
9016 9016
 		if ($addjscombo && $jsbeautify) {
9017 9017
 			// Enhance with select2
9018
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
9018
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
9019 9019
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
9020 9020
 		}
9021 9021
 
@@ -9043,28 +9043,28 @@  discard block
 block discarded – undo
9043 9043
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
9044 9044
 	{
9045 9045
 		global $conf, $langs;
9046
-		global $delayedhtmlcontent;    // Will be used later outside of this function
9046
+		global $delayedhtmlcontent; // Will be used later outside of this function
9047 9047
 
9048 9048
 		// TODO Use an internal dolibarr component instead of select2
9049 9049
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
9050 9050
 			return '';
9051 9051
 		}
9052 9052
 
9053
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
9053
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
9054 9054
 
9055 9055
 		$outdelayed = '';
9056 9056
 		if (!empty($conf->use_javascript_ajax)) {
9057 9057
 			$tmpplugin = 'select2';
9058
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
9059
-		    	<script nonce="' . getNonce() . '">
9058
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
9059
+		    	<script nonce="' . getNonce().'">
9060 9060
 		    	$(document).ready(function () {
9061 9061
 
9062
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
9062
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
9063 9063
 
9064
-	                $(".' . $htmlname . '").select2({
9064
+	                $(".' . $htmlname.'").select2({
9065 9065
 				    	ajax: {
9066 9066
 					    	dir: "ltr",
9067
-					    	url: "' . $url . '",
9067
+					    	url: "' . $url.'",
9068 9068
 					    	dataType: \'json\',
9069 9069
 					    	delay: 250,
9070 9070
 					    	data: function (params) {
@@ -9091,9 +9091,9 @@  discard block
 block discarded – undo
9091 9091
 				    	},
9092 9092
 		 				language: select2arrayoflanguage,
9093 9093
 						containerCssClass: \':all:\',					/* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */
9094
-					    placeholder: "' . dol_escape_js($placeholder) . '",
9094
+					    placeholder: "' . dol_escape_js($placeholder).'",
9095 9095
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
9096
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
9096
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
9097 9097
 				        formatResult: function (result, container, query, escapeMarkup) {
9098 9098
 	                        return escapeMarkup(result.text);
9099 9099
 	                    },
@@ -9101,10 +9101,10 @@  discard block
 block discarded – undo
9101 9101
 
9102 9102
 	                ' . ($callurlonselect ? '
9103 9103
 	                /* Code to execute a GET when we select a value */
9104
-	                $(".' . $htmlname . '").change(function() {
9105
-				    	var selected = $(".' . $htmlname . '").val();
9104
+	                $(".' . $htmlname.'").change(function() {
9105
+				    	var selected = $(".' . $htmlname.'").val();
9106 9106
 	                	console.log("We select in selectArrayAjax the entry "+selected)
9107
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
9107
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
9108 9108
 	    			    $.each( saveRemoteData, function( key, value ) {
9109 9109
 	    				        if (key == selected)
9110 9110
 	    			            {
@@ -9112,7 +9112,7 @@  discard block
 block discarded – undo
9112 9112
 	    			                 location.assign(value.url);
9113 9113
 	    			            }
9114 9114
 	                    });
9115
-	    			});' : '') . '
9115
+	    			});' : '').'
9116 9116
 
9117 9117
 	    	   });
9118 9118
 		       </script>';
@@ -9148,14 +9148,14 @@  discard block
 block discarded – undo
9148 9148
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
9149 9149
 	{
9150 9150
 		global $conf, $langs;
9151
-		global $delayedhtmlcontent;    // Will be used later outside of this function
9151
+		global $delayedhtmlcontent; // Will be used later outside of this function
9152 9152
 
9153 9153
 		// TODO Use an internal dolibarr component instead of select2
9154 9154
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
9155 9155
 			return '';
9156 9156
 		}
9157 9157
 
9158
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
9158
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
9159 9159
 
9160 9160
 		$formattedarrayresult = array();
9161 9161
 
@@ -9170,20 +9170,20 @@  discard block
 block discarded – undo
9170 9170
 		$outdelayed = '';
9171 9171
 		if (!empty($conf->use_javascript_ajax)) {
9172 9172
 			$tmpplugin = 'select2';
9173
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
9174
-				<script nonce="' . getNonce() . '">
9173
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
9174
+				<script nonce="' . getNonce().'">
9175 9175
 				$(document).ready(function () {
9176
-					var data = ' . json_encode($formattedarrayresult) . ';
9176
+					var data = ' . json_encode($formattedarrayresult).';
9177 9177
 
9178
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
9178
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
9179 9179
 
9180
-					$(".' . $htmlname . '").select2({
9180
+					$(".' . $htmlname.'").select2({
9181 9181
 						data: data,
9182 9182
 						language: select2arrayoflanguage,
9183 9183
 						containerCssClass: \':all:\',					/* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */
9184
-						placeholder: "' . dol_escape_js($placeholder) . '",
9184
+						placeholder: "' . dol_escape_js($placeholder).'",
9185 9185
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
9186
-						minimumInputLength: ' . $minimumInputLength . ',
9186
+						minimumInputLength: ' . $minimumInputLength.',
9187 9187
 						formatResult: function (result, container, query, escapeMarkup) {
9188 9188
 							return escapeMarkup(result.text);
9189 9189
 						},
@@ -9222,11 +9222,11 @@  discard block
 block discarded – undo
9222 9222
 
9223 9223
 					' . ($callurlonselect ? '
9224 9224
 					/* Code to execute a GET when we select a value */
9225
-					$(".' . $htmlname . '").change(function() {
9226
-						var selected = $(".' . $htmlname . '").val();
9225
+					$(".' . $htmlname.'").change(function() {
9226
+						var selected = $(".' . $htmlname.'").val();
9227 9227
 						console.log("We select "+selected)
9228 9228
 
9229
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
9229
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
9230 9230
 						$.each( saveRemoteData, function( key, value ) {
9231 9231
 							if (key == selected)
9232 9232
 							{
@@ -9234,7 +9234,7 @@  discard block
 block discarded – undo
9234 9234
 								location.assign(value.url);
9235 9235
 							}
9236 9236
 						});
9237
-					});' : '') . '
9237
+					});' : '').'
9238 9238
 
9239 9239
 				});
9240 9240
 				</script>';
@@ -9282,7 +9282,7 @@  discard block
 block discarded – undo
9282 9282
 		$useenhancedmultiselect = 0;
9283 9283
 		if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
9284 9284
 			if ($addjscombo) {
9285
-				$useenhancedmultiselect = 1;	// Use the js multiselect in one line. Possible only if $addjscombo not 0.
9285
+				$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
9286 9286
 			}
9287 9287
 		}
9288 9288
 
@@ -9291,7 +9291,7 @@  discard block
 block discarded – undo
9291 9291
 		// submitted to nothing.
9292 9292
 		$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
9293 9293
 		// Output select component
9294
-		$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', (string) $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
9294
+		$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', (string) $width) ? $width : $width.'px').'"' : '').'>'."\n";
9295 9295
 		if (is_array($array) && !empty($array)) {
9296 9296
 			if ($value_as_key) {
9297 9297
 				$array = array_combine($array, $array);
@@ -9312,33 +9312,33 @@  discard block
 block discarded – undo
9312 9312
 						$tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']) : $value['labelhtml'];
9313 9313
 					}
9314 9314
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
9315
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
9315
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
9316 9316
 
9317
-					$out .= '<option value="' . $tmpkey . '"';
9317
+					$out .= '<option value="'.$tmpkey.'"';
9318 9318
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
9319 9319
 						$out .= ' selected';
9320 9320
 					}
9321 9321
 					if (!empty($tmplabelhtml)) {
9322
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
9322
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
9323 9323
 					} else {
9324
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
9325
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
9324
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
9325
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
9326 9326
 					}
9327 9327
 					$out .= '>';
9328 9328
 					$out .= dol_htmlentitiesbr($newval);
9329
-					$out .= '</option>' . "\n";
9329
+					$out .= '</option>'."\n";
9330 9330
 				}
9331 9331
 			}
9332 9332
 		}
9333
-		$out .= '</select>' . "\n";
9333
+		$out .= '</select>'."\n";
9334 9334
 
9335 9335
 		// Add code for jquery to use multiselect
9336 9336
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
9337
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
9338
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
9337
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
9338
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
9339 9339
 			if ($addjscombo == 1) {
9340 9340
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
9341
-				$out .= 'function formatResult(record, container) {' . "\n";
9341
+				$out .= 'function formatResult(record, container) {'."\n";
9342 9342
 				// If property data-html set, we decode html entities and use this.
9343 9343
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
9344 9344
 				$out .= '	if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {';
@@ -9346,26 +9346,26 @@  discard block
 block discarded – undo
9346 9346
 				$out .= '		return htmlEntityDecodeJs($(record.element).attr("data-html"));';
9347 9347
 				$out .= '	}'."\n";
9348 9348
 				$out .= '	return record.text;';
9349
-				$out .= '}' . "\n";
9350
-				$out .= 'function formatSelection(record) {' . "\n";
9349
+				$out .= '}'."\n";
9350
+				$out .= 'function formatSelection(record) {'."\n";
9351 9351
 				if ($elemtype == 'category') {
9352
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
9352
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
9353 9353
 				} else {
9354 9354
 					$out .= 'return record.text;';
9355 9355
 				}
9356
-				$out .= '}' . "\n";
9356
+				$out .= '}'."\n";
9357 9357
 				$out .= '$(document).ready(function () {
9358
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
9358
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
9359 9359
 				if ($placeholder) {
9360 9360
 					$out .= '
9361 9361
 								placeholder: {
9362 9362
 								    id: \'-1\',
9363
-								    text: \'' . dol_escape_js($placeholder) . '\'
9363
+								    text: \'' . dol_escape_js($placeholder).'\'
9364 9364
 								  },';
9365 9365
 				}
9366 9366
 				$out .= '		dir: \'ltr\',
9367 9367
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
9368
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
9368
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
9369 9369
 								// Specify format function for dropdown item
9370 9370
 								formatResult: formatResult,
9371 9371
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -9377,21 +9377,21 @@  discard block
 block discarded – undo
9377 9377
 
9378 9378
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
9379 9379
 								 the size only if component is not hidden by default on load */
9380
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
9380
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
9381 9381
 						});' . "\n";
9382 9382
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
9383 9383
 				// Add other js lib
9384 9384
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
9385 9385
 				// ...
9386
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
9386
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
9387 9387
 				$out .= '$(document).ready(function () {
9388
-							$(\'#' . $htmlname . '\').multiSelect({
9388
+							$(\'#' . $htmlname.'\').multiSelect({
9389 9389
 								containerHTML: \'<div class="multi-select-container">\',
9390 9390
 								menuHTML: \'<div class="multi-select-menu">\',
9391
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
9391
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
9392 9392
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
9393 9393
 								activeClass: \'multi-select-container--open\',
9394
-								noneText: \'' . $placeholder . '\'
9394
+								noneText: \'' . $placeholder.'\'
9395 9395
 							});
9396 9396
 						})';
9397 9397
 			}
@@ -9424,7 +9424,7 @@  discard block
 block discarded – undo
9424 9424
 			return '';
9425 9425
 		}
9426 9426
 
9427
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
9427
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
9428 9428
 
9429 9429
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
9430 9430
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -9467,19 +9467,19 @@  discard block
 block discarded – undo
9467 9467
 				}
9468 9468
 
9469 9469
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list  @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
9470
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
9471
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
9470
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
9471
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
9472 9472
 			}
9473 9473
 		}
9474 9474
 
9475
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
9475
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
9476 9476
 
9477 9477
         <dl class="dropdown">
9478 9478
             <dt>
9479
-            <a href="#' . $htmlname . '">
9480
-              ' . img_picto('', 'list') . '
9479
+            <a href="#' . $htmlname.'">
9480
+              ' . img_picto('', 'list').'
9481 9481
             </a>
9482
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
9482
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
9483 9483
             </dt>
9484 9484
             <dd class="dropdowndd">
9485 9485
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -9491,19 +9491,19 @@  discard block
 block discarded – undo
9491 9491
             </dd>
9492 9492
         </dl>
9493 9493
 
9494
-        <script nonce="' . getNonce() . '" type="text/javascript">
9494
+        <script nonce="' . getNonce().'" type="text/javascript">
9495 9495
           jQuery(document).ready(function () {
9496
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
9496
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
9497 9497
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
9498 9498
 
9499 9499
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
9500 9500
 
9501 9501
                   var title = $(this).val() + ",";
9502 9502
                   if ($(this).is(\':checked\')) {
9503
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
9503
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
9504 9504
                   }
9505 9505
                   else {
9506
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
9506
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
9507 9507
                   }
9508 9508
                   // Now, we submit page
9509 9509
                   //$(this).parents(\'form:first\').submit();
@@ -9534,7 +9534,7 @@  discard block
 block discarded – undo
9534 9534
 	 */
9535 9535
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9536 9536
 	{
9537
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9537
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9538 9538
 
9539 9539
 		$cat = new Categorie($this->db);
9540 9540
 		$categories = $cat->containing($id, $type);
@@ -9544,13 +9544,13 @@  discard block
 block discarded – undo
9544 9544
 			foreach ($categories as $c) {
9545 9545
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
9546 9546
 				foreach ($ways as $way) {
9547
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9547
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9548 9548
 				}
9549 9549
 			}
9550 9550
 			if (empty($toprint)) {
9551 9551
 				return '';
9552 9552
 			} else {
9553
-				return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9553
+				return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9554 9554
 			}
9555 9555
 		}
9556 9556
 
@@ -9599,15 +9599,15 @@  discard block
 block discarded – undo
9599 9599
 
9600 9600
 
9601 9601
 			print '<div class="div-table-responsive-no-min">';
9602
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9602
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9603 9603
 
9604 9604
 			print '<tr class="liste_titre">';
9605
-			print '<td>' . $langs->trans("Type") . '</td>';
9606
-			print '<td>' . $langs->trans("Ref") . '</td>';
9605
+			print '<td>'.$langs->trans("Type").'</td>';
9606
+			print '<td>'.$langs->trans("Ref").'</td>';
9607 9607
 			print '<td class="center"></td>';
9608
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9609
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9610
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9608
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9609
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9610
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9611 9611
 			print '<td></td>';
9612 9612
 			print '</tr>';
9613 9613
 
@@ -9626,13 +9626,13 @@  discard block
 block discarded – undo
9626 9626
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9627 9627
 					$element = $regs[1];
9628 9628
 					$subelement = $regs[2];
9629
-					$tplpath = $element . '/' . $subelement;
9629
+					$tplpath = $element.'/'.$subelement;
9630 9630
 				}
9631 9631
 				$tplname = 'linkedobjectblock';
9632 9632
 
9633 9633
 				// To work with non standard path
9634 9634
 				if ($objecttype == 'facture') {
9635
-					$tplpath = 'compta/' . $element;
9635
+					$tplpath = 'compta/'.$element;
9636 9636
 					if (!isModEnabled('invoice')) {
9637 9637
 						continue; // Do not show if module disabled
9638 9638
 					}
@@ -9643,7 +9643,7 @@  discard block
 block discarded – undo
9643 9643
 						continue; // Do not show if module disabled
9644 9644
 					}
9645 9645
 				} elseif ($objecttype == 'propal') {
9646
-					$tplpath = 'comm/' . $element;
9646
+					$tplpath = 'comm/'.$element;
9647 9647
 					if (!isModEnabled('propal')) {
9648 9648
 						continue; // Do not show if module disabled
9649 9649
 					}
@@ -9696,7 +9696,7 @@  discard block
 block discarded – undo
9696 9696
 				$linkedObjectBlock = $objects;
9697 9697
 
9698 9698
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9699
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9699
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9700 9700
 				foreach ($dirtpls as $reldir) {
9701 9701
 					$reldir = rtrim($reldir, '/');
9702 9702
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
@@ -9704,7 +9704,7 @@  discard block
 block discarded – undo
9704 9704
 						$noMoreLinkedObjectBlockAfter = 1;
9705 9705
 					}
9706 9706
 
9707
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9707
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9708 9708
 					if ($res) {
9709 9709
 						$nboftypesoutput++;
9710 9710
 						break;
@@ -9713,7 +9713,7 @@  discard block
 block discarded – undo
9713 9713
 			}
9714 9714
 
9715 9715
 			if (!$nboftypesoutput) {
9716
-				print '<tr><td colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9716
+				print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9717 9717
 			}
9718 9718
 
9719 9719
 			print '</table>';
@@ -9761,14 +9761,14 @@  discard block
 block discarded – undo
9761 9761
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9762 9762
 			$listofidcompanytoscan = (int) $object->thirdparty->id;
9763 9763
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9764
-				$listofidcompanytoscan .= ',' . (int) $object->thirdparty->parent;
9764
+				$listofidcompanytoscan .= ','.(int) $object->thirdparty->parent;
9765 9765
 			}
9766 9766
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9767
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9767
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9768 9768
 				$tmpproject = new Project($this->db);
9769 9769
 				$tmpproject->fetch($object->fk_project);
9770 9770
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9771
-					$listofidcompanytoscan .= ',' . (int) $tmpproject->socid;
9771
+					$listofidcompanytoscan .= ','.(int) $tmpproject->socid;
9772 9772
 				}
9773 9773
 				unset($tmpproject);
9774 9774
 			}
@@ -9778,75 +9778,75 @@  discard block
 block discarded – undo
9778 9778
 					'enabled' => isModEnabled('propal'),
9779 9779
 					'perms' => 1,
9780 9780
 					'label' => 'LinkToProposal',
9781
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9781
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('propal').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9782 9782
 				),
9783 9783
 				'shipping' => array(
9784 9784
 					'enabled' => isModEnabled('shipping'),
9785 9785
 					'perms' => 1,
9786 9786
 					'label' => 'LinkToExpedition',
9787
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : ''),
9787
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('shipping').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : ''),
9788 9788
 				),
9789 9789
 				'order' => array(
9790 9790
 					'enabled' => isModEnabled('order'),
9791 9791
 					'perms' => 1,
9792 9792
 					'label' => 'LinkToOrder',
9793
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : ''),
9793
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : ''),
9794 9794
 					'linkname' => 'commande',
9795 9795
 				),
9796 9796
 				'invoice' => array(
9797 9797
 					'enabled' => isModEnabled('invoice'),
9798 9798
 					'perms' => 1,
9799 9799
 					'label' => 'LinkToInvoice',
9800
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9800
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9801 9801
 					'linkname' => 'facture',
9802 9802
 				),
9803 9803
 				'invoice_template' => array(
9804 9804
 					'enabled' => isModEnabled('invoice'),
9805 9805
 					'perms' => 1,
9806 9806
 					'label' => 'LinkToTemplateInvoice',
9807
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9807
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9808 9808
 				),
9809 9809
 				'contrat' => array(
9810 9810
 					'enabled' => isModEnabled('contract'),
9811 9811
 					'perms' => 1,
9812 9812
 					'label' => 'LinkToContract',
9813 9813
 					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht
9814
-							FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier',
9814
+							FROM " . $this->db->prefix()."societe as s, ".$this->db->prefix()."contrat as t, ".$this->db->prefix()."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier',
9815 9815
 				),
9816 9816
 				'fichinter' => array(
9817 9817
 					'enabled' => isModEnabled('intervention'),
9818 9818
 					'perms' => 1,
9819 9819
 					'label' => 'LinkToIntervention',
9820
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')',
9820
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')',
9821 9821
 				),
9822 9822
 				'supplier_proposal' => array(
9823 9823
 					'enabled' => isModEnabled('supplier_proposal'),
9824 9824
 					'perms' => 1,
9825 9825
 					'label' => 'LinkToSupplierProposal',
9826
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9826
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''),
9827 9827
 				),
9828 9828
 				'order_supplier' => array(
9829 9829
 					'enabled' => isModEnabled("supplier_order"),
9830 9830
 					'perms' => 1,
9831 9831
 					'label' => 'LinkToSupplierOrder',
9832
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : ''),
9832
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : ''),
9833 9833
 				),
9834 9834
 				'invoice_supplier' => array(
9835 9835
 					'enabled' => isModEnabled("supplier_invoice"),
9836 9836
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9837
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9837
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''),
9838 9838
 				),
9839 9839
 				'ticket' => array(
9840 9840
 					'enabled' => isModEnabled('ticket'),
9841 9841
 					'perms' => 1,
9842 9842
 					'label' => 'LinkToTicket',
9843
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : ''),
9843
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : ''),
9844 9844
 				),
9845 9845
 				'mo' => array(
9846 9846
 					'enabled' => isModEnabled('mrp'),
9847 9847
 					'perms' => 1,
9848 9848
 					'label' => 'LinkToMo',
9849
-					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid  WHERE  t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : ''),
9849
+					'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix()."mrp_mo as t ON t.fk_soc = s.rowid  WHERE  t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : ''),
9850 9850
 				),
9851 9851
 			);
9852 9852
 		}
@@ -9888,23 +9888,23 @@  discard block
 block discarded – undo
9888 9888
 			}
9889 9889
 
9890 9890
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9891
-				$htmltoenteralink .= '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9891
+				$htmltoenteralink .= '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9892 9892
 
9893 9893
 				// Section for free ref input
9894 9894
 				if (!getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) {
9895 9895
 					$htmltoenteralink .= '<br>'."\n";
9896 9896
 					$htmltoenteralink .= '<!-- form to add a link from anywhere -->'."\n";
9897
-					$htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9898
-					$htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">';
9897
+					$htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9898
+					$htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">';
9899 9899
 					$htmltoenteralink .= '<input type="hidden" name="action" value="addlinkbyref">';
9900
-					$htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">';
9901
-					$htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">';
9900
+					$htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">';
9901
+					$htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">';
9902 9902
 					$htmltoenteralink .= '<table class="noborder">';
9903 9903
 					$htmltoenteralink .= '<tr class="liste_titre">';
9904 9904
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9905
-					$htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9906
-					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9907
-					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9905
+					$htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9906
+					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9907
+					$htmltoenteralink .= '<input type="submit" class="button smallpaddingimp" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9908 9908
 					$htmltoenteralink .= '</tr>';
9909 9909
 					$htmltoenteralink .= '</table>';
9910 9910
 					$htmltoenteralink .= '</form>';
@@ -9923,18 +9923,18 @@  discard block
 block discarded – undo
9923 9923
 							$htmltoenteralink .= '<br>';
9924 9924
 						}
9925 9925
 						$htmltoenteralink .= '<!-- form to add a link from object to same thirdparty -->'."\n";
9926
-						$htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9927
-						$htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">';
9926
+						$htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9927
+						$htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">';
9928 9928
 						$htmltoenteralink .= '<input type="hidden" name="action" value="addlink">';
9929
-						$htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">';
9930
-						$htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">';
9929
+						$htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">';
9930
+						$htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">';
9931 9931
 						$htmltoenteralink .= '<table class="noborder">';
9932 9932
 						$htmltoenteralink .= '<tr class="liste_titre">';
9933 9933
 						$htmltoenteralink .= '<td class="nowrap"></td>';
9934
-						$htmltoenteralink .= '<td>' . $langs->trans("Ref") . '</td>';
9935
-						$htmltoenteralink .= '<td>' . $langs->trans("RefCustomer") . '</td>';
9936
-						$htmltoenteralink .= '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9937
-						$htmltoenteralink .= '<td>' . $langs->trans("Company") . '</td>';
9934
+						$htmltoenteralink .= '<td>'.$langs->trans("Ref").'</td>';
9935
+						$htmltoenteralink .= '<td>'.$langs->trans("RefCustomer").'</td>';
9936
+						$htmltoenteralink .= '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9937
+						$htmltoenteralink .= '<td>'.$langs->trans("Company").'</td>';
9938 9938
 						$htmltoenteralink .= '</tr>';
9939 9939
 						while ($i < $num) {
9940 9940
 							$objp = $this->db->fetch_object($resqllist);
@@ -9949,30 +9949,30 @@  discard block
 block discarded – undo
9949 9949
 							if ($alreadylinked) {
9950 9950
 								$htmltoenteralink .= img_picto('', 'link');
9951 9951
 							} else {
9952
-								$htmltoenteralink .= '<input type="checkbox" name="idtolinkto[' . $key . '_' . $objp->rowid . ']" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9952
+								$htmltoenteralink .= '<input type="checkbox" name="idtolinkto['.$key.'_'.$objp->rowid.']" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9953 9953
 							}
9954 9954
 							$htmltoenteralink .= '</td>';
9955
-							$htmltoenteralink .= '<td><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9956
-							$htmltoenteralink .= '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9955
+							$htmltoenteralink .= '<td><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9956
+							$htmltoenteralink .= '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9957 9957
 							$htmltoenteralink .= '<td class="right">';
9958 9958
 							if ($possiblelink['label'] == 'LinkToContract') {
9959
-								$htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9959
+								$htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9960 9960
 							}
9961
-							$htmltoenteralink .= '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9961
+							$htmltoenteralink .= '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9962 9962
 							$htmltoenteralink .= '</td>';
9963
-							$htmltoenteralink .= '<td>' . $objp->name . '</td>';
9963
+							$htmltoenteralink .= '<td>'.$objp->name.'</td>';
9964 9964
 							$htmltoenteralink .= '</tr>';
9965 9965
 							$i++;
9966 9966
 						}
9967 9967
 						$htmltoenteralink .= '</table>';
9968 9968
 						$htmltoenteralink .= '<div class="center">';
9969 9969
 						if ($num) {
9970
-							$htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly smallpaddingimp" value="' . $langs->trans('ToLink') . '">';
9970
+							$htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly smallpaddingimp" value="'.$langs->trans('ToLink').'">';
9971 9971
 						}
9972 9972
 						if (empty($conf->use_javascript_ajax)) {
9973
-							$htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9973
+							$htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9974 9974
 						} else {
9975
-							$htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9975
+							$htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9976 9976
 						}
9977 9977
 						$htmltoenteralink .= '</form>';
9978 9978
 					}
@@ -9986,10 +9986,10 @@  discard block
 block discarded – undo
9986 9986
 
9987 9987
 				// Complete the list for the combo box
9988 9988
 				if ($num > 0 || !getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) {
9989
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9989
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9990 9990
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9991 9991
 				} else {
9992
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9992
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9993 9993
 				}
9994 9994
 			}
9995 9995
 		}
@@ -9999,11 +9999,11 @@  discard block
 block discarded – undo
9999 9999
 			<dl class="dropdown" id="linktoobjectname">
10000 10000
 			';
10001 10001
 			if (!empty($conf->use_javascript_ajax)) {
10002
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
10002
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
10003 10003
 			}
10004 10004
 			$linktoelem .= '<dd>
10005 10005
 			<div class="multiselectlinkto">
10006
-			<ul class="ulselectedfields">' . $linktoelemlist . '
10006
+			<ul class="ulselectedfields">' . $linktoelemlist.'
10007 10007
 			</ul>
10008 10008
 			</div>
10009 10009
 			</dd>
@@ -10014,7 +10014,7 @@  discard block
 block discarded – undo
10014 10014
 
10015 10015
 		if (!empty($conf->use_javascript_ajax)) {
10016 10016
 			print '<!-- Add js to show linkto box -->
10017
-				<script nonce="' . getNonce() . '">
10017
+				<script nonce="' . getNonce().'">
10018 10018
 				jQuery(document).ready(function() {
10019 10019
 					jQuery(".linkto").click(function() {
10020 10020
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -10061,19 +10061,19 @@  discard block
 block discarded – undo
10061 10061
 
10062 10062
 		$disabled = ($disabled ? ' disabled' : '');
10063 10063
 
10064
-		$resultyesno = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
10064
+		$resultyesno = '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
10065 10065
 		if ($useempty) {
10066
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10066
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
10067 10067
 		}
10068 10068
 		if (("$value" == 'yes') || ($value == 1)) {
10069
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
10070
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
10069
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
10070
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
10071 10071
 		} else {
10072 10072
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
10073
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
10074
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
10073
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
10074
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
10075 10075
 		}
10076
-		$resultyesno .= '</select>' . "\n";
10076
+		$resultyesno .= '</select>'."\n";
10077 10077
 
10078 10078
 		if ($addjscombo) {
10079 10079
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -10097,12 +10097,12 @@  discard block
 block discarded – undo
10097 10097
 	{
10098 10098
 		// phpcs:enable
10099 10099
 		$sql = "SELECT rowid, label";
10100
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
10101
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
10100
+		$sql .= " FROM ".$this->db->prefix()."export_model";
10101
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
10102 10102
 		$sql .= " ORDER BY rowid";
10103 10103
 		$result = $this->db->query($sql);
10104 10104
 		if ($result) {
10105
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
10105
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
10106 10106
 			if ($useempty) {
10107 10107
 				print '<option value="-1">&nbsp;</option>';
10108 10108
 			}
@@ -10112,9 +10112,9 @@  discard block
 block discarded – undo
10112 10112
 			while ($i < $num) {
10113 10113
 				$obj = $this->db->fetch_object($result);
10114 10114
 				if ($selected == $obj->rowid) {
10115
-					print '<option value="' . $obj->rowid . '" selected>';
10115
+					print '<option value="'.$obj->rowid.'" selected>';
10116 10116
 				} else {
10117
-					print '<option value="' . $obj->rowid . '">';
10117
+					print '<option value="'.$obj->rowid.'">';
10118 10118
 				}
10119 10119
 				print $obj->label;
10120 10120
 				print '</option>';
@@ -10205,8 +10205,8 @@  discard block
 block discarded – undo
10205 10205
 				$stringforfirstkey .= ' CTL +';
10206 10206
 			}
10207 10207
 
10208
-			$previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
10209
-			$next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
10208
+			$previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
10209
+			$next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
10210 10210
 		}
10211 10211
 
10212 10212
 		//print "xx".$previous_ref."x".$next_ref;
@@ -10214,18 +10214,18 @@  discard block
 block discarded – undo
10214 10214
 
10215 10215
 		// Right part of banner
10216 10216
 		if ($morehtmlright) {
10217
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
10217
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
10218 10218
 		}
10219 10219
 
10220 10220
 		if ($previous_ref || $next_ref || $morehtml) {
10221 10221
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
10222 10222
 		}
10223 10223
 		if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) {
10224
-			$ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
10224
+			$ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
10225 10225
 		}
10226 10226
 		if ($shownav && ($previous_ref || $next_ref)) {
10227
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
10228
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
10227
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
10228
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
10229 10229
 		}
10230 10230
 		if ($previous_ref || $next_ref || $morehtml) {
10231 10231
 			$ret .= '</ul></div>';
@@ -10240,7 +10240,7 @@  discard block
 block discarded – undo
10240 10240
 			$morehtmlstatus = $hookmanager->resPrint;
10241 10241
 		}
10242 10242
 		if ($morehtmlstatus) {
10243
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
10243
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
10244 10244
 		}
10245 10245
 
10246 10246
 		$parameters = array();
@@ -10254,14 +10254,14 @@  discard block
 block discarded – undo
10254 10254
 		// Left part of banner
10255 10255
 		if ($morehtmlleft) {
10256 10256
 			if ($conf->browser->layout == 'phone') {
10257
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
10257
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
10258 10258
 			} else {
10259
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
10259
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
10260 10260
 			}
10261 10261
 		}
10262 10262
 
10263 10263
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
10264
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
10264
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
10265 10265
 
10266 10266
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
10267 10267
 		if ($object->element == 'societe') {
@@ -10275,7 +10275,7 @@  discard block
 block discarded – undo
10275 10275
 
10276 10276
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
10277 10277
 				if (!is_object($extralanguages)) {
10278
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
10278
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
10279 10279
 					$extralanguages = new ExtraLanguages($this->db);
10280 10280
 				}
10281 10281
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -10290,21 +10290,21 @@  discard block
 block discarded – undo
10290 10290
 						if ($object->array_languages['name'][$extralangcode]) {
10291 10291
 							$htmltext .= $object->array_languages['name'][$extralangcode];
10292 10292
 						} else {
10293
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
10293
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
10294 10294
 						}
10295 10295
 					}
10296
-					$ret .= '<!-- Show translations of name -->' . "\n";
10296
+					$ret .= '<!-- Show translations of name -->'."\n";
10297 10297
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
10298 10298
 				}
10299 10299
 			}
10300 10300
 		} elseif ($object->element == 'member') {
10301 10301
 			'@phan-var-force Adherent $object';
10302
-			$ret .= $object->ref . '<br>';
10302
+			$ret .= $object->ref.'<br>';
10303 10303
 			$fullname = $object->getFullName($langs);
10304 10304
 			if ($object->morphy == 'mor' && $object->societe) {
10305
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
10305
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
10306 10306
 			} else {
10307
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
10307
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
10308 10308
 			}
10309 10309
 		} elseif (in_array($object->element, array('contact', 'user'))) {
10310 10310
 			$ret .= '<span class="valignmiddle">'.dol_htmlentities($object->getFullName($langs)).'</span>'.$addgendertxt;
@@ -10312,7 +10312,7 @@  discard block
 block discarded – undo
10312 10312
 			$ret .= dol_htmlentities($object->name);
10313 10313
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
10314 10314
 			'@phan-var-force ActionComm $object';
10315
-			$ret .= $object->ref . '<br>' . $object->label;
10315
+			$ret .= $object->ref.'<br>'.$object->label;
10316 10316
 		} elseif (in_array($object->element, array('adherent_type'))) {
10317 10317
 			$ret .= $object->label;
10318 10318
 		} elseif ($object->element == 'ecm_directories') {
@@ -10365,9 +10365,9 @@  discard block
 block discarded – undo
10365 10365
 		}
10366 10366
 
10367 10367
 		// Barcode image  @phan-suppress-next-line PhanUndeclaredProperty
10368
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
10369
-		$out = '<!-- url barcode = ' . $url . ' -->';
10370
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
10368
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
10369
+		$out = '<!-- url barcode = '.$url.' -->';
10370
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
10371 10371
 
10372 10372
 		return $out;
10373 10373
 	}
@@ -10394,7 +10394,7 @@  discard block
 block discarded – undo
10394 10394
 		global $conf, $langs;
10395 10395
 
10396 10396
 		$entity = (empty($object->entity) ? $conf->entity : $object->entity);
10397
-		$id = (empty($object->id) ? $object->rowid : $object->id);  // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
10397
+		$id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
10398 10398
 
10399 10399
 		$dir = '';
10400 10400
 		$file = '';
@@ -10407,28 +10407,28 @@  discard block
 block discarded – undo
10407 10407
 			if (!empty($object->logo)) {
10408 10408
 				if (dolIsAllowedForPreview($object->logo)) {
10409 10409
 					if ((string) $imagesize == 'mini') {
10410
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
10410
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
10411 10411
 					} elseif ((string) $imagesize == 'small') {
10412
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
10412
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
10413 10413
 					} else {
10414
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
10414
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
10415 10415
 					}
10416
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
10416
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
10417 10417
 				}
10418 10418
 			}
10419 10419
 			$email = $object->email;
10420 10420
 		} elseif ($modulepart == 'contact') {
10421
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
10421
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
10422 10422
 			if (!empty($object->photo)) {
10423 10423
 				if (dolIsAllowedForPreview($object->photo)) {
10424 10424
 					if ((string) $imagesize == 'mini') {
10425
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10425
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10426 10426
 					} elseif ((string) $imagesize == 'small') {
10427
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10427
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
10428 10428
 					} else {
10429
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
10429
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
10430 10430
 					}
10431
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
10431
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
10432 10432
 				}
10433 10433
 			}
10434 10434
 			$email = $object->email;
@@ -10438,17 +10438,17 @@  discard block
 block discarded – undo
10438 10438
 			if (!empty($object->photo)) {
10439 10439
 				if (dolIsAllowedForPreview($object->photo)) {
10440 10440
 					if ((string) $imagesize == 'mini') {
10441
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10441
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10442 10442
 					} elseif ((string) $imagesize == 'small') {
10443
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10443
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
10444 10444
 					} else {
10445
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
10445
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
10446 10446
 					}
10447
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
10447
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
10448 10448
 				}
10449 10449
 			}
10450 10450
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
10451
-				$altfile = $object->id . ".jpg"; // For backward compatibility
10451
+				$altfile = $object->id.".jpg"; // For backward compatibility
10452 10452
 			}
10453 10453
 			$email = $object->email;
10454 10454
 			$capture = 'user';
@@ -10457,17 +10457,17 @@  discard block
 block discarded – undo
10457 10457
 			if (!empty($object->photo)) {
10458 10458
 				if (dolIsAllowedForPreview($object->photo)) {
10459 10459
 					if ((string) $imagesize == 'mini') {
10460
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10460
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10461 10461
 					} elseif ((string) $imagesize == 'small') {
10462
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10462
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
10463 10463
 					} else {
10464
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
10464
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
10465 10465
 					}
10466
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
10466
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
10467 10467
 				}
10468 10468
 			}
10469 10469
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
10470
-				$altfile = $object->id . ".jpg"; // For backward compatibility
10470
+				$altfile = $object->id.".jpg"; // For backward compatibility
10471 10471
 			}
10472 10472
 			$email = $object->email;
10473 10473
 			$capture = 'user';
@@ -10493,35 +10493,35 @@  discard block
 block discarded – undo
10493 10493
 		$ret = '';
10494 10494
 
10495 10495
 		if ($dir) {
10496
-			if ($file && file_exists($dir . "/" . $file)) {
10496
+			if ($file && file_exists($dir."/".$file)) {
10497 10497
 				if ($addlinktofullsize) {
10498
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10498
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10499 10499
 					if ($urladvanced) {
10500
-						$ret .= '<a href="' . $urladvanced . '">';
10500
+						$ret .= '<a href="'.$urladvanced.'">';
10501 10501
 					} else {
10502
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10502
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10503 10503
 					}
10504 10504
 				}
10505
-				$ret .= '<img alt="" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">';
10505
+				$ret .= '<img alt="" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
10506 10506
 				if ($addlinktofullsize) {
10507 10507
 					$ret .= '</a>';
10508 10508
 				}
10509
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
10509
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
10510 10510
 				if ($addlinktofullsize) {
10511
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10511
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10512 10512
 					if ($urladvanced) {
10513
-						$ret .= '<a href="' . $urladvanced . '">';
10513
+						$ret .= '<a href="'.$urladvanced.'">';
10514 10514
 					} else {
10515
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10515
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10516 10516
 					}
10517 10517
 				}
10518
-				$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="Photo alt" id="photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" class="' . $cssclass . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($altfile) . '&cache=' . $cache . '">';
10518
+				$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" class="'.$cssclass.'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">';
10519 10519
 				if ($addlinktofullsize) {
10520 10520
 					$ret .= '</a>';
10521 10521
 				}
10522 10522
 			} else {
10523 10523
 				$nophoto = '/public/theme/common/nophoto.png';
10524
-				$defaultimg = 'identicon';        // For gravatar
10524
+				$defaultimg = 'identicon'; // For gravatar
10525 10525
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
10526 10526
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) {
10527 10527
 						$nophoto = 'company';
@@ -10539,13 +10539,13 @@  discard block
 block discarded – undo
10539 10539
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
10540 10540
 					// see https://gravatar.com/site/implement/images/php/
10541 10541
 					$ret .= '<!-- Put link to gravatar -->';
10542
-					$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . dol_hash(strtolower(trim($email)), 'sha256', 1) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash
10542
+					$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)), 'sha256', 1).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash
10543 10543
 				} else {
10544 10544
 					if ($nophoto == 'company') {
10545
-						$ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
10545
+						$ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
10546 10546
 						//$ret .= '<div class="difforspanimgright"></div>';
10547 10547
 					} else {
10548
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
10548
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
10549 10549
 					}
10550 10550
 				}
10551 10551
 			}
@@ -10556,15 +10556,15 @@  discard block
 block discarded – undo
10556 10556
 				}
10557 10557
 				$ret .= '<table class="nobordernopadding centpercent">';
10558 10558
 				if ($object->photo) {
10559
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
10559
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
10560 10560
 				}
10561 10561
 				$ret .= '<tr><td class="tdoverflow">';
10562 10562
 				$maxfilesizearray = getMaxFileSizeArray();
10563 10563
 				$maxmin = $maxfilesizearray['maxmin'];
10564 10564
 				if ($maxmin > 0) {
10565
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
10565
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
10566 10566
 				}
10567
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
10567
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
10568 10568
 				$ret .= '</td></tr>';
10569 10569
 				$ret .= '</table>';
10570 10570
 			}
@@ -10618,38 +10618,38 @@  discard block
 block discarded – undo
10618 10618
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10619 10619
 			$sql .= ", e.label";
10620 10620
 		}
10621
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10621
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10622 10622
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10623
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10623
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10624 10624
 			if ($force_entity) {
10625
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10625
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10626 10626
 			} else {
10627 10627
 				$sql .= " WHERE ug.entity IS NOT NULL";
10628 10628
 			}
10629 10629
 		} else {
10630
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10630
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10631 10631
 		}
10632 10632
 		if (is_array($exclude) && $excludeGroups) {
10633
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10633
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10634 10634
 		}
10635 10635
 		if (is_array($include) && $includeGroups) {
10636
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10636
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10637 10637
 		}
10638 10638
 		$sql .= " ORDER BY ug.nom ASC";
10639 10639
 
10640
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10640
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10641 10641
 		$resql = $this->db->query($sql);
10642 10642
 		if ($resql) {
10643 10643
 			// Enhance with select2
10644
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10644
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10645 10645
 
10646
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10646
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10647 10647
 
10648 10648
 			$num = $this->db->num_rows($resql);
10649 10649
 			$i = 0;
10650 10650
 			if ($num) {
10651 10651
 				if ($show_empty && !$multiple) {
10652
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10652
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10653 10653
 				}
10654 10654
 
10655 10655
 				while ($i < $num) {
@@ -10662,11 +10662,11 @@  discard block
 block discarded – undo
10662 10662
 					$label = $obj->name;
10663 10663
 					$labelhtml = $obj->name;
10664 10664
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10665
-						$label .= " (" . $obj->label . ")";
10666
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10665
+						$label .= " (".$obj->label.")";
10666
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10667 10667
 					}
10668 10668
 
10669
-					$out .= '<option value="' . $obj->rowid . '"';
10669
+					$out .= '<option value="'.$obj->rowid.'"';
10670 10670
 					if ($disableline) {
10671 10671
 						$out .= ' disabled';
10672 10672
 					}
@@ -10682,9 +10682,9 @@  discard block
 block discarded – undo
10682 10682
 				}
10683 10683
 			} else {
10684 10684
 				if ($show_empty) {
10685
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10685
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10686 10686
 				}
10687
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10687
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10688 10688
 			}
10689 10689
 			$out .= '</select>';
10690 10690
 
@@ -10728,25 +10728,25 @@  discard block
 block discarded – undo
10728 10728
 		$out = '';
10729 10729
 
10730 10730
 		if (!empty($conf->use_javascript_ajax)) {
10731
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10731
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10732 10732
 		}
10733
-		$out .= '<script nonce="' . getNonce() . '">
10733
+		$out .= '<script nonce="'.getNonce().'">
10734 10734
             $(document).ready(function() {
10735
-                $("#' . $cssclass . 's").click(function() {
10735
+                $("#' . $cssclass.'s").click(function() {
10736 10736
                     if($(this).is(\':checked\')){
10737
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10738
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10737
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10738
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10739 10739
                     }
10740 10740
                     else
10741 10741
                     {
10742 10742
                         console.log("We uncheck all");
10743
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10743
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10744 10744
                     }' . "\n";
10745 10745
 		if ($calljsfunction) {
10746
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10746
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10747 10747
 		}
10748 10748
 		$out .= '         });
10749
-        	        $(".' . $cssclass . '").change(function() {
10749
+        	        $(".' . $cssclass.'").change(function() {
10750 10750
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10751 10751
 				});
10752 10752
 		 	});
@@ -10791,67 +10791,67 @@  discard block
 block discarded – undo
10791 10791
 		global $langs, $user;
10792 10792
 
10793 10793
 		$out = '';
10794
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10795
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10794
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10795
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10796 10796
 		if (!empty($excludeid)) {
10797
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10797
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10798 10798
 		}
10799 10799
 		$sql .= " ORDER BY label";
10800 10800
 
10801 10801
 		$resql = $this->db->query($sql);
10802 10802
 		if ($resql) {
10803
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10803
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10804 10804
 			if ($useempty) {
10805 10805
 				$out .= '<option value="0">&nbsp;</option>';
10806 10806
 			}
10807 10807
 
10808 10808
 			while ($obj = $this->db->fetch_object($resql)) {
10809
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10809
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10810 10810
 			}
10811 10811
 			$out .= '</select>';
10812
-			$out .= ajax_combobox('select_' . $htmlname);
10812
+			$out .= ajax_combobox('select_'.$htmlname);
10813 10813
 
10814 10814
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10815
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10815
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10816 10816
 			}
10817 10817
 
10818 10818
 			if (!empty($target)) {
10819
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10819
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10820 10820
 				$resql = $this->db->query($sql);
10821 10821
 				if ($resql) {
10822 10822
 					if ($this->db->num_rows($resql) > 0) {
10823 10823
 						$obj = $this->db->fetch_object($resql);
10824
-						$out .= '<script nonce="' . getNonce() . '">
10824
+						$out .= '<script nonce="'.getNonce().'">
10825 10825
 							$(function() {
10826
-								$("select[name=' . $target . ']").on("change", function() {
10826
+								$("select[name=' . $target.']").on("change", function() {
10827 10827
 									var current_val = $(this).val();
10828
-									if (current_val == ' . $obj->id . ') {';
10828
+									if (current_val == ' . $obj->id.') {';
10829 10829
 						if (!empty($default_selected) || !empty($selected)) {
10830
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10830
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10831 10831
 						}
10832 10832
 
10833 10833
 						$out .= '
10834
-										$("select[name=' . $htmlname . ']").change();
10834
+										$("select[name=' . $htmlname.']").change();
10835 10835
 									}
10836 10836
 								});
10837 10837
 
10838
-								$("select[name=' . $htmlname . ']").change(function() {
10838
+								$("select[name=' . $htmlname.']").change(function() {
10839 10839
 
10840
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10840
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10841 10841
 										// get price of kilometer to fill the unit price
10842 10842
 										$.ajax({
10843 10843
 											method: "POST",
10844 10844
 											dataType: "json",
10845
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10846
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '",
10845
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10846
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'",
10847 10847
 										}).done(function( data, textStatus, jqXHR ) {
10848 10848
 											console.log(data);
10849 10849
 											if (typeof data.up != "undefined") {
10850 10850
 												$("input[name=value_unit]").val(data.up);
10851
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10851
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10852 10852
 											} else {
10853 10853
 												$("input[name=value_unit]").val("");
10854
-												$("select[name=' . $htmlname . ']").attr("title", "");
10854
+												$("select[name=' . $htmlname.']").attr("title", "");
10855 10855
 											}
10856 10856
 										});
10857 10857
 									}
@@ -10881,18 +10881,18 @@  discard block
 block discarded – undo
10881 10881
 		global $conf, $langs;
10882 10882
 
10883 10883
 		$out = '';
10884
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10885
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10884
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10885
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10886 10886
 
10887 10887
 		$resql = $this->db->query($sql);
10888 10888
 		if ($resql) {
10889
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10889
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10890 10890
 			if ($useempty) {
10891 10891
 				$out .= '<option value="0"></option>';
10892 10892
 			}
10893 10893
 
10894 10894
 			while ($obj = $this->db->fetch_object($resql)) {
10895
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10895
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10896 10896
 			}
10897 10897
 			$out .= '</select>';
10898 10898
 		} else {
@@ -10923,12 +10923,12 @@  discard block
 block discarded – undo
10923 10923
 
10924 10924
 		$resql = $this->db->query($sql);
10925 10925
 		if ($resql) {
10926
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10926
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10927 10927
 			if ($useempty) {
10928 10928
 				$out .= '<option value="0"></option>';
10929 10929
 			}
10930 10930
 			if ($allchoice) {
10931
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10931
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10932 10932
 			}
10933 10933
 
10934 10934
 			$field = 'code';
@@ -10938,7 +10938,7 @@  discard block
 block discarded – undo
10938 10938
 
10939 10939
 			while ($obj = $this->db->fetch_object($resql)) {
10940 10940
 				$key = $langs->trans($obj->code);
10941
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10941
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10942 10942
 			}
10943 10943
 			$out .= '</select>';
10944 10944
 
@@ -10972,7 +10972,7 @@  discard block
 block discarded – undo
10972 10972
 	{
10973 10973
 		global $user, $conf, $langs;
10974 10974
 
10975
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10975
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10976 10976
 
10977 10977
 		if (is_null($usertofilter)) {
10978 10978
 			$usertofilter = $user;
@@ -10996,10 +10996,10 @@  discard block
 block discarded – undo
10996 10996
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10997 10997
             p.title, p.fk_soc, p.fk_statut, p.public,";
10998 10998
 		$sql .= ' s.nom as name';
10999
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
11000
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
11001
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
11002
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10999
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
11000
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
11001
+		$sql .= ' '.$this->db->prefix().'facture as f';
11002
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
11003 11003
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
11004 11004
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
11005 11005
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -11010,14 +11010,14 @@  discard block
 block discarded – undo
11010 11010
 		if ($resql) {
11011 11011
 			// Use select2 selector
11012 11012
 			if (!empty($conf->use_javascript_ajax)) {
11013
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
11013
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
11014 11014
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
11015 11015
 				$out .= $comboenhancement;
11016 11016
 				$morecss = 'minwidth200imp maxwidth500';
11017 11017
 			}
11018 11018
 
11019 11019
 			if (empty($option_only)) {
11020
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
11020
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
11021 11021
 			}
11022 11022
 			if (!empty($show_empty)) {
11023 11023
 				$out .= '<option value="0" class="optiongrey">';
@@ -11047,33 +11047,33 @@  discard block
 block discarded – undo
11047 11047
 						if ($showproject == 'all') {
11048 11048
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
11049 11049
 							if ($obj->name) {
11050
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
11050
+								$labeltoshow .= ' - '.$obj->name; // Soc name
11051 11051
 							}
11052 11052
 
11053 11053
 							$disabled = 0;
11054 11054
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
11055 11055
 								$disabled = 1;
11056
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
11056
+								$labeltoshow .= ' - '.$langs->trans("Draft");
11057 11057
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
11058 11058
 								if ($discard_closed == 2) {
11059 11059
 									$disabled = 1;
11060 11060
 								}
11061
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
11061
+								$labeltoshow .= ' - '.$langs->trans("Closed");
11062 11062
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
11063 11063
 								$disabled = 1;
11064
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
11064
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
11065 11065
 							}
11066 11066
 						}
11067 11067
 
11068 11068
 						if (!empty($selected) && $selected == $obj->rowid) {
11069
-							$out .= '<option value="' . $obj->rowid . '" selected';
11069
+							$out .= '<option value="'.$obj->rowid.'" selected';
11070 11070
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
11071
-							$out .= '>' . $labeltoshow . '</option>';
11071
+							$out .= '>'.$labeltoshow.'</option>';
11072 11072
 						} else {
11073 11073
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
11074 11074
 								$resultat = '';
11075 11075
 							} else {
11076
-								$resultat = '<option value="' . $obj->rowid . '"';
11076
+								$resultat = '<option value="'.$obj->rowid.'"';
11077 11077
 								if ($disabled) {
11078 11078
 									$resultat .= ' disabled';
11079 11079
 								}
@@ -11125,22 +11125,22 @@  discard block
 block discarded – undo
11125 11125
 
11126 11126
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
11127 11127
 		//$sql.= ', el.fk_source';
11128
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
11129
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
11128
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
11129
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
11130 11130
 		$sql .= " ORDER BY f.titre ASC";
11131 11131
 
11132 11132
 		$resql = $this->db->query($sql);
11133 11133
 		if ($resql) {
11134 11134
 			// Use select2 selector
11135 11135
 			if (!empty($conf->use_javascript_ajax)) {
11136
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
11136
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
11137 11137
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
11138 11138
 				$out .= $comboenhancement;
11139 11139
 				$morecss = 'minwidth200imp maxwidth500';
11140 11140
 			}
11141 11141
 
11142 11142
 			if (empty($option_only)) {
11143
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
11143
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
11144 11144
 			}
11145 11145
 			if (!empty($show_empty)) {
11146 11146
 				$out .= '<option value="0" class="optiongrey">';
@@ -11159,19 +11159,19 @@  discard block
 block discarded – undo
11159 11159
 					$disabled = 0;
11160 11160
 					if (!empty($obj->suspended)) {
11161 11161
 						$disabled = 1;
11162
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
11162
+						$labeltoshow .= ' - '.$langs->trans("Closed");
11163 11163
 					}
11164 11164
 
11165 11165
 
11166 11166
 					if (!empty($selected) && $selected == $obj->rowid) {
11167
-						$out .= '<option value="' . $obj->rowid . '" selected';
11167
+						$out .= '<option value="'.$obj->rowid.'" selected';
11168 11168
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
11169
-						$out .= '>' . $labeltoshow . '</option>';
11169
+						$out .= '>'.$labeltoshow.'</option>';
11170 11170
 					} else {
11171 11171
 						if ($disabled && ($selected != $obj->rowid)) {
11172 11172
 							$resultat = '';
11173 11173
 						} else {
11174
-							$resultat = '<option value="' . $obj->rowid . '"';
11174
+							$resultat = '<option value="'.$obj->rowid.'"';
11175 11175
 							if ($disabled) {
11176 11176
 								$resultat .= ' disabled';
11177 11177
 							}
@@ -11216,14 +11216,14 @@  discard block
 block discarded – undo
11216 11216
 		$formother = new FormOther($this->db);
11217 11217
 
11218 11218
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
11219
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
11219
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
11220 11220
 		}
11221 11221
 
11222 11222
 		$ret = '';
11223 11223
 
11224 11224
 		$ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">';
11225 11225
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
11226
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
11226
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
11227 11227
 		$ret .= '</a>';
11228 11228
 
11229 11229
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -11267,30 +11267,30 @@  discard block
 block discarded – undo
11267 11267
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
11268 11268
 		}
11269 11269
 		$ret .= "<!-- We store the full Universal Search String into this field. For example: (t.ref:like:'SO-%') AND ((t.ref:like:'CO-%') OR (t.ref:like:'AA%')) -->";
11270
-		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
11270
+		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
11271 11271
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
11272 11272
 
11273 11273
 		// TODO : Use $arrayoffiltercriterias instead of $arrayofcriterias
11274 11274
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
11275 11275
 		foreach ($arrayofcriterias as $criteria) {
11276 11276
 			foreach ($criteria as $criteriafamilykey => $criteriafamilyval) {
11277
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
11277
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
11278 11278
 					continue;
11279 11279
 				}
11280 11280
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
11281 11281
 					continue;
11282 11282
 				}
11283 11283
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
11284
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
11285
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
11286
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
11287
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
11288
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
11289
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
11290
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
11291
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
11284
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
11285
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
11286
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
11287
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
11288
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
11289
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
11290
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
11291
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
11292 11292
 				} else {
11293
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
11293
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
11294 11294
 				}
11295 11295
 			}
11296 11296
 		}
@@ -11298,7 +11298,7 @@  discard block
 block discarded – undo
11298 11298
 		$ret .= '</div>';
11299 11299
 
11300 11300
 		$ret .= "<!-- Field to enter a generic filter string: t.ref:like:'SO-%', t.date_creation:<:'20160101', t.date_creation:<:'2016-01-01 12:30:00', t.nature:is:NULL, t.field2:isnot:NULL -->\n";
11301
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
11301
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
11302 11302
 
11303 11303
 		$ret .= '</div>';
11304 11304
 		$ret .= '</div>';
@@ -11355,7 +11355,7 @@  discard block
 block discarded – undo
11355 11355
 		// Convert $arrayoffiltercriterias into a json object that can be used in jquery to build the search component dynamically
11356 11356
 		$arrayoffiltercriterias_json = json_encode($arrayoffiltercriterias);
11357 11357
 		$ret .= '<script>
11358
-			var arrayoffiltercriterias = ' . $arrayoffiltercriterias_json . ';
11358
+			var arrayoffiltercriterias = ' . $arrayoffiltercriterias_json.';
11359 11359
 		</script>';
11360 11360
 
11361 11361
 
@@ -11369,9 +11369,9 @@  discard block
 block discarded – undo
11369 11369
 		$ret .= '<div class="search-component-assistance">';
11370 11370
 		$ret .= '<div>';
11371 11371
 
11372
-		$ret .= '<p class="assistance-title">' . img_picto('', 'filter') . ' ' . $langs->trans('FilterAssistance') . ' </p>';
11372
+		$ret .= '<p class="assistance-title">'.img_picto('', 'filter').' '.$langs->trans('FilterAssistance').' </p>';
11373 11373
 
11374
-		$ret .= '<p class="assistance-errors error" style="display:none">' . $langs->trans('AllFieldsRequired') . ' </p>';
11374
+		$ret .= '<p class="assistance-errors error" style="display:none">'.$langs->trans('AllFieldsRequired').' </p>';
11375 11375
 
11376 11376
 		$ret .= '<div class="operand">';
11377 11377
 		$ret .= $form->selectarray('search_filter_field', $arrayoffilterfieldslabel, '', $langs->trans("Fields"), 0, 0, '', 0, 0, 0, '', 'width250', 1);
@@ -11385,7 +11385,7 @@  discard block
 block discarded – undo
11385 11385
 		$ret .= '</select>';
11386 11386
 		$ret .= '<script>$(document).ready(function() {';
11387 11387
 		$ret .= '   $(".operator-selector").select2({';
11388
-		$ret .= '       placeholder: \'' . dol_escape_js($langs->trans('Operator')) . '\'';
11388
+		$ret .= '       placeholder: \''.dol_escape_js($langs->trans('Operator')).'\'';
11389 11389
 		$ret .= '   });';
11390 11390
 		$ret .= '});</script>';
11391 11391
 		$ret .= '</div>';
@@ -11394,12 +11394,12 @@  discard block
 block discarded – undo
11394 11394
 
11395 11395
 		$ret .= '<div class="value">';
11396 11396
 		// Input field for entering values
11397
-		$ret .= '<input type="text" class="flat width100 value-input" placeholder="' . dolPrintHTML($langs->trans('Value')) . '">';
11397
+		$ret .= '<input type="text" class="flat width100 value-input" placeholder="'.dolPrintHTML($langs->trans('Value')).'">';
11398 11398
 
11399 11399
 		// Date selector
11400 11400
 		$dateOne = '';
11401 11401
 		$ret .= '<span class="date-one" style="display:none">';
11402
-		$ret .=  $form->selectDate(($dateOne ? $dateOne : -1), 'dateone', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '');
11402
+		$ret .= $form->selectDate(($dateOne ? $dateOne : -1), 'dateone', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '');
11403 11403
 		$ret .= '</span>';
11404 11404
 
11405 11405
 		// Value selector (will be populated dynamically) based on search_filter_field value if a selected value has an array of values
@@ -11408,7 +11408,7 @@  discard block
 block discarded – undo
11408 11408
 		$ret .= '<script>
11409 11409
 			$(document).ready(function() {
11410 11410
 				$("#value-selector").select2({
11411
-					placeholder: "' . dol_escape_js($langs->trans('Value')) . '"
11411
+					placeholder: "' . dol_escape_js($langs->trans('Value')).'"
11412 11412
 				});
11413 11413
 				$("#value-selector").hide();
11414 11414
 				$("#value-selector").next(".select2-container").hide();
@@ -11418,7 +11418,7 @@  discard block
 block discarded – undo
11418 11418
 		$ret .= '</div>';
11419 11419
 
11420 11420
 		$ret .= '<div class="btn-div">';
11421
-		$ret .= '<button class="button buttongen button-save add-filter-btn" type="button">' . $langs->trans("addToFilter") . '</button>';
11421
+		$ret .= '<button class="button buttongen button-save add-filter-btn" type="button">'.$langs->trans("addToFilter").'</button>';
11422 11422
 		$ret .= '</div>';
11423 11423
 
11424 11424
 		$ret .= '</div>';
@@ -11584,7 +11584,7 @@  discard block
 block discarded – undo
11584 11584
 
11585 11585
 		$TModels = array();
11586 11586
 
11587
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
11587
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
11588 11588
 		$formmail = new FormMail($this->db);
11589 11589
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
11590 11590
 
@@ -11597,20 +11597,20 @@  discard block
 block discarded – undo
11597 11597
 			}
11598 11598
 		}
11599 11599
 
11600
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
11600
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
11601 11601
 
11602 11602
 		foreach ($TModels as $id_model => $label_model) {
11603
-			$retstring .= '<option value="' . $id_model . '"';
11603
+			$retstring .= '<option value="'.$id_model.'"';
11604 11604
 			if (!empty($selected) && $selected == $id_model) {
11605 11605
 				$retstring .= "selected";
11606 11606
 			}
11607
-			$retstring .= ">" . $label_model . "</option>";
11607
+			$retstring .= ">".$label_model."</option>";
11608 11608
 		}
11609 11609
 
11610 11610
 		$retstring .= "</select>";
11611 11611
 
11612 11612
 		if ($addjscombo) {
11613
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
11613
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
11614 11614
 		}
11615 11615
 
11616 11616
 		return $retstring;
@@ -11661,16 +11661,16 @@  discard block
 block discarded – undo
11661 11661
 
11662 11662
 		foreach ($buttons as $button) {
11663 11663
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
11664
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
11664
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
11665 11665
 		}
11666 11666
 		$retstring .= $withoutdiv ? '' : '</div>';
11667 11667
 
11668 11668
 		if ($dol_openinpopup) {
11669
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . dol_escape_htmltag($dol_openinpopup) . ' context, so we enable the close of dialog on cancel -->' . "\n";
11670
-			$retstring .= '<script nonce="' . getNonce() . '">';
11669
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.dol_escape_htmltag($dol_openinpopup).' context, so we enable the close of dialog on cancel -->'."\n";
11670
+			$retstring .= '<script nonce="'.getNonce().'">';
11671 11671
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
11672
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup) . '\');
11673
-				window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup) . '\').dialog(\'close\');
11672
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup).'\');
11673
+				window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup).'\').dialog(\'close\');
11674 11674
 				 });';
11675 11675
 			$retstring .= '</script>';
11676 11676
 		}
@@ -11699,7 +11699,7 @@  discard block
 block discarded – undo
11699 11699
 		dol_syslog(__METHOD__, LOG_DEBUG);
11700 11700
 
11701 11701
 		$sql = "SELECT rowid, code, label as label";
11702
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
11702
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
11703 11703
 		$sql .= " WHERE active = 1";
11704 11704
 
11705 11705
 		$resql = $this->db->query($sql);
@@ -11710,7 +11710,7 @@  discard block
 block discarded – undo
11710 11710
 				$obj = $this->db->fetch_object($resql);
11711 11711
 
11712 11712
 				// If translation exists, we use it, otherwise we take the default wording
11713
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11713
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11714 11714
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
11715 11715
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
11716 11716
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -11742,18 +11742,18 @@  discard block
 block discarded – undo
11742 11742
 		global $langs, $user;
11743 11743
 
11744 11744
 		$out = '';
11745
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
11745
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
11746 11746
 
11747 11747
 		$this->load_cache_invoice_subtype();
11748 11748
 
11749
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
11749
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
11750 11750
 		if ($addempty) {
11751 11751
 			$out .= '<option value="0">&nbsp;</option>';
11752 11752
 		}
11753 11753
 
11754 11754
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
11755 11755
 			$label = $subtype['label'];
11756
-			$out .= '<option value="' . $subtype['rowid'] . '"';
11756
+			$out .= '<option value="'.$subtype['rowid'].'"';
11757 11757
 			if ($selected == $subtype['rowid']) {
11758 11758
 				$out .= ' selected="selected"';
11759 11759
 			}
Please login to merge, or discard this patch.
htdocs/fourn/facture/card.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	// Action clone object
200 200
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
201 201
 		$objectutil = dol_clone($object, 1); // To avoid to denaturate loaded object when setting some properties for clone. We use native clone to keep this->db valid.
202
-		'@phan-var-force FactureFournisseur $objectutil';  // Same object type for cloned object
202
+		'@phan-var-force FactureFournisseur $objectutil'; // Same object type for cloned object
203 203
 
204 204
 		if (GETPOST('newsupplierref', 'alphanohtml')) {
205 205
 			$objectutil->ref_supplier = GETPOST('newsupplierref', 'alphanohtml');
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 		$db->begin();
785 785
 
786 786
 		$error = 0;
787
-		$tmpproject = 0;  // Ensure a value
787
+		$tmpproject = 0; // Ensure a value
788 788
 
789 789
 		// Fill array 'array_options' with data from add form
790 790
 		$ret = $extrafields->setOptionalsFromPost(null, $object);
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 			$error++;
793 793
 		}
794 794
 
795
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
795
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
796 796
 		$datedue = dol_mktime(0, 0, 0, GETPOSTINT('echmonth'), GETPOSTINT('echday'), GETPOSTINT('echyear'), 'tzserver');
797 797
 		//var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour'));
798 798
 		//var_dump(dol_now('tzuserrel').' '.dol_get_last_hour(dol_now('tzuserrel')).' '.dol_print_date(dol_now('tzuserrel'),'dayhour').' '.dol_print_date(dol_get_last_hour(dol_now('tzuserrel')), 'dayhour'));
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 				$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
832 832
 				$object->socid = GETPOSTINT('socid');
833 833
 				$object->label = GETPOST('label', 'alphanohtml');
834
-				$object->libelle = $object->label;	// deprecated
834
+				$object->libelle = $object->label; // deprecated
835 835
 				$object->date = $dateinvoice;
836 836
 				$object->date_echeance = $datedue;
837 837
 				$object->note_public = GETPOST('note_public', 'restricthtml');
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
 				$object->subtype            = GETPOST('subtype', 'alphanohtml');
906 906
 				$object->socid				= GETPOSTINT('socid');
907 907
 				$object->label				= GETPOST('label', 'alphanohtml');
908
-				$object->libelle            = $object->label;  // Deprecated
908
+				$object->libelle            = $object->label; // Deprecated
909 909
 				$object->date               = $dateinvoice;
910 910
 				$object->date_echeance      = $datedue;
911 911
 				$object->note_public        = GETPOST('note_public', 'restricthtml');
@@ -1015,7 +1015,7 @@  discard block
 block discarded – undo
1015 1015
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
1016 1016
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1017 1017
 				$object->fk_account         = GETPOSTINT('fk_account');
1018
-				$object->amount             = (float) price2num(GETPOST('amount'));  // FIXME: FactureFournisseur::$amount is deprecated and not used?
1018
+				$object->amount             = (float) price2num(GETPOST('amount')); // FIXME: FactureFournisseur::$amount is deprecated and not used?
1019 1019
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
1020 1020
 				//$object->remise_percent		= price2num(GETPOST('remise_percent'), '', 2);
1021 1021
 				$object->fk_incoterms       = GETPOSTINT('incoterm_id');
@@ -1068,28 +1068,28 @@  discard block
 block discarded – undo
1068 1068
 				$tmpproject = GETPOSTINT('projectid');
1069 1069
 
1070 1070
 				// Creation invoice
1071
-				$object->socid				= GETPOSTINT('socid');
1072
-				$object->type				= GETPOST('type', 'alphanohtml');
1073
-				$object->subtype            = GETPOSTINT('subtype');
1074
-				$object->ref				= GETPOST('ref', 'alphanohtml');
1075
-				$object->ref_supplier		= GETPOST('ref_supplier', 'alphanohtml');
1071
+				$object->socid = GETPOSTINT('socid');
1072
+				$object->type = GETPOST('type', 'alphanohtml');
1073
+				$object->subtype = GETPOSTINT('subtype');
1074
+				$object->ref = GETPOST('ref', 'alphanohtml');
1075
+				$object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml');
1076 1076
 				$object->socid				= GETPOSTINT('socid');
1077 1077
 				$object->label				= GETPOST('label', 'alphanohtml');
1078
-				$object->libelle			= $object->label;	// deprecated
1079
-				$object->date				= $dateinvoice;
1080
-				$object->date_echeance		= $datedue;
1081
-				$object->note_public		= GETPOST('note_public', 'restricthtml');
1082
-				$object->note_private		= GETPOST('note_private', 'restricthtml');
1078
+				$object->libelle = $object->label; // deprecated
1079
+				$object->date = $dateinvoice;
1080
+				$object->date_echeance = $datedue;
1081
+				$object->note_public = GETPOST('note_public', 'restricthtml');
1082
+				$object->note_private = GETPOST('note_private', 'restricthtml');
1083 1083
 				$object->cond_reglement_id	= GETPOST('cond_reglement_id');
1084 1084
 				$object->mode_reglement_id	= GETPOST('mode_reglement_id');
1085 1085
 				$object->fk_account			= GETPOSTINT('fk_account');
1086 1086
 				$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1087 1087
 				$object->fk_project			= ($tmpproject > 0) ? $tmpproject : null;
1088
-				$object->fk_incoterms		= GETPOSTINT('incoterm_id');
1088
+				$object->fk_incoterms = GETPOSTINT('incoterm_id');
1089 1089
 				$object->location_incoterms	= GETPOST('location_incoterms', 'alpha');
1090 1090
 				$object->multicurrency_code	= GETPOST('multicurrency_code', 'alpha');
1091
-				$object->multicurrency_tx	= GETPOSTINT('originmulticurrency_tx');
1092
-				$object->transport_mode_id	= GETPOSTINT('transport_mode_id');
1091
+				$object->multicurrency_tx = GETPOSTINT('originmulticurrency_tx');
1092
+				$object->transport_mode_id = GETPOSTINT('transport_mode_id');
1093 1093
 
1094 1094
 				// Auto calculation of date due if not filled by user
1095 1095
 				if (empty($object->date_echeance)) {
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 									0,
1302 1302
 									$object->lines[0]->date_start,
1303 1303
 									$object->lines[0]->date_end,
1304
-									array(),  // array_options
1304
+									array(), // array_options
1305 1305
 									0,
1306 1306
 									0,
1307 1307
 									'',
@@ -1438,7 +1438,7 @@  discard block
 block discarded – undo
1438 1438
 		// Edit line
1439 1439
 		$db->begin();
1440 1440
 
1441
-		if (! $object->fetch($id) > 0) {
1441
+		if (!$object->fetch($id) > 0) {
1442 1442
 			dol_print_error($db);
1443 1443
 		}
1444 1444
 		$object->fetch_thirdparty();
@@ -1609,7 +1609,7 @@  discard block
 block discarded – undo
1609 1609
 			$price_ttc_devise = price2num(GETPOST('multicurrency_price_ttc'), 'CU', 2);
1610 1610
 		}
1611 1611
 
1612
-		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);		// Can be '1.2' or '1.2 (CODE)'
1612
+		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)'
1613 1613
 
1614 1614
 		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
1615 1615
 
@@ -1753,7 +1753,7 @@  discard block
 block discarded – undo
1753 1753
 
1754 1754
 				// Get vat rate
1755 1755
 				if (!GETPOSTISSET('tva_tx')) {	// If vat rate not provided from the form (the form has the priority)
1756
-					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha');	// can be an id of price, or -1, -2, -99 or 'idprod_...'
1756
+					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha'); // can be an id of price, or -1, -2, -99 or 'idprod_...'
1757 1757
 					if (is_numeric($tmpidprodfournprice) && (int) $tmpidprodfournprice > 0) {
1758 1758
 						$tmpidprodfournprice = (int) $tmpidprodfournprice;
1759 1759
 					} else {
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
 // Mode creation
2126 2126
 if ($action == 'create') {
2127 2127
 	$facturestatic = new FactureFournisseur($db);
2128
-	$selectedLines = array();  // Ensure initialised
2128
+	$selectedLines = array(); // Ensure initialised
2129 2129
 
2130 2130
 	print load_fiche_titre($langs->trans('NewSupplierInvoice'), '', 'supplier_invoice');
2131 2131
 
@@ -2319,7 +2319,7 @@  discard block
 block discarded – undo
2319 2319
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">';
2320 2320
 	print '<input type="hidden" name="token" value="'.newToken().'">';
2321 2321
 	print '<input type="hidden" name="action" value="add">';
2322
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
2322
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
2323 2323
 
2324 2324
 	if (!empty($societe->id) && $societe->id > 0) {
2325 2325
 		print '<input type="hidden" name="socid" value="'.$societe->id.'">'."\n";
@@ -2403,7 +2403,7 @@  discard block
 block discarded – undo
2403 2403
 
2404 2404
 			$sql = 'SELECT r.rowid, r.titre as title, r.total_ttc';
2405 2405
 			$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_rec as r';
2406
-			$sql .= ' WHERE r.fk_soc = '. (int) $invoice_predefined->socid;
2406
+			$sql .= ' WHERE r.fk_soc = '.(int) $invoice_predefined->socid;
2407 2407
 
2408 2408
 			$resql = $db->query($sql);
2409 2409
 			if ($resql) {
@@ -2470,7 +2470,7 @@  discard block
 block discarded – undo
2470 2470
 			// Deposit - Down payment
2471 2471
 			if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) {
2472 2472
 				print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
2473
-				$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOSTINT('type') == 3 ? ' checked' : '') . '> ';
2473
+				$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"'.(GETPOSTINT('type') == 3 ? ' checked' : '').'> ';
2474 2474
 				print '<script type="text/javascript">
2475 2475
 				jQuery(document).ready(function() {
2476 2476
 					jQuery("#typestandardinvoice, #valuestandardinvoice").click(function() {
@@ -2517,7 +2517,7 @@  discard block
 block discarded – undo
2517 2517
 					print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit', 'aZ09'), 0, 0, 0, '', 1);
2518 2518
 					print '</td>';
2519 2519
 					print '<td class="nowrap" style="padding-left: 5px">';
2520
-					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="' . GETPOSTINT('valuedeposit') . '"/>';
2520
+					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="'.GETPOSTINT('valuedeposit').'"/>';
2521 2521
 					print '</td>';
2522 2522
 				}
2523 2523
 				print '</tr></table>';
@@ -2767,8 +2767,8 @@  discard block
 block discarded – undo
2767 2767
 
2768 2768
 		// Vat reverse-charge by default
2769 2769
 		if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2770
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
2771
-			print '<tr><td>' . $langs->trans('VATReverseCharge') . '</td><td>';
2770
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
2771
+			print '<tr><td>'.$langs->trans('VATReverseCharge').'</td><td>';
2772 2772
 			// Try to propose to use VAT reverse charge even if the VAT reverse charge is not activated in the supplier card, if this corresponds to the context of use, the activation is proposed
2773 2773
 			if (GETPOSTISSET('vat_reverse_charge')) {  // Check if form was submitted previously
2774 2774
 				$vat_reverse_charge = (GETPOST('vat_reverse_charge', 'alpha') == 'on' || GETPOST('vat_reverse_charge', 'alpha') == '1') ? 1 : 0;
@@ -2778,7 +2778,7 @@  discard block
 block discarded – undo
2778 2778
 				$vat_reverse_charge = 0;
2779 2779
 			}
2780 2780
 
2781
-			print '<input type="checkbox" name="vat_reverse_charge"'. (!empty($vat_reverse_charge) ? ' checked ' : '') . '>';
2781
+			print '<input type="checkbox" name="vat_reverse_charge"'.(!empty($vat_reverse_charge) ? ' checked ' : '').'>';
2782 2782
 			print '</td></tr>';
2783 2783
 		}
2784 2784
 
@@ -3345,7 +3345,7 @@  discard block
 block discarded – undo
3345 3345
 					$facavoir->fetch($id);
3346 3346
 					$invoicecredits[] = $facavoir->getNomUrl(1);
3347 3347
 				}
3348
-				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits);
3348
+				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir").(count($invoicecredits) ? ' ' : '').implode(',', $invoicecredits);
3349 3349
 				print '</span>';
3350 3350
 			}
3351 3351
 			if (isset($objectidnext) && $objectidnext > 0) {
@@ -3492,12 +3492,12 @@  discard block
 block discarded – undo
3492 3492
 					print '<input type="hidden" name="action" value="setvatreversecharge">';
3493 3493
 					print '<input type="hidden" name="token" value="'.newToken().'">';
3494 3494
 
3495
-					print '<input type="checkbox" name="vat_reverse_charge"' . ($object->vat_reverse_charge == '1' ? ' checked ' : '') . '>';
3495
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').'>';
3496 3496
 
3497 3497
 					print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
3498 3498
 					print '</form>';
3499 3499
 				} else {
3500
-					print '<input type="checkbox" name="vat_reverse_charge"'. ($object->vat_reverse_charge == '1' ? ' checked ' : '') . ' disabled>';
3500
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').' disabled>';
3501 3501
 				}
3502 3502
 				print '</td></tr>';
3503 3503
 			}
@@ -3565,15 +3565,15 @@  discard block
 block discarded – undo
3565 3565
 			include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3566 3566
 
3567 3567
 			print '<tr>';
3568
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3569
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3568
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3569
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3570 3570
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3571
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3571
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3572 3572
 			}
3573 3573
 			print '</tr>';
3574 3574
 
3575 3575
 			print '<tr>';
3576
-			print '<td>' . $langs->trans('AmountVAT') . '</td>';
3576
+			print '<td>'.$langs->trans('AmountVAT').'</td>';
3577 3577
 			print '<td class="nowrap amountcard right">';
3578 3578
 			if (GETPOST('calculationrule')) {
3579 3579
 				$calculationrule = GETPOST('calculationrule', 'alpha');
@@ -3587,40 +3587,40 @@  discard block
 block discarded – undo
3587 3587
 			}
3588 3588
 			// Show link for "recalculate"
3589 3589
 			if ($object->getVentilExportCompta() == 0) {
3590
-				$s = '<span class="hideonsmartphone opacitymedium">' . $langs->trans("ReCalculate") . ' </span>';
3591
-				$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=totalofround">' . $langs->trans("Mode1") . '</a>';
3590
+				$s = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("ReCalculate").' </span>';
3591
+				$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
3592 3592
 				$s .= ' / ';
3593
-				$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=roundoftotal">' . $langs->trans("Mode2") . '</a>';
3593
+				$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
3594 3594
 				print '<div class="inline-block">';
3595
-				print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum) . '<br>' . $langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate');
3595
+				print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate');
3596 3596
 				print '&nbsp; &nbsp; &nbsp; &nbsp;';
3597 3597
 				print '</div>';
3598 3598
 			}
3599 3599
 			print price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency);
3600 3600
 			print '</td>';
3601 3601
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3602
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3602
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3603 3603
 			}
3604 3604
 			print '</tr>';
3605 3605
 
3606 3606
 			if ($societe->localtax1_assuj == "1") { //Localtax1
3607 3607
 				print '<tr>';
3608
-				print '<td>' . $langs->transcountry("AmountLT1", $societe->country_code) . '</td>';
3609
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency) . '</td>';
3608
+				print '<td>'.$langs->transcountry("AmountLT1", $societe->country_code).'</td>';
3609
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
3610 3610
 				print '</tr>';
3611 3611
 			}
3612 3612
 			if ($societe->localtax2_assuj == "1") { //Localtax2
3613 3613
 				print '<tr>';
3614
-				print '<td>' . $langs->transcountry("AmountLT2", $societe->country_code) . '</td>';
3615
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency) . '</td>';
3614
+				print '<td>'.$langs->transcountry("AmountLT2", $societe->country_code).'</td>';
3615
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
3616 3616
 				print '</tr>';
3617 3617
 			}
3618 3618
 
3619 3619
 			print '<tr>';
3620
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
3621
-			print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3620
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
3621
+			print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3622 3622
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3623
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3623
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3624 3624
 			}
3625 3625
 			print '</tr>';
3626 3626
 
@@ -4163,7 +4163,7 @@  discard block
 block discarded – undo
4163 4163
 				}
4164 4164
 
4165 4165
 				// Clone as predefined / Create template
4166
-				if (($object->type ==  FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) {
4166
+				if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) {
4167 4167
 					if (!$objectidnext && count($object->lines) > 0) {
4168 4168
 						print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card-rec.php?facid='.$object->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>';
4169 4169
 					}
Please login to merge, or discard this patch.