Completed
Branch develop (24d030)
by Laurent
20:10
created
htdocs/workstation/workstation_card.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 $action      = GETPOST('action', 'aZ09');
44 44
 $confirm     = GETPOST('confirm', 'alpha');
45 45
 $cancel      = GETPOST('cancel', 'aZ09');
46
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'workstationcard';   // To manage different context of search
46
+$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'workstationcard'; // To manage different context of search
47 47
 $backtopage  = GETPOST('backtopage', 'alpha');
48 48
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
49 49
 
50
-$groups	    = GETPOST('groups', 'array:int');
51
-$resources	= GETPOST('resources', 'array:int');
50
+$groups = GETPOST('groups', 'array:int');
51
+$resources = GETPOST('resources', 'array:int');
52 52
 //$lineid   = GETPOST('lineid', 'int');
53 53
 
54 54
 // Initialize technical objects
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 
82 82
 // Permissions
83 83
 $permissiontoread = $user->hasRight('workstation', 'workstation', 'read');
84
-$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write');      // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
84
+$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
85 85
 $permissiontodelete = $user->hasRight('workstation', 'workstation', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DISABLED);
86
-$permissionnote = $user->hasRight('workstation', 'workstation', 'write');      // Used by the include of actions_setnotes.inc.php
87
-$permissiondellink = $user->hasRight('workstation', 'workstation', 'write');      // Used by the include of actions_dellink.inc.php
86
+$permissionnote = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_setnotes.inc.php
87
+$permissiondellink = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_dellink.inc.php
88 88
 
89 89
 $upload_dir = $conf->workstation->multidir_output[isset($object->entity) ? $object->entity : 1];
90 90
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
  */
99 99
 
100 100
 $parameters = array();
101
-$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);   // Note that $action and $object may have been modified by some hooks
101
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
102 102
 if ($reshook < 0) {
103 103
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
104 104
 }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		}
119 119
 	}
120 120
 
121
-	$triggermodname = 'WORKSTATION_WORKSTATION_MODIFY';    // Name of trigger action code to execute when we modify record
121
+	$triggermodname = 'WORKSTATION_WORKSTATION_MODIFY'; // Name of trigger action code to execute when we modify record
122 122
 
123 123
 	// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
124 124
 	include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
@@ -400,11 +400,11 @@  discard block
 block discarded – undo
400 400
 		$g = new UserGroup($db);
401 401
 		foreach ($object->usergroups as $id_group) {
402 402
 			$g->fetch($id_group);
403
-			$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $g->getNomUrl(1, '', 0, 'categtextwhite') . '</li>';
403
+			$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$g->getNomUrl(1, '', 0, 'categtextwhite').'</li>';
404 404
 		}
405 405
 
406
-		print '<tr><td>' . $langs->trans('Groups') . '</td><td>';
407
-		print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
406
+		print '<tr><td>'.$langs->trans('Groups').'</td><td>';
407
+		print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
408 408
 		print '</td></tr>';
409 409
 	}
410 410
 
@@ -414,11 +414,11 @@  discard block
 block discarded – undo
414 414
 		$r = new Dolresource($db);
415 415
 		foreach ($object->resources as $id_resource) {
416 416
 			$r->fetch($id_resource);
417
-			$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $r->getNomUrl(1, '', '', 0, 'categtextwhite') . '</li>';
417
+			$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$r->getNomUrl(1, '', '', 0, 'categtextwhite').'</li>';
418 418
 		}
419 419
 
420
-		print '<tr><td>' . $langs->trans('Machines') . '</td><td>';
421
-		print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
420
+		print '<tr><td>'.$langs->trans('Machines').'</td><td>';
421
+		print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
422 422
 		print '</td></tr>';
423 423
 	}
424 424
 
Please login to merge, or discard this patch.
htdocs/core/lib/modulebuilder.lib.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -270,22 +270,22 @@  discard block
 block discarded – undo
270 270
 	// Edit .sql file
271 271
 	if ($moduletype == 'internal') {
272 272
 		$pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql';
273
-		if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
273
+		if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
274 274
 			$pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'-'.strtolower($module).'.sql';
275
-			if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
275
+			if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
276 276
 				$pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'-'.strtolower($module).'.sql';
277
-				if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
277
+				if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
278 278
 					$pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'.sql';
279 279
 				}
280 280
 			}
281 281
 		}
282 282
 	} else {
283 283
 		$pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql';
284
-		if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
284
+		if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
285 285
 			$pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'-'.strtolower($module).'.sql';
286
-			if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
286
+			if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
287 287
 				$pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'-'.strtolower($module).'.sql';
288
-				if (! dol_is_file($readdir.$pathoffiletoeditsrc)) {
288
+				if (!dol_is_file($readdir.$pathoffiletoeditsrc)) {
289 289
 					$pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'.sql';
290 290
 				}
291 291
 			}
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 			$objects[$fileobj['fullname']] = $objectnameloop;
443 443
 		}
444 444
 	}
445
-	if (count($objects)>0) {
445
+	if (count($objects) > 0) {
446 446
 		return $objects;
447 447
 	}
448 448
 
@@ -525,12 +525,12 @@  discard block
 block discarded – undo
525 525
 			}
526 526
 		}
527 527
 	} elseif ($action == -2 && !empty($objectname) && !empty($module)) {
528
-		$key= null;
528
+		$key = null;
529 529
 		$right = null;
530 530
 		$objectOfRights = array();
531 531
 		//check if object already declared in rights file
532 532
 		foreach ($permissions as $right) {
533
-			$objectOfRights[]= $right[4];
533
+			$objectOfRights[] = $right[4];
534 534
 		}
535 535
 		if (in_array(strtolower($objectname), $objectOfRights)) {
536 536
 			$error++;
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 	if (!$error) {
558 558
 		// prepare permissions array
559 559
 		$count_perms = count($permissions);
560
-		for ($i = 0;$i<$count_perms;$i++) {
560
+		for ($i = 0; $i < $count_perms; $i++) {
561 561
 			$permissions[$i][0] = "\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1)";
562 562
 			$permissions[$i][1] = "\$this->rights[\$r][1] = '".$permissions[$i][1]."'";
563 563
 			$permissions[$i][4] = "\$this->rights[\$r][4] = '".$permissions[$i][4]."'";
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 
578 578
 
579 579
 		// parcourir les objets
580
-		$o=0;
580
+		$o = 0;
581 581
 		foreach ($permissions as &$object) {
582 582
 			// récupérer la permission de l'objet
583 583
 			$p = 1;
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 {
673 673
 
674 674
 	// stock all properties in array
675
-	$attributesUnique = array ('type','label', 'enabled', 'position', 'notnull', 'visible', 'noteditable', 'index', 'default' , 'foreignkey', 'arrayofkeyval', 'alwayseditable','validate', 'searchall','comment', 'isameasure', 'css', 'cssview','csslist', 'help', 'showoncombobox','picto' );
675
+	$attributesUnique = array('type', 'label', 'enabled', 'position', 'notnull', 'visible', 'noteditable', 'index', 'default', 'foreignkey', 'arrayofkeyval', 'alwayseditable', 'validate', 'searchall', 'comment', 'isameasure', 'css', 'cssview', 'csslist', 'help', 'showoncombobox', 'picto');
676 676
 
677 677
 	$start = "public \$fields=array(";
678 678
 	$end = ");";
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 	foreach ($attributesUnique as $attUnique) {
703 703
 		$table .= "|".$attUnique;
704 704
 	}
705
-	$table .="\n";
705
+	$table .= "\n";
706 706
 	$valuesModif = array();
707 707
 	foreach ($keys as $string) {
708 708
 		$string = trim($string, "'");
@@ -742,8 +742,8 @@  discard block
 block discarded – undo
742 742
 				$valuesModif[$attUnique] = $values[$attUnique];
743 743
 			}
744 744
 		}
745
-		$table .= "|*" . $field[0] . "*|";
746
-		$table .= implode("|", $valuesModif) . "\n";
745
+		$table .= "|*".$field[0]."*|";
746
+		$table .= implode("|", $valuesModif)."\n";
747 747
 	}
748 748
 
749 749
 	// end table
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 
753 753
 	//write in file
754 754
 	$writeInFile = dolReplaceInFile($destfile, array('== DATA SPECIFICATIONS' => $table));
755
-	if ($writeInFile<0) {
755
+	if ($writeInFile < 0) {
756 756
 		return -1;
757 757
 	}
758 758
 	return 1;
@@ -771,13 +771,13 @@  discard block
 block discarded – undo
771 771
 	$start = "== Table of fields and their properties for object *".ucfirst($objectname)."* : ";
772 772
 	$end = "__ end table for object ".ucfirst($objectname);
773 773
 	$str = file_get_contents($file);
774
-	$search = '/' . preg_quote($start, '/') . '(.*?)' . preg_quote($end, '/') . '/s';
774
+	$search = '/'.preg_quote($start, '/').'(.*?)'.preg_quote($end, '/').'/s';
775 775
 	$new_contents = preg_replace($search, '', $str);
776 776
 	file_put_contents($file, $new_contents);
777 777
 
778 778
 	//perms If Exist
779 779
 	$perms = "|*".strtolower($objectname)."*|";
780
-	$search_pattern_perms = '/' . preg_quote($perms, '/') . '.*?\n/';
780
+	$search_pattern_perms = '/'.preg_quote($perms, '/').'.*?\n/';
781 781
 	$new_contents = preg_replace($search_pattern_perms, '', $new_contents);
782 782
 	file_put_contents($file, $new_contents);
783 783
 }
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
 	$string = "[options='header',grid=rows,width=60%,caption=Organisation]\n";
834 834
 	$string .= "|===\n";
835 835
 	// header for table
836
-	$header = array($langs->trans('Objects'),$langs->trans('Permission'));
836
+	$header = array($langs->trans('Objects'), $langs->trans('Permission'));
837 837
 	foreach ($header as $h) {
838 838
 		$string .= "|".$h;
839 839
 	}
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 	foreach ($permissions as $key => $element) {
861 861
 		$element = str_replace(" '", '', $element);
862 862
 		$element = trim($element, "'");
863
-		$permsN[] = substr($element, strpos($element, "=")+1);
863
+		$permsN[] = substr($element, strpos($element, "=") + 1);
864 864
 	}
865 865
 	array_pop($permsN);
866 866
 
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 	// end table
891 891
 	$string .= "\n|===\n";
892 892
 	$write = dolReplaceInFile($destfile, array('__DATA_PERMISSIONS__'=> $string));
893
-	if ($write<0) {
893
+	if ($write < 0) {
894 894
 		return -1;
895 895
 	}
896 896
 	return 1;
@@ -919,26 +919,26 @@  discard block
 block discarded – undo
919 919
 		if (strpos($lineContent, $varcomented) !== false) {
920 920
 			$lineContent = '';
921 921
 			foreach ($objects as $object) {
922
-				$lineContent .= "\t * @var ".$object." \$".strtolower($object)." {@type ".$object."}". PHP_EOL;
922
+				$lineContent .= "\t * @var ".$object." \$".strtolower($object)." {@type ".$object."}".PHP_EOL;
923 923
 			}
924 924
 			//var_dump($lineContent);exit;
925 925
 		}
926 926
 		if (strpos($lineContent, $props) !== false) {
927 927
 			$lineContent = '';
928 928
 			foreach ($objects as $object) {
929
-				$lineContent .= "\tpublic \$".strtolower($object).";". PHP_EOL;
929
+				$lineContent .= "\tpublic \$".strtolower($object).";".PHP_EOL;
930 930
 			}
931 931
 		}
932 932
 		if (strpos($lineContent, $constructObj) !== false) {
933 933
 			$lineContent = '';
934 934
 			foreach ($objects as $object) {
935
-				$lineContent .= "\t\t\$this->".strtolower($object)." = new ".$object."(\$this->db);". PHP_EOL;
935
+				$lineContent .= "\t\t\$this->".strtolower($object)." = new ".$object."(\$this->db);".PHP_EOL;
936 936
 			}
937 937
 		}
938 938
 		if (strpos($lineContent, $includeClass) !== false) {
939 939
 			$lineContent = '';
940 940
 			foreach ($objects as $object) {
941
-				$lineContent .= "dol_include_once('/".strtolower($modulename)."/class/".strtolower($object).".class.php');". PHP_EOL;
941
+				$lineContent .= "dol_include_once('/".strtolower($modulename)."/class/".strtolower($object).".class.php');".PHP_EOL;
942 942
 			}
943 943
 		}
944 944
 	}
@@ -948,10 +948,10 @@  discard block
 block discarded – undo
948 948
 	//add methods for each object
949 949
 	$allContent = getFromFile($file, '/*begin methods CRUD*/', '/*end methods CRUD*/');
950 950
 	foreach ($objects as $object) {
951
-		$contentReplaced =str_replace(["myobject","MyObject"], [strtolower($object),$object], $allContent);
951
+		$contentReplaced = str_replace(["myobject", "MyObject"], [strtolower($object), $object], $allContent);
952 952
 		dolReplaceInFile($file, array('/*end methods CRUD*/' => '/*CRUD FOR '.strtoupper($object).'*/'."\n".$contentReplaced."\n\t".'/*END CRUD FOR '.strtoupper($object).'*/'."\n\t".'/*end methods CRUD*/'));
953 953
 	}
954
-	dolReplaceInFile($file, array($allContent => '','MyModule' => ucfirst($modulename)));
954
+	dolReplaceInFile($file, array($allContent => '', 'MyModule' => ucfirst($modulename)));
955 955
 	return 1;
956 956
 }
957 957
 
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
  */
1013 1013
 function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action)
1014 1014
 {
1015
-	$errors =0;
1015
+	$errors = 0;
1016 1016
 	$counter = 0;
1017 1017
 	if (!file_exists($file)) {
1018 1018
 		return -1;
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
 		array_push($menus, $menuWantTo);
1026 1026
 	} elseif ($action == 2 && !empty($key) && !empty($menuWantTo)) {
1027 1027
 		// update right from permissions array
1028
-		$urlCounter=0;
1028
+		$urlCounter = 0;
1029 1029
 		// check if the values already exists
1030 1030
 		foreach ($menus as $index => $menu) {
1031 1031
 			if ($index !== $key) {
@@ -1071,20 +1071,20 @@  discard block
 block discarded – undo
1071 1071
 				$val_actuel = $menu;
1072 1072
 				$next_val = $menus[$index + 1];
1073 1073
 				$str_menu .= $start."\n";
1074
-				$str_menu.= "\t\t\$this->menu[\$r++]=array(\n";
1075
-				$str_menu.= "\t\t\t 'fk_menu' =>'".$menu['fk_menu']."',\n";
1076
-				$str_menu.= "\t\t\t 'type' =>'".$menu['type']."',\n";
1077
-				$str_menu.= "\t\t\t 'titre' =>'".$menu['titre']."',\n";
1078
-				$str_menu.= "\t\t\t 'mainmenu' =>'".$menu['mainmenu']."',\n";
1079
-				$str_menu.= "\t\t\t 'leftmenu' =>'".$menu['leftmenu']."',\n";
1080
-				$str_menu.= "\t\t\t 'url' =>'".$menu['url']."',\n";
1081
-				$str_menu.= "\t\t\t 'langs' =>'".$menu['langs']."',\n";
1082
-				$str_menu.= "\t\t\t 'position' =>".$menu['position'].",\n";
1083
-				$str_menu.= "\t\t\t 'enabled' =>'".$menu['enabled']."',\n";
1084
-				$str_menu.= "\t\t\t 'perms' =>'".$menu['perms']."',\n";
1085
-				$str_menu.= "\t\t\t 'target' =>'".$menu['target']."',\n";
1086
-				$str_menu.= "\t\t\t 'user' =>".$menu['user'].",\n";
1087
-				$str_menu.= "\t\t);\n";
1074
+				$str_menu .= "\t\t\$this->menu[\$r++]=array(\n";
1075
+				$str_menu .= "\t\t\t 'fk_menu' =>'".$menu['fk_menu']."',\n";
1076
+				$str_menu .= "\t\t\t 'type' =>'".$menu['type']."',\n";
1077
+				$str_menu .= "\t\t\t 'titre' =>'".$menu['titre']."',\n";
1078
+				$str_menu .= "\t\t\t 'mainmenu' =>'".$menu['mainmenu']."',\n";
1079
+				$str_menu .= "\t\t\t 'leftmenu' =>'".$menu['leftmenu']."',\n";
1080
+				$str_menu .= "\t\t\t 'url' =>'".$menu['url']."',\n";
1081
+				$str_menu .= "\t\t\t 'langs' =>'".$menu['langs']."',\n";
1082
+				$str_menu .= "\t\t\t 'position' =>".$menu['position'].",\n";
1083
+				$str_menu .= "\t\t\t 'enabled' =>'".$menu['enabled']."',\n";
1084
+				$str_menu .= "\t\t\t 'perms' =>'".$menu['perms']."',\n";
1085
+				$str_menu .= "\t\t\t 'target' =>'".$menu['target']."',\n";
1086
+				$str_menu .= "\t\t\t 'user' =>".$menu['user'].",\n";
1087
+				$str_menu .= "\t\t);\n";
1088 1088
 
1089 1089
 				if ($val_actuel['leftmenu'] !== $next_val['leftmenu']) {
1090 1090
 					$str_menu .= $end."\n";
@@ -1121,21 +1121,21 @@  discard block
 block discarded – undo
1121 1121
 		$dicData .= "\t\t\t'$key'=>";
1122 1122
 
1123 1123
 		if ($key === 'tabcond') {
1124
-			$conditions = array_map(function ($val) use ($module) {
1124
+			$conditions = array_map(function($val) use ($module) {
1125 1125
 				return ($val === true || $val === false) ? "isModEnabled('$module')" : $val;
1126 1126
 			}, $value);
1127
-			$dicData .= "array(" . implode(",", $conditions) . ")";
1127
+			$dicData .= "array(".implode(",", $conditions).")";
1128 1128
 		} elseif ($key === 'tabhelp') {
1129 1129
 			$helpItems = array();
1130 1130
 			foreach ($value as $key => $helpValue) {
1131 1131
 				$helpItems[] = "array('code'=>\$langs->trans('".$helpValue['code']."'), 'field2' => 'field2tooltip')";
1132 1132
 			}
1133
-			$dicData .= "array(" . implode(",", $helpItems) . ")";
1133
+			$dicData .= "array(".implode(",", $helpItems).")";
1134 1134
 		} else {
1135 1135
 			if (is_array($value)) {
1136
-				$dicData .= "array(" . implode(",", array_map(function ($val) {
1136
+				$dicData .= "array(".implode(",", array_map(function($val) {
1137 1137
 					return "'$val'";
1138
-				}, $value)) . ")";
1138
+				}, $value)).")";
1139 1139
 			} else {
1140 1140
 				$dicData .= "'$value'";
1141 1141
 			}
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 		}
1202 1202
 	}
1203 1203
 	// check if tablename exist in Database and create it if not
1204
-	$query = "SHOW TABLES LIKE '" . MAIN_DB_PREFIX.strtolower($namedic) . "'";
1204
+	$query = "SHOW TABLES LIKE '".MAIN_DB_PREFIX.strtolower($namedic)."'";
1205 1205
 	$checkTable = $db->query($query);
1206 1206
 	if ($checkTable && $db->num_rows($checkTable) > 0) {
1207 1207
 		setEventMessages($langs->trans("ErrorTableExist", $namedic), null, 'errors');
Please login to merge, or discard this patch.
htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 		$maxfilesizearray = getMaxFileSizeArray();
210 210
 		$maxmin = $maxfilesizearray['maxmin'];
211 211
 		if ($maxmin > 0) {
212
-			$texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
212
+			$texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
213 213
 		}
214 214
 		$texte .= ' <input type="file" name="uploadfile">';
215 215
 		$texte .= '<input type="hidden" value="PROPALE_ADDON_PDF_ODT_PATH" name="keyforuploaddir">';
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 				$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
300 300
 				$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
301 301
 
302
-				$newfiletmp = $objectref . '_' . $newfiletmp;
302
+				$newfiletmp = $objectref.'_'.$newfiletmp;
303 303
 
304 304
 				// Get extension (ods or odt)
305 305
 				$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
@@ -308,11 +308,11 @@  discard block
 block discarded – undo
308 308
 					if ($format == '1') {
309 309
 						$format = '%Y%m%d%H%M%S';
310 310
 					}
311
-					$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
311
+					$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
312 312
 				} else {
313
-					$filename = $newfiletmp . '.' . $newfileformat;
313
+					$filename = $newfiletmp.'.'.$newfileformat;
314 314
 				}
315
-				$file = $dir . '/' . $filename;
315
+				$file = $dir.'/'.$filename;
316 316
 				//print "newdir=".$dir;
317 317
 				//print "newfile=".$newfile;
318 318
 				//print "file=".$file;
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 				dol_mkdir($conf->propal->multidir_temp[$object->entity]);
322 322
 				if (!is_writable($conf->propal->dir_temp)) {
323 323
 					$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->propal->dir_temp);
324
-					dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
324
+					dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
325 325
 					return -1;
326 326
 				}
327 327
 
@@ -413,8 +413,8 @@  discard block
 block discarded – undo
413 413
 				include_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
414 414
 				$companybankaccount = new CompanyBankAccount($this->db);
415 415
 				$companybankaccount->fetch(0, $object->thirdparty->id);
416
-				$array_objet['company_default_bank_iban']=$companybankaccount->iban;
417
-				$array_objet['company_default_bank_bic']=$companybankaccount->bic;
416
+				$array_objet['company_default_bank_iban'] = $companybankaccount->iban;
417
+				$array_objet['company_default_bank_bic'] = $companybankaccount->bic;
418 418
 
419 419
 				// retrieve contact information for use in object as contact_xxx tags
420 420
 				$array_thirdparty_contact = array();
Please login to merge, or discard this patch.
htdocs/asset/list.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 $show_files		= GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
40 40
 $confirm		= GETPOST('confirm', 'alpha'); // Result of a confirmation
41 41
 $cancel			= GETPOST('cancel', 'alpha'); // We click on a Cancel button
42
-$toselect		= GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
42
+$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
43 43
 $contextpage	= GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'assetlist'; // To manage different context of search
44 44
 $backtopage		= GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
45
-$optioncss		= GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
46
-$mode			= GETPOST('mode', 'alpha');  // mode view (kanban or common)
45
+$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
46
+$mode = GETPOST('mode', 'alpha'); // mode view (kanban or common)
47 47
 $id				= GETPOST('id', 'int');
48 48
 
49 49
 // Load variable for pagination
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 // Default sort order (if not yet defined by previous GETPOST)
74 74
 if (!$sortfield) {
75
-	reset($object->fields);					// Reset is required to avoid key() to return null.
75
+	reset($object->fields); // Reset is required to avoid key() to return null.
76 76
 	$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
77 77
 }
78 78
 if (!$sortorder) {
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 					$sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'";
257 257
 				}
258 258
 				if (preg_match('/_dtend$/', $key)) {
259
-					$sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'";
259
+					$sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'";
260 260
 				}
261 261
 			}
262 262
 		}
Please login to merge, or discard this patch.
htdocs/webhook/target_list.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
 $langs->loadLangs(array('other'));
38 38
 
39 39
 // Get Parameters
40
-$action      = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view';    // The action 'add', 'create', 'edit', 'update', 'view', ...
41
-$massaction  = GETPOST('massaction', 'alpha');    // The bulk action (combo box choice into lists)
42
-$show_files  = GETPOST('show_files', 'int');    // Show files area generated by bulk actions ?
43
-$confirm     = GETPOST('confirm', 'alpha');    // Result of a confirmation
44
-$cancel      = GETPOST('cancel', 'alpha');    // We click on a Cancel button
45
-$toselect    = GETPOST('toselect', 'array');    // Array of ids of elements selected into a list
46
-$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetlist';    // To manage different context of search
47
-$backtopage  = GETPOST('backtopage', 'alpha');    // Go back to a dedicated page
48
-$optioncss   = GETPOST('optioncss', 'aZ');    // Option for the css output (always '' except when 'print')
40
+$action      = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
41
+$massaction  = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
42
+$show_files  = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
43
+$confirm     = GETPOST('confirm', 'alpha'); // Result of a confirmation
44
+$cancel      = GETPOST('cancel', 'alpha'); // We click on a Cancel button
45
+$toselect    = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
46
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetlist'; // To manage different context of search
47
+$backtopage  = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
48
+$optioncss   = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
49 49
 $mode        = GETPOST('mode', 'aZ');
50 50
 if (empty($mode)) {
51 51
 	$mode = 'modulesetup';
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
 // Default sort order (if not yet defined by previous GETPOST)
82 82
 if (!$sortfield) {
83
-	reset($object->fields);					// Reset is required to avoid key() to return null.
83
+	reset($object->fields); // Reset is required to avoid key() to return null.
84 84
 	$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
85 85
 }
86 86
 if (!$sortorder) {
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -146,13 +146,19 @@
 block discarded – undo
146 146
 }
147 147
 
148 148
 // Security check (enable the most restrictive one)
149
-if ($user->socid > 0) accessforbidden();
149
+if ($user->socid > 0) {
150
+	accessforbidden();
151
+}
150 152
 //if ($user->socid > 0) accessforbidden();
151 153
 //$socid = 0; if ($user->socid > 0) $socid = $user->socid;
152 154
 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
153 155
 //restrictedArea($user, $object->element, 0, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
154
-if (!isModEnabled('webhook')) accessforbidden('Module not enabled');
155
-if (!$permissiontoread) accessforbidden();
156
+if (!isModEnabled('webhook')) {
157
+	accessforbidden('Module not enabled');
158
+}
159
+if (!$permissiontoread) {
160
+	accessforbidden();
161
+}
156 162
 
157 163
 
158 164
 /*
Please login to merge, or discard this patch.
htdocs/compta/paiement/card.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 // Load object
62 62
 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
63 63
 
64
-$result = restrictedArea($user, $object->element, $object->id, 'paiement');	// This also test permission on read invoice
64
+$result = restrictedArea($user, $object->element, $object->id, 'paiement'); // This also test permission on read invoice
65 65
 
66 66
 // Security check
67 67
 if ($user->socid) {
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 			}
191 191
 		}
192 192
 
193
-		if (! $error) {
193
+		if (!$error) {
194 194
 			header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
195 195
 			exit;
196 196
 		}
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 	if (isModEnabled('stripe') && in_array($object->ext_payment_site, array('Stripe', 'StripeLive'))) {
426 426
 		$tmp1 = explode('@', $object->ext_payment_id);
427 427
 		if (!empty($tmp1[1])) {
428
-			$site_account_payment = $tmp1[1];	// pk_live_...
428
+			$site_account_payment = $tmp1[1]; // pk_live_...
429 429
 		}
430 430
 		$tmp2 = explode(':', $tmp1[0]);
431 431
 		if (!empty($tmp2[1])) {
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 }
594 594
 
595 595
 $params = array();
596
-if (! empty($title_button)) {
596
+if (!empty($title_button)) {
597 597
 	$params['attr'] = array('title' => $title_button);
598 598
 }
599 599
 
Please login to merge, or discard this patch.
htdocs/bookcal/class/availabilities.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	/**
102 102
 	 * @var array  Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
103 103
 	 */
104
-	public $fields=array(
104
+	public $fields = array(
105 105
 		'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
106 106
 		'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>"Help text", 'showoncombobox'=>'2', 'validate'=>'1',),
107 107
 		'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>3, 'validate'=>'1',),
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
 				$this->date_creation     = $this->db->jdate($obj->datec);
888 888
 				$this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
889 889
 				if (!empty($obj->datev)) {
890
-					$this->date_validation   = empty($obj->datev) ? '' : $this->db->jdate($obj->datev);
890
+					$this->date_validation = empty($obj->datev) ? '' : $this->db->jdate($obj->datev);
891 891
 				}
892 892
 			}
893 893
 
Please login to merge, or discard this patch.
htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		$maxfilesizearray = getMaxFileSizeArray();
175 175
 		$maxmin = $maxfilesizearray['maxmin'];
176 176
 		if ($maxmin > 0) {
177
-			$texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
177
+			$texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
178 178
 		}
179 179
 		$texte .= ' <input type="file" name="uploadfile">';
180 180
 		$texte .= '<input type="hidden" value="FACTURE_ADDON_PDF_ODT_PATH" name="keyforuploaddir">';
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 				$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
265 265
 				$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
266 266
 
267
-				$newfiletmp = $objectref . '_' . $newfiletmp;
267
+				$newfiletmp = $objectref.'_'.$newfiletmp;
268 268
 
269 269
 				// Get extension (ods or odt)
270 270
 				$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
 					if ($format == '1') {
274 274
 						$format = '%Y%m%d%H%M%S';
275 275
 					}
276
-					$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
276
+					$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
277 277
 				} else {
278
-					$filename = $newfiletmp . '.' . $newfileformat;
278
+					$filename = $newfiletmp.'.'.$newfileformat;
279 279
 				}
280
-				$file = $dir . '/' . $filename;
280
+				$file = $dir.'/'.$filename;
281 281
 				//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
282 282
 				//print "newdir=".$dir;
283 283
 				//print "newfile=".$newfile;
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 				dol_mkdir($conf->facture->dir_temp);
288 288
 				if (!is_writable($conf->facture->dir_temp)) {
289 289
 					$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->facture->dir_temp);
290
-					dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
290
+					dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
291 291
 					return -1;
292 292
 				}
293 293
 
@@ -409,10 +409,10 @@  discard block
 block discarded – undo
409 409
 				}
410 410
 
411 411
 				// Define substitution array
412
-				$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);	// Set tags __...__
412
+				$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); // Set tags __...__
413 413
 				$array_object_from_properties = $this->get_substitutionarray_each_var_object($object, $outputlangs);
414
-				$array_objet = $this->get_substitutionarray_object($object, $outputlangs);			// Set tags object_...
415
-				$array_user = $this->get_substitutionarray_user($user, $outputlangs);				// Set tags myuser_...
414
+				$array_objet = $this->get_substitutionarray_object($object, $outputlangs); // Set tags object_...
415
+				$array_user = $this->get_substitutionarray_user($user, $outputlangs); // Set tags myuser_...
416 416
 				$array_soc = $this->get_substitutionarray_mysoc($mysoc, $outputlangs);
417 417
 				$array_thirdparty = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
418 418
 				$array_propal = is_object($propal_object) ? $this->get_substitutionarray_object($propal_object, $outputlangs, 'propal') : array();
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 				$tmparray['object_PREVIOUS_YEAR'] = dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y');
441 441
 				$tmparray['object_YEAR'] = dol_print_date($object->date, '%Y');
442 442
 				$tmparray['object_NEXT_YEAR'] = dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y');
443
-				$tmparray['object_productorservice_operation'] = $outputlangs->transnoentities("MentionCategoryOfOperations" . $categoryOfOperation);
443
+				$tmparray['object_productorservice_operation'] = $outputlangs->transnoentities("MentionCategoryOfOperations".$categoryOfOperation);
444 444
 
445 445
 
446 446
 				// Call the ODTSubstitution hook
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1223 added lines, -1223 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;/', $typeofdata)) {
118 118
 			if (!empty($perm)) {
119 119
 				$tmp = explode(':', $typeofdata);
120
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
120
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
121 121
 				if ($fieldrequired) {
122 122
 					$ret .= '<span class="fieldrequired">';
123 123
 				}
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 				if ($fieldrequired) {
130 130
 					$ret .= '</span>';
131 131
 				}
132
-				$ret .= '</div>' . "\n";
132
+				$ret .= '</div>'."\n";
133 133
 			} else {
134 134
 				if ($fieldrequired) {
135 135
 					$ret .= '<span class="fieldrequired">';
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 			if (empty($notabletag) && $perm) {
168 168
 				$ret .= '<td class="right">';
169 169
 			}
170
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
171
-				$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>';
170
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
171
+				$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>';
172 172
 			}
173 173
 			if (!empty($notabletag) && $notabletag == 1) {
174 174
 				if ($text) {
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 			} elseif ($reg[1] == 'int') {
236 236
 				$typeofdata = 'numeric';
237 237
 			} else {
238
-				return 'ErrorBadParameter ' . $typeofdata;
238
+				return 'ErrorBadParameter '.$typeofdata;
239 239
 			}
240 240
 		}
241 241
 
@@ -246,13 +246,13 @@  discard block
 block discarded – undo
246 246
 			if ($editaction == '') {
247 247
 				$editaction = GETPOST('action', 'aZ09');
248 248
 			}
249
-			$editmode = ($editaction == 'edit' . $htmlname);
249
+			$editmode = ($editaction == 'edit'.$htmlname);
250 250
 			if ($editmode) {	// edit mode
251 251
 				$ret .= "\n";
252
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
253
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
254
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
255
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
252
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
253
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
254
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
255
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
256 256
 				if (empty($notabletag)) {
257 257
 					$ret .= '<table class="nobordernopadding centpercent">';
258 258
 				}
@@ -261,28 +261,28 @@  discard block
 block discarded – undo
261 261
 				}
262 262
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
263 263
 					$tmp = explode(':', $typeofdata);
264
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
264
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
265 265
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
266 266
 					$tmp = explode(':', $typeofdata);
267 267
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
268
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
268
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
269 269
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
270 270
 					$tmp = explode(':', $typeofdata);
271 271
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
272
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
272
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
273 273
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
274 274
 					$tmp = explode(':', $typeofdata);
275
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
275
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
276 276
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
277 277
 					$tmp = explode(':', $typeofdata);
278 278
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
279 279
 					$morealt = '';
280 280
 					if (preg_match('/%/', $cols)) {
281
-						$morealt = ' style="width: ' . $cols . '"';
281
+						$morealt = ' style="width: '.$cols.'"';
282 282
 						$cols = '';
283 283
 					}
284 284
 					$valuetoshow = ($editvalue ? $editvalue : $value);
285
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
285
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
286 286
 					// textarea convert automatically entities chars into simple chars.
287 287
 					// 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 wysiwig is off.
288 288
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
293 293
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
294 294
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
295
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
295
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
296 296
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
297 297
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
298 298
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
299 299
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
300
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
300
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
301 301
 				} elseif (preg_match('/^select;/', $typeofdata)) {
302 302
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
303 303
 					$arraylist = array();
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 					// TODO Not yet implemented. See code for extrafields
312 312
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
313 313
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
314
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
314
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
315 315
 					$doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7]));
316 316
 					$ret .= $doleditor->Create(1);
317 317
 				} elseif ($typeofdata == 'asis') {
@@ -326,19 +326,19 @@  discard block
 block discarded – undo
326 326
 					$ret .= '<td>';
327 327
 				}
328 328
 				//else $ret.='<div class="clearboth"></div>';
329
-				$ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
329
+				$ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
330 330
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
331
-					$ret .= '<br>' . "\n";
331
+					$ret .= '<br>'."\n";
332 332
 				}
333
-				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
333
+				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
334 334
 				if (empty($notabletag)) {
335 335
 					$ret .= '</td>';
336 336
 				}
337 337
 
338 338
 				if (empty($notabletag)) {
339
-					$ret .= '</tr></table>' . "\n";
339
+					$ret .= '</tr></table>'."\n";
340 340
 				}
341
-				$ret .= '</form>' . "\n";
341
+				$ret .= '</form>'."\n";
342 342
 			} else {		// view mode
343 343
 				if (preg_match('/^email/', $typeofdata)) {
344 344
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -350,15 +350,15 @@  discard block
 block discarded – undo
350 350
 					$ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : '');
351 351
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
352 352
 					$tmp = explode(':', $typeofdata);
353
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
353
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
354 354
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
355 355
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
356 356
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
357 357
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
358 358
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
359
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
359
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
360 360
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
361
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
361
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
362 362
 				} elseif (preg_match('/^select;/', $typeofdata)) {
363 363
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
364 364
 					$arraylist = array();
@@ -369,9 +369,9 @@  discard block
 block discarded – undo
369 369
 					$ret .= $arraylist[$value];
370 370
 					if ($htmlname == 'fk_product_type') {
371 371
 						if ($value == 0) {
372
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
372
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
373 373
 						} else {
374
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
374
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
375 375
 						}
376 376
 					}
377 377
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 					if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
380 380
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
381 381
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
382
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
382
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
383 383
 					}
384 384
 					// We dont use dol_escape_htmltag to get the html formating active, but this need we must also
385 385
 					// clean data from some dangerous html
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
389 389
 						$ret .= dol_escape_htmltag($value);
390 390
 					} else {
391
-						$ret .= $value;        // $value must be already html escaped.
391
+						$ret .= $value; // $value must be already html escaped.
392 392
 					}
393 393
 				}
394 394
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 
427 427
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
428 428
 			if (!is_object($extralanguages)) {
429
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
429
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
430 430
 				$extralanguages = new ExtraLanguages($this->db);
431 431
 			}
432 432
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -435,17 +435,17 @@  discard block
 block discarded – undo
435 435
 				return ''; // No extralang field to show
436 436
 			}
437 437
 
438
-			$result .= '<!-- Widget for translation -->' . "\n";
439
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
438
+			$result .= '<!-- Widget for translation -->'."\n";
439
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
440 440
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
441 441
 			$result .= $s;
442 442
 			$result .= '</div>';
443 443
 
444
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
444
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
445 445
 
446 446
 			$resultforextrlang = '';
447 447
 			foreach ($arrayoflangcode as $langcode) {
448
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
448
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
449 449
 				if (empty($valuetoshow)) {
450 450
 					$object->fetchValuesForExtraLanguages();
451 451
 					//var_dump($object->array_languages);
@@ -457,17 +457,17 @@  discard block
 block discarded – undo
457 457
 
458 458
 				// TODO Use the showInputField() method of ExtraLanguages object
459 459
 				if ($typeofdata == 'textarea') {
460
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
460
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
461 461
 					$resultforextrlang .= $valuetoshow;
462 462
 					$resultforextrlang .= '</textarea>';
463 463
 				} else {
464
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
464
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
465 465
 				}
466 466
 			}
467 467
 			$result .= $resultforextrlang;
468 468
 
469 469
 			$result .= '</div>';
470
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
470
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
471 471
 		}
472 472
 
473 473
 		return $result;
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 				if (!empty($tmp[2])) {
533 533
 					$savemethod = $tmp[2];
534 534
 				}
535
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
535
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
536 536
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
537 537
 				$tmp = explode(':', $inputType);
538 538
 				$inputType = $tmp[0];
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 					$savemethod = $tmp[2];
544 544
 				}
545 545
 
546
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
546
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
547 547
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
548 548
 				$tmp = explode(':', $inputType);
549 549
 				$inputType = $tmp[0];
@@ -574,40 +574,40 @@  discard block
 block discarded – undo
574 574
 				}
575 575
 
576 576
 				if (isModEnabled('fckeditor')) {
577
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
577
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
578 578
 				} else {
579 579
 					$inputType = 'textarea';
580 580
 				}
581 581
 			}
582 582
 
583
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
584
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
585
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
586
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
583
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
584
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
585
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
586
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
587 587
 			if (!empty($savemethod)) {
588
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
588
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
589 589
 			}
590 590
 			if (!empty($ext_element)) {
591
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
591
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
592 592
 			}
593 593
 			if (!empty($custommsg)) {
594 594
 				if (is_array($custommsg)) {
595 595
 					if (!empty($custommsg['success'])) {
596
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
596
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
597 597
 					}
598 598
 					if (!empty($custommsg['error'])) {
599
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
599
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
600 600
 					}
601 601
 				} else {
602
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
602
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
603 603
 				}
604 604
 			}
605 605
 			if ($inputType == 'textarea') {
606
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
607
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
606
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
607
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
608 608
 			}
609
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
610
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
609
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
610
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
611 611
 		} else {
612 612
 			$out = $value;
613 613
 		}
@@ -636,12 +636,12 @@  discard block
 block discarded – undo
636 636
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
637 637
 	{
638 638
 		if ($incbefore) {
639
-			$text = $incbefore . $text;
639
+			$text = $incbefore.$text;
640 640
 		}
641 641
 		if (!$htmltext) {
642 642
 			return $text;
643 643
 		}
644
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
644
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
645 645
 
646 646
 		$tag = 'td';
647 647
 		if ($notabs == 2) {
@@ -655,11 +655,11 @@  discard block
 block discarded – undo
655 655
 
656 656
 		$extrastyle = '';
657 657
 		if ($direction < 0) {
658
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
658
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
659 659
 			$extrastyle = 'padding: 0px; padding-left: 3px;';
660 660
 		}
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-right: 3px;';
664 664
 		}
665 665
 
@@ -672,53 +672,53 @@  discard block
 block discarded – undo
672 672
 			$htmltext = str_replace('"', '&quot;', $htmltext);
673 673
 		} else {
674 674
 			$classfortooltip = 'classfortooltiponclick';
675
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
675
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
676 676
 		}
677 677
 		if ($tooltipon == 2 || $tooltipon == 3) {
678
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
678
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
679 679
 			if ($tooltiptrigger == '') {
680
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on img tag to store tooltip
680
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on img tag to store tooltip
681 681
 			} else {
682
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
682
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
683 683
 			}
684 684
 		} else {
685
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag
685
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag
686 686
 		}
687 687
 		if ($tooltipon == 1 || $tooltipon == 3) {
688
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
688
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
689 689
 			if ($tooltiptrigger == '') {
690
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on td tag to store tooltip
690
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on td tag to store tooltip
691 691
 			} else {
692
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
692
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
693 693
 			}
694 694
 		} else {
695
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag
695
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag
696 696
 		}
697 697
 		if (empty($notabs)) {
698 698
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
699 699
 		} elseif ($notabs == 2) {
700
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
700
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
701 701
 		}
702 702
 		// Define value if value is before
703 703
 		if ($direction < 0) {
704
-			$s .= '<' . $tag . $paramfortooltipimg;
704
+			$s .= '<'.$tag.$paramfortooltipimg;
705 705
 			if ($tag == 'td') {
706 706
 				$s .= ' class="valigntop" width="14"';
707 707
 			}
708
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
708
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
709 709
 		}
710 710
 		// Use another method to help avoid having a space in value in order to use this value with jquery
711 711
 		// Define label
712 712
 		if ((string) $text != '') {
713
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
713
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
714 714
 		}
715 715
 		// Define value if value is after
716 716
 		if ($direction > 0) {
717
-			$s .= '<' . $tag . $paramfortooltipimg;
717
+			$s .= '<'.$tag.$paramfortooltipimg;
718 718
 			if ($tag == 'td') {
719 719
 				$s .= ' class="valignmiddle" width="14"';
720 720
 			}
721
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
721
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
722 722
 		}
723 723
 		if (empty($notabs)) {
724 724
 			$s .= '</tr></table>';
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 
824 824
 		$disabled = 0;
825 825
 		$ret = '<div class="centpercent center">';
826
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
826
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
827 827
 
828 828
 		// 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.
829 829
 		$parameters = array();
@@ -833,9 +833,9 @@  discard block
 block discarded – undo
833 833
 			return;
834 834
 		}
835 835
 		if (empty($reshook)) {
836
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
836
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
837 837
 			foreach ($arrayofaction as $code => $label) {
838
-				$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
838
+				$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
839 839
 			}
840 840
 		}
841 841
 		$ret .= $hookmanager->resPrint;
@@ -843,17 +843,17 @@  discard block
 block discarded – undo
843 843
 		$ret .= '</select>';
844 844
 
845 845
 		if (empty($conf->dol_optimize_smallscreen)) {
846
-			$ret .= ajax_combobox('.' . $name . 'select');
846
+			$ret .= ajax_combobox('.'.$name.'select');
847 847
 		}
848 848
 
849 849
 		// 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
850 850
 		$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.
851
-		$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")) . '">';
851
+		$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")).'">';
852 852
 		$ret .= '</div>';
853 853
 
854 854
 		if (!empty($conf->use_javascript_ajax)) {
855 855
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
856
-    		<script nonce="' . getNonce() . '">
856
+    		<script nonce="' . getNonce().'">
857 857
                         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 */
858 858
         		{
859 859
         			atleastoneselected=0;
@@ -864,11 +864,11 @@  discard block
 block discarded – undo
864 864
 
865 865
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
866 866
 
867
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
867
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
868 868
     	  			{
869 869
                                     jQuery("."+name).show();
870
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
871
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
870
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
871
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
872 872
     	  			}
873 873
     	  			else
874 874
     	  			{
@@ -878,11 +878,11 @@  discard block
 block discarded – undo
878 878
         		}
879 879
 
880 880
         	jQuery(document).ready(function () {
881
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
882
-                    jQuery(".' . $cssclass . '").click(function() {
883
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
881
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
882
+                    jQuery(".' . $cssclass.'").click(function() {
883
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
884 884
                     });
885
-                        jQuery(".' . $name . 'select").change(function() {
885
+                        jQuery(".' . $name.'select").change(function() {
886 886
         			var massaction = $( this ).val();
887 887
         			var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
888 888
         			if (massaction == "builddoc")
@@ -890,18 +890,18 @@  discard block
 block discarded – undo
890 890
                         urlform = urlform + "#show_files";
891 891
     	            }
892 892
         			$( this ).closest("form").attr("action", urlform);
893
-                    console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
893
+                    console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
894 894
         	        /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
895 895
         			if ($(this).val() != \'0\')
896 896
     	  			{
897
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
898
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
899
-                                        jQuery(".' . $name . '"+massaction).show();
897
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
898
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
899
+                                        jQuery(".' . $name.'"+massaction).show();
900 900
     	  			}
901 901
     	  			else
902 902
     	  			{
903
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
904
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
903
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
904
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
905 905
     	  			}
906 906
     	        });
907 907
         	});
@@ -944,14 +944,14 @@  discard block
 block discarded – undo
944 944
 		$atleastonefavorite = 0;
945 945
 
946 946
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
947
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
947
+		$sql .= " FROM ".$this->db->prefix()."c_country";
948 948
 		$sql .= " WHERE active > 0";
949 949
 		//$sql.= " ORDER BY code ASC";
950 950
 
951
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
951
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
952 952
 		$resql = $this->db->query($sql);
953 953
 		if ($resql) {
954
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
954
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
955 955
 			$num = $this->db->num_rows($resql);
956 956
 			$i = 0;
957 957
 			if ($num) {
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
 					$countryArray[$i]['rowid'] = $obj->rowid;
962 962
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
963 963
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
964
-					$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 : ''));
964
+					$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 : ''));
965 965
 					$countryArray[$i]['favorite'] = $obj->favorite;
966 966
 					$countryArray[$i]['eec'] = $obj->eec;
967 967
 					$favorite[$i] = $obj->favorite;
@@ -979,20 +979,20 @@  discard block
 block discarded – undo
979 979
 
980 980
 				if ($showempty) {
981 981
 					if (is_numeric($showempty)) {
982
-						$out .= '<option value="">&nbsp;</option>' . "\n";
982
+						$out .= '<option value="">&nbsp;</option>'."\n";
983 983
 					} else {
984
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
984
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
985 985
 					}
986 986
 				}
987 987
 
988 988
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
989 989
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
990
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
991
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
990
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
991
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
992 992
 					if ($mysoc->isInEEC()) {
993
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
993
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
994 994
 					}
995
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
995
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
996 996
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
997 997
 				}
998 998
 
@@ -1020,20 +1020,20 @@  discard block
 block discarded – undo
1020 1020
 						$labeltoshow .= '&nbsp;';
1021 1021
 					}
1022 1022
 					if ($row['code_iso']) {
1023
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1023
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1024 1024
 						if (empty($hideflags)) {
1025 1025
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1026
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1026
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1027 1027
 						}
1028 1028
 					}
1029 1029
 
1030 1030
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1031
-						$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']) . '">';
1031
+						$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']).'">';
1032 1032
 					} else {
1033
-						$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']) . '">';
1033
+						$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']).'">';
1034 1034
 					}
1035 1035
 					$out .= $labeltoshow;
1036
-					$out .= '</option>' . "\n";
1036
+					$out .= '</option>'."\n";
1037 1037
 				}
1038 1038
 			}
1039 1039
 			$out .= '</select>';
@@ -1042,8 +1042,8 @@  discard block
 block discarded – undo
1042 1042
 		}
1043 1043
 
1044 1044
 		// Make select dynamic
1045
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1046
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1045
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1046
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1047 1047
 
1048 1048
 		return $out;
1049 1049
 	}
@@ -1075,25 +1075,25 @@  discard block
 block discarded – undo
1075 1075
 		$incotermArray = array();
1076 1076
 
1077 1077
 		$sql = "SELECT rowid, code";
1078
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1078
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1079 1079
 		$sql .= " WHERE active > 0";
1080 1080
 		$sql .= " ORDER BY code ASC";
1081 1081
 
1082
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1082
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1083 1083
 		$resql = $this->db->query($sql);
1084 1084
 		if ($resql) {
1085 1085
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1086
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1086
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1087 1087
 				$out .= ajax_combobox($htmlname, $events);
1088 1088
 			}
1089 1089
 
1090 1090
 			if (!empty($page)) {
1091
-				$out .= '<form method="post" action="' . $page . '">';
1091
+				$out .= '<form method="post" action="'.$page.'">';
1092 1092
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1093
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1093
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1094 1094
 			}
1095 1095
 
1096
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1096
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1097 1097
 			$out .= '<option value="0">&nbsp;</option>';
1098 1098
 			$num = $this->db->num_rows($resql);
1099 1099
 			$i = 0;
@@ -1107,9 +1107,9 @@  discard block
 block discarded – undo
1107 1107
 
1108 1108
 				foreach ($incotermArray as $row) {
1109 1109
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1110
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1110
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1111 1111
 					} else {
1112
-						$out .= '<option value="' . $row['rowid'] . '">';
1112
+						$out .= '<option value="'.$row['rowid'].'">';
1113 1113
 					}
1114 1114
 
1115 1115
 					if ($row['code']) {
@@ -1122,13 +1122,13 @@  discard block
 block discarded – undo
1122 1122
 			$out .= '</select>';
1123 1123
 
1124 1124
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1125
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1125
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1126 1126
 				$moreattrib .= ' autocomplete="off"';
1127 1127
 			}
1128
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1128
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1129 1129
 
1130 1130
 			if (!empty($page)) {
1131
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1131
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1132 1132
 			}
1133 1133
 		} else {
1134 1134
 			dol_print_error($this->db);
@@ -1159,9 +1159,9 @@  discard block
 block discarded – undo
1159 1159
 		if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
1160 1160
 			|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
1161 1161
 			if (empty($hidetext)) {
1162
-				print $langs->trans("Type") . ': ';
1162
+				print $langs->trans("Type").': ';
1163 1163
 			}
1164
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1164
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1165 1165
 			if ($showempty) {
1166 1166
 				print '<option value="-1"';
1167 1167
 				if ($selected == -1) {
@@ -1174,28 +1174,28 @@  discard block
 block discarded – undo
1174 1174
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1175 1175
 				print ' selected';
1176 1176
 			}
1177
-			print '>' . $langs->trans("Product");
1177
+			print '>'.$langs->trans("Product");
1178 1178
 
1179 1179
 			print '<option value="1"';
1180 1180
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1181 1181
 				print ' selected';
1182 1182
 			}
1183
-			print '>' . $langs->trans("Service");
1183
+			print '>'.$langs->trans("Service");
1184 1184
 
1185 1185
 			print '</select>';
1186
-			print ajax_combobox('select_' . $htmlname);
1186
+			print ajax_combobox('select_'.$htmlname);
1187 1187
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1188 1188
 		}
1189 1189
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1190 1190
 			print $langs->trans("Service");
1191
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1191
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1192 1192
 		}
1193 1193
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1194 1194
 			print $langs->trans("Product");
1195
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1195
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1196 1196
 		}
1197 1197
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1198
-			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
1198
+			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
1199 1199
 		}
1200 1200
 	}
1201 1201
 
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
 		$langs->load("trips");
1222 1222
 
1223 1223
 		$sql = "SELECT c.code, c.label";
1224
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1224
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1225 1225
 		$sql .= " WHERE active > 0";
1226 1226
 
1227 1227
 		$resql = $this->db->query($sql);
@@ -1262,11 +1262,11 @@  discard block
 block discarded – undo
1262 1262
 		// phpcs:enable
1263 1263
 		global $user, $langs;
1264 1264
 
1265
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1265
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1266 1266
 
1267 1267
 		$this->load_cache_types_fees();
1268 1268
 
1269
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1269
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1270 1270
 		if ($showempty) {
1271 1271
 			print '<option value="-1"';
1272 1272
 			if ($selected == -1) {
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 		}
1277 1277
 
1278 1278
 		foreach ($this->cache_types_fees as $key => $value) {
1279
-			print '<option value="' . $key . '"';
1279
+			print '<option value="'.$key.'"';
1280 1280
 			if ($key == $selected) {
1281 1281
 				print ' selected';
1282 1282
 			}
@@ -1327,12 +1327,12 @@  discard block
 block discarded – undo
1327 1327
 				$ajaxoptions = array();
1328 1328
 			}
1329 1329
 
1330
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1330
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1331 1331
 
1332 1332
 			// No immediate load of all database
1333 1333
 			$placeholder = '';
1334 1334
 			if ($selected && empty($selected_input_value)) {
1335
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1335
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1336 1336
 				$societetmp = new Societe($this->db);
1337 1337
 				$societetmp->fetch($selected);
1338 1338
 				$selected_input_value = $societetmp->name;
@@ -1340,25 +1340,25 @@  discard block
 block discarded – undo
1340 1340
 			}
1341 1341
 
1342 1342
 			// mode 1
1343
-			$urloption = 'htmlname=' . urlencode(str_replace('.', '_', $htmlname)) . '&outjson=1&filter=' . urlencode($filter) . (empty($excludeids) ? '' : '&excludeids=' . join(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode($showtype) : '') . ($showcode ? '&showcode=' . urlencode($showcode) : '');
1343
+			$urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '').($showcode ? '&showcode='.urlencode($showcode) : '');
1344 1344
 
1345 1345
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1346 1346
 			if (empty($hidelabel)) {
1347
-				print $langs->trans("RefOrLabel") . ' : ';
1347
+				print $langs->trans("RefOrLabel").' : ';
1348 1348
 			} elseif ($hidelabel > 1) {
1349 1349
 				$placeholder = $langs->trans("RefOrLabel");
1350 1350
 				if ($hidelabel == 2) {
1351 1351
 					$out .= img_picto($langs->trans("Search"), 'search');
1352 1352
 				}
1353 1353
 			}
1354
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
1354
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
1355 1355
 			if ($hidelabel == 3) {
1356 1356
 				$out .= img_picto($langs->trans("Search"), 'search');
1357 1357
 			}
1358 1358
 
1359 1359
 			$out .= ajax_event($htmlname, $events);
1360 1360
 
1361
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1361
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1362 1362
 		} else {
1363 1363
 			// Immediate load of all database
1364 1364
 			$out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode);
@@ -1442,30 +1442,30 @@  discard block
 block discarded – undo
1442 1442
 			$sql .= ", s.address, s.zip, s.town";
1443 1443
 			$sql .= ", dictp.code as country_code";
1444 1444
 		}
1445
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1445
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1446 1446
 		if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
1447
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1447
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1448 1448
 		}
1449 1449
 		if (empty($user->rights->societe->client->voir) && !$user->socid) {
1450
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1450
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1451 1451
 		}
1452
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1452
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1453 1453
 		if (!empty($user->socid)) {
1454
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1454
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1455 1455
 		}
1456 1456
 		if ($filter) {
1457 1457
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1458 1458
 			// if not, by testSqlAndScriptInject() only.
1459
-			$sql .= " AND (" . $filter . ")";
1459
+			$sql .= " AND (".$filter.")";
1460 1460
 		}
1461 1461
 		if (empty($user->rights->societe->client->voir) && !$user->socid) {
1462
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1462
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1463 1463
 		}
1464 1464
 		if (!empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) {
1465 1465
 			$sql .= " AND s.status <> 0";
1466 1466
 		}
1467 1467
 		if (!empty($excludeids)) {
1468
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(join(',', $excludeids)) . ")";
1468
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")";
1469 1469
 		}
1470 1470
 		// Add where from hooks
1471 1471
 		$parameters = array();
@@ -1485,17 +1485,17 @@  discard block
 block discarded – undo
1485 1485
 				if ($i > 0) {
1486 1486
 					$sql .= " AND ";
1487 1487
 				}
1488
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1488
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1489 1489
 				$i++;
1490 1490
 			}
1491 1491
 			if (count($scrit) > 1) {
1492 1492
 				$sql .= ")";
1493 1493
 			}
1494 1494
 			if (isModEnabled('barcode')) {
1495
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1495
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1496 1496
 			}
1497
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1498
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1497
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1498
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1499 1499
 			$sql .= ")";
1500 1500
 		}
1501 1501
 		$sql .= $this->db->order("nom", "ASC");
@@ -1506,12 +1506,12 @@  discard block
 block discarded – undo
1506 1506
 		$resql = $this->db->query($sql);
1507 1507
 		if ($resql) {
1508 1508
 			if (!$forcecombo) {
1509
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1509
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1510 1510
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT"));
1511 1511
 			}
1512 1512
 
1513 1513
 			// Construct $out and $outarray
1514
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1514
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1515 1515
 
1516 1516
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1517 1517
 			if (!empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) {
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
 				}
1525 1525
 			}
1526 1526
 			if ($showempty) {
1527
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1527
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1528 1528
 			}
1529 1529
 
1530 1530
 			$companytemp = new Societe($this->db);
@@ -1537,18 +1537,18 @@  discard block
 block discarded – undo
1537 1537
 					$label = '';
1538 1538
 					if ($showcode || !empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) {
1539 1539
 						if (($obj->client) && (!empty($obj->code_client))) {
1540
-							$label = $obj->code_client . ' - ';
1540
+							$label = $obj->code_client.' - ';
1541 1541
 						}
1542 1542
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1543
-							$label .= $obj->code_fournisseur . ' - ';
1543
+							$label .= $obj->code_fournisseur.' - ';
1544 1544
 						}
1545
-						$label .= ' ' . $obj->name;
1545
+						$label .= ' '.$obj->name;
1546 1546
 					} else {
1547 1547
 						$label = $obj->name;
1548 1548
 					}
1549 1549
 
1550 1550
 					if (!empty($obj->name_alias)) {
1551
-						$label .= ' (' . $obj->name_alias . ')';
1551
+						$label .= ' ('.$obj->name_alias.')';
1552 1552
 					}
1553 1553
 
1554 1554
 					if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST) && !empty($obj->tva_intra)) {
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
 						$companytemp->fournisseur = $obj->fournisseur;
1564 1564
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1565 1565
 						if ($tmptype) {
1566
-							$labelhtml .= ' ' . $tmptype;
1566
+							$labelhtml .= ' '.$tmptype;
1567 1567
 						}
1568 1568
 
1569 1569
 						if ($obj->client || $obj->fournisseur) {
@@ -1573,10 +1573,10 @@  discard block
 block discarded – undo
1573 1573
 							$label .= $langs->trans("Customer");
1574 1574
 						}
1575 1575
 						if ($obj->client == 2 || $obj->client == 3) {
1576
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1576
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1577 1577
 						}
1578 1578
 						if ($obj->fournisseur) {
1579
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1579
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1580 1580
 						}
1581 1581
 						if ($obj->client || $obj->fournisseur) {
1582 1582
 							$label .= ')';
@@ -1584,9 +1584,9 @@  discard block
 block discarded – undo
1584 1584
 					}
1585 1585
 
1586 1586
 					if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
1587
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1587
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1588 1588
 						if (!empty($obj->country_code)) {
1589
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1589
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1590 1590
 						}
1591 1591
 						$label .= $s;
1592 1592
 						$labelhtml .= $s;
@@ -1594,9 +1594,9 @@  discard block
 block discarded – undo
1594 1594
 
1595 1595
 					if (empty($outputmode)) {
1596 1596
 						if (in_array($obj->rowid, $selected)) {
1597
-							$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>';
1597
+							$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>';
1598 1598
 						} else {
1599
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1599
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1600 1600
 						}
1601 1601
 					} else {
1602 1602
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
 					}
1609 1609
 				}
1610 1610
 			}
1611
-			$out .= '</select>' . "\n";
1611
+			$out .= '</select>'."\n";
1612 1612
 		} else {
1613 1613
 			dol_print_error($this->db);
1614 1614
 		}
@@ -1642,18 +1642,18 @@  discard block
 block discarded – undo
1642 1642
 		// On recherche les remises
1643 1643
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
1644 1644
 		$sql .= " re.description, re.fk_facture_source";
1645
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
1646
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
1647
-		$sql .= " AND re.entity = " . $conf->entity;
1645
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
1646
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
1647
+		$sql .= " AND re.entity = ".$conf->entity;
1648 1648
 		if ($filter) {
1649
-			$sql .= " AND " . $filter;
1649
+			$sql .= " AND ".$filter;
1650 1650
 		}
1651 1651
 		$sql .= " ORDER BY re.description ASC";
1652 1652
 
1653
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
1653
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
1654 1654
 		$resql = $this->db->query($sql);
1655 1655
 		if ($resql) {
1656
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
1656
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
1657 1657
 			$num = $this->db->num_rows($resql);
1658 1658
 
1659 1659
 			$qualifiedlines = $num;
@@ -1691,16 +1691,16 @@  discard block
 block discarded – undo
1691 1691
 					if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST) && !empty($obj->fk_facture_source)) {
1692 1692
 						$tmpfac = new Facture($this->db);
1693 1693
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
1694
-							$desc = $desc . ' - ' . $tmpfac->ref;
1694
+							$desc = $desc.' - '.$tmpfac->ref;
1695 1695
 						}
1696 1696
 					}
1697 1697
 
1698
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
1698
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
1699 1699
 					$i++;
1700 1700
 				}
1701 1701
 			}
1702 1702
 			print '</select>';
1703
-			print ajax_combobox('select_' . $htmlname);
1703
+			print ajax_combobox('select_'.$htmlname);
1704 1704
 
1705 1705
 			return $qualifiedlines;
1706 1706
 		} else {
@@ -1781,7 +1781,7 @@  discard block
 block discarded – undo
1781 1781
 		$out = '';
1782 1782
 
1783 1783
 		if (!is_object($hookmanager)) {
1784
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1784
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1785 1785
 			$hookmanager = new HookManager($this->db);
1786 1786
 		}
1787 1787
 
@@ -1790,13 +1790,13 @@  discard block
 block discarded – undo
1790 1790
 		if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
1791 1791
 			$sql .= ", s.nom as company, s.town AS company_town";
1792 1792
 		}
1793
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1793
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1794 1794
 		if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
1795
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1795
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1796 1796
 		}
1797
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1797
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1798 1798
 		if ($socid > 0 || $socid == -1) {
1799
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1799
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1800 1800
 		}
1801 1801
 		if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) {
1802 1802
 			$sql .= " AND sp.statut <> 0";
@@ -1807,30 +1807,30 @@  discard block
 block discarded – undo
1807 1807
 		$sql .= $hookmanager->resPrint;
1808 1808
 		$sql .= " ORDER BY sp.lastname ASC";
1809 1809
 
1810
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1810
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1811 1811
 		$resql = $this->db->query($sql);
1812 1812
 		if ($resql) {
1813 1813
 			$num = $this->db->num_rows($resql);
1814 1814
 
1815 1815
 			if ($htmlname != 'none' && !$options_only) {
1816
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1816
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1817 1817
 			}
1818 1818
 
1819 1819
 			if ($showempty && !is_numeric($showempty)) {
1820 1820
 				$textforempty = $showempty;
1821
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1821
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1822 1822
 			} else {
1823 1823
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1824
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1824
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1825 1825
 				}
1826 1826
 				if ($showempty == 2) {
1827
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1827
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1828 1828
 				}
1829 1829
 			}
1830 1830
 
1831 1831
 			$i = 0;
1832 1832
 			if ($num) {
1833
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1833
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1834 1834
 				$contactstatic = new Contact($this->db);
1835 1835
 
1836 1836
 				while ($i < $num) {
@@ -1866,7 +1866,7 @@  discard block
 block discarded – undo
1866 1866
 						}
1867 1867
 						$extendedInfos = implode(' - ', $extendedInfos);
1868 1868
 						if (!empty($extendedInfos)) {
1869
-							$extendedInfos = ' - ' . $extendedInfos;
1869
+							$extendedInfos = ' - '.$extendedInfos;
1870 1870
 						}
1871 1871
 					}
1872 1872
 
@@ -1883,42 +1883,42 @@  discard block
 block discarded – undo
1883 1883
 								$disabled = 1;
1884 1884
 							}
1885 1885
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1886
-								$out .= '<option value="' . $obj->rowid . '"';
1886
+								$out .= '<option value="'.$obj->rowid.'"';
1887 1887
 								if ($disabled) {
1888 1888
 									$out .= ' disabled';
1889 1889
 								}
1890 1890
 								$out .= ' selected>';
1891
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1891
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1892 1892
 								if ($showfunction && $obj->poste) {
1893
-									$out .= ' (' . $obj->poste . ')';
1893
+									$out .= ' ('.$obj->poste.')';
1894 1894
 								}
1895 1895
 								if (($showsoc > 0) && $obj->company) {
1896
-									$out .= ' - (' . $obj->company . ')';
1896
+									$out .= ' - ('.$obj->company.')';
1897 1897
 								}
1898 1898
 								$out .= '</option>';
1899 1899
 							} else {
1900
-								$out .= '<option value="' . $obj->rowid . '"';
1900
+								$out .= '<option value="'.$obj->rowid.'"';
1901 1901
 								if ($disabled) {
1902 1902
 									$out .= ' disabled';
1903 1903
 								}
1904 1904
 								$out .= '>';
1905
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1905
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1906 1906
 								if ($showfunction && $obj->poste) {
1907
-									$out .= ' (' . $obj->poste . ')';
1907
+									$out .= ' ('.$obj->poste.')';
1908 1908
 								}
1909 1909
 								if (($showsoc > 0) && $obj->company) {
1910
-									$out .= ' - (' . $obj->company . ')';
1910
+									$out .= ' - ('.$obj->company.')';
1911 1911
 								}
1912 1912
 								$out .= '</option>';
1913 1913
 							}
1914 1914
 						} else {
1915 1915
 							if (in_array($obj->rowid, $selected)) {
1916
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1916
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1917 1917
 								if ($showfunction && $obj->poste) {
1918
-									$out .= ' (' . $obj->poste . ')';
1918
+									$out .= ' ('.$obj->poste.')';
1919 1919
 								}
1920 1920
 								if (($showsoc > 0) && $obj->company) {
1921
-									$out .= ' - (' . $obj->company . ')';
1921
+									$out .= ' - ('.$obj->company.')';
1922 1922
 								}
1923 1923
 							}
1924 1924
 						}
@@ -1927,7 +1927,7 @@  discard block
 block discarded – undo
1927 1927
 				}
1928 1928
 			} else {
1929 1929
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1930
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1930
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1931 1931
 				$out .= $labeltoshow;
1932 1932
 				$out .= '</option>';
1933 1933
 			}
@@ -1948,7 +1948,7 @@  discard block
 block discarded – undo
1948 1948
 			}
1949 1949
 
1950 1950
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1951
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1951
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1952 1952
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
1953 1953
 			}
1954 1954
 
@@ -2053,37 +2053,37 @@  discard block
 block discarded – undo
2053 2053
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2054 2054
 			$sql .= ", e.label";
2055 2055
 		}
2056
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2056
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2057 2057
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2058
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2058
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2059 2059
 			if ($force_entity) {
2060
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2060
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2061 2061
 			} else {
2062 2062
 				$sql .= " WHERE u.entity IS NOT NULL";
2063 2063
 			}
2064 2064
 		} else {
2065 2065
 			if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
2066
-				$sql .= " LEFT JOIN " . $this->db->prefix() . "usergroup_user as ug";
2066
+				$sql .= " LEFT JOIN ".$this->db->prefix()."usergroup_user as ug";
2067 2067
 				$sql .= " ON ug.fk_user = u.rowid";
2068
-				$sql .= " WHERE ug.entity = " . (int) $conf->entity;
2068
+				$sql .= " WHERE ug.entity = ".(int) $conf->entity;
2069 2069
 			} else {
2070
-				$sql .= " WHERE u.entity IN (0, " . ((int) $conf->entity) . ")";
2070
+				$sql .= " WHERE u.entity IN (0, ".((int) $conf->entity).")";
2071 2071
 			}
2072 2072
 		}
2073 2073
 		if (!empty($user->socid)) {
2074
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2074
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2075 2075
 		}
2076 2076
 		if (is_array($exclude) && $excludeUsers) {
2077
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2077
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2078 2078
 		}
2079 2079
 		if ($includeUsers) {
2080
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2080
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2081 2081
 		}
2082 2082
 		if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $notdisabled) {
2083 2083
 			$sql .= " AND u.statut <> 0";
2084 2084
 		}
2085 2085
 		if (!empty($morefilter)) {
2086
-			$sql .= " " . $morefilter;
2086
+			$sql .= " ".$morefilter;
2087 2087
 		}
2088 2088
 
2089 2089
 		//Add hook to filter on user (for exemple on usergroup define in custom modules)
@@ -2098,7 +2098,7 @@  discard block
 block discarded – undo
2098 2098
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2099 2099
 		}
2100 2100
 
2101
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2101
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2102 2102
 
2103 2103
 		$resql = $this->db->query($sql);
2104 2104
 		if ($resql) {
@@ -2106,7 +2106,7 @@  discard block
 block discarded – undo
2106 2106
 			$i = 0;
2107 2107
 			if ($num) {
2108 2108
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2109
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2109
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2110 2110
 				if ($show_empty && !$multiple) {
2111 2111
 					$textforempty = ' ';
2112 2112
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2115,10 +2115,10 @@  discard block
 block discarded – undo
2115 2115
 					if (!is_numeric($show_empty)) {
2116 2116
 						$textforempty = $show_empty;
2117 2117
 					}
2118
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2118
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2119 2119
 				}
2120 2120
 				if ($show_every) {
2121
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2121
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2122 2122
 				}
2123 2123
 
2124 2124
 				$userstatic = new User($this->db);
@@ -2165,22 +2165,22 @@  discard block
 block discarded – undo
2165 2165
 					}
2166 2166
 					if ($showstatus >= 0) {
2167 2167
 						if ($obj->status == 1 && $showstatus == 1) {
2168
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2169
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2168
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2169
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2170 2170
 						}
2171 2171
 						if ($obj->status == 0 && $showstatus == 1) {
2172
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2173
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2172
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2173
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2174 2174
 						}
2175 2175
 					}
2176 2176
 					if (isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) {
2177 2177
 						if (!$obj->entity) {
2178
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2179
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2178
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2179
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2180 2180
 						} else {
2181 2181
 							if ($obj->entity != $conf->entity) {
2182
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2183
-								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2182
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2183
+								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2184 2184
 							}
2185 2185
 						}
2186 2186
 					}
@@ -2188,13 +2188,13 @@  discard block
 block discarded – undo
2188 2188
 					$moreinfohtml .= ($moreinfohtml ? ')</span>' : '');
2189 2189
 					if ($disableline && $disableline != '1') {
2190 2190
 						// Add text from $enableonlytext parameter
2191
-						$moreinfo .= ' - ' . $disableline;
2192
-						$moreinfohtml .= ' - ' . $disableline;
2191
+						$moreinfo .= ' - '.$disableline;
2192
+						$moreinfohtml .= ' - '.$disableline;
2193 2193
 					}
2194 2194
 					$labeltoshow .= $moreinfo;
2195 2195
 					$labeltoshowhtml .= $moreinfohtml;
2196 2196
 
2197
-					$out .= '<option value="' . $obj->rowid . '"';
2197
+					$out .= '<option value="'.$obj->rowid.'"';
2198 2198
 					if ($disableline) {
2199 2199
 						$out .= ' disabled';
2200 2200
 					}
@@ -2202,7 +2202,7 @@  discard block
 block discarded – undo
2202 2202
 						$out .= ' selected';
2203 2203
 					}
2204 2204
 					$out .= ' data-html="';
2205
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2205
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2206 2206
 					if ($showstatus >= 0 && $obj->status == 0) {
2207 2207
 						$outhtml .= '<strike class="opacitymediumxxx">';
2208 2208
 					}
@@ -2215,7 +2215,7 @@  discard block
 block discarded – undo
2215 2215
 					$out .= $labeltoshow;
2216 2216
 					$out .= '</option>';
2217 2217
 
2218
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2218
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2219 2219
 					$outarray2[$userstatic->id] = array(
2220 2220
 						'id'=>$userstatic->id,
2221 2221
 						'label'=>$labeltoshow,
@@ -2227,14 +2227,14 @@  discard block
 block discarded – undo
2227 2227
 					$i++;
2228 2228
 				}
2229 2229
 			} else {
2230
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2231
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2230
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2231
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2232 2232
 			}
2233 2233
 			$out .= '</select>';
2234 2234
 
2235 2235
 			if ($num && !$forcecombo) {
2236 2236
 				// Enhance with select2
2237
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2237
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2238 2238
 				$out .= ajax_combobox($htmlname);
2239 2239
 			}
2240 2240
 		} else {
@@ -2306,16 +2306,16 @@  discard block
 block discarded – undo
2306 2306
 			$out .= $userstatic->getNomUrl(-1);
2307 2307
 			if ($i == 0) {
2308 2308
 				$ownerid = $value['id'];
2309
-				$out .= ' (' . $langs->trans("Owner") . ')';
2309
+				$out .= ' ('.$langs->trans("Owner").')';
2310 2310
 			}
2311 2311
 			if ($nbassignetouser > 1 && $action != 'view') {
2312
-				$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 . '">';
2312
+				$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.'">';
2313 2313
 			}
2314 2314
 			// Show my availability
2315 2315
 			if ($showproperties) {
2316 2316
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2317 2317
 					$out .= '<div class="myavailability inline-block">';
2318
-					$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>';
2318
+					$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>';
2319 2319
 					$out .= '</div>';
2320 2320
 				}
2321 2321
 			}
@@ -2332,15 +2332,15 @@  discard block
 block discarded – undo
2332 2332
 		// Method with no ajax
2333 2333
 		if ($action != 'view') {
2334 2334
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2335
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2335
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2336 2336
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2337 2337
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2338
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2339
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2338
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2339
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2340 2340
 			$out .= '});';
2341 2341
 			$out .= '})</script>';
2342 2342
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2343
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2343
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2344 2344
 			$out .= '<br>';
2345 2345
 		}
2346 2346
 
@@ -2402,7 +2402,7 @@  discard block
 block discarded – undo
2402 2402
 			$placeholder = '';
2403 2403
 
2404 2404
 			if ($selected && empty($selected_input_value)) {
2405
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2405
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2406 2406
 				$producttmpselect = new Product($this->db);
2407 2407
 				$producttmpselect->fetch($selected);
2408 2408
 				$selected_input_value = $producttmpselect->ref;
@@ -2417,17 +2417,17 @@  discard block
 block discarded – undo
2417 2417
 				}
2418 2418
 			}
2419 2419
 			// mode=1 means customers products
2420
-			$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;
2421
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2420
+			$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;
2421
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2422 2422
 
2423 2423
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2424 2424
 				// Code to automatically insert with javascript the select of attributes under the select of product
2425 2425
 				// when a parent of variant has been selected.
2426 2426
 				$out .= '
2427 2427
 				<!-- script to auto show attributes select tags if a variant was selected -->
2428
-				<script nonce="' . getNonce() . '">
2428
+				<script nonce="' . getNonce().'">
2429 2429
 					// auto show attributes fields
2430
-					selected = ' . json_encode($selected_combinations) . ';
2430
+					selected = ' . json_encode($selected_combinations).';
2431 2431
 					combvalues = {};
2432 2432
 
2433 2433
 					jQuery(document).ready(function () {
@@ -2438,7 +2438,7 @@  discard block
 block discarded – undo
2438 2438
 							}
2439 2439
 						});
2440 2440
 
2441
-						jQuery("input#' . $htmlname . '").change(function () {
2441
+						jQuery("input#' . $htmlname.'").change(function () {
2442 2442
 
2443 2443
 							if (!jQuery(this).val()) {
2444 2444
 								jQuery(\'div#attributes_box\').empty();
@@ -2447,7 +2447,7 @@  discard block
 block discarded – undo
2447 2447
 
2448 2448
 							console.log("A change has started. We get variants fields to inject html select");
2449 2449
 
2450
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2450
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2451 2451
 								id: jQuery(this).val()
2452 2452
 							}, function (data) {
2453 2453
 								jQuery(\'div#attributes_box\').empty();
@@ -2490,21 +2490,21 @@  discard block
 block discarded – undo
2490 2490
 							})
2491 2491
 						});
2492 2492
 
2493
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2493
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2494 2494
 					});
2495 2495
 				</script>
2496 2496
                 ';
2497 2497
 			}
2498 2498
 
2499 2499
 			if (empty($hidelabel)) {
2500
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2500
+				$out .= $langs->trans("RefOrLabel").' : ';
2501 2501
 			} elseif ($hidelabel > 1) {
2502
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2502
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2503 2503
 				if ($hidelabel == 2) {
2504 2504
 					$out .= img_picto($langs->trans("Search"), 'search');
2505 2505
 				}
2506 2506
 			}
2507
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
2507
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
2508 2508
 			if ($hidelabel == 3) {
2509 2509
 				$out .= img_picto($langs->trans("Search"), 'search');
2510 2510
 			}
@@ -2541,26 +2541,26 @@  discard block
 block discarded – undo
2541 2541
 		// phpcs:enable
2542 2542
 		global $conf, $user, $langs, $db;
2543 2543
 
2544
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2544
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2545 2545
 
2546 2546
 		$error = 0;
2547 2547
 		$out = '';
2548 2548
 
2549 2549
 		if (!$forcecombo) {
2550
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2550
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2551 2551
 			$events = array();
2552 2552
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2553 2553
 		}
2554 2554
 
2555
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2555
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2556 2556
 
2557 2557
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2558
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2559
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2560
-		if (!empty($status)) $sql .= ' AND status = ' . (int) $status;
2561
-		if (!empty($type)) $sql .= ' AND bomtype = ' . (int) $type;
2562
-		if (!empty($TProducts)) $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2563
-		if (!empty($limit)) $sql .= ' LIMIT ' . (int) $limit;
2558
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2559
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2560
+		if (!empty($status)) $sql .= ' AND status = '.(int) $status;
2561
+		if (!empty($type)) $sql .= ' AND bomtype = '.(int) $type;
2562
+		if (!empty($TProducts)) $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2563
+		if (!empty($limit)) $sql .= ' LIMIT '.(int) $limit;
2564 2564
 		$resql = $db->query($sql);
2565 2565
 		if ($resql) {
2566 2566
 			if ($showempty) {
@@ -2571,9 +2571,9 @@  discard block
 block discarded – undo
2571 2571
 			while ($obj = $db->fetch_object($resql)) {
2572 2572
 				$product = new Product($db);
2573 2573
 				$res = $product->fetch($obj->fk_product);
2574
-				$out .= '<option value="' . $obj->rowid . '"';
2574
+				$out .= '<option value="'.$obj->rowid.'"';
2575 2575
 				if ($obj->rowid == $selected) $out .= 'selected';
2576
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2576
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2577 2577
 			}
2578 2578
 		} else {
2579 2579
 			$error++;
@@ -2630,7 +2630,7 @@  discard block
 block discarded – undo
2630 2630
 
2631 2631
 		$warehouseStatusArray = array();
2632 2632
 		if (!empty($warehouseStatus)) {
2633
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2633
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2634 2634
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2635 2635
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2636 2636
 			}
@@ -2644,9 +2644,9 @@  discard block
 block discarded – undo
2644 2644
 
2645 2645
 		$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";
2646 2646
 		if (count($warehouseStatusArray)) {
2647
-			$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
2647
+			$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
2648 2648
 		} else {
2649
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2649
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2650 2650
 		}
2651 2651
 
2652 2652
 		$sql = "SELECT ";
@@ -2662,9 +2662,9 @@  discard block
 block discarded – undo
2662 2662
 
2663 2663
 		if (!empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) {
2664 2664
 			//Product category
2665
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2666
-						FROM " . $this->db->prefix() . "categorie_product
2667
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2665
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2666
+						FROM " . $this->db->prefix()."categorie_product
2667
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2668 2668
 						LIMIT 1
2669 2669
 				) AS categorie_product_id ";
2670 2670
 		}
@@ -2690,15 +2690,15 @@  discard block
 block discarded – undo
2690 2690
 		}
2691 2691
 		// Price by quantity
2692 2692
 		if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
2693
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2693
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2694 2694
 			if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
2695
-				$sql .= " AND price_level = " . ((int) $price_level);
2695
+				$sql .= " AND price_level = ".((int) $price_level);
2696 2696
 			}
2697 2697
 			$sql .= " ORDER BY date_price";
2698 2698
 			$sql .= " DESC LIMIT 1) as price_rowid";
2699
-			$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
2699
+			$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
2700 2700
 			if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
2701
-				$sql .= " AND price_level = " . ((int) $price_level);
2701
+				$sql .= " AND price_level = ".((int) $price_level);
2702 2702
 			}
2703 2703
 			$sql .= " ORDER BY date_price";
2704 2704
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -2712,67 +2712,67 @@  discard block
 block discarded – undo
2712 2712
 		$sql .= $hookmanager->resPrint;
2713 2713
 
2714 2714
 		if (count($warehouseStatusArray)) {
2715
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
2716
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
2717
-			$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.
2715
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
2716
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
2717
+			$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.
2718 2718
 		}
2719 2719
 
2720 2720
 		// include search in supplier ref
2721 2721
 		if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) {
2722
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2722
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2723 2723
 		}
2724 2724
 
2725 2725
 		//Price by customer
2726 2726
 		if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
2727
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
2727
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
2728 2728
 		}
2729 2729
 		// Units
2730 2730
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
2731
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
2731
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
2732 2732
 		}
2733 2733
 		// Multilang : we add translation
2734 2734
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
2735
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
2735
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
2736 2736
 			if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) {
2737
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
2737
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
2738 2738
 				$soc = new Societe($this->db);
2739 2739
 				$result = $soc->fetch($socid);
2740 2740
 				if ($result > 0 && !empty($soc->default_lang)) {
2741
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
2741
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
2742 2742
 				} else {
2743
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2743
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2744 2744
 				}
2745 2745
 			} else {
2746
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2746
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2747 2747
 			}
2748 2748
 		}
2749 2749
 
2750 2750
 		if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
2751
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2751
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2752 2752
 		}
2753 2753
 
2754
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
2754
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
2755 2755
 
2756 2756
 		if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
2757 2757
 			$sql .= " AND pac.rowid IS NULL";
2758 2758
 		}
2759 2759
 
2760 2760
 		if ($finished == 0) {
2761
-			$sql .= " AND p.finished = " . ((int) $finished);
2761
+			$sql .= " AND p.finished = ".((int) $finished);
2762 2762
 		} elseif ($finished == 1) {
2763
-			$sql .= " AND p.finished = " . ((int) $finished);
2763
+			$sql .= " AND p.finished = ".((int) $finished);
2764 2764
 			if ($status >= 0) {
2765
-				$sql .= " AND p.tosell = " . ((int) $status);
2765
+				$sql .= " AND p.tosell = ".((int) $status);
2766 2766
 			}
2767 2767
 		} elseif ($status >= 0) {
2768
-			$sql .= " AND p.tosell = " . ((int) $status);
2768
+			$sql .= " AND p.tosell = ".((int) $status);
2769 2769
 		}
2770 2770
 		if ($status_purchase >= 0) {
2771
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
2771
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
2772 2772
 		}
2773 2773
 		// Filter by product type
2774 2774
 		if (strval($filtertype) != '') {
2775
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
2775
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
2776 2776
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
2777 2777
 			$sql .= " AND p.fk_product_type = 1";
2778 2778
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
@@ -2796,21 +2796,21 @@  discard block
 block discarded – undo
2796 2796
 				if ($i > 0) {
2797 2797
 					$sql .= " AND ";
2798 2798
 				}
2799
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2799
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2800 2800
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
2801
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2801
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2802 2802
 				}
2803 2803
 				if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
2804
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2804
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
2805 2805
 				}
2806 2806
 				if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) {
2807
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2807
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2808 2808
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
2809
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2809
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2810 2810
 					}
2811 2811
 				}
2812 2812
 				if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) {
2813
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2813
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
2814 2814
 				}
2815 2815
 				$sql .= ")";
2816 2816
 				$i++;
@@ -2819,12 +2819,12 @@  discard block
 block discarded – undo
2819 2819
 				$sql .= ")";
2820 2820
 			}
2821 2821
 			if (isModEnabled('barcode')) {
2822
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
2822
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
2823 2823
 			}
2824 2824
 			$sql .= ')';
2825 2825
 		}
2826 2826
 		if (count($warehouseStatusArray)) {
2827
-			$sql .= " GROUP BY " . $selectFields;
2827
+			$sql .= " GROUP BY ".$selectFields;
2828 2828
 		}
2829 2829
 
2830 2830
 		//Sort by category
@@ -2839,23 +2839,23 @@  discard block
 block discarded – undo
2839 2839
 		$sql .= $this->db->plimit($limit, 0);
2840 2840
 
2841 2841
 		// Build output string
2842
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
2842
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
2843 2843
 		$result = $this->db->query($sql);
2844 2844
 		if ($result) {
2845
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2846
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2847
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
2845
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2846
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2847
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
2848 2848
 
2849 2849
 			$num = $this->db->num_rows($result);
2850 2850
 
2851 2851
 			$events = null;
2852 2852
 
2853 2853
 			if (!$forcecombo) {
2854
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2854
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2855 2855
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2856 2856
 			}
2857 2857
 
2858
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2858
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2859 2859
 
2860 2860
 			$textifempty = '';
2861 2861
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -2872,7 +2872,7 @@  discard block
 block discarded – undo
2872 2872
 				}
2873 2873
 			}
2874 2874
 			if ($showempty) {
2875
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
2875
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
2876 2876
 			}
2877 2877
 
2878 2878
 			$i = 0;
@@ -2883,11 +2883,11 @@  discard block
 block discarded – undo
2883 2883
 
2884 2884
 				if ((!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->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
2885 2885
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
2886
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
2887
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
2886
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
2887
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
2888 2888
 					$sql .= " ORDER BY quantity ASC";
2889 2889
 
2890
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
2890
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
2891 2891
 					$result2 = $this->db->query($sql);
2892 2892
 					if ($result2) {
2893 2893
 						$nb_prices = $this->db->num_rows($result2);
@@ -2925,7 +2925,7 @@  discard block
 block discarded – undo
2925 2925
 						$price_product = new Product($this->db);
2926 2926
 						$price_product->fetch($objp->rowid, '', '', 1);
2927 2927
 
2928
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2928
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2929 2929
 						$priceparser = new PriceParser($this->db);
2930 2930
 						$price_result = $priceparser->parseProduct($price_product);
2931 2931
 						if ($price_result >= 0) {
@@ -3009,7 +3009,7 @@  discard block
 block discarded – undo
3009 3009
 			$label = $objp->label_translated;
3010 3010
 		}
3011 3011
 		if (!empty($filterkey) && $filterkey != '') {
3012
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3012
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3013 3013
 		}
3014 3014
 
3015 3015
 		$outkey = $objp->rowid;
@@ -3030,32 +3030,32 @@  discard block
 block discarded – undo
3030 3030
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3031 3031
 
3032 3032
 		if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) {
3033
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3033
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3034 3034
 		}
3035 3035
 
3036 3036
 		// Units
3037 3037
 		$outvalUnits = '';
3038 3038
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3039 3039
 			if (!empty($objp->unit_short)) {
3040
-				$outvalUnits .= ' - ' . $objp->unit_short;
3040
+				$outvalUnits .= ' - '.$objp->unit_short;
3041 3041
 			}
3042 3042
 		}
3043 3043
 		if (!empty($conf->global->PRODUCT_SHOW_DIMENSIONS_IN_COMBO)) {
3044 3044
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3045 3045
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3046
-				$outvalUnits .= ' - ' . $unitToShow;
3046
+				$outvalUnits .= ' - '.$unitToShow;
3047 3047
 			}
3048 3048
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3049
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3050
-				$outvalUnits .= ' - ' . $unitToShow;
3049
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3050
+				$outvalUnits .= ' - '.$unitToShow;
3051 3051
 			}
3052 3052
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3053 3053
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3054
-				$outvalUnits .= ' - ' . $unitToShow;
3054
+				$outvalUnits .= ' - '.$unitToShow;
3055 3055
 			}
3056 3056
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3057 3057
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3058
-				$outvalUnits .= ' - ' . $unitToShow;
3058
+				$outvalUnits .= ' - '.$unitToShow;
3059 3059
 			}
3060 3060
 		}
3061 3061
 		if ($outdurationvalue && $outdurationunit) {
@@ -3067,14 +3067,14 @@  discard block
 block discarded – undo
3067 3067
 				'y' => $langs->trans('Year')
3068 3068
 			);
3069 3069
 			if (isset($da[$outdurationunit])) {
3070
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3070
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3071 3071
 			}
3072 3072
 		}
3073 3073
 
3074
-		$opt = '<option value="' . $objp->rowid . '"';
3074
+		$opt = '<option value="'.$objp->rowid.'"';
3075 3075
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3076 3076
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3077
-			$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 . '"';
3077
+			$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.'"';
3078 3078
 		}
3079 3079
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
3080 3080
 			if (!empty($user->rights->stock->lire)) {
@@ -3086,36 +3086,36 @@  discard block
 block discarded – undo
3086 3086
 			}
3087 3087
 		}
3088 3088
 		if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
3089
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3090
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3089
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3090
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3091 3091
 		}
3092 3092
 		$opt .= '>';
3093 3093
 		$opt .= $objp->ref;
3094 3094
 		if (!empty($objp->custref)) {
3095
-			$opt .= ' (' . $objp->custref . ')';
3095
+			$opt .= ' ('.$objp->custref.')';
3096 3096
 		}
3097 3097
 		if ($outbarcode) {
3098
-			$opt .= ' (' . $outbarcode . ')';
3098
+			$opt .= ' ('.$outbarcode.')';
3099 3099
 		}
3100
-		$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
3100
+		$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
3101 3101
 		if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) {
3102
-			$opt .= ' (' . getCountry($outorigin, 1) . ')';
3102
+			$opt .= ' ('.getCountry($outorigin, 1).')';
3103 3103
 		}
3104 3104
 
3105 3105
 		$objRef = $objp->ref;
3106 3106
 		if (!empty($objp->custref)) {
3107
-			$objRef .= ' (' . $objp->custref . ')';
3107
+			$objRef .= ' ('.$objp->custref.')';
3108 3108
 		}
3109 3109
 		if (!empty($filterkey) && $filterkey != '') {
3110
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3110
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3111 3111
 		}
3112 3112
 		$outval .= $objRef;
3113 3113
 		if ($outbarcode) {
3114
-			$outval .= ' (' . $outbarcode . ')';
3114
+			$outval .= ' ('.$outbarcode.')';
3115 3115
 		}
3116
-		$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
3116
+		$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
3117 3117
 		if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) {
3118
-			$outval .= ' (' . getCountry($outorigin, 1) . ')';
3118
+			$outval .= ' ('.getCountry($outorigin, 1).')';
3119 3119
 		}
3120 3120
 
3121 3121
 		// Units
@@ -3128,35 +3128,35 @@  discard block
 block discarded – undo
3128 3128
 		// If we need a particular price level (from 1 to n)
3129 3129
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) {
3130 3130
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3131
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3132
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3133
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3134
-			$sql .= " AND price_level = " . ((int) $price_level);
3131
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3132
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3133
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3134
+			$sql .= " AND price_level = ".((int) $price_level);
3135 3135
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3136 3136
 			$sql .= " LIMIT 1";
3137 3137
 
3138
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3138
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3139 3139
 			$result2 = $this->db->query($sql);
3140 3140
 			if ($result2) {
3141 3141
 				$objp2 = $this->db->fetch_object($result2);
3142 3142
 				if ($objp2) {
3143 3143
 					$found = 1;
3144 3144
 					if ($objp2->price_base_type == 'HT') {
3145
-						$opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3146
-						$outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3145
+						$opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3146
+						$outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3147 3147
 					} else {
3148
-						$opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3149
-						$outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3148
+						$opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3149
+						$outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3150 3150
 					}
3151 3151
 					$outprice_ht = price($objp2->price);
3152 3152
 					$outprice_ttc = price($objp2->price_ttc);
3153 3153
 					$outpricebasetype = $objp2->price_base_type;
3154 3154
 					if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) {  // using this option is a bug. kept for backward compatibility
3155
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3156
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3155
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3156
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3157 3157
 					} else {
3158
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3159
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3158
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3159
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3160 3160
 					}
3161 3161
 				}
3162 3162
 			} else {
@@ -3170,13 +3170,13 @@  discard block
 block discarded – undo
3170 3170
 			$outqty = $objp->quantity;
3171 3171
 			$outdiscount = $objp->remise_percent;
3172 3172
 			if ($objp->quantity == 1) {
3173
-				$opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3174
-				$outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3173
+				$opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3174
+				$outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3175 3175
 				$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3176 3176
 				$outval .= $langs->transnoentities("Unit");
3177 3177
 			} else {
3178
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3179
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3178
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3179
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3180 3180
 				$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3181 3181
 				$outval .= $langs->transnoentities("Units");
3182 3182
 			}
@@ -3184,16 +3184,16 @@  discard block
 block discarded – undo
3184 3184
 			$outprice_ht = price($objp->unitprice);
3185 3185
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3186 3186
 			$outpricebasetype = $objp->price_base_type;
3187
-			$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
3188
-			$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
3187
+			$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
3188
+			$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
3189 3189
 		}
3190 3190
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3191
-			$opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3192
-			$outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3191
+			$opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3192
+			$outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3193 3193
 		}
3194 3194
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3195
-			$opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3196
-			$outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3195
+			$opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3196
+			$outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3197 3197
 		}
3198 3198
 
3199 3199
 		// Price by customer
@@ -3202,11 +3202,11 @@  discard block
 block discarded – undo
3202 3202
 				$found = 1;
3203 3203
 
3204 3204
 				if ($objp->custprice_base_type == 'HT') {
3205
-					$opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3206
-					$outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3205
+					$opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3206
+					$outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3207 3207
 				} else {
3208
-					$opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3209
-					$outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3208
+					$opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3209
+					$outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3210 3210
 				}
3211 3211
 
3212 3212
 				$outprice_ht = price($objp->custprice);
@@ -3220,11 +3220,11 @@  discard block
 block discarded – undo
3220 3220
 		// If level no defined or multiprice not found, we used the default price
3221 3221
 		if (empty($hidepriceinlabel) && !$found) {
3222 3222
 			if ($objp->price_base_type == 'HT') {
3223
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3224
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3223
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3224
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3225 3225
 			} else {
3226
-				$opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3227
-				$outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3226
+				$opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3227
+				$outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3228 3228
 			}
3229 3229
 			$outprice_ht = price($objp->price);
3230 3230
 			$outprice_ttc = price($objp->price_ttc);
@@ -3235,14 +3235,14 @@  discard block
 block discarded – undo
3235 3235
 
3236 3236
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
3237 3237
 			if (!empty($user->rights->stock->lire)) {
3238
-				$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3238
+				$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3239 3239
 
3240 3240
 				if ($objp->stock > 0) {
3241 3241
 					$outval .= ' - <span class="product_line_stock_ok">';
3242 3242
 				} elseif ($objp->stock <= 0) {
3243 3243
 					$outval .= ' - <span class="product_line_stock_too_low">';
3244 3244
 				}
3245
-				$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3245
+				$outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3246 3246
 				$outval .= '</span>';
3247 3247
 				if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) {  // Warning, this option may slow down combo list generation
3248 3248
 					$langs->load("stocks");
@@ -3252,9 +3252,9 @@  discard block
 block discarded – undo
3252 3252
 					$tmpproduct->load_virtual_stock();
3253 3253
 					$virtualstock = $tmpproduct->stock_theorique;
3254 3254
 
3255
-					$opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3255
+					$opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3256 3256
 
3257
-					$outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3257
+					$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
3258 3258
 					if ($virtualstock > 0) {
3259 3259
 						$outval .= '<span class="product_line_stock_ok">';
3260 3260
 					} elseif ($virtualstock <= 0) {
@@ -3332,7 +3332,7 @@  discard block
 block discarded – undo
3332 3332
 		$selected_input_value = '';
3333 3333
 		if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
3334 3334
 			if ($selected > 0) {
3335
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3335
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3336 3336
 				$producttmpselect = new Product($this->db);
3337 3337
 				$producttmpselect->fetch($selected);
3338 3338
 				$selected_input_value = $producttmpselect->ref;
@@ -3340,10 +3340,10 @@  discard block
 block discarded – undo
3340 3340
 			}
3341 3341
 
3342 3342
 			// mode=2 means suppliers products
3343
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3344
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3343
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3344
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3345 3345
 
3346
-			print ($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3346
+			print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3347 3347
 		} else {
3348 3348
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3349 3349
 		}
@@ -3403,25 +3403,25 @@  discard block
 block discarded – undo
3403 3403
 		if (isModEnabled('barcode')) {
3404 3404
 			$sql .= ", pfp.barcode";
3405 3405
 		}
3406
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3407
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3406
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3407
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3408 3408
 		if ($socid > 0) {
3409
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3409
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3410 3410
 		}
3411
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3411
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3412 3412
 		// Units
3413 3413
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3414
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3414
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3415 3415
 		}
3416
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3416
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3417 3417
 		if ($statut != -1) {
3418
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3418
+			$sql .= " AND p.tobuy = ".((int) $statut);
3419 3419
 		}
3420 3420
 		if (strval($filtertype) != '') {
3421
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3421
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3422 3422
 		}
3423 3423
 		if (!empty($filtre)) {
3424
-			$sql .= " " . $filtre;
3424
+			$sql .= " ".$filtre;
3425 3425
 		}
3426 3426
 		// Add where from hooks
3427 3427
 		$parameters = array();
@@ -3441,9 +3441,9 @@  discard block
 block discarded – undo
3441 3441
 				if ($i > 0) {
3442 3442
 					$sql .= " AND ";
3443 3443
 				}
3444
-				$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) . "%'";
3444
+				$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)."%'";
3445 3445
 				if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) {
3446
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3446
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3447 3447
 				}
3448 3448
 				$sql .= ")";
3449 3449
 				$i++;
@@ -3452,8 +3452,8 @@  discard block
 block discarded – undo
3452 3452
 				$sql .= ")";
3453 3453
 			}
3454 3454
 			if (isModEnabled('barcode')) {
3455
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3456
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3455
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3456
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3457 3457
 			}
3458 3458
 			$sql .= ')';
3459 3459
 		}
@@ -3462,20 +3462,20 @@  discard block
 block discarded – undo
3462 3462
 
3463 3463
 		// Build output string
3464 3464
 
3465
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3465
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3466 3466
 		$result = $this->db->query($sql);
3467 3467
 		if ($result) {
3468
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3469
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3468
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3469
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3470 3470
 
3471 3471
 			$num = $this->db->num_rows($result);
3472 3472
 
3473 3473
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3474
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3474
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3475 3475
 			if (!$selected) {
3476
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3476
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3477 3477
 			} else {
3478
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3478
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3479 3479
 			}
3480 3480
 
3481 3481
 			$i = 0;
@@ -3490,7 +3490,7 @@  discard block
 block discarded – undo
3490 3490
 
3491 3491
 				$outkey = $objp->idprodfournprice; // id in table of price
3492 3492
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3493
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3493
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3494 3494
 				}
3495 3495
 
3496 3496
 				$outref = $objp->ref;
@@ -3505,23 +3505,23 @@  discard block
 block discarded – undo
3505 3505
 				$outvalUnits = '';
3506 3506
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3507 3507
 					if (!empty($objp->unit_short)) {
3508
-						$outvalUnits .= ' - ' . $objp->unit_short;
3508
+						$outvalUnits .= ' - '.$objp->unit_short;
3509 3509
 					}
3510 3510
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3511 3511
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3512
-						$outvalUnits .= ' - ' . $unitToShow;
3512
+						$outvalUnits .= ' - '.$unitToShow;
3513 3513
 					}
3514 3514
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3515
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3516
-						$outvalUnits .= ' - ' . $unitToShow;
3515
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3516
+						$outvalUnits .= ' - '.$unitToShow;
3517 3517
 					}
3518 3518
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3519 3519
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3520
-						$outvalUnits .= ' - ' . $unitToShow;
3520
+						$outvalUnits .= ' - '.$unitToShow;
3521 3521
 					}
3522 3522
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3523 3523
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3524
-						$outvalUnits .= ' - ' . $unitToShow;
3524
+						$outvalUnits .= ' - '.$unitToShow;
3525 3525
 					}
3526 3526
 					if ($outdurationvalue && $outdurationunit) {
3527 3527
 						$da = array(
@@ -3532,22 +3532,22 @@  discard block
 block discarded – undo
3532 3532
 							'y' => $langs->trans('Year')
3533 3533
 						);
3534 3534
 						if (isset($da[$outdurationunit])) {
3535
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3535
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3536 3536
 						}
3537 3537
 					}
3538 3538
 				}
3539 3539
 
3540 3540
 				$objRef = $objp->ref;
3541 3541
 				if ($filterkey && $filterkey != '') {
3542
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3542
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3543 3543
 				}
3544 3544
 				$objRefFourn = $objp->ref_fourn;
3545 3545
 				if ($filterkey && $filterkey != '') {
3546
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3546
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3547 3547
 				}
3548 3548
 				$label = $objp->label;
3549 3549
 				if ($filterkey && $filterkey != '') {
3550
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3550
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3551 3551
 				}
3552 3552
 
3553 3553
 				switch ($objp->fk_product_type) {
@@ -3570,21 +3570,21 @@  discard block
 block discarded – undo
3570 3570
 
3571 3571
 				$optlabel .= $objp->ref;
3572 3572
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3573
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3573
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3574 3574
 				}
3575 3575
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3576
-					$optlabel .= ' (' . $outbarcode . ')';
3576
+					$optlabel .= ' ('.$outbarcode.')';
3577 3577
 				}
3578
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3578
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3579 3579
 
3580 3580
 				$outvallabel = $objRef;
3581 3581
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3582
-					$outvallabel .= ' (' . $objRefFourn . ')';
3582
+					$outvallabel .= ' ('.$objRefFourn.')';
3583 3583
 				}
3584 3584
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3585
-					$outvallabel .= ' (' . $outbarcode . ')';
3585
+					$outvallabel .= ' ('.$outbarcode.')';
3586 3586
 				}
3587
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3587
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3588 3588
 
3589 3589
 				// Units
3590 3590
 				$optlabel .= $outvalUnits;
@@ -3601,7 +3601,7 @@  discard block
 block discarded – undo
3601 3601
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3602 3602
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3603 3603
 
3604
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3604
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3605 3605
 						$priceparser = new PriceParser($this->db);
3606 3606
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3607 3607
 						if ($price_result >= 0) {
@@ -3612,48 +3612,48 @@  discard block
 block discarded – undo
3612 3612
 						}
3613 3613
 					}
3614 3614
 					if ($objp->quantity == 1) {
3615
-						$optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3616
-						$outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3615
+						$optlabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3616
+						$outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3617 3617
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3618 3618
 						$outvallabel .= $langs->transnoentities("Unit");
3619 3619
 					} else {
3620
-						$optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3621
-						$outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3622
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3623
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3620
+						$optlabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3621
+						$outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3622
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3623
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3624 3624
 					}
3625 3625
 
3626 3626
 					if ($objp->quantity > 1) {
3627
-						$optlabel .= " (" . price($objp->unitprice * (!empty($conf->global->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
3628
-						$outvallabel .= " (" . price($objp->unitprice * (!empty($conf->global->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
3627
+						$optlabel .= " (".price($objp->unitprice * (!empty($conf->global->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
3628
+						$outvallabel .= " (".price($objp->unitprice * (!empty($conf->global->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
3629 3629
 					}
3630 3630
 					if ($objp->remise_percent >= 1) {
3631
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3632
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3631
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3632
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3633 3633
 					}
3634 3634
 					if ($objp->duration) {
3635
-						$optlabel .= " - " . $objp->duration;
3636
-						$outvallabel .= " - " . $objp->duration;
3635
+						$optlabel .= " - ".$objp->duration;
3636
+						$outvallabel .= " - ".$objp->duration;
3637 3637
 					}
3638 3638
 					if (!$socid) {
3639
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3640
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3639
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3640
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3641 3641
 					}
3642 3642
 					if ($objp->supplier_reputation) {
3643 3643
 						//TODO dictionary
3644 3644
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3645 3645
 
3646
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3647
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3646
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3647
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3648 3648
 					}
3649 3649
 				} else {
3650 3650
 					if (empty($alsoproductwithnosupplierprice)) {     // No supplier price defined for couple product/supplier
3651
-						$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3652
-						$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3651
+						$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3652
+						$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3653 3653
 					} else // No supplier price defined for product, even on other suppliers
3654 3654
 					{
3655
-						$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3656
-						$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3655
+						$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3656
+						$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3657 3657
 					}
3658 3658
 				}
3659 3659
 
@@ -3661,14 +3661,14 @@  discard block
 block discarded – undo
3661 3661
 					$novirtualstock = ($showstockinlist == 2);
3662 3662
 
3663 3663
 					if (!empty($user->rights->stock->lire)) {
3664
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3664
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3665 3665
 
3666 3666
 						if ($objp->stock > 0) {
3667 3667
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3668 3668
 						} elseif ($objp->stock <= 0) {
3669 3669
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3670 3670
 						}
3671
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3671
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3672 3672
 						$optlabel .= '</span>';
3673 3673
 						if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) {  // Warning, this option may slow down combo list generation
3674 3674
 							$langs->load("stocks");
@@ -3678,9 +3678,9 @@  discard block
 block discarded – undo
3678 3678
 							$tmpproduct->load_virtual_stock();
3679 3679
 							$virtualstock = $tmpproduct->stock_theorique;
3680 3680
 
3681
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3681
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3682 3682
 
3683
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3683
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
3684 3684
 							if ($virtualstock > 0) {
3685 3685
 								$optlabel .= '<span class="product_line_stock_ok">';
3686 3686
 							} elseif ($virtualstock <= 0) {
@@ -3694,7 +3694,7 @@  discard block
 block discarded – undo
3694 3694
 					}
3695 3695
 				}
3696 3696
 
3697
-				$optstart = '<option value="' . $outkey . '"';
3697
+				$optstart = '<option value="'.$outkey.'"';
3698 3698
 				if ($selected && $selected == $objp->idprodfournprice) {
3699 3699
 					$optstart .= ' selected';
3700 3700
 				}
@@ -3703,26 +3703,26 @@  discard block
 block discarded – undo
3703 3703
 				}
3704 3704
 
3705 3705
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
3706
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
3707
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
3708
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
3709
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
3710
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
3711
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
3712
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
3713
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
3714
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
3715
-				}
3716
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
3706
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
3707
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
3708
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
3709
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
3710
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
3711
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
3712
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
3713
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
3714
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
3715
+				}
3716
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
3717 3717
 
3718 3718
 				$outarrayentry = array(
3719 3719
 					'key' => $outkey,
3720 3720
 					'value' => $outref,
3721 3721
 					'label' => $outvallabel,
3722 3722
 					'qty' => $outqty,
3723
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
3724
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3725
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3723
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3724
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3725
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3726 3726
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
3727 3727
 					'tva_tx' => price2num($objp->tva_tx),
3728 3728
 					'default_vat_code' => $objp->default_vat_code,
@@ -3747,18 +3747,18 @@  discard block
 block discarded – undo
3747 3747
 				// Add new entry
3748 3748
 				// "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
3749 3749
 				// "label" value of json key array is used by jQuery automatically as text for combo box
3750
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
3750
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
3751 3751
 				array_push(
3752 3752
 					$outarray,
3753 3753
 					array('key' => $outkey,
3754 3754
 						'value' => $outref,
3755 3755
 						'label' => $outvallabel,
3756 3756
 						'qty' => $outqty,
3757
-						'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
3757
+						'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3758 3758
 						'price_qty_ht_locale' => price($objp->fprice),
3759
-						'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3759
+						'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3760 3760
 						'price_unit_ht_locale' => price($objp->unitprice),
3761
-						'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3761
+						'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3762 3762
 						'tva_tx_formated' => price($objp->tva_tx),
3763 3763
 						'tva_tx' => price2num($objp->tva_tx),
3764 3764
 						'default_vat_code' => $objp->default_vat_code,
@@ -3785,7 +3785,7 @@  discard block
 block discarded – undo
3785 3785
 
3786 3786
 			$this->db->free($result);
3787 3787
 
3788
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3788
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3789 3789
 			$out .= ajax_combobox($htmlname);
3790 3790
 		} else {
3791 3791
 			dol_print_error($this->db);
@@ -3817,43 +3817,43 @@  discard block
 block discarded – undo
3817 3817
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
3818 3818
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
3819 3819
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
3820
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3821
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3822
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3823
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
3820
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3821
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3822
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3823
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
3824 3824
 		$sql .= " AND p.tobuy = 1";
3825 3825
 		$sql .= " AND s.fournisseur = 1";
3826
-		$sql .= " AND p.rowid = " . ((int) $productid);
3826
+		$sql .= " AND p.rowid = ".((int) $productid);
3827 3827
 		if (empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED)) {
3828 3828
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
3829 3829
 		} else {
3830 3830
 			$sql .= " ORDER BY pfp.unitprice ASC";
3831 3831
 		}
3832 3832
 
3833
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
3833
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
3834 3834
 		$result = $this->db->query($sql);
3835 3835
 
3836 3836
 		if ($result) {
3837 3837
 			$num = $this->db->num_rows($result);
3838 3838
 
3839
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3839
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3840 3840
 
3841 3841
 			if (!$num) {
3842
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
3842
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
3843 3843
 			} else {
3844
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3844
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3845 3845
 				$form .= '<option value="0">&nbsp;</option>';
3846 3846
 
3847 3847
 				$i = 0;
3848 3848
 				while ($i < $num) {
3849 3849
 					$objp = $this->db->fetch_object($result);
3850 3850
 
3851
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
3851
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
3852 3852
 					//if there is only one supplier, preselect it
3853 3853
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && !empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED))) {
3854 3854
 						$opt .= ' selected';
3855 3855
 					}
3856
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
3856
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
3857 3857
 
3858 3858
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
3859 3859
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -3863,7 +3863,7 @@  discard block
 block discarded – undo
3863 3863
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3864 3864
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3865 3865
 
3866
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3866
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3867 3867
 						$priceparser = new PriceParser($this->db);
3868 3868
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3869 3869
 						if ($price_result >= 0) {
@@ -3874,10 +3874,10 @@  discard block
 block discarded – undo
3874 3874
 						}
3875 3875
 					}
3876 3876
 					if ($objp->quantity == 1) {
3877
-						$opt .= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3877
+						$opt .= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3878 3878
 					}
3879 3879
 
3880
-					$opt .= $objp->quantity . ' ';
3880
+					$opt .= $objp->quantity.' ';
3881 3881
 
3882 3882
 					if ($objp->quantity == 1) {
3883 3883
 						$opt .= $langs->trans("Unit");
@@ -3886,10 +3886,10 @@  discard block
 block discarded – undo
3886 3886
 					}
3887 3887
 					if ($objp->quantity > 1) {
3888 3888
 						$opt .= " - ";
3889
-						$opt .= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit");
3889
+						$opt .= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit");
3890 3890
 					}
3891 3891
 					if ($objp->duration) {
3892
-						$opt .= " - " . $objp->duration;
3892
+						$opt .= " - ".$objp->duration;
3893 3893
 					}
3894 3894
 					$opt .= "</option>\n";
3895 3895
 
@@ -3923,14 +3923,14 @@  discard block
 block discarded – undo
3923 3923
 		// phpcs:enable
3924 3924
 		// looking for users
3925 3925
 		$sql = "SELECT a.rowid, a.label";
3926
-		$sql .= " FROM " . $this->db->prefix() . "societe_address as a";
3927
-		$sql .= " WHERE a.fk_soc = " . ((int) $socid);
3926
+		$sql .= " FROM ".$this->db->prefix()."societe_address as a";
3927
+		$sql .= " WHERE a.fk_soc = ".((int) $socid);
3928 3928
 		$sql .= " ORDER BY a.label ASC";
3929 3929
 
3930
-		dol_syslog(get_class($this) . "::select_address", LOG_DEBUG);
3930
+		dol_syslog(get_class($this)."::select_address", LOG_DEBUG);
3931 3931
 		$resql = $this->db->query($sql);
3932 3932
 		if ($resql) {
3933
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3933
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3934 3934
 			if ($showempty) {
3935 3935
 				print '<option value="0">&nbsp;</option>';
3936 3936
 			}
@@ -3941,9 +3941,9 @@  discard block
 block discarded – undo
3941 3941
 					$obj = $this->db->fetch_object($resql);
3942 3942
 
3943 3943
 					if ($selected && $selected == $obj->rowid) {
3944
-						print '<option value="' . $obj->rowid . '" selected>' . $obj->label . '</option>';
3944
+						print '<option value="'.$obj->rowid.'" selected>'.$obj->label.'</option>';
3945 3945
 					} else {
3946
-						print '<option value="' . $obj->rowid . '">' . $obj->label . '</option>';
3946
+						print '<option value="'.$obj->rowid.'">'.$obj->label.'</option>';
3947 3947
 					}
3948 3948
 					$i++;
3949 3949
 				}
@@ -3976,8 +3976,8 @@  discard block
 block discarded – undo
3976 3976
 		dol_syslog(__METHOD__, LOG_DEBUG);
3977 3977
 
3978 3978
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
3979
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
3980
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
3979
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
3980
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
3981 3981
 		$sql .= " AND active > 0";
3982 3982
 		$sql .= " ORDER BY sortorder";
3983 3983
 
@@ -3989,7 +3989,7 @@  discard block
 block discarded – undo
3989 3989
 				$obj = $this->db->fetch_object($resql);
3990 3990
 
3991 3991
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
3992
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != ("PaymentConditionShort" . $obj->code) ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
3992
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != ("PaymentConditionShort".$obj->code) ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
3993 3993
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
3994 3994
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
3995 3995
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4017,7 +4017,7 @@  discard block
 block discarded – undo
4017 4017
 		// phpcs:enable
4018 4018
 		global $langs;
4019 4019
 
4020
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4020
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4021 4021
 		if ($num > 0) {
4022 4022
 			return 0; // Cache already loaded
4023 4023
 		}
@@ -4027,7 +4027,7 @@  discard block
 block discarded – undo
4027 4027
 		$langs->load('propal');
4028 4028
 
4029 4029
 		$sql = "SELECT rowid, code, label, position";
4030
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4030
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4031 4031
 		$sql .= " WHERE active > 0";
4032 4032
 
4033 4033
 		$resql = $this->db->query($sql);
@@ -4038,7 +4038,7 @@  discard block
 block discarded – undo
4038 4038
 				$obj = $this->db->fetch_object($resql);
4039 4039
 
4040 4040
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4041
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != ("AvailabilityType" . $obj->code) ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4041
+				$label = ($langs->trans("AvailabilityType".$obj->code) != ("AvailabilityType".$obj->code) ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4042 4042
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4043 4043
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4044 4044
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4070,17 +4070,17 @@  discard block
 block discarded – undo
4070 4070
 
4071 4071
 		$this->load_cache_availability();
4072 4072
 
4073
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4073
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4074 4074
 
4075
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4075
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4076 4076
 		if ($addempty) {
4077 4077
 			print '<option value="0">&nbsp;</option>';
4078 4078
 		}
4079 4079
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4080 4080
 			if ($selected == $id) {
4081
-				print '<option value="' . $id . '" selected>';
4081
+				print '<option value="'.$id.'" selected>';
4082 4082
 			} else {
4083
-				print '<option value="' . $id . '">';
4083
+				print '<option value="'.$id.'">';
4084 4084
 			}
4085 4085
 			print dol_escape_htmltag($arrayavailability['label']);
4086 4086
 			print '</option>';
@@ -4101,13 +4101,13 @@  discard block
 block discarded – undo
4101 4101
 	{
4102 4102
 		global $langs;
4103 4103
 
4104
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4104
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4105 4105
 		if ($num > 0) {
4106 4106
 			return 0; // Cache already loaded
4107 4107
 		}
4108 4108
 
4109 4109
 		$sql = "SELECT rowid, code, label";
4110
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4110
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4111 4111
 		$sql .= " WHERE active > 0";
4112 4112
 
4113 4113
 		$resql = $this->db->query($sql);
@@ -4120,8 +4120,8 @@  discard block
 block discarded – undo
4120 4120
 
4121 4121
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4122 4122
 				$label = ($obj->label != '-' ? $obj->label : '');
4123
-				if ($langs->trans("DemandReasonType" . $obj->code) != ("DemandReasonType" . $obj->code)) {
4124
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4123
+				if ($langs->trans("DemandReasonType".$obj->code) != ("DemandReasonType".$obj->code)) {
4124
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4125 4125
 				}
4126 4126
 				if ($langs->trans($obj->code) != $obj->code) {
4127 4127
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4161,9 +4161,9 @@  discard block
 block discarded – undo
4161 4161
 
4162 4162
 		$this->loadCacheInputReason();
4163 4163
 
4164
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4164
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4165 4165
 		if ($addempty) {
4166
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4166
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4167 4167
 		}
4168 4168
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4169 4169
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4171,9 +4171,9 @@  discard block
 block discarded – undo
4171 4171
 			}
4172 4172
 
4173 4173
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4174
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4174
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4175 4175
 			} else {
4176
-				print '<option value="' . $arraydemandreason['id'] . '">';
4176
+				print '<option value="'.$arraydemandreason['id'].'">';
4177 4177
 			}
4178 4178
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4179 4179
 			print $langs->trans($label);
@@ -4183,7 +4183,7 @@  discard block
 block discarded – undo
4183 4183
 		if ($user->admin && empty($notooltip)) {
4184 4184
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4185 4185
 		}
4186
-		print ajax_combobox('select_' . $htmlname);
4186
+		print ajax_combobox('select_'.$htmlname);
4187 4187
 	}
4188 4188
 
4189 4189
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4198,7 +4198,7 @@  discard block
 block discarded – undo
4198 4198
 		// phpcs:enable
4199 4199
 		global $langs;
4200 4200
 
4201
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4201
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4202 4202
 		if ($num > 0) {
4203 4203
 			return $num; // Cache already loaded
4204 4204
 		}
@@ -4208,8 +4208,8 @@  discard block
 block discarded – undo
4208 4208
 		$this->cache_types_paiements = array();
4209 4209
 
4210 4210
 		$sql = "SELECT id, code, libelle as label, type, active";
4211
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4212
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4211
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4212
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4213 4213
 
4214 4214
 		$resql = $this->db->query($sql);
4215 4215
 		if ($resql) {
@@ -4219,7 +4219,7 @@  discard block
 block discarded – undo
4219 4219
 				$obj = $this->db->fetch_object($resql);
4220 4220
 
4221 4221
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4222
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4222
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4223 4223
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4224 4224
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4225 4225
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4285,17 +4285,17 @@  discard block
 block discarded – undo
4285 4285
 		global $langs, $user, $conf;
4286 4286
 
4287 4287
 		$out = '';
4288
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4288
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4289 4289
 
4290 4290
 		$this->load_cache_conditions_paiements();
4291 4291
 
4292 4292
 		// Set default value if not already set by caller
4293 4293
 		if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) {
4294
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4294
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4295 4295
 			$selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID;
4296 4296
 		}
4297 4297
 
4298
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4298
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4299 4299
 		if ($addempty) {
4300 4300
 			$out .= '<option value="0">&nbsp;</option>';
4301 4301
 		}
@@ -4309,9 +4309,9 @@  discard block
 block discarded – undo
4309 4309
 
4310 4310
 			if ($selected == $id) {
4311 4311
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4312
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4312
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4313 4313
 			} else {
4314
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4314
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4315 4315
 			}
4316 4316
 			$label = $arrayconditions['label'];
4317 4317
 
@@ -4329,21 +4329,21 @@  discard block
 block discarded – undo
4329 4329
 		$out .= ajax_combobox($htmlname);
4330 4330
 
4331 4331
 		if ($deposit_percent >= 0) {
4332
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4333
-			$out .= $langs->trans('DepositPercent') . ' : ';
4334
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4332
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4333
+			$out .= $langs->trans('DepositPercent').' : ';
4334
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4335 4335
 			$out .= '</span>';
4336 4336
 			$out .= '
4337
-				<script nonce="' . getNonce() . '">
4337
+				<script nonce="' . getNonce().'">
4338 4338
 					$(document).ready(function () {
4339
-						$("#' . $htmlname . '").change(function () {
4339
+						$("#' . $htmlname.'").change(function () {
4340 4340
 							let $selected = $(this).find("option:selected");
4341 4341
 							let depositPercent = $selected.attr("data-deposit_percent");
4342 4342
 
4343 4343
 							if (depositPercent.length > 0) {
4344
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4344
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4345 4345
 							} else {
4346
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4346
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4347 4347
 							}
4348 4348
 
4349 4349
 							return true;
@@ -4381,7 +4381,7 @@  discard block
 block discarded – undo
4381 4381
 
4382 4382
 		$out = '';
4383 4383
 
4384
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4384
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4385 4385
 
4386 4386
 		$filterarray = array();
4387 4387
 		if ($filtertype == 'CRDT') {
@@ -4396,11 +4396,11 @@  discard block
 block discarded – undo
4396 4396
 
4397 4397
 		// Set default value if not already set by caller
4398 4398
 		if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) {
4399
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4399
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4400 4400
 			$selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID;
4401 4401
 		}
4402 4402
 
4403
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4403
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4404 4404
 		if ($empty) {
4405 4405
 			$out .= '<option value="">&nbsp;</option>';
4406 4406
 		}
@@ -4421,13 +4421,13 @@  discard block
 block discarded – undo
4421 4421
 			}
4422 4422
 
4423 4423
 			if ($format == 0) {
4424
-				$out .= '<option value="' . $id . '"';
4424
+				$out .= '<option value="'.$id.'"';
4425 4425
 			} elseif ($format == 1) {
4426
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4426
+				$out .= '<option value="'.$arraytypes['code'].'"';
4427 4427
 			} elseif ($format == 2) {
4428
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4428
+				$out .= '<option value="'.$arraytypes['code'].'"';
4429 4429
 			} elseif ($format == 3) {
4430
-				$out .= '<option value="' . $id . '"';
4430
+				$out .= '<option value="'.$id.'"';
4431 4431
 			}
4432 4432
 			// Print attribute selected or not
4433 4433
 			if ($format == 1 || $format == 2) {
@@ -4457,7 +4457,7 @@  discard block
 block discarded – undo
4457 4457
 		if ($user->admin && !$noadmininfo) {
4458 4458
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4459 4459
 		}
4460
-		$out .= ajax_combobox('select' . $htmlname);
4460
+		$out .= ajax_combobox('select'.$htmlname);
4461 4461
 
4462 4462
 		if (empty($nooutput)) {
4463 4463
 			print $out;
@@ -4479,22 +4479,22 @@  discard block
 block discarded – undo
4479 4479
 	{
4480 4480
 		global $langs;
4481 4481
 
4482
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4482
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4483 4483
 		$options = array(
4484 4484
 			'HT' => $langs->trans("HT"),
4485 4485
 			'TTC' => $langs->trans("TTC")
4486 4486
 		);
4487 4487
 		foreach ($options as $id => $value) {
4488 4488
 			if ($selected == $id) {
4489
-				$return .= '<option value="' . $id . '" selected>' . $value;
4489
+				$return .= '<option value="'.$id.'" selected>'.$value;
4490 4490
 			} else {
4491
-				$return .= '<option value="' . $id . '">' . $value;
4491
+				$return .= '<option value="'.$id.'">'.$value;
4492 4492
 			}
4493 4493
 			$return .= '</option>';
4494 4494
 		}
4495 4495
 		$return .= '</select>';
4496 4496
 		if ($addjscombo) {
4497
-			$return .= ajax_combobox('select_' . $htmlname);
4497
+			$return .= ajax_combobox('select_'.$htmlname);
4498 4498
 		}
4499 4499
 
4500 4500
 		return $return;
@@ -4512,7 +4512,7 @@  discard block
 block discarded – undo
4512 4512
 		// phpcs:enable
4513 4513
 		global $langs;
4514 4514
 
4515
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4515
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4516 4516
 		if ($num > 0) {
4517 4517
 			return $num; // Cache already loaded
4518 4518
 		}
@@ -4522,8 +4522,8 @@  discard block
 block discarded – undo
4522 4522
 		$this->cache_transport_mode = array();
4523 4523
 
4524 4524
 		$sql = "SELECT rowid, code, label, active";
4525
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4526
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4525
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4526
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4527 4527
 
4528 4528
 		$resql = $this->db->query($sql);
4529 4529
 		if ($resql) {
@@ -4533,7 +4533,7 @@  discard block
 block discarded – undo
4533 4533
 				$obj = $this->db->fetch_object($resql);
4534 4534
 
4535 4535
 				// If traduction exist, we use it else we take the default label
4536
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4536
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4537 4537
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4538 4538
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4539 4539
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4567,11 +4567,11 @@  discard block
 block discarded – undo
4567 4567
 	{
4568 4568
 		global $langs, $user;
4569 4569
 
4570
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4570
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4571 4571
 
4572 4572
 		$this->load_cache_transport_mode();
4573 4573
 
4574
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4574
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4575 4575
 		if ($empty) {
4576 4576
 			print '<option value="">&nbsp;</option>';
4577 4577
 		}
@@ -4587,13 +4587,13 @@  discard block
 block discarded – undo
4587 4587
 			}
4588 4588
 
4589 4589
 			if ($format == 0) {
4590
-				print '<option value="' . $id . '"';
4590
+				print '<option value="'.$id.'"';
4591 4591
 			} elseif ($format == 1) {
4592
-				print '<option value="' . $arraytypes['code'] . '"';
4592
+				print '<option value="'.$arraytypes['code'].'"';
4593 4593
 			} elseif ($format == 2) {
4594
-				print '<option value="' . $arraytypes['code'] . '"';
4594
+				print '<option value="'.$arraytypes['code'].'"';
4595 4595
 			} elseif ($format == 3) {
4596
-				print '<option value="' . $id . '"';
4596
+				print '<option value="'.$id.'"';
4597 4597
 			}
4598 4598
 			// If text is selected, we compare with code, else with id
4599 4599
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4641,31 +4641,31 @@  discard block
 block discarded – undo
4641 4641
 		$langs->load("deliveries");
4642 4642
 
4643 4643
 		$sql = "SELECT rowid, code, libelle as label";
4644
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4644
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4645 4645
 		$sql .= " WHERE active > 0";
4646 4646
 		if ($filtre) {
4647
-			$sql .= " AND " . $filtre;
4647
+			$sql .= " AND ".$filtre;
4648 4648
 		}
4649 4649
 		$sql .= " ORDER BY libelle ASC";
4650 4650
 
4651
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4651
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4652 4652
 		$result = $this->db->query($sql);
4653 4653
 		if ($result) {
4654 4654
 			$num = $this->db->num_rows($result);
4655 4655
 			$i = 0;
4656 4656
 			if ($num) {
4657
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4657
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4658 4658
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4659 4659
 					print '<option value="-1">&nbsp;</option>';
4660 4660
 				}
4661 4661
 				while ($i < $num) {
4662 4662
 					$obj = $this->db->fetch_object($result);
4663 4663
 					if ($selected == $obj->rowid) {
4664
-						print '<option value="' . $obj->rowid . '" selected>';
4664
+						print '<option value="'.$obj->rowid.'" selected>';
4665 4665
 					} else {
4666
-						print '<option value="' . $obj->rowid . '">';
4666
+						print '<option value="'.$obj->rowid.'">';
4667 4667
 					}
4668
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4668
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4669 4669
 					print '</option>';
4670 4670
 					$i++;
4671 4671
 				}
@@ -4674,7 +4674,7 @@  discard block
 block discarded – undo
4674 4674
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4675 4675
 				}
4676 4676
 
4677
-				print ajax_combobox('select' . $htmlname);
4677
+				print ajax_combobox('select'.$htmlname);
4678 4678
 			} else {
4679 4679
 				print $langs->trans("NoShippingMethodDefined");
4680 4680
 			}
@@ -4699,16 +4699,16 @@  discard block
 block discarded – undo
4699 4699
 		$langs->load("deliveries");
4700 4700
 
4701 4701
 		if ($htmlname != "none") {
4702
-			print '<form method="POST" action="' . $page . '">';
4702
+			print '<form method="POST" action="'.$page.'">';
4703 4703
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4704
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4704
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4705 4705
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4706
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4706
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4707 4707
 			print '</form>';
4708 4708
 		} else {
4709 4709
 			if ($selected) {
4710 4710
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
4711
-				print $langs->trans("SendingMethod" . strtoupper($code));
4711
+				print $langs->trans("SendingMethod".strtoupper($code));
4712 4712
 			} else {
4713 4713
 				print "&nbsp;";
4714 4714
 			}
@@ -4731,10 +4731,10 @@  discard block
 block discarded – undo
4731 4731
 
4732 4732
 		$opt = '<option value="" selected></option>';
4733 4733
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
4734
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
4735
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
4734
+		$sql .= ' FROM '.$this->db->prefix().'facture';
4735
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
4736 4736
 		$sql .= ' AND situation_counter >= 1';
4737
-		$sql .= ' AND fk_soc = ' . (int) $socid;
4737
+		$sql .= ' AND fk_soc = '.(int) $socid;
4738 4738
 		$sql .= ' AND type <> 2';
4739 4739
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
4740 4740
 		$resql = $this->db->query($sql);
@@ -4752,19 +4752,19 @@  discard block
 block discarded – undo
4752 4752
 						//Not prov?
4753 4753
 						if (substr($obj->ref, 1, 4) != 'PROV') {
4754 4754
 							if ($selected == $obj->rowid) {
4755
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
4755
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
4756 4756
 							} else {
4757
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
4757
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
4758 4758
 							}
4759 4759
 						}
4760 4760
 					}
4761 4761
 				}
4762 4762
 			}
4763 4763
 		} else {
4764
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
4764
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
4765 4765
 		}
4766 4766
 		if ($opt == '<option value ="" selected></option>') {
4767
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
4767
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
4768 4768
 		}
4769 4769
 		return $opt;
4770 4770
 	}
@@ -4784,12 +4784,12 @@  discard block
 block discarded – undo
4784 4784
 
4785 4785
 		$langs->load('products');
4786 4786
 
4787
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
4787
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
4788 4788
 
4789
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
4789
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
4790 4790
 		$sql .= ' WHERE active > 0';
4791 4791
 		if (!empty($unit_type)) {
4792
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
4792
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
4793 4793
 		}
4794 4794
 		$sql .= " ORDER BY sortorder";
4795 4795
 
@@ -4801,14 +4801,14 @@  discard block
 block discarded – undo
4801 4801
 
4802 4802
 			while ($res = $this->db->fetch_object($resql)) {
4803 4803
 				$unitLabel = $res->label;
4804
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
4805
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
4804
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
4805
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
4806 4806
 				}
4807 4807
 
4808 4808
 				if ($selected == $res->rowid) {
4809
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
4809
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
4810 4810
 				} else {
4811
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
4811
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
4812 4812
 				}
4813 4813
 			}
4814 4814
 			$return .= '</select>';
@@ -4843,23 +4843,23 @@  discard block
 block discarded – undo
4843 4843
 		$num = 0;
4844 4844
 
4845 4845
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
4846
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
4847
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
4846
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
4847
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
4848 4848
 		if ($status != 2) {
4849
-			$sql .= " AND clos = " . (int) $status;
4849
+			$sql .= " AND clos = ".(int) $status;
4850 4850
 		}
4851 4851
 		if ($filtre) {
4852
-			$sql .= " AND " . $filtre;
4852
+			$sql .= " AND ".$filtre;
4853 4853
 		}
4854 4854
 		$sql .= " ORDER BY label";
4855 4855
 
4856
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
4856
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
4857 4857
 		$result = $this->db->query($sql);
4858 4858
 		if ($result) {
4859 4859
 			$num = $this->db->num_rows($result);
4860 4860
 			$i = 0;
4861 4861
 			if ($num) {
4862
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4862
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4863 4863
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4864 4864
 					$out .= '<option value="-1">&nbsp;</option>';
4865 4865
 				}
@@ -4867,27 +4867,27 @@  discard block
 block discarded – undo
4867 4867
 				while ($i < $num) {
4868 4868
 					$obj = $this->db->fetch_object($result);
4869 4869
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
4870
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
4870
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
4871 4871
 					} else {
4872
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
4872
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
4873 4873
 					}
4874 4874
 					$out .= trim($obj->label);
4875 4875
 					if ($showcurrency) {
4876
-						$out .= ' (' . $obj->currency_code . ')';
4876
+						$out .= ' ('.$obj->currency_code.')';
4877 4877
 					}
4878 4878
 					if ($status == 2 && $obj->status == 1) {
4879
-						$out .= ' (' . $langs->trans("Closed") . ')';
4879
+						$out .= ' ('.$langs->trans("Closed").')';
4880 4880
 					}
4881 4881
 					$out .= '</option>';
4882 4882
 					$i++;
4883 4883
 				}
4884 4884
 				$out .= "</select>";
4885
-				$out .= ajax_combobox('select' . $htmlname);
4885
+				$out .= ajax_combobox('select'.$htmlname);
4886 4886
 			} else {
4887 4887
 				if ($status == 0) {
4888
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
4888
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
4889 4889
 				} else {
4890
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
4890
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
4891 4891
 				}
4892 4892
 			}
4893 4893
 		} else {
@@ -4923,23 +4923,23 @@  discard block
 block discarded – undo
4923 4923
 		$num = 0;
4924 4924
 
4925 4925
 		$sql = "SELECT rowid, name, fk_country, status, entity";
4926
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
4926
+		$sql .= " FROM ".$this->db->prefix()."establishment";
4927 4927
 		$sql .= " WHERE 1=1";
4928 4928
 		if ($status != 2) {
4929
-			$sql .= " AND status = " . (int) $status;
4929
+			$sql .= " AND status = ".(int) $status;
4930 4930
 		}
4931 4931
 		if ($filtre) {
4932
-			$sql .= " AND " . $filtre;
4932
+			$sql .= " AND ".$filtre;
4933 4933
 		}
4934 4934
 		$sql .= " ORDER BY name";
4935 4935
 
4936
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
4936
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
4937 4937
 		$result = $this->db->query($sql);
4938 4938
 		if ($result) {
4939 4939
 			$num = $this->db->num_rows($result);
4940 4940
 			$i = 0;
4941 4941
 			if ($num) {
4942
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4942
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4943 4943
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4944 4944
 					print '<option value="-1">&nbsp;</option>';
4945 4945
 				}
@@ -4947,13 +4947,13 @@  discard block
 block discarded – undo
4947 4947
 				while ($i < $num) {
4948 4948
 					$obj = $this->db->fetch_object($result);
4949 4949
 					if ($selected == $obj->rowid) {
4950
-						print '<option value="' . $obj->rowid . '" selected>';
4950
+						print '<option value="'.$obj->rowid.'" selected>';
4951 4951
 					} else {
4952
-						print '<option value="' . $obj->rowid . '">';
4952
+						print '<option value="'.$obj->rowid.'">';
4953 4953
 					}
4954 4954
 					print trim($obj->name);
4955 4955
 					if ($status == 2 && $obj->status == 1) {
4956
-						print ' (' . $langs->trans("Closed") . ')';
4956
+						print ' ('.$langs->trans("Closed").')';
4957 4957
 					}
4958 4958
 					print '</option>';
4959 4959
 					$i++;
@@ -4961,9 +4961,9 @@  discard block
 block discarded – undo
4961 4961
 				print "</select>";
4962 4962
 			} else {
4963 4963
 				if ($status == 0) {
4964
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
4964
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
4965 4965
 				} else {
4966
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
4966
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
4967 4967
 				}
4968 4968
 			}
4969 4969
 
@@ -4987,20 +4987,20 @@  discard block
 block discarded – undo
4987 4987
 	{
4988 4988
 		global $langs;
4989 4989
 		if ($htmlname != "none") {
4990
-			print '<form method="POST" action="' . $page . '">';
4990
+			print '<form method="POST" action="'.$page.'">';
4991 4991
 			print '<input type="hidden" name="action" value="setbankaccount">';
4992
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4992
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4993 4993
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
4994 4994
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
4995 4995
 			if ($nbaccountfound > 0) {
4996
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
4996
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
4997 4997
 			}
4998 4998
 			print '</form>';
4999 4999
 		} else {
5000 5000
 			$langs->load('banks');
5001 5001
 
5002 5002
 			if ($selected) {
5003
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5003
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5004 5004
 				$bankstatic = new Account($this->db);
5005 5005
 				$result = $bankstatic->fetch($selected);
5006 5006
 				if ($result) {
@@ -5038,19 +5038,19 @@  discard block
 block discarded – undo
5038 5038
 		global $conf, $langs;
5039 5039
 		$langs->load("categories");
5040 5040
 
5041
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5041
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5042 5042
 
5043 5043
 		// For backward compatibility
5044 5044
 		if (is_numeric($type)) {
5045
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5045
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5046 5046
 		}
5047 5047
 
5048 5048
 		if ($type === Categorie::TYPE_BANK_LINE) {
5049 5049
 			// TODO Move this into common category feature
5050 5050
 			$cate_arbo = array();
5051 5051
 			$sql = "SELECT c.label, c.rowid";
5052
-			$sql .= " FROM " . $this->db->prefix() . "bank_categ as c";
5053
-			$sql .= " WHERE entity = " . $conf->entity;
5052
+			$sql .= " FROM ".$this->db->prefix()."bank_categ as c";
5053
+			$sql .= " WHERE entity = ".$conf->entity;
5054 5054
 			$sql .= " ORDER BY c.label";
5055 5055
 			$result = $this->db->query($sql);
5056 5056
 			if ($result) {
@@ -5074,10 +5074,10 @@  discard block
 block discarded – undo
5074 5074
 
5075 5075
 		$outarray = array();
5076 5076
 
5077
-		$output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5077
+		$output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5078 5078
 		if (is_array($cate_arbo)) {
5079 5079
 			if (!count($cate_arbo)) {
5080
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5080
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5081 5081
 			} else {
5082 5082
 				$output .= '<option value="-1">&nbsp;</option>';
5083 5083
 				foreach ($cate_arbo as $key => $value) {
@@ -5086,8 +5086,8 @@  discard block
 block discarded – undo
5086 5086
 					} else {
5087 5087
 						$add = '';
5088 5088
 					}
5089
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5090
-					$output .= ' data-html="' . dol_escape_htmltag(img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"') . dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle')) . '"';
5089
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5090
+					$output .= ' data-html="'.dol_escape_htmltag(img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"').dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle')).'"';
5091 5091
 					$output .= '>';
5092 5092
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5093 5093
 					$output .= '</option>';
@@ -5128,7 +5128,7 @@  discard block
 block discarded – undo
5128 5128
 	public function form_confirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5129 5129
 	{
5130 5130
 		// phpcs:enable
5131
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5131
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5132 5132
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5133 5133
 	}
5134 5134
 
@@ -5163,7 +5163,7 @@  discard block
 block discarded – undo
5163 5163
 	{
5164 5164
 		global $langs, $conf;
5165 5165
 
5166
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5166
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5167 5167
 		$formconfirm = '';
5168 5168
 		$inputok = array();
5169 5169
 		$inputko = array();
@@ -5187,27 +5187,27 @@  discard block
 block discarded – undo
5187 5187
 			foreach ($formquestion as $key => $input) {
5188 5188
 				if (is_array($input) && !empty($input)) {
5189 5189
 					if ($input['type'] == 'hidden') {
5190
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5191
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5190
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5191
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5192 5192
 
5193
-						$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";
5193
+						$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";
5194 5194
 					}
5195 5195
 				}
5196 5196
 			}
5197 5197
 
5198 5198
 			// Now add questions
5199 5199
 			$moreonecolumn = '';
5200
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5200
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5201 5201
 			foreach ($formquestion as $key => $input) {
5202 5202
 				if (is_array($input) && !empty($input)) {
5203
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5204
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5205
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5203
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5204
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5205
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5206 5206
 
5207 5207
 					if ($input['type'] == 'text') {
5208
-						$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";
5208
+						$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";
5209 5209
 					} elseif ($input['type'] == 'password') {
5210
-						$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";
5210
+						$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";
5211 5211
 					} elseif ($input['type'] == 'textarea') {
5212 5212
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5213 5213
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5215,8 +5215,8 @@  discard block
 block discarded – undo
5215 5215
 						$more .= '</textarea>';
5216 5216
 						$more .= '</div></div>'."\n";*/
5217 5217
 						$moreonecolumn .= '<div class="margintoponly">';
5218
-						$moreonecolumn .= $input['label'] . '<br>';
5219
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5218
+						$moreonecolumn .= $input['label'].'<br>';
5219
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5220 5220
 						$moreonecolumn .= $input['value'];
5221 5221
 						$moreonecolumn .= '</textarea>';
5222 5222
 						$moreonecolumn .= '</div>';
@@ -5233,20 +5233,20 @@  discard block
 block discarded – undo
5233 5233
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5234 5234
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5235 5235
 
5236
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5236
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5237 5237
 						if (!empty($input['label'])) {
5238
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5238
+							$more .= $input['label'].'</div><div class="tagtd left">';
5239 5239
 						}
5240 5240
 						if ($input['type'] == 'select') {
5241 5241
 							$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);
5242 5242
 						} else {
5243 5243
 							$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);
5244 5244
 						}
5245
-						$more .= '</div></div>' . "\n";
5245
+						$more .= '</div></div>'."\n";
5246 5246
 					} elseif ($input['type'] == 'checkbox') {
5247 5247
 						$more .= '<div class="tagtr">';
5248
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5249
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5248
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5249
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5250 5250
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5251 5251
 							$more .= ' checked';
5252 5252
 						}
@@ -5257,19 +5257,19 @@  discard block
 block discarded – undo
5257 5257
 							$more .= ' disabled';
5258 5258
 						}
5259 5259
 						$more .= ' /></div>';
5260
-						$more .= '</div>' . "\n";
5260
+						$more .= '</div>'."\n";
5261 5261
 					} elseif ($input['type'] == 'radio') {
5262 5262
 						$i = 0;
5263 5263
 						foreach ($input['values'] as $selkey => $selval) {
5264 5264
 							$more .= '<div class="tagtr">';
5265 5265
 							if (isset($input['label'])) {
5266 5266
 								if ($i == 0) {
5267
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5267
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5268 5268
 								} else {
5269
-									$more .= '<div clas="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5269
+									$more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5270 5270
 								}
5271 5271
 							}
5272
-							$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;
5272
+							$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;
5273 5273
 							if (!empty($input['disabled'])) {
5274 5274
 								$more .= ' disabled';
5275 5275
 							}
@@ -5277,12 +5277,12 @@  discard block
 block discarded – undo
5277 5277
 								$more .= ' checked="checked"';
5278 5278
 							}
5279 5279
 							$more .= ' /> ';
5280
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5281
-							$more .= '</div></div>' . "\n";
5280
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5281
+							$more .= '</div></div>'."\n";
5282 5282
 							$i++;
5283 5283
 						}
5284 5284
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5285
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5285
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5286 5286
 						$more .= '<div class="tagtd">';
5287 5287
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5288 5288
 						$h = $m = 0;
@@ -5300,24 +5300,24 @@  discard block
 block discarded – undo
5300 5300
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5301 5301
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5302 5302
 						if (!empty($input['label'])) {
5303
-							$more .= $input['label'] . '</div><div class="tagtd">';
5303
+							$more .= $input['label'].'</div><div class="tagtd">';
5304 5304
 						}
5305 5305
 						$more .= $input['value'];
5306
-						$more .= '</div></div>' . "\n";
5306
+						$more .= '</div></div>'."\n";
5307 5307
 					} elseif ($input['type'] == 'onecolumn') {
5308 5308
 						$moreonecolumn .= '<div class="margintoponly">';
5309 5309
 						$moreonecolumn .= $input['value'];
5310
-						$moreonecolumn .= '</div>' . "\n";
5310
+						$moreonecolumn .= '</div>'."\n";
5311 5311
 					} elseif ($input['type'] == 'hidden') {
5312 5312
 						// Do nothing more, already added by a previous loop
5313 5313
 					} elseif ($input['type'] == 'separator') {
5314 5314
 						$more .= '<br>';
5315 5315
 					} else {
5316
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5316
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5317 5317
 					}
5318 5318
 				}
5319 5319
 			}
5320
-			$more .= '</div>' . "\n";
5320
+			$more .= '</div>'."\n";
5321 5321
 			$more .= $moreonecolumn;
5322 5322
 		}
5323 5323
 
@@ -5339,10 +5339,10 @@  discard block
 block discarded – undo
5339 5339
 				$button = $useajax;
5340 5340
 				$useajax = 1;
5341 5341
 				$autoOpen = false;
5342
-				$dialogconfirm .= '-' . $button;
5342
+				$dialogconfirm .= '-'.$button;
5343 5343
 			}
5344
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5345
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5344
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5345
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5346 5346
 
5347 5347
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5348 5348
 			if (is_array($formquestion)) {
@@ -5364,24 +5364,24 @@  discard block
 block discarded – undo
5364 5364
 			}
5365 5365
 
5366 5366
 			// Show JQuery confirm box.
5367
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5367
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5368 5368
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5369
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5369
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5370 5370
 			}
5371 5371
 			if (!empty($more)) {
5372
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5372
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5373 5373
 			}
5374
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : '');
5375
-			$formconfirm .= '</div>' . "\n";
5374
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : '');
5375
+			$formconfirm .= '</div>'."\n";
5376 5376
 
5377
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5378
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5377
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5378
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5379 5379
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5380 5380
 			$formconfirm .= 'jQuery(document).ready(function() {
5381 5381
             $(function() {
5382
-            	$( "#' . $dialogconfirm . '" ).dialog(
5382
+            	$( "#' . $dialogconfirm.'" ).dialog(
5383 5383
             	{
5384
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5384
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5385 5385
 			if ($newselectedchoice == 'no') {
5386 5386
 				$formconfirm .= '
5387 5387
 						open: function() {
@@ -5391,24 +5391,24 @@  discard block
 block discarded – undo
5391 5391
 
5392 5392
 			$jsforcursor = '';
5393 5393
 			if ($useajax == 1) {
5394
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5395
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5394
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5395
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5396 5396
 			}
5397 5397
 
5398 5398
 			$postconfirmas = 'GET';
5399 5399
 
5400 5400
 			$formconfirm .= '
5401 5401
                     resizable: false,
5402
-                    height: "' . $height . '",
5403
-                    width: "' . $width . '",
5402
+                    height: "' . $height.'",
5403
+                    width: "' . $width.'",
5404 5404
                     modal: true,
5405 5405
                     closeOnEscape: false,
5406 5406
                     buttons: {
5407
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5408
-							var options = "token=' . urlencode(newToken()) . '";
5409
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5410
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5411
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5407
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5408
+							var options = "token=' . urlencode(newToken()).'";
5409
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5410
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5411
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5412 5412
 
5413 5413
                          	if (inputok.length > 0) {
5414 5414
                          		$.each(inputok, function(i, inputname) {
@@ -5442,11 +5442,11 @@  discard block
 block discarded – undo
5442 5442
 							}
5443 5443
 	                        $(this).dialog("close");
5444 5444
                         },
5445
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5446
-                        	var options = "token=' . urlencode(newToken()) . '";
5447
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5448
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5449
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5445
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5446
+                        	var options = "token=' . urlencode(newToken()).'";
5447
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5448
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5449
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5450 5450
                          	if (inputko.length > 0) {
5451 5451
                          		$.each(inputko, function(i, inputname) {
5452 5452
                          			var more = "";
@@ -5478,10 +5478,10 @@  discard block
 block discarded – undo
5478 5478
                 }
5479 5479
                 );
5480 5480
 
5481
-            	var button = "' . $button . '";
5481
+            	var button = "' . $button.'";
5482 5482
             	if (button.length > 0) {
5483 5483
                 	$( "#" + button ).click(function() {
5484
-                		$("#' . $dialogconfirm . '").dialog("open");
5484
+                		$("#' . $dialogconfirm.'").dialog("open");
5485 5485
         			});
5486 5486
                 }
5487 5487
             });
@@ -5489,44 +5489,44 @@  discard block
 block discarded – undo
5489 5489
             </script>';
5490 5490
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5491 5491
 		} else {
5492
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5492
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5493 5493
 
5494 5494
 			if (empty($disableformtag)) {
5495
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n";
5495
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
5496 5496
 			}
5497 5497
 
5498
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5499
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5498
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5499
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5500 5500
 
5501
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5501
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5502 5502
 
5503 5503
 			// Line title
5504 5504
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5505
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5506
-			$formconfirm .= '</td></tr>' . "\n";
5505
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5506
+			$formconfirm .= '</td></tr>'."\n";
5507 5507
 
5508 5508
 			// Line text
5509 5509
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5510
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5510
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5511 5511
 			}
5512 5512
 
5513 5513
 			// Line form fields
5514 5514
 			if ($more) {
5515
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5515
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5516 5516
 				$formconfirm .= $more;
5517
-				$formconfirm .= '</td></tr>' . "\n";
5517
+				$formconfirm .= '</td></tr>'."\n";
5518 5518
 			}
5519 5519
 
5520 5520
 			// Line with question
5521 5521
 			$formconfirm .= '<tr class="valid">';
5522
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5522
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5523 5523
 			$formconfirm .= '<td class="valid center">';
5524 5524
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5525
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5525
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5526 5526
 			$formconfirm .= '</td>';
5527
-			$formconfirm .= '</tr>' . "\n";
5527
+			$formconfirm .= '</tr>'."\n";
5528 5528
 
5529
-			$formconfirm .= '</table>' . "\n";
5529
+			$formconfirm .= '</table>'."\n";
5530 5530
 
5531 5531
 			if (empty($disableformtag)) {
5532 5532
 				$formconfirm .= "</form>\n";
@@ -5535,7 +5535,7 @@  discard block
 block discarded – undo
5535 5535
 
5536 5536
 			if (!empty($conf->use_javascript_ajax)) {
5537 5537
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5538
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5538
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5539 5539
 				$formconfirm .= '
5540 5540
 				$(document).ready(function () {
5541 5541
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5547,7 +5547,7 @@  discard block
 block discarded – undo
5547 5547
 					});
5548 5548
 				});
5549 5549
 				';
5550
-				$formconfirm .= '</script>' . "\n";
5550
+				$formconfirm .= '</script>'."\n";
5551 5551
 			}
5552 5552
 
5553 5553
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5579,8 +5579,8 @@  discard block
 block discarded – undo
5579 5579
 		// phpcs:enable
5580 5580
 		global $langs;
5581 5581
 
5582
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5583
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5582
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5583
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5584 5584
 
5585 5585
 		$out = '';
5586 5586
 
@@ -5588,11 +5588,11 @@  discard block
 block discarded – undo
5588 5588
 
5589 5589
 		$langs->load("project");
5590 5590
 		if ($htmlname != "none") {
5591
-			$out .= '<form method="post" action="' . $page . '">';
5591
+			$out .= '<form method="post" action="'.$page.'">';
5592 5592
 			$out .= '<input type="hidden" name="action" value="classin">';
5593
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5593
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5594 5594
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5595
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5595
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5596 5596
 			$out .= '</form>';
5597 5597
 		} else {
5598 5598
 			$out .= '<span class="project_head_block">';
@@ -5601,7 +5601,7 @@  discard block
 block discarded – undo
5601 5601
 				$projet->fetch($selected);
5602 5602
 				$out .= $projet->getNomUrl(0, '', 1);
5603 5603
 			} else {
5604
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5604
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5605 5605
 			}
5606 5606
 			$out .= '</span>';
5607 5607
 		}
@@ -5638,14 +5638,14 @@  discard block
 block discarded – undo
5638 5638
 		$out = '';
5639 5639
 
5640 5640
 		if ($htmlname != "none") {
5641
-			$out .= '<form method="POST" action="' . $page . '">';
5641
+			$out .= '<form method="POST" action="'.$page.'">';
5642 5642
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5643
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5643
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5644 5644
 			if ($type) {
5645
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5645
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5646 5646
 			}
5647 5647
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5648
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5648
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5649 5649
 			$out .= '</form>';
5650 5650
 		} else {
5651 5651
 			if ($selected) {
@@ -5690,12 +5690,12 @@  discard block
 block discarded – undo
5690 5690
 		// phpcs:enable
5691 5691
 		global $langs;
5692 5692
 		if ($htmlname != "none") {
5693
-			print '<form method="post" action="' . $page . '">';
5693
+			print '<form method="post" action="'.$page.'">';
5694 5694
 			print '<input type="hidden" name="action" value="setavailability">';
5695
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5695
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5696 5696
 			$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
5697
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5698
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
5697
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5698
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
5699 5699
 			print '</form>';
5700 5700
 		} else {
5701 5701
 			if ($selected) {
@@ -5721,11 +5721,11 @@  discard block
 block discarded – undo
5721 5721
 	{
5722 5722
 		global $langs;
5723 5723
 		if ($htmlname != "none") {
5724
-			print '<form method="post" action="' . $page . '">';
5724
+			print '<form method="post" action="'.$page.'">';
5725 5725
 			print '<input type="hidden" name="action" value="setdemandreason">';
5726
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5726
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5727 5727
 			$this->selectInputReason($selected, $htmlname, -1, $addempty);
5728
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5728
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5729 5729
 			print '</form>';
5730 5730
 		} else {
5731 5731
 			if ($selected) {
@@ -5765,17 +5765,17 @@  discard block
 block discarded – undo
5765 5765
 		$ret = '';
5766 5766
 
5767 5767
 		if ($htmlname != "none") {
5768
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5769
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
5770
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
5768
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5769
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
5770
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
5771 5771
 			if ($type) {
5772
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5772
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5773 5773
 			}
5774 5774
 			$ret .= '<table class="nobordernopadding">';
5775 5775
 			$ret .= '<tr><td>';
5776
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
5776
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
5777 5777
 			$ret .= '</td>';
5778
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
5778
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
5779 5779
 			$ret .= '</tr></table></form>';
5780 5780
 		} else {
5781 5781
 			if ($displayhour) {
@@ -5810,15 +5810,15 @@  discard block
 block discarded – undo
5810 5810
 		global $langs;
5811 5811
 
5812 5812
 		if ($htmlname != "none") {
5813
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5814
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
5815
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5813
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5814
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
5815
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5816 5816
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
5817
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5817
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5818 5818
 			print '</form>';
5819 5819
 		} else {
5820 5820
 			if ($selected) {
5821
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
5821
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
5822 5822
 				$theuser = new User($this->db);
5823 5823
 				$theuser->fetch($selected);
5824 5824
 				print $theuser->getNomUrl(1);
@@ -5851,14 +5851,14 @@  discard block
 block discarded – undo
5851 5851
 
5852 5852
 		$out = '';
5853 5853
 		if ($htmlname != "none") {
5854
-			$out .= '<form method="POST" action="' . $page . '">';
5854
+			$out .= '<form method="POST" action="'.$page.'">';
5855 5855
 			$out .= '<input type="hidden" name="action" value="setmode">';
5856
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5856
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5857 5857
 			if ($type) {
5858
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5858
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5859 5859
 			}
5860 5860
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
5861
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5861
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5862 5862
 			$out .= '</form>';
5863 5863
 		} else {
5864 5864
 			if ($selected) {
@@ -5891,11 +5891,11 @@  discard block
 block discarded – undo
5891 5891
 	{
5892 5892
 		global $langs;
5893 5893
 		if ($htmlname != "none") {
5894
-			print '<form method="POST" action="' . $page . '">';
5894
+			print '<form method="POST" action="'.$page.'">';
5895 5895
 			print '<input type="hidden" name="action" value="settransportmode">';
5896
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5896
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5897 5897
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
5898
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5898
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5899 5899
 			print '</form>';
5900 5900
 		} else {
5901 5901
 			if ($selected) {
@@ -5922,11 +5922,11 @@  discard block
 block discarded – undo
5922 5922
 		// phpcs:enable
5923 5923
 		global $langs;
5924 5924
 		if ($htmlname != "none") {
5925
-			print '<form method="POST" action="' . $page . '">';
5925
+			print '<form method="POST" action="'.$page.'">';
5926 5926
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
5927
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5927
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5928 5928
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
5929
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5929
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5930 5930
 			print '</form>';
5931 5931
 		} else {
5932 5932
 			dol_include_once('/core/lib/company.lib.php');
@@ -5951,21 +5951,21 @@  discard block
 block discarded – undo
5951 5951
 		global $langs, $mysoc, $conf;
5952 5952
 
5953 5953
 		if ($htmlname != "none") {
5954
-			print '<form method="POST" action="' . $page . '">';
5954
+			print '<form method="POST" action="'.$page.'">';
5955 5955
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
5956
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5957
-			print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
5956
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5957
+			print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
5958 5958
 			print '<select name="calculation_mode">';
5959
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
5960
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
5959
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
5960
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
5961 5961
 			print '</select> ';
5962
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5962
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5963 5963
 			print '</form>';
5964 5964
 		} else {
5965 5965
 			if (!empty($rate)) {
5966 5966
 				print price($rate, 1, $langs, 1, 0);
5967 5967
 				if ($currency && $rate != 1) {
5968
-					print ' &nbsp; (' . price($rate, 1, $langs, 1, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')';
5968
+					print ' &nbsp; ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')';
5969 5969
 				}
5970 5970
 			} else {
5971 5971
 				print 1;
@@ -5996,9 +5996,9 @@  discard block
 block discarded – undo
5996 5996
 		// phpcs:enable
5997 5997
 		global $conf, $langs;
5998 5998
 		if ($htmlname != "none") {
5999
-			print '<form method="post" action="' . $page . '">';
5999
+			print '<form method="post" action="'.$page.'">';
6000 6000
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6001
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6001
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6002 6002
 			print '<div class="inline-block">';
6003 6003
 			if (!empty($discount_type)) {
6004 6004
 				if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
@@ -6036,24 +6036,24 @@  discard block
 block discarded – undo
6036 6036
 			print '</div>';
6037 6037
 			if (empty($hidelist)) {
6038 6038
 				print '<div class="inline-block" style="padding-right: 10px">';
6039
-				$newfilter = 'discount_type=' . intval($discount_type);
6039
+				$newfilter = 'discount_type='.intval($discount_type);
6040 6040
 				if (!empty($discount_type)) {
6041 6041
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6042 6042
 				} else {
6043 6043
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6044 6044
 				}
6045 6045
 				if ($filter) {
6046
-					$newfilter .= ' AND (' . $filter . ')';
6046
+					$newfilter .= ' AND ('.$filter.')';
6047 6047
 				}
6048 6048
 				// output the combo of discounts
6049 6049
 				$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
6050 6050
 				if ($nbqualifiedlines > 0) {
6051
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6051
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6052 6052
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6053
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6053
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6054 6054
 					}
6055 6055
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6056
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6056
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6057 6057
 					}
6058 6058
 
6059 6059
 					print '>';
@@ -6093,23 +6093,23 @@  discard block
 block discarded – undo
6093 6093
 		global $langs, $conf;
6094 6094
 
6095 6095
 		if ($htmlname != "none") {
6096
-			print '<form method="post" action="' . $page . '">';
6096
+			print '<form method="post" action="'.$page.'">';
6097 6097
 			print '<input type="hidden" name="action" value="set_contact">';
6098
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6098
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6099 6099
 			print '<table class="nobordernopadding">';
6100 6100
 			print '<tr><td>';
6101 6101
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6102 6102
 			$num = $this->num;
6103 6103
 			if ($num == 0) {
6104 6104
 				$addcontact = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6105
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6105
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6106 6106
 			}
6107 6107
 			print '</td>';
6108
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6108
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6109 6109
 			print '</tr></table></form>';
6110 6110
 		} else {
6111 6111
 			if ($selected) {
6112
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6112
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6113 6113
 				$contact = new Contact($this->db);
6114 6114
 				$contact->fetch($selected);
6115 6115
 				print $contact->getFullName($langs);
@@ -6144,20 +6144,20 @@  discard block
 block discarded – undo
6144 6144
 
6145 6145
 		$out = '';
6146 6146
 		if ($htmlname != "none") {
6147
-			$out .= '<form method="post" action="' . $page . '">';
6147
+			$out .= '<form method="post" action="'.$page.'">';
6148 6148
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6149
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6149
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6150 6150
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6151
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6151
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6152 6152
 			$out .= '</form>';
6153 6153
 		} else {
6154 6154
 			if ($selected) {
6155
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6155
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6156 6156
 				$soc = new Societe($this->db);
6157 6157
 				$soc->fetch($selected);
6158 6158
 				$out .= $soc->getNomUrl(0, '');
6159 6159
 			} else {
6160
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6160
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6161 6161
 			}
6162 6162
 		}
6163 6163
 
@@ -6207,22 +6207,22 @@  discard block
 block discarded – undo
6207 6207
 			$selected = 'EUR'; // Pour compatibilite
6208 6208
 		}
6209 6209
 
6210
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6210
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6211 6211
 		if ($useempty) {
6212 6212
 			$out .= '<option value="-1" selected></option>';
6213 6213
 		}
6214 6214
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6215 6215
 			$labeltoshow = $currency['label'];
6216 6216
 			if ($mode == 1) {
6217
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6217
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6218 6218
 			} else {
6219
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6219
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6220 6220
 			}
6221 6221
 
6222 6222
 			if ($selected && $selected == $code_iso) {
6223
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6223
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6224 6224
 			} else {
6225
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6225
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6226 6226
 			}
6227 6227
 			$out .= $labeltoshow;
6228 6228
 			$out .= '</option>';
@@ -6233,7 +6233,7 @@  discard block
 block discarded – undo
6233 6233
 		}
6234 6234
 
6235 6235
 		// Make select dynamic
6236
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6236
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6237 6237
 		$out .= ajax_combobox($htmlname);
6238 6238
 
6239 6239
 		return $out;
@@ -6259,10 +6259,10 @@  discard block
 block discarded – undo
6259 6259
 
6260 6260
 		$TCurrency = array();
6261 6261
 
6262
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6263
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6262
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6263
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6264 6264
 		if ($filter) {
6265
-			$sql .= " AND " . $filter;
6265
+			$sql .= " AND ".$filter;
6266 6266
 		}
6267 6267
 		$resql = $this->db->query($sql);
6268 6268
 		if ($resql) {
@@ -6272,7 +6272,7 @@  discard block
 block discarded – undo
6272 6272
 		}
6273 6273
 
6274 6274
 		$out = '';
6275
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6275
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6276 6276
 		if ($useempty) {
6277 6277
 			$out .= '<option value="">&nbsp;</option>';
6278 6278
 		}
@@ -6284,13 +6284,13 @@  discard block
 block discarded – undo
6284 6284
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6285 6285
 				if (isset($TCurrency[$code_iso])) {
6286 6286
 					if (!empty($selected) && $selected == $code_iso) {
6287
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6287
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6288 6288
 					} else {
6289
-						$out .= '<option value="' . $code_iso . '">';
6289
+						$out .= '<option value="'.$code_iso.'">';
6290 6290
 					}
6291 6291
 
6292 6292
 					$out .= $currency['label'];
6293
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6293
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6294 6294
 					$out .= '</option>';
6295 6295
 				}
6296 6296
 			}
@@ -6299,7 +6299,7 @@  discard block
 block discarded – undo
6299 6299
 		$out .= '</select>';
6300 6300
 
6301 6301
 		// Make select dynamic
6302
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6302
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6303 6303
 		$out .= ajax_combobox($htmlname);
6304 6304
 
6305 6305
 		return $out;
@@ -6326,11 +6326,11 @@  discard block
 block discarded – undo
6326 6326
 		dol_syslog(__METHOD__, LOG_DEBUG);
6327 6327
 
6328 6328
 		$sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly";
6329
-		$sql .= " FROM " . $this->db->prefix() . "c_tva as t, " . $this->db->prefix() . "c_country as c";
6329
+		$sql .= " FROM ".$this->db->prefix()."c_tva as t, ".$this->db->prefix()."c_country as c";
6330 6330
 		$sql .= " WHERE t.fk_pays = c.rowid";
6331 6331
 		$sql .= " AND t.active > 0";
6332 6332
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6333
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6333
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6334 6334
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6335 6335
 
6336 6336
 		$resql = $this->db->query($sql);
@@ -6348,22 +6348,22 @@  discard block
 block discarded – undo
6348 6348
 					$this->cache_vatrates[$i]['localtax2'] = $obj->localtax2;
6349 6349
 					$this->cache_vatrates[$i]['localtax2_type'] = $obj->localtax1_type;
6350 6350
 
6351
-					$this->cache_vatrates[$i]['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6352
-					$this->cache_vatrates[$i]['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
6351
+					$this->cache_vatrates[$i]['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6352
+					$this->cache_vatrates[$i]['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
6353 6353
 					$positiverates = '';
6354 6354
 					if ($obj->taux) {
6355
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6355
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6356 6356
 					}
6357 6357
 					if ($obj->localtax1) {
6358
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6358
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6359 6359
 					}
6360 6360
 					if ($obj->localtax2) {
6361
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6361
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6362 6362
 					}
6363 6363
 					if (empty($positiverates)) {
6364 6364
 						$positiverates = '0';
6365 6365
 					}
6366
-					$this->cache_vatrates[$i]['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6366
+					$this->cache_vatrates[$i]['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6367 6367
 				}
6368 6368
 
6369 6369
 				return $num;
@@ -6381,7 +6381,7 @@  discard block
 block discarded – undo
6381 6381
 				return -1;
6382 6382
 			}
6383 6383
 		} else {
6384
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6384
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6385 6385
 			return -2;
6386 6386
 		}
6387 6387
 	}
@@ -6433,9 +6433,9 @@  discard block
 block discarded – undo
6433 6433
 		// Check parameters
6434 6434
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6435 6435
 			if ($societe_vendeuse->id == $mysoc->id) {
6436
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6436
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6437 6437
 			} else {
6438
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6438
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6439 6439
 			}
6440 6440
 			return $return;
6441 6441
 		}
@@ -6447,25 +6447,25 @@  discard block
 block discarded – undo
6447 6447
 		// Define list of countries to use to search VAT rates to show
6448 6448
 		// First we defined code_country to use to find list
6449 6449
 		if (is_object($societe_vendeuse)) {
6450
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6450
+			$code_country = "'".$societe_vendeuse->country_code."'";
6451 6451
 		} else {
6452
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6452
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6453 6453
 		}
6454 6454
 		if (!empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) {    // If option to have vat for end customer for services is on
6455
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6455
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6456 6456
 			if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) {
6457 6457
 				// We also add the buyer country code
6458 6458
 				if (is_numeric($type)) {
6459 6459
 					if ($type == 1) { // We know product is a service
6460
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6460
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6461 6461
 					}
6462 6462
 				} elseif (!$idprod) {  // We don't know type of product
6463
-					$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6463
+					$code_country .= ",'".$societe_acheteuse->country_code."'";
6464 6464
 				} else {
6465 6465
 					$prodstatic = new Product($this->db);
6466 6466
 					$prodstatic->fetch($idprod);
6467 6467
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6468
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6468
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6469 6469
 					}
6470 6470
 				}
6471 6471
 			}
@@ -6517,13 +6517,13 @@  discard block
 block discarded – undo
6517 6517
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6518 6518
 				// of using supplier invoices (this is a very bad idea !)
6519 6519
 				if (empty($conf->global->EXPENSEREPORT_OVERRIDE_VAT)) {
6520
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6520
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6521 6521
 					$disabled = true;
6522 6522
 				}
6523 6523
 			}
6524 6524
 
6525 6525
 			if (!$options_only) {
6526
-				$return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6526
+				$return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6527 6527
 			}
6528 6528
 
6529 6529
 			$selectedfound = false;
@@ -6537,13 +6537,13 @@  discard block
 block discarded – undo
6537 6537
 				$key = $rate['txtva'];
6538 6538
 				$key .= $rate['nprtva'] ? '*' : '';
6539 6539
 				if ($mode > 0 && $rate['code']) {
6540
-					$key .= ' (' . $rate['code'] . ')';
6540
+					$key .= ' ('.$rate['code'].')';
6541 6541
 				}
6542 6542
 				if ($mode < 0) {
6543 6543
 					$key = $rate['rowid'];
6544 6544
 				}
6545 6545
 
6546
-				$return .= '<option value="' . $key . '"';
6546
+				$return .= '<option value="'.$key.'"';
6547 6547
 				if (!$selectedfound) {
6548 6548
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6549 6549
 						if ($defaultcode == $rate['code']) {
@@ -6614,7 +6614,7 @@  discard block
 block discarded – undo
6614 6614
 	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 = '', $addplusone = '', $adddateof = '')
6615 6615
 	{
6616 6616
 		// phpcs:enable
6617
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6617
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6618 6618
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
6619 6619
 		if (!empty($nooutput)) {
6620 6620
 			return $retstring;
@@ -6643,11 +6643,11 @@  discard block
 block discarded – undo
6643 6643
 	{
6644 6644
 		global $langs;
6645 6645
 
6646
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6646
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6647 6647
 		if ($forcenewline) {
6648 6648
 			$ret .= '<br>';
6649 6649
 		}
6650
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6650
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6651 6651
 		return $ret;
6652 6652
 	}
6653 6653
 
@@ -6713,7 +6713,7 @@  discard block
 block discarded – undo
6713 6713
 		$orig_set_time = $set_time;
6714 6714
 
6715 6715
 		if ($set_time === '' && $emptydate == 0) {
6716
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
6716
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
6717 6717
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
6718 6718
 				$set_time = dol_now($gm);
6719 6719
 			} else {
@@ -6781,38 +6781,38 @@  discard block
 block discarded – undo
6781 6781
 				// Calendrier popup version eldy
6782 6782
 				if ($usecalendar == "eldy") {
6783 6783
 					// Input area to enter date manually
6784
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
6784
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6785 6785
 					$retstring .= ($disabled ? ' disabled' : '');
6786
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6786
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6787 6787
 					$retstring .= '>';
6788 6788
 
6789 6789
 					// Icon calendar
6790 6790
 					$retstringbuttom = '';
6791 6791
 					if (!$disabled) {
6792
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
6793
-						$base = DOL_URL_ROOT . '/core/';
6794
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
6795
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
6792
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
6793
+						$base = DOL_URL_ROOT.'/core/';
6794
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
6795
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
6796 6796
 					} else {
6797
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6797
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6798 6798
 					}
6799
-					$retstring = $retstringbuttom . $retstring;
6799
+					$retstring = $retstringbuttom.$retstring;
6800 6800
 
6801
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6802
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6803
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6801
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6802
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6803
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6804 6804
 				} elseif ($usecalendar == 'jquery') {
6805 6805
 					if (!$disabled) {
6806 6806
 						// Output javascript for datepicker
6807 6807
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100));
6808 6808
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100));
6809 6809
 
6810
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
6811
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
6812
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
6810
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
6811
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
6812
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
6813 6813
 							autoclose: true,
6814 6814
 							todayHighlight: true,
6815
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
6815
+							yearRange: '" . $minYear.":".$maxYear."',";
6816 6816
 						if (!empty($conf->dol_use_jmobile)) {
6817 6817
 							$retstring .= "
6818 6818
 								beforeShow: function (input, datePicker) {
@@ -6827,7 +6827,7 @@  discard block
 block discarded – undo
6827 6827
 						if (empty($conf->global->MAIN_POPUP_CALENDAR_ON_FOCUS)) {
6828 6828
 							$retstring .= "
6829 6829
 								showOn: 'button',	/* both has problem with autocompletion */
6830
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
6830
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
6831 6831
 								buttonImageOnly: true";
6832 6832
 						}
6833 6833
 						$retstring .= "
@@ -6839,8 +6839,8 @@  discard block
 block discarded – undo
6839 6839
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
6840 6840
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6841 6841
 					$retstring .= ($disabled ? ' disabled' : '');
6842
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
6843
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6842
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
6843
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6844 6844
 					$retstring .= '>';
6845 6845
 
6846 6846
 					// Icone calendrier
@@ -6855,40 +6855,40 @@  discard block
 block discarded – undo
6855 6855
 						$retstring.='});';
6856 6856
 						$retstring.="</script>";*/
6857 6857
 					} else {
6858
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6859
-						$retsring = $retstringbutton . $retstring;
6858
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6859
+						$retsring = $retstringbutton.$retstring;
6860 6860
 					}
6861 6861
 
6862 6862
 					$retstring .= '</div>';
6863
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6864
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6865
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6863
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6864
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6865
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6866 6866
 				} else {
6867 6867
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
6868 6868
 				}
6869 6869
 			} else {
6870 6870
 				// Show date with combo selects
6871 6871
 				// Day
6872
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
6872
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
6873 6873
 
6874 6874
 				if ($emptydate || $set_time == -1) {
6875 6875
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6876 6876
 				}
6877 6877
 
6878 6878
 				for ($day = 1; $day <= 31; $day++) {
6879
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
6879
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
6880 6880
 				}
6881 6881
 
6882 6882
 				$retstring .= "</select>";
6883 6883
 
6884
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
6884
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
6885 6885
 				if ($emptydate || $set_time == -1) {
6886 6886
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6887 6887
 				}
6888 6888
 
6889 6889
 				// Month
6890 6890
 				for ($month = 1; $month <= 12; $month++) {
6891
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
6891
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
6892 6892
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
6893 6893
 					$retstring .= "</option>";
6894 6894
 				}
@@ -6896,12 +6896,12 @@  discard block
 block discarded – undo
6896 6896
 
6897 6897
 				// Year
6898 6898
 				if ($emptydate || $set_time == -1) {
6899
-					$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 . '">';
6899
+					$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.'">';
6900 6900
 				} else {
6901
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
6901
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
6902 6902
 
6903 6903
 					for ($year = $syear - 10; $year < $syear + 10; $year++) {
6904
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
6904
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
6905 6905
 					}
6906 6906
 					$retstring .= "</select>\n";
6907 6907
 				}
@@ -6925,15 +6925,15 @@  discard block
 block discarded – undo
6925 6925
 				}
6926 6926
 			}
6927 6927
 			// Show hour
6928
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
6928
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
6929 6929
 			if ($emptyhours) {
6930 6930
 				$retstring .= '<option value="-1">&nbsp;</option>';
6931 6931
 			}
6932 6932
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
6933 6933
 				if (strlen($hour) < 2) {
6934
-					$hour = "0" . $hour;
6934
+					$hour = "0".$hour;
6935 6935
 				}
6936
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
6936
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
6937 6937
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
6938 6938
 				$retstring .= '</option>';
6939 6939
 			}
@@ -6946,19 +6946,19 @@  discard block
 block discarded – undo
6946 6946
 
6947 6947
 		if ($m) {
6948 6948
 			// Show minutes
6949
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
6949
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
6950 6950
 			if ($emptyhours) {
6951 6951
 				$retstring .= '<option value="-1">&nbsp;</option>';
6952 6952
 			}
6953 6953
 			for ($min = 0; $min < 60; $min += $stepminutes) {
6954 6954
 				if (strlen($min) < 2) {
6955
-					$min = "0" . $min;
6955
+					$min = "0".$min;
6956 6956
 				}
6957
-				$retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>';
6957
+				$retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>';
6958 6958
 			}
6959 6959
 			$retstring .= '</select>';
6960 6960
 
6961
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
6961
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
6962 6962
 		}
6963 6963
 
6964 6964
 		if ($d && $h) {
@@ -6981,10 +6981,10 @@  discard block
 block discarded – undo
6981 6981
 
6982 6982
 			// Generate the date part, depending on the use or not of the javascript calendar
6983 6983
 			if ($addnowlink == 1) { // server time expressed in user time setup
6984
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
6985
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
6986
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
6987
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
6984
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
6985
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
6986
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
6987
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
6988 6988
 			} elseif ($addnowlink == 2) {
6989 6989
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
6990 6990
 				 * This break application for foreign languages.
@@ -6993,10 +6993,10 @@  discard block
 block discarded – undo
6993 6993
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
6994 6994
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
6995 6995
 				*/
6996
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
6997
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
6998
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
6999
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
6996
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
6997
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
6998
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
6999
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7000 7000
 			}
7001 7001
 			/*if ($usecalendar == "eldy")
7002 7002
 			{
@@ -7016,11 +7016,11 @@  discard block
 block discarded – undo
7016 7016
 				}
7017 7017
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7018 7018
 				if ($addnowlink == 1) {
7019
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7020
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7019
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7020
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7021 7021
 				} elseif ($addnowlink == 2) {
7022
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7023
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7022
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7023
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7024 7024
 				}
7025 7025
 
7026 7026
 				if ($fullday) {
@@ -7034,11 +7034,11 @@  discard block
 block discarded – undo
7034 7034
 				}
7035 7035
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7036 7036
 				if ($addnowlink == 1) {
7037
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7038
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7037
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7038
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7039 7039
 				} elseif ($addnowlink == 2) {
7040
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7041
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7040
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7041
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7042 7042
 				}
7043 7043
 				if ($fullday) {
7044 7044
 					$reset_scripts .= ' } ';
@@ -7046,7 +7046,7 @@  discard block
 block discarded – undo
7046 7046
 			}
7047 7047
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7048 7048
 			if ($reset_scripts && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
7049
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7049
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7050 7050
 				$retstring .= $langs->trans("Now");
7051 7051
 				$retstring .= '</button> ';
7052 7052
 			}
@@ -7058,16 +7058,16 @@  discard block
 block discarded – undo
7058 7058
 			$reset_scripts = "";
7059 7059
 
7060 7060
 			// Generate the date part, depending on the use or not of the javascript calendar
7061
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7062
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7063
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7064
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7061
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7062
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7063
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7064
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7065 7065
 			// Update the hour part
7066 7066
 			if ($h) {
7067 7067
 				if ($fullday) {
7068 7068
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7069 7069
 				}
7070
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7070
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7071 7071
 				if ($fullday) {
7072 7072
 					$reset_scripts .= ' } ';
7073 7073
 				}
@@ -7077,14 +7077,14 @@  discard block
 block discarded – undo
7077 7077
 				if ($fullday) {
7078 7078
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7079 7079
 				}
7080
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7080
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7081 7081
 				if ($fullday) {
7082 7082
 					$reset_scripts .= ' } ';
7083 7083
 				}
7084 7084
 			}
7085 7085
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7086 7086
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7087
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7087
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7088 7088
 				$retstring .= $langs->trans("DateStartPlusOne");
7089 7089
 				$retstring .= '</button> ';
7090 7090
 			}
@@ -7142,17 +7142,17 @@  discard block
 block discarded – undo
7142 7142
 			unset($TDurationTypes[$value]);
7143 7143
 		}
7144 7144
 
7145
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7145
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7146 7146
 		foreach ($TDurationTypes as $key => $typeduration) {
7147
-			$retstring .= '<option value="' . $key . '"';
7147
+			$retstring .= '<option value="'.$key.'"';
7148 7148
 			if ($key == $selected) {
7149 7149
 				$retstring .= " selected";
7150 7150
 			}
7151
-			$retstring .= ">" . $typeduration . "</option>";
7151
+			$retstring .= ">".$typeduration."</option>";
7152 7152
 		}
7153 7153
 		$retstring .= "</select>";
7154 7154
 
7155
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7155
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7156 7156
 
7157 7157
 		return $retstring;
7158 7158
 	}
@@ -7184,30 +7184,30 @@  discard block
 block discarded – undo
7184 7184
 
7185 7185
 		// Hours
7186 7186
 		if ($iSecond != '') {
7187
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7187
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7188 7188
 
7189 7189
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7190 7190
 			$minSelected = convertSecondToTime($iSecond, 'min');
7191 7191
 		}
7192 7192
 
7193 7193
 		if ($typehour == 'select') {
7194
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7194
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7195 7195
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7196
-				$retstring .= '<option value="' . $hour . '"';
7196
+				$retstring .= '<option value="'.$hour.'"';
7197 7197
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7198 7198
 					$retstring .= " selected";
7199 7199
 				}
7200
-				$retstring .= ">" . $hour . "</option>";
7200
+				$retstring .= ">".$hour."</option>";
7201 7201
 			}
7202 7202
 			$retstring .= "</select>";
7203 7203
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7204
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7204
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7205 7205
 		} else {
7206 7206
 			return 'BadValueForParameterTypeHour';
7207 7207
 		}
7208 7208
 
7209 7209
 		if ($typehour != 'text') {
7210
-			$retstring .= ' ' . $langs->trans('HourShort');
7210
+			$retstring .= ' '.$langs->trans('HourShort');
7211 7211
 		} else {
7212 7212
 			$retstring .= '<span class="">:</span>';
7213 7213
 		}
@@ -7222,21 +7222,21 @@  discard block
 block discarded – undo
7222 7222
 		}
7223 7223
 
7224 7224
 		if ($typehour == 'select' || $typehour == 'textselect') {
7225
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7225
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7226 7226
 			for ($min = 0; $min <= 55; $min = $min + 5) {
7227
-				$retstring .= '<option value="' . $min . '"';
7227
+				$retstring .= '<option value="'.$min.'"';
7228 7228
 				if (is_numeric($minSelected) && $minSelected == $min) {
7229 7229
 					$retstring .= ' selected';
7230 7230
 				}
7231
-				$retstring .= '>' . $min . '</option>';
7231
+				$retstring .= '>'.$min.'</option>';
7232 7232
 			}
7233 7233
 			$retstring .= "</select>";
7234 7234
 		} elseif ($typehour == 'text') {
7235
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7235
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7236 7236
 		}
7237 7237
 
7238 7238
 		if ($typehour != 'text') {
7239
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7239
+			$retstring .= ' '.$langs->trans('MinuteShort');
7240 7240
 		}
7241 7241
 
7242 7242
 		$retstring .= "</span>";
@@ -7282,7 +7282,7 @@  discard block
 block discarded – undo
7282 7282
 			$placeholder = '';
7283 7283
 
7284 7284
 			if ($selected && empty($selected_input_value)) {
7285
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7285
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7286 7286
 				$tickettmpselect = new Ticket($this->db);
7287 7287
 				$tickettmpselect->fetch($selected);
7288 7288
 				$selected_input_value = $tickettmpselect->ref;
@@ -7290,16 +7290,16 @@  discard block
 block discarded – undo
7290 7290
 			}
7291 7291
 
7292 7292
 			$urloption = '';
7293
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7293
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7294 7294
 
7295
-			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : ';
7295
+			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : ';
7296 7296
 			elseif ($hidelabel > 1) {
7297
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7297
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7298 7298
 				if ($hidelabel == 2) {
7299 7299
 					$out .= img_picto($langs->trans("Search"), 'search');
7300 7300
 				}
7301 7301
 			}
7302
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
7302
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
7303 7303
 			if ($hidelabel == 3) {
7304 7304
 				$out .= img_picto($langs->trans("Search"), 'search');
7305 7305
 			}
@@ -7343,8 +7343,8 @@  discard block
 block discarded – undo
7343 7343
 
7344 7344
 		$sql = "SELECT ";
7345 7345
 		$sql .= $selectFields;
7346
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7347
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7346
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7347
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7348 7348
 
7349 7349
 		// Add criteria on ref/label
7350 7350
 		if ($filterkey != '') {
@@ -7356,7 +7356,7 @@  discard block
 block discarded – undo
7356 7356
 			if (count($scrit) > 1) $sql .= "(";
7357 7357
 			foreach ($scrit as $crit) {
7358 7358
 				if ($i > 0) $sql .= " AND ";
7359
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7359
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7360 7360
 				$sql .= ")";
7361 7361
 				$i++;
7362 7362
 			}
@@ -7367,22 +7367,22 @@  discard block
 block discarded – undo
7367 7367
 		$sql .= $this->db->plimit($limit, 0);
7368 7368
 
7369 7369
 		// Build output string
7370
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7370
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7371 7371
 		$result = $this->db->query($sql);
7372 7372
 		if ($result) {
7373
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7374
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7373
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7374
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7375 7375
 
7376 7376
 			$num = $this->db->num_rows($result);
7377 7377
 
7378 7378
 			$events = null;
7379 7379
 
7380 7380
 			if (!$forcecombo) {
7381
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7381
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7382 7382
 				$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT);
7383 7383
 			}
7384 7384
 
7385
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7385
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7386 7386
 
7387 7387
 			$textifempty = '';
7388 7388
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7393,7 +7393,7 @@  discard block
 block discarded – undo
7393 7393
 			} else {
7394 7394
 				if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
7395 7395
 			}
7396
-			if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>';
7396
+			if ($showempty) $out .= '<option value="0" selected>'.$textifempty.'</option>';
7397 7397
 
7398 7398
 			$i = 0;
7399 7399
 			while ($num && $i < $num) {
@@ -7447,12 +7447,12 @@  discard block
 block discarded – undo
7447 7447
 		$outref = $objp->ref;
7448 7448
 		$outtype = $objp->fk_product_type;
7449 7449
 
7450
-		$opt = '<option value="' . $objp->rowid . '"';
7450
+		$opt = '<option value="'.$objp->rowid.'"';
7451 7451
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7452 7452
 		$opt .= '>';
7453 7453
 		$opt .= $objp->ref;
7454 7454
 		$objRef = $objp->ref;
7455
-		if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7455
+		if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7456 7456
 
7457 7457
 		$opt .= "</option>\n";
7458 7458
 		$optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype);
@@ -7490,7 +7490,7 @@  discard block
 block discarded – undo
7490 7490
 			$placeholder = '';
7491 7491
 
7492 7492
 			if ($selected && empty($selected_input_value)) {
7493
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7493
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7494 7494
 				$projecttmpselect = new Project($this->db);
7495 7495
 				$projecttmpselect->fetch($selected);
7496 7496
 				$selected_input_value = $projecttmpselect->ref;
@@ -7498,16 +7498,16 @@  discard block
 block discarded – undo
7498 7498
 			}
7499 7499
 
7500 7500
 			$urloption = '';
7501
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7501
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7502 7502
 
7503
-			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : ';
7503
+			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : ';
7504 7504
 			elseif ($hidelabel > 1) {
7505
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7505
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7506 7506
 				if ($hidelabel == 2) {
7507 7507
 					$out .= img_picto($langs->trans("Search"), 'search');
7508 7508
 				}
7509 7509
 			}
7510
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
7510
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
7511 7511
 			if ($hidelabel == 3) {
7512 7512
 				$out .= img_picto($langs->trans("Search"), 'search');
7513 7513
 			}
@@ -7550,8 +7550,8 @@  discard block
 block discarded – undo
7550 7550
 
7551 7551
 		$sql = "SELECT ";
7552 7552
 		$sql .= $selectFields;
7553
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7554
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7553
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7554
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7555 7555
 
7556 7556
 		// Add criteria on ref/label
7557 7557
 		if ($filterkey != '') {
@@ -7563,7 +7563,7 @@  discard block
 block discarded – undo
7563 7563
 			if (count($scrit) > 1) $sql .= "(";
7564 7564
 			foreach ($scrit as $crit) {
7565 7565
 				if ($i > 0) $sql .= " AND ";
7566
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7566
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7567 7567
 				$sql .= "";
7568 7568
 				$i++;
7569 7569
 			}
@@ -7574,22 +7574,22 @@  discard block
 block discarded – undo
7574 7574
 		$sql .= $this->db->plimit($limit, 0);
7575 7575
 
7576 7576
 		// Build output string
7577
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7577
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7578 7578
 		$result = $this->db->query($sql);
7579 7579
 		if ($result) {
7580
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7581
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7580
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7581
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7582 7582
 
7583 7583
 			$num = $this->db->num_rows($result);
7584 7584
 
7585 7585
 			$events = null;
7586 7586
 
7587 7587
 			if (!$forcecombo) {
7588
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7588
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7589 7589
 				$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
7590 7590
 			}
7591 7591
 
7592
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7592
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7593 7593
 
7594 7594
 			$textifempty = '';
7595 7595
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7600,7 +7600,7 @@  discard block
 block discarded – undo
7600 7600
 			} else {
7601 7601
 				if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
7602 7602
 			}
7603
-			if ($showempty) $out .= '<option value="0" selected>' . $textifempty . '</option>';
7603
+			if ($showempty) $out .= '<option value="0" selected>'.$textifempty.'</option>';
7604 7604
 
7605 7605
 			$i = 0;
7606 7606
 			while ($num && $i < $num) {
@@ -7657,12 +7657,12 @@  discard block
 block discarded – undo
7657 7657
 		$outlabel = $objp->label;
7658 7658
 		$outtype = $objp->fk_product_type;
7659 7659
 
7660
-		$opt = '<option value="' . $objp->rowid . '"';
7660
+		$opt = '<option value="'.$objp->rowid.'"';
7661 7661
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7662 7662
 		$opt .= '>';
7663 7663
 		$opt .= $objp->ref;
7664 7664
 		$objRef = $objp->ref;
7665
-		if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7665
+		if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7666 7666
 
7667 7667
 		$opt .= "</option>\n";
7668 7668
 		$optJson = array('key' => $outkey, 'value' => $outref, 'type' => $outtype);
@@ -7702,7 +7702,7 @@  discard block
 block discarded – undo
7702 7702
 			$urloption = '';
7703 7703
 
7704 7704
 			if ($selected && empty($selected_input_value)) {
7705
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7705
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7706 7706
 				$adherenttmpselect = new Adherent($this->db);
7707 7707
 				$adherenttmpselect->fetch($selected);
7708 7708
 				$selected_input_value = $adherenttmpselect->ref;
@@ -7711,16 +7711,16 @@  discard block
 block discarded – undo
7711 7711
 
7712 7712
 			$urloption = '';
7713 7713
 
7714
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7714
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7715 7715
 
7716
-			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel") . ' : ';
7716
+			if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : ';
7717 7717
 			elseif ($hidelabel > 1) {
7718
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7718
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7719 7719
 				if ($hidelabel == 2) {
7720 7720
 					$out .= img_picto($langs->trans("Search"), 'search');
7721 7721
 				}
7722 7722
 			}
7723
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
7723
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
7724 7724
 			if ($hidelabel == 3) {
7725 7725
 				$out .= img_picto($langs->trans("Search"), 'search');
7726 7726
 			}
@@ -7765,8 +7765,8 @@  discard block
 block discarded – undo
7765 7765
 
7766 7766
 		$sql = "SELECT ";
7767 7767
 		$sql .= $selectFields;
7768
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
7769
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
7768
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
7769
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
7770 7770
 
7771 7771
 		// Add criteria on ref/label
7772 7772
 		if ($filterkey != '') {
@@ -7778,35 +7778,35 @@  discard block
 block discarded – undo
7778 7778
 			if (count($scrit) > 1) $sql .= "(";
7779 7779
 			foreach ($scrit as $crit) {
7780 7780
 				if ($i > 0) $sql .= " AND ";
7781
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7782
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
7781
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
7782
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
7783 7783
 				$i++;
7784 7784
 			}
7785 7785
 			if (count($scrit) > 1) $sql .= ")";
7786 7786
 			$sql .= ')';
7787 7787
 		}
7788 7788
 		if ($status != -1) {
7789
-			$sql .= ' AND statut = ' . ((int) $status);
7789
+			$sql .= ' AND statut = '.((int) $status);
7790 7790
 		}
7791 7791
 		$sql .= $this->db->plimit($limit, 0);
7792 7792
 
7793 7793
 		// Build output string
7794
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
7794
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
7795 7795
 		$result = $this->db->query($sql);
7796 7796
 		if ($result) {
7797
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7798
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
7797
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7798
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
7799 7799
 
7800 7800
 			$num = $this->db->num_rows($result);
7801 7801
 
7802 7802
 			$events = null;
7803 7803
 
7804 7804
 			if (!$forcecombo) {
7805
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7805
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7806 7806
 				$out .= ajax_combobox($htmlname, $events, !empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT) ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
7807 7807
 			}
7808 7808
 
7809
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7809
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7810 7810
 
7811 7811
 			$textifempty = '';
7812 7812
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7818,7 +7818,7 @@  discard block
 block discarded – undo
7818 7818
 				if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
7819 7819
 			}
7820 7820
 			if ($showempty) {
7821
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
7821
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
7822 7822
 			}
7823 7823
 
7824 7824
 			$i = 0;
@@ -7874,11 +7874,11 @@  discard block
 block discarded – undo
7874 7874
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
7875 7875
 		$outtype = $objp->fk_adherent_type;
7876 7876
 
7877
-		$opt = '<option value="' . $objp->rowid . '"';
7877
+		$opt = '<option value="'.$objp->rowid.'"';
7878 7878
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7879 7879
 		$opt .= '>';
7880 7880
 		if (!empty($filterkey) && $filterkey != '') {
7881
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
7881
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
7882 7882
 		}
7883 7883
 		$opt .= $outlabel;
7884 7884
 		$opt .= "</option>\n";
@@ -7919,9 +7919,9 @@  discard block
 block discarded – undo
7919 7919
 		$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
7920 7920
 		$reg = array();
7921 7921
 		if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
7922
-			$InfoFieldList[4] = $reg[1];    // take the sort field
7922
+			$InfoFieldList[4] = $reg[1]; // take the sort field
7923 7923
 		}
7924
-		$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
7924
+		$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
7925 7925
 
7926 7926
 		$classname = $InfoFieldList[0];
7927 7927
 		$classpath = $InfoFieldList[1];
@@ -7945,8 +7945,8 @@  discard block
 block discarded – undo
7945 7945
 			}
7946 7946
 		}
7947 7947
 		if (!is_object($objecttmp)) {
7948
-			dol_syslog('Error bad setup of type for field ' . join(',', $InfoFieldList), LOG_WARNING);
7949
-			return 'Error bad setup of type for field ' . join(',', $InfoFieldList);
7948
+			dol_syslog('Error bad setup of type for field '.join(',', $InfoFieldList), LOG_WARNING);
7949
+			return 'Error bad setup of type for field '.join(',', $InfoFieldList);
7950 7950
 		}
7951 7951
 
7952 7952
 		//var_dump($filter);
@@ -7957,9 +7957,9 @@  discard block
 block discarded – undo
7957 7957
 		if ($prefixforautocompletemode == 'product') {
7958 7958
 			$prefixforautocompletemode = 'produit';
7959 7959
 		}
7960
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
7960
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
7961 7961
 
7962
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
7962
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
7963 7963
 		$out = '';
7964 7964
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString($confkeyforautocompletemode) && !$forcecombo) {
7965 7965
 			// No immediate load of all database
@@ -7970,15 +7970,15 @@  discard block
 block discarded – undo
7970 7970
 				//unset($objecttmp);
7971 7971
 			}
7972 7972
 
7973
-			$objectdesc = $classname . ':' . $classpath . ':' . $addcreatebuttonornot . ':' . $filter;
7974
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
7973
+			$objectdesc = $classname.':'.$classpath.':'.$addcreatebuttonornot.':'.$filter;
7974
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
7975 7975
 
7976 7976
 			// No immediate load of all database
7977
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdesc) . '&filter=' . urlencode($filter) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
7977
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdesc).'&filter='.urlencode($filter).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
7978 7978
 			// Activate the auto complete using ajax call.
7979 7979
 			$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
7980 7980
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
7981
-			$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) . '"' : '') . ' />';
7981
+			$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).'"' : '').' />';
7982 7982
 		} else {
7983 7983
 			// Immediate load of table record.
7984 7984
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8018,7 +8018,7 @@  discard block
 block discarded – undo
8018 8018
 		if ($prefixforautocompletemode == 'societe') {
8019 8019
 			$prefixforautocompletemode = 'company';
8020 8020
 		}
8021
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8021
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8022 8022
 
8023 8023
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8024 8024
 			$tmpfieldstoshow = '';
@@ -8027,7 +8027,7 @@  discard block
 block discarded – undo
8027 8027
 					continue;
8028 8028
 				}
8029 8029
 				if (!empty($val['showoncombobox'])) {
8030
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8030
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8031 8031
 				}
8032 8032
 			}
8033 8033
 			if ($tmpfieldstoshow) {
@@ -8055,18 +8055,18 @@  discard block
 block discarded – undo
8055 8055
 		$num = 0;
8056 8056
 
8057 8057
 		// Search data
8058
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8058
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8059 8059
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8060
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object";
8060
+			$sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object";
8061 8061
 		}
8062 8062
 		if (isset($objecttmp->ismultientitymanaged)) {
8063 8063
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8064 8064
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8065
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8065
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8066 8066
 			}
8067 8067
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8068 8068
 				if (empty($user->rights->societe->client->voir) && !$user->socid) {
8069
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8069
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8070 8070
 				}
8071 8071
 			}
8072 8072
 		}
@@ -8086,21 +8086,21 @@  discard block
 block discarded – undo
8086 8086
 			$sql .= " WHERE 1=1";
8087 8087
 			if (isset($objecttmp->ismultientitymanaged)) {
8088 8088
 				if ($objecttmp->ismultientitymanaged == 1) {
8089
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8089
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8090 8090
 				}
8091 8091
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8092
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8092
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8093 8093
 				}
8094 8094
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8095 8095
 					if ($objecttmp->element == 'societe') {
8096
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8096
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8097 8097
 					} else {
8098
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8098
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8099 8099
 					}
8100 8100
 				}
8101 8101
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8102 8102
 					if (empty($user->rights->societe->client->voir) && !$user->socid) {
8103
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8103
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8104 8104
 					}
8105 8105
 				}
8106 8106
 			}
@@ -8112,7 +8112,7 @@  discard block
 block discarded – undo
8112 8112
 				$errormessage = '';
8113 8113
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8114 8114
 				if ($errormessage) {
8115
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8115
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8116 8116
 				}
8117 8117
 			}
8118 8118
 		}
@@ -8124,7 +8124,7 @@  discard block
 block discarded – undo
8124 8124
 		$resql = $this->db->query($sql);
8125 8125
 		if ($resql) {
8126 8126
 			// Construct $out and $outarray
8127
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8127
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8128 8128
 
8129 8129
 			// 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
8130 8130
 			$textifempty = '&nbsp;';
@@ -8138,7 +8138,7 @@  discard block
 block discarded – undo
8138 8138
 				}
8139 8139
 			}
8140 8140
 			if ($showempty) {
8141
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8141
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8142 8142
 			}
8143 8143
 
8144 8144
 			$num = $this->db->num_rows($resql);
@@ -8161,9 +8161,9 @@  discard block
 block discarded – undo
8161 8161
 					}
8162 8162
 					if (empty($outputmode)) {
8163 8163
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8164
-							$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>';
8164
+							$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>';
8165 8165
 						} else {
8166
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8166
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8167 8167
 						}
8168 8168
 					} else {
8169 8169
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8176,10 +8176,10 @@  discard block
 block discarded – undo
8176 8176
 				}
8177 8177
 			}
8178 8178
 
8179
-			$out .= '</select>' . "\n";
8179
+			$out .= '</select>'."\n";
8180 8180
 
8181 8181
 			if (!$forcecombo) {
8182
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8182
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8183 8183
 				$out .= ajax_combobox($htmlname, null, (!empty($conf->global->$confkeyforautocompletemode) ? $conf->global->$confkeyforautocompletemode : 0));
8184 8184
 			}
8185 8185
 		} else {
@@ -8241,8 +8241,8 @@  discard block
 block discarded – undo
8241 8241
 			}
8242 8242
 		}
8243 8243
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8244
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8245
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8244
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8245
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8246 8246
 		$out .= '>'."\n";
8247 8247
 
8248 8248
 		if ($show_empty) {
@@ -8253,7 +8253,7 @@  discard block
 block discarded – undo
8253 8253
 			if (!is_numeric($show_empty)) {
8254 8254
 				$textforempty = $show_empty;
8255 8255
 			}
8256
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8256
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8257 8257
 		}
8258 8258
 		if (is_array($array)) {
8259 8259
 			// Translate
@@ -8276,7 +8276,7 @@  discard block
 block discarded – undo
8276 8276
 				if (is_array($tmpvalue)) {
8277 8277
 					$value = $tmpvalue['label'];
8278 8278
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8279
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8279
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8280 8280
 				} else {
8281 8281
 					$value = $tmpvalue;
8282 8282
 					$disabled = '';
@@ -8291,9 +8291,9 @@  discard block
 block discarded – undo
8291 8291
 				}
8292 8292
 				if ($key_in_label) {
8293 8293
 					if (empty($nohtmlescape)) {
8294
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8294
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8295 8295
 					} else {
8296
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8296
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8297 8297
 					}
8298 8298
 				} else {
8299 8299
 					if (empty($nohtmlescape)) {
@@ -8305,8 +8305,8 @@  discard block
 block discarded – undo
8305 8305
 						$selectOptionValue = '&nbsp;';
8306 8306
 					}
8307 8307
 				}
8308
-				$out .= '<option value="' . $key . '"';
8309
-				$out .= $style . $disabled;
8308
+				$out .= '<option value="'.$key.'"';
8309
+				$out .= $style.$disabled;
8310 8310
 				if (is_array($id)) {
8311 8311
 					if (in_array($key, $id) && !$disabled) {
8312 8312
 						$out .= ' selected'; // To preselect a value
@@ -8318,7 +8318,7 @@  discard block
 block discarded – undo
8318 8318
 					}
8319 8319
 				}
8320 8320
 				if ($nohtmlescape) {
8321
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8321
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8322 8322
 				}
8323 8323
 				if (is_array($tmpvalue)) {
8324 8324
 					foreach ($tmpvalue as $keyforvalue => $valueforvalue) {
@@ -8336,7 +8336,7 @@  discard block
 block discarded – undo
8336 8336
 			// Add code for jquery to use multiselect
8337 8337
 		if ($addjscombo && $jsbeautify) {
8338 8338
 			// Enhance with select2
8339
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8339
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8340 8340
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', ($show_empty < 0 ? (string) $show_empty : '-1'), $morecss);
8341 8341
 		}
8342 8342
 
@@ -8368,28 +8368,28 @@  discard block
 block discarded – undo
8368 8368
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8369 8369
 	{
8370 8370
 		global $conf, $langs;
8371
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8371
+		global $delayedhtmlcontent; // Will be used later outside of this function
8372 8372
 
8373 8373
 		// TODO Use an internal dolibarr component instead of select2
8374 8374
 		if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8375 8375
 			return '';
8376 8376
 		}
8377 8377
 
8378
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8378
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8379 8379
 
8380 8380
 		$outdelayed = '';
8381 8381
 		if (!empty($conf->use_javascript_ajax)) {
8382 8382
 			$tmpplugin = 'select2';
8383
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8384
-		    	<script nonce="' . getNonce() . '">
8383
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8384
+		    	<script nonce="' . getNonce().'">
8385 8385
 		    	$(document).ready(function () {
8386 8386
 
8387
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8387
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8388 8388
 
8389
-	                $(".' . $htmlname . '").select2({
8389
+	                $(".' . $htmlname.'").select2({
8390 8390
 				    	ajax: {
8391 8391
 					    	dir: "ltr",
8392
-					    	url: "' . $url . '",
8392
+					    	url: "' . $url.'",
8393 8393
 					    	dataType: \'json\',
8394 8394
 					    	delay: 250,
8395 8395
 					    	data: function (params) {
@@ -8416,9 +8416,9 @@  discard block
 block discarded – undo
8416 8416
 				    	},
8417 8417
 		 				language: select2arrayoflanguage,
8418 8418
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8419
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8419
+					    placeholder: "' . dol_escape_js($placeholder).'",
8420 8420
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8421
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8421
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8422 8422
 				        formatResult: function (result, container, query, escapeMarkup) {
8423 8423
 	                        return escapeMarkup(result.text);
8424 8424
 	                    },
@@ -8426,10 +8426,10 @@  discard block
 block discarded – undo
8426 8426
 
8427 8427
 	                ' . ($callurlonselect ? '
8428 8428
 	                /* Code to execute a GET when we select a value */
8429
-	                $(".' . $htmlname . '").change(function() {
8430
-				    	var selected = $(".' . $htmlname . '").val();
8429
+	                $(".' . $htmlname.'").change(function() {
8430
+				    	var selected = $(".' . $htmlname.'").val();
8431 8431
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8432
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8432
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8433 8433
 	    			    $.each( saveRemoteData, function( key, value ) {
8434 8434
 	    				        if (key == selected)
8435 8435
 	    			            {
@@ -8437,7 +8437,7 @@  discard block
 block discarded – undo
8437 8437
 	    			                 location.assign(value.url);
8438 8438
 	    			            }
8439 8439
 	                    });
8440
-	    			});' : '') . '
8440
+	    			});' : '').'
8441 8441
 
8442 8442
 	    	   });
8443 8443
 		       </script>';
@@ -8473,14 +8473,14 @@  discard block
 block discarded – undo
8473 8473
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8474 8474
 	{
8475 8475
 		global $conf, $langs;
8476
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8476
+		global $delayedhtmlcontent; // Will be used later outside of this function
8477 8477
 
8478 8478
 		// TODO Use an internal dolibarr component instead of select2
8479 8479
 		if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8480 8480
 			return '';
8481 8481
 		}
8482 8482
 
8483
-		$out = '<select type="text"'.($textfortitle? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8483
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8484 8484
 
8485 8485
 		$formattedarrayresult = array();
8486 8486
 
@@ -8495,20 +8495,20 @@  discard block
 block discarded – undo
8495 8495
 		$outdelayed = '';
8496 8496
 		if (!empty($conf->use_javascript_ajax)) {
8497 8497
 			$tmpplugin = 'select2';
8498
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8499
-				<script nonce="' . getNonce() . '">
8498
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8499
+				<script nonce="' . getNonce().'">
8500 8500
 				$(document).ready(function () {
8501
-					var data = ' . json_encode($formattedarrayresult) . ';
8501
+					var data = ' . json_encode($formattedarrayresult).';
8502 8502
 
8503
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8503
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8504 8504
 
8505
-					$(".' . $htmlname . '").select2({
8505
+					$(".' . $htmlname.'").select2({
8506 8506
 						data: data,
8507 8507
 						language: select2arrayoflanguage,
8508 8508
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8509
-						placeholder: "' . dol_escape_js($placeholder) . '",
8509
+						placeholder: "' . dol_escape_js($placeholder).'",
8510 8510
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8511
-						minimumInputLength: ' . $minimumInputLength . ',
8511
+						minimumInputLength: ' . $minimumInputLength.',
8512 8512
 						formatResult: function (result, container, query, escapeMarkup) {
8513 8513
 							return escapeMarkup(result.text);
8514 8514
 						},
@@ -8547,11 +8547,11 @@  discard block
 block discarded – undo
8547 8547
 
8548 8548
 					' . ($callurlonselect ? '
8549 8549
 					/* Code to execute a GET when we select a value */
8550
-					$(".' . $htmlname . '").change(function() {
8551
-						var selected = $(".' . $htmlname . '").val();
8550
+					$(".' . $htmlname.'").change(function() {
8551
+						var selected = $(".' . $htmlname.'").val();
8552 8552
 						console.log("We select "+selected)
8553 8553
 
8554
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
8554
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
8555 8555
 						$.each( saveRemoteData, function( key, value ) {
8556 8556
 							if (key == selected)
8557 8557
 							{
@@ -8559,7 +8559,7 @@  discard block
 block discarded – undo
8559 8559
 								location.assign(value.url);
8560 8560
 							}
8561 8561
 						});
8562
-					});' : '') . '
8562
+					});' : '').'
8563 8563
 
8564 8564
 				});
8565 8565
 				</script>';
@@ -8611,7 +8611,7 @@  discard block
 block discarded – undo
8611 8611
 		}
8612 8612
 
8613 8613
 		// Output select component
8614
-		$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
8614
+		$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n";
8615 8615
 		if (is_array($array) && !empty($array)) {
8616 8616
 			if ($value_as_key) {
8617 8617
 				$array = array_combine($array, $array);
@@ -8632,57 +8632,57 @@  discard block
 block discarded – undo
8632 8632
 						$tmplabelhtml = !empty($value['labelhtml']) ? $value['labelhtml'] : '';
8633 8633
 					}
8634 8634
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
8635
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
8635
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
8636 8636
 
8637
-					$out .= '<option value="' . $tmpkey . '"';
8637
+					$out .= '<option value="'.$tmpkey.'"';
8638 8638
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
8639 8639
 						$out .= ' selected';
8640 8640
 					}
8641 8641
 					if (!empty($tmplabelhtml)) {
8642
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8642
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8643 8643
 					} else {
8644
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
8645
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8644
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
8645
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8646 8646
 					}
8647 8647
 					$out .= '>';
8648 8648
 					$out .= dol_htmlentitiesbr($newval);
8649
-					$out .= '</option>' . "\n";
8649
+					$out .= '</option>'."\n";
8650 8650
 				}
8651 8651
 			}
8652 8652
 		}
8653
-		$out .= '</select>' . "\n";
8653
+		$out .= '</select>'."\n";
8654 8654
 
8655 8655
 		// Add code for jquery to use multiselect
8656 8656
 		if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) {
8657
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
8658
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
8657
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
8658
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
8659 8659
 			if ($addjscombo == 1) {
8660 8660
 				$tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
8661
-				$out .= 'function formatResult(record, container) {' . "\n";
8661
+				$out .= 'function formatResult(record, container) {'."\n";
8662 8662
 				// If property html set, we decode html entities and use this.
8663 8663
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
8664 8664
 				$out .= '	if ($(record.element).attr("data-html") != undefined) { return htmlEntityDecodeJs($(record.element).attr("data-html")); }'."\n";
8665 8665
 				$out .= '	return record.text;';
8666
-				$out .= '}' . "\n";
8667
-				$out .= 'function formatSelection(record) {' . "\n";
8666
+				$out .= '}'."\n";
8667
+				$out .= 'function formatSelection(record) {'."\n";
8668 8668
 				if ($elemtype == 'category') {
8669
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8669
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8670 8670
 				} else {
8671 8671
 					$out .= 'return record.text;';
8672 8672
 				}
8673
-				$out .= '}' . "\n";
8673
+				$out .= '}'."\n";
8674 8674
 				$out .= '$(document).ready(function () {
8675
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
8675
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
8676 8676
 				if ($placeholder) {
8677 8677
 					$out .= '
8678 8678
 								placeholder: {
8679 8679
 								    id: \'-1\',
8680
-								    text: \'' . dol_escape_js($placeholder) . '\'
8680
+								    text: \'' . dol_escape_js($placeholder).'\'
8681 8681
 								  },';
8682 8682
 				}
8683 8683
 				$out .= '		dir: \'ltr\',
8684 8684
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
8685
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */
8685
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */
8686 8686
 								// Specify format function for dropdown item
8687 8687
 								formatResult: formatResult,
8688 8688
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -8694,21 +8694,21 @@  discard block
 block discarded – undo
8694 8694
 
8695 8695
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
8696 8696
 								 the size only if component is not hidden by default on load */
8697
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
8697
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
8698 8698
 						});' . "\n";
8699 8699
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
8700 8700
 				// Add other js lib
8701 8701
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
8702 8702
 				// ...
8703
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
8703
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
8704 8704
 				$out .= '$(document).ready(function () {
8705
-							$(\'#' . $htmlname . '\').multiSelect({
8705
+							$(\'#' . $htmlname.'\').multiSelect({
8706 8706
 								containerHTML: \'<div class="multi-select-container">\',
8707 8707
 								menuHTML: \'<div class="multi-select-menu">\',
8708
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
8708
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
8709 8709
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
8710 8710
 								activeClass: \'multi-select-container--open\',
8711
-								noneText: \'' . $placeholder . '\'
8711
+								noneText: \'' . $placeholder.'\'
8712 8712
 							});
8713 8713
 						})';
8714 8714
 			}
@@ -8740,7 +8740,7 @@  discard block
 block discarded – undo
8740 8740
 			return '';
8741 8741
 		}
8742 8742
 
8743
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
8743
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
8744 8744
 
8745 8745
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
8746 8746
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -8783,19 +8783,19 @@  discard block
 block discarded – undo
8783 8783
 				}
8784 8784
 
8785 8785
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list
8786
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
8787
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
8786
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
8787
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
8788 8788
 			}
8789 8789
 		}
8790 8790
 
8791
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
8791
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
8792 8792
 
8793 8793
         <dl class="dropdown">
8794 8794
             <dt>
8795
-            <a href="#' . $htmlname . '">
8796
-              ' . img_picto('', 'list') . '
8795
+            <a href="#' . $htmlname.'">
8796
+              ' . img_picto('', 'list').'
8797 8797
             </a>
8798
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
8798
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
8799 8799
             </dt>
8800 8800
             <dd class="dropdowndd">
8801 8801
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -8807,19 +8807,19 @@  discard block
 block discarded – undo
8807 8807
             </dd>
8808 8808
         </dl>
8809 8809
 
8810
-        <script nonce="' . getNonce() . '" type="text/javascript">
8810
+        <script nonce="' . getNonce().'" type="text/javascript">
8811 8811
           jQuery(document).ready(function () {
8812
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
8812
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
8813 8813
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
8814 8814
 
8815 8815
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
8816 8816
 
8817 8817
                   var title = $(this).val() + ",";
8818 8818
                   if ($(this).is(\':checked\')) {
8819
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
8819
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
8820 8820
                   }
8821 8821
                   else {
8822
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
8822
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
8823 8823
                   }
8824 8824
                   // Now, we submit page
8825 8825
                   //$(this).parents(\'form:first\').submit();
@@ -8850,7 +8850,7 @@  discard block
 block discarded – undo
8850 8850
 	 */
8851 8851
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
8852 8852
 	{
8853
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8853
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8854 8854
 
8855 8855
 		$cat = new Categorie($this->db);
8856 8856
 		$categories = $cat->containing($id, $type);
@@ -8860,10 +8860,10 @@  discard block
 block discarded – undo
8860 8860
 			foreach ($categories as $c) {
8861 8861
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
8862 8862
 				foreach ($ways as $way) {
8863
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
8863
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
8864 8864
 				}
8865 8865
 			}
8866
-			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8866
+			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8867 8867
 		}
8868 8868
 
8869 8869
 		if ($rendermode == 0) {
@@ -8911,15 +8911,15 @@  discard block
 block discarded – undo
8911 8911
 
8912 8912
 
8913 8913
 			print '<div class="div-table-responsive-no-min">';
8914
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
8914
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
8915 8915
 
8916 8916
 			print '<tr class="liste_titre">';
8917
-			print '<td>' . $langs->trans("Type") . '</td>';
8918
-			print '<td>' . $langs->trans("Ref") . '</td>';
8917
+			print '<td>'.$langs->trans("Type").'</td>';
8918
+			print '<td>'.$langs->trans("Ref").'</td>';
8919 8919
 			print '<td class="center"></td>';
8920
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
8921
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
8922
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
8920
+			print '<td class="center">'.$langs->trans("Date").'</td>';
8921
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
8922
+			print '<td class="right">'.$langs->trans("Status").'</td>';
8923 8923
 			print '<td></td>';
8924 8924
 			print '</tr>';
8925 8925
 
@@ -8938,13 +8938,13 @@  discard block
 block discarded – undo
8938 8938
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
8939 8939
 					$element = $regs[1];
8940 8940
 					$subelement = $regs[2];
8941
-					$tplpath = $element . '/' . $subelement;
8941
+					$tplpath = $element.'/'.$subelement;
8942 8942
 				}
8943 8943
 				$tplname = 'linkedobjectblock';
8944 8944
 
8945 8945
 				// To work with non standard path
8946 8946
 				if ($objecttype == 'facture') {
8947
-					$tplpath = 'compta/' . $element;
8947
+					$tplpath = 'compta/'.$element;
8948 8948
 					if (!isModEnabled('facture')) {
8949 8949
 						continue; // Do not show if module disabled
8950 8950
 					}
@@ -8955,7 +8955,7 @@  discard block
 block discarded – undo
8955 8955
 						continue; // Do not show if module disabled
8956 8956
 					}
8957 8957
 				} elseif ($objecttype == 'propal') {
8958
-					$tplpath = 'comm/' . $element;
8958
+					$tplpath = 'comm/'.$element;
8959 8959
 					if (!isModEnabled('propal')) {
8960 8960
 						continue; // Do not show if module disabled
8961 8961
 					}
@@ -9006,14 +9006,14 @@  discard block
 block discarded – undo
9006 9006
 				$linkedObjectBlock = $objects;
9007 9007
 
9008 9008
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9009
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9009
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9010 9010
 				foreach ($dirtpls as $reldir) {
9011 9011
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
9012 9012
 						global $noMoreLinkedObjectBlockAfter;
9013 9013
 						$noMoreLinkedObjectBlockAfter = 1;
9014 9014
 					}
9015 9015
 
9016
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9016
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9017 9017
 					if ($res) {
9018 9018
 						$nboftypesoutput++;
9019 9019
 						break;
@@ -9022,7 +9022,7 @@  discard block
 block discarded – undo
9022 9022
 			}
9023 9023
 
9024 9024
 			if (!$nboftypesoutput) {
9025
-				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9025
+				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9026 9026
 			}
9027 9027
 
9028 9028
 			print '</table>';
@@ -9062,14 +9062,14 @@  discard block
 block discarded – undo
9062 9062
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9063 9063
 			$listofidcompanytoscan = $object->thirdparty->id;
9064 9064
 			if (($object->thirdparty->parent > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) {
9065
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9065
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9066 9066
 			}
9067 9067
 			if (($object->fk_project > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO)) {
9068
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9068
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9069 9069
 				$tmpproject = new Project($this->db);
9070 9070
 				$tmpproject->fetch($object->fk_project);
9071 9071
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9072
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9072
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9073 9073
 				}
9074 9074
 				unset($tmpproject);
9075 9075
 			}
@@ -9079,63 +9079,63 @@  discard block
 block discarded – undo
9079 9079
 					'enabled' => isModEnabled('propal'),
9080 9080
 					'perms' => 1,
9081 9081
 					'label' => 'LinkToProposal',
9082
-					'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') . ')'),
9082
+					'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').')'),
9083 9083
 				'shipping' => array(
9084 9084
 					'enabled' => isModEnabled('expedition'),
9085 9085
 					'perms' => 1,
9086 9086
 					'label' => 'LinkToExpedition',
9087
-					'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') . ')'),
9087
+					'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').')'),
9088 9088
 				'order' => array(
9089 9089
 					'enabled' => isModEnabled('commande'),
9090 9090
 					'perms' => 1,
9091 9091
 					'label' => 'LinkToOrder',
9092
-					'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') . ')'),
9092
+					'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').')'),
9093 9093
 				'invoice' => array(
9094 9094
 					'enabled' => isModEnabled('facture'),
9095 9095
 					'perms' => 1,
9096 9096
 					'label' => 'LinkToInvoice',
9097
-					'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') . ')'),
9097
+					'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').')'),
9098 9098
 				'invoice_template' => array(
9099 9099
 					'enabled' => isModEnabled('facture'),
9100 9100
 					'perms' => 1,
9101 9101
 					'label' => 'LinkToTemplateInvoice',
9102
-					'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') . ')'),
9102
+					'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').')'),
9103 9103
 				'contrat' => array(
9104 9104
 					'enabled' => isModEnabled('contrat'),
9105 9105
 					'perms' => 1,
9106 9106
 					'label' => 'LinkToContract',
9107 9107
 					'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
9108
-							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'
9108
+							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'
9109 9109
 				),
9110 9110
 				'fichinter' => array(
9111 9111
 					'enabled' => isModEnabled('ficheinter'),
9112 9112
 					'perms' => 1,
9113 9113
 					'label' => 'LinkToIntervention',
9114
-					'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') . ')'),
9114
+					'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').')'),
9115 9115
 				'supplier_proposal' => array(
9116 9116
 					'enabled' => (isModEnabled('supplier_proposal') ? $conf->supplier_proposal->enabled : 0),
9117 9117
 					'perms' => 1,
9118 9118
 					'label' => 'LinkToSupplierProposal',
9119
-					'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') . ')'),
9119
+					'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').')'),
9120 9120
 				'order_supplier' => array(
9121 9121
 					'enabled' => (isModEnabled("supplier_order") ? $conf->supplier_order->enabled : 0),
9122 9122
 					'perms' => 1,
9123 9123
 					'label' => 'LinkToSupplierOrder',
9124
-					'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') . ')'),
9124
+					'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').')'),
9125 9125
 				'invoice_supplier' => array(
9126 9126
 					'enabled' => (isModEnabled("supplier_invoice") ? $conf->supplier_invoice->enabled : 0),
9127 9127
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9128
-					'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') . ')'),
9128
+					'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').')'),
9129 9129
 				'ticket' => array(
9130 9130
 					'enabled' => isModEnabled('ticket'),
9131 9131
 					'perms' => 1,
9132 9132
 					'label' => 'LinkToTicket',
9133
-					'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') . ')'),
9133
+					'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').')'),
9134 9134
 				'mo' => array(
9135 9135
 					'enabled' => isModEnabled('mrp'),
9136 9136
 					'perms' => 1,
9137 9137
 					'label' => 'LinkToMo',
9138
-					'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') . ')')
9138
+					'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').')')
9139 9139
 			);
9140 9140
 		}
9141 9141
 
@@ -9170,22 +9170,22 @@  discard block
 block discarded – undo
9170 9170
 			}
9171 9171
 
9172 9172
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9173
-				print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9173
+				print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9174 9174
 
9175 9175
 				if (!empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) {
9176 9176
 					print '<br>'."\n";
9177 9177
 					print '<!-- form to add a link from anywhere -->'."\n";
9178
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9179
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9178
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9179
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9180 9180
 					print '<input type="hidden" name="action" value="addlinkbyref">';
9181
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9182
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9181
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9182
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9183 9183
 					print '<table class="noborder">';
9184 9184
 					print '<tr>';
9185 9185
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9186
-					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9187
-					print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9188
-					print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9186
+					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9187
+					print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9188
+					print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9189 9189
 					print '</tr>';
9190 9190
 					print '</table>';
9191 9191
 					print '</form>';
@@ -9200,48 +9200,48 @@  discard block
 block discarded – undo
9200 9200
 
9201 9201
 					print '<br>';
9202 9202
 					print '<!-- form to add a link from object to same thirdparty -->'."\n";
9203
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9203
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9204 9204
 					print '<input type="hidden" name="action" value="addlink">';
9205
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9206
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9207
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9205
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9206
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9207
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9208 9208
 					print '<table class="noborder">';
9209 9209
 					print '<tr class="liste_titre">';
9210 9210
 					print '<td class="nowrap"></td>';
9211
-					print '<td class="center">' . $langs->trans("Ref") . '</td>';
9212
-					print '<td class="left">' . $langs->trans("RefCustomer") . '</td>';
9213
-					print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9214
-					print '<td class="left">' . $langs->trans("Company") . '</td>';
9211
+					print '<td class="center">'.$langs->trans("Ref").'</td>';
9212
+					print '<td class="left">'.$langs->trans("RefCustomer").'</td>';
9213
+					print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9214
+					print '<td class="left">'.$langs->trans("Company").'</td>';
9215 9215
 					print '</tr>';
9216 9216
 					while ($i < $num) {
9217 9217
 						$objp = $this->db->fetch_object($resqllist);
9218 9218
 
9219 9219
 						print '<tr class="oddeven">';
9220 9220
 						print '<td class="left">';
9221
-						print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9221
+						print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9222 9222
 						print '</td>';
9223
-						print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9224
-						print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9223
+						print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9224
+						print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9225 9225
 						print '<td class="right">';
9226 9226
 						if ($possiblelink['label'] == 'LinkToContract') {
9227 9227
 							$form = new Form($this->db);
9228
-							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9228
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9229 9229
 						}
9230
-						print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9230
+						print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9231 9231
 						print '</td>';
9232
-						print '<td>' . $objp->name . '</td>';
9232
+						print '<td>'.$objp->name.'</td>';
9233 9233
 						print '</tr>';
9234 9234
 						$i++;
9235 9235
 					}
9236 9236
 					print '</table>';
9237 9237
 					print '<div class="center">';
9238 9238
 					if ($num) {
9239
-						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9239
+						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9240 9240
 					}
9241 9241
 					if (empty($conf->use_javascript_ajax)) {
9242
-						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9242
+						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9243 9243
 					} else {
9244
-						print '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9244
+						print '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9245 9245
 					}
9246 9246
 					print '</form>';
9247 9247
 					$this->db->free($resqllist);
@@ -9252,10 +9252,10 @@  discard block
 block discarded – undo
9252 9252
 
9253 9253
 				//$linktoelem.=($linktoelem?' &nbsp; ':'');
9254 9254
 				if ($num > 0 || !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) {
9255
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9255
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9256 9256
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9257 9257
 				} else {
9258
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9258
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9259 9259
 				}
9260 9260
 			}
9261 9261
 		}
@@ -9265,11 +9265,11 @@  discard block
 block discarded – undo
9265 9265
     		<dl class="dropdown" id="linktoobjectname">
9266 9266
     		';
9267 9267
 			if (!empty($conf->use_javascript_ajax)) {
9268
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9268
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9269 9269
 			}
9270 9270
 			$linktoelem .= '<dd>
9271 9271
     		<div class="multiselectlinkto">
9272
-    		<ul class="ulselectedfields">' . $linktoelemlist . '
9272
+    		<ul class="ulselectedfields">' . $linktoelemlist.'
9273 9273
     		</ul>
9274 9274
     		</div>
9275 9275
     		</dd>
@@ -9280,7 +9280,7 @@  discard block
 block discarded – undo
9280 9280
 
9281 9281
 		if (!empty($conf->use_javascript_ajax)) {
9282 9282
 			print '<!-- Add js to show linkto box -->
9283
-				<script nonce="' . getNonce() . '">
9283
+				<script nonce="' . getNonce().'">
9284 9284
 				jQuery(document).ready(function() {
9285 9285
 					jQuery(".linkto").click(function() {
9286 9286
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9321,19 +9321,19 @@  discard block
 block discarded – undo
9321 9321
 
9322 9322
 		$disabled = ($disabled ? ' disabled' : '');
9323 9323
 
9324
-		$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9324
+		$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9325 9325
 		if ($useempty) {
9326
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9326
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9327 9327
 		}
9328 9328
 		if (("$value" == 'yes') || ($value == 1)) {
9329
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9330
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9329
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9330
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9331 9331
 		} else {
9332 9332
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9333
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9334
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9333
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9334
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9335 9335
 		}
9336
-		$resultyesno .= '</select>' . "\n";
9336
+		$resultyesno .= '</select>'."\n";
9337 9337
 
9338 9338
 		if ($addjscombo) {
9339 9339
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9357,12 +9357,12 @@  discard block
 block discarded – undo
9357 9357
 	{
9358 9358
 		// phpcs:enable
9359 9359
 		$sql = "SELECT rowid, label";
9360
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9361
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9360
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9361
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9362 9362
 		$sql .= " ORDER BY rowid";
9363 9363
 		$result = $this->db->query($sql);
9364 9364
 		if ($result) {
9365
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9365
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9366 9366
 			if ($useempty) {
9367 9367
 				print '<option value="-1">&nbsp;</option>';
9368 9368
 			}
@@ -9372,9 +9372,9 @@  discard block
 block discarded – undo
9372 9372
 			while ($i < $num) {
9373 9373
 				$obj = $this->db->fetch_object($result);
9374 9374
 				if ($selected == $obj->rowid) {
9375
-					print '<option value="' . $obj->rowid . '" selected>';
9375
+					print '<option value="'.$obj->rowid.'" selected>';
9376 9376
 				} else {
9377
-					print '<option value="' . $obj->rowid . '">';
9377
+					print '<option value="'.$obj->rowid.'">';
9378 9378
 				}
9379 9379
 				print $obj->label;
9380 9380
 				print '</option>';
@@ -9464,8 +9464,8 @@  discard block
 block discarded – undo
9464 9464
 				$stringforfirstkey .= ' CTL +';
9465 9465
 			}
9466 9466
 
9467
-			$previous_ref = $object->ref_previous ? '<a accesskey="p" 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>';
9468
-			$next_ref = $object->ref_next ? '<a accesskey="n" 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>';
9467
+			$previous_ref = $object->ref_previous ? '<a accesskey="p" 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>';
9468
+			$next_ref = $object->ref_next ? '<a accesskey="n" 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>';
9469 9469
 		}
9470 9470
 
9471 9471
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9473,18 +9473,18 @@  discard block
 block discarded – undo
9473 9473
 
9474 9474
 		// Right part of banner
9475 9475
 		if ($morehtmlright) {
9476
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9476
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9477 9477
 		}
9478 9478
 
9479 9479
 		if ($previous_ref || $next_ref || $morehtml) {
9480 9480
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9481 9481
 		}
9482 9482
 		if ($morehtml) {
9483
-			$ret .= '<li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9483
+			$ret .= '<li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9484 9484
 		}
9485 9485
 		if ($shownav && ($previous_ref || $next_ref)) {
9486
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
9487
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
9486
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
9487
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
9488 9488
 		}
9489 9489
 		if ($previous_ref || $next_ref || $morehtml) {
9490 9490
 			$ret .= '</ul></div>';
@@ -9499,7 +9499,7 @@  discard block
 block discarded – undo
9499 9499
 			$morehtmlstatus = $hookmanager->resPrint;
9500 9500
 		}
9501 9501
 		if ($morehtmlstatus) {
9502
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
9502
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
9503 9503
 		}
9504 9504
 
9505 9505
 		$parameters = array();
@@ -9513,14 +9513,14 @@  discard block
 block discarded – undo
9513 9513
 		// Left part of banner
9514 9514
 		if ($morehtmlleft) {
9515 9515
 			if ($conf->browser->layout == 'phone') {
9516
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
9516
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
9517 9517
 			} else {
9518
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
9518
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
9519 9519
 			}
9520 9520
 		}
9521 9521
 
9522 9522
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
9523
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
9523
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
9524 9524
 
9525 9525
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
9526 9526
 		if ($object->element == 'societe') {
@@ -9534,7 +9534,7 @@  discard block
 block discarded – undo
9534 9534
 
9535 9535
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
9536 9536
 				if (!is_object($extralanguages)) {
9537
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
9537
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
9538 9538
 					$extralanguages = new ExtraLanguages($this->db);
9539 9539
 				}
9540 9540
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -9549,27 +9549,27 @@  discard block
 block discarded – undo
9549 9549
 						if ($object->array_languages['name'][$extralangcode]) {
9550 9550
 							$htmltext .= $object->array_languages['name'][$extralangcode];
9551 9551
 						} else {
9552
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
9552
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
9553 9553
 						}
9554 9554
 					}
9555
-					$ret .= '<!-- Show translations of name -->' . "\n";
9555
+					$ret .= '<!-- Show translations of name -->'."\n";
9556 9556
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
9557 9557
 				}
9558 9558
 			}
9559 9559
 		} elseif ($object->element == 'member') {
9560
-			$ret .= $object->ref . '<br>';
9560
+			$ret .= $object->ref.'<br>';
9561 9561
 			$fullname = $object->getFullName($langs);
9562 9562
 			if ($object->morphy == 'mor' && $object->societe) {
9563
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
9563
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
9564 9564
 			} else {
9565
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
9565
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
9566 9566
 			}
9567 9567
 		} elseif (in_array($object->element, array('contact', 'user'))) {
9568
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
9568
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
9569 9569
 		} elseif ($object->element == 'usergroup') {
9570 9570
 			$ret .= dol_htmlentities($object->name);
9571 9571
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
9572
-			$ret .= $object->ref . '<br>' . $object->label;
9572
+			$ret .= $object->ref.'<br>'.$object->label;
9573 9573
 		} elseif (in_array($object->element, array('adherent_type'))) {
9574 9574
 			$ret .= $object->label;
9575 9575
 		} elseif ($object->element == 'ecm_directories') {
@@ -9621,9 +9621,9 @@  discard block
 block discarded – undo
9621 9621
 		}
9622 9622
 
9623 9623
 		// Barcode image
9624
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
9625
-		$out = '<!-- url barcode = ' . $url . ' -->';
9626
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
9624
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
9625
+		$out = '<!-- url barcode = '.$url.' -->';
9626
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
9627 9627
 
9628 9628
 		return $out;
9629 9629
 	}
@@ -9663,28 +9663,28 @@  discard block
 block discarded – undo
9663 9663
 			if (!empty($object->logo)) {
9664 9664
 				if (dolIsAllowedForPreview($object->logo)) {
9665 9665
 					if ((string) $imagesize == 'mini') {
9666
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9666
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9667 9667
 					} elseif ((string) $imagesize == 'small') {
9668
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
9668
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
9669 9669
 					} else {
9670
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9670
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9671 9671
 					}
9672
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9672
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9673 9673
 				}
9674 9674
 			}
9675 9675
 			$email = $object->email;
9676 9676
 		} elseif ($modulepart == 'contact') {
9677
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
9677
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
9678 9678
 			if (!empty($object->photo)) {
9679 9679
 				if (dolIsAllowedForPreview($object->photo)) {
9680 9680
 					if ((string) $imagesize == 'mini') {
9681
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9681
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9682 9682
 					} elseif ((string) $imagesize == 'small') {
9683
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9683
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
9684 9684
 					} else {
9685
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9685
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9686 9686
 					}
9687
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9687
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9688 9688
 				}
9689 9689
 			}
9690 9690
 			$email = $object->email;
@@ -9694,17 +9694,17 @@  discard block
 block discarded – undo
9694 9694
 			if (!empty($object->photo)) {
9695 9695
 				if (dolIsAllowedForPreview($object->photo)) {
9696 9696
 					if ((string) $imagesize == 'mini') {
9697
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9697
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9698 9698
 					} elseif ((string) $imagesize == 'small') {
9699
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9699
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
9700 9700
 					} else {
9701
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9701
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9702 9702
 					}
9703
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9703
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9704 9704
 				}
9705 9705
 			}
9706 9706
 			if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
9707
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9707
+				$altfile = $object->id.".jpg"; // For backward compatibility
9708 9708
 			}
9709 9709
 			$email = $object->email;
9710 9710
 			$capture = 'user';
@@ -9713,17 +9713,17 @@  discard block
 block discarded – undo
9713 9713
 			if (!empty($object->photo)) {
9714 9714
 				if (dolIsAllowedForPreview($object->photo)) {
9715 9715
 					if ((string) $imagesize == 'mini') {
9716
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9716
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9717 9717
 					} elseif ((string) $imagesize == 'small') {
9718
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9718
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
9719 9719
 					} else {
9720
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9720
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9721 9721
 					}
9722
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9722
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9723 9723
 				}
9724 9724
 			}
9725 9725
 			if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
9726
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9726
+				$altfile = $object->id.".jpg"; // For backward compatibility
9727 9727
 			}
9728 9728
 			$email = $object->email;
9729 9729
 			$capture = 'user';
@@ -9733,17 +9733,17 @@  discard block
 block discarded – undo
9733 9733
 			if (!empty($object->photo)) {
9734 9734
 				if (dolIsAllowedForPreview($object->photo)) {
9735 9735
 					if ((string) $imagesize == 'mini') {
9736
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9736
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
9737 9737
 					} elseif ((string) $imagesize == 'small') {
9738
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9738
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
9739 9739
 					} else {
9740
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo;
9740
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
9741 9741
 					}
9742
-					$originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo;
9742
+					$originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
9743 9743
 				}
9744 9744
 			}
9745 9745
 			if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
9746
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9746
+				$altfile = $object->id.".jpg"; // For backward compatibility
9747 9747
 			}
9748 9748
 			$email = $object->email;
9749 9749
 		}
@@ -9753,35 +9753,35 @@  discard block
 block discarded – undo
9753 9753
 		}
9754 9754
 
9755 9755
 		if ($dir) {
9756
-			if ($file && file_exists($dir . "/" . $file)) {
9756
+			if ($file && file_exists($dir."/".$file)) {
9757 9757
 				if ($addlinktofullsize) {
9758
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9758
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9759 9759
 					if ($urladvanced) {
9760
-						$ret .= '<a href="' . $urladvanced . '">';
9760
+						$ret .= '<a href="'.$urladvanced.'">';
9761 9761
 					} else {
9762
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9762
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9763 9763
 					}
9764 9764
 				}
9765
-				$ret .= '<img alt="Photo" 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 . '">';
9765
+				$ret .= '<img alt="Photo" 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.'">';
9766 9766
 				if ($addlinktofullsize) {
9767 9767
 					$ret .= '</a>';
9768 9768
 				}
9769
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
9769
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
9770 9770
 				if ($addlinktofullsize) {
9771
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9771
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9772 9772
 					if ($urladvanced) {
9773
-						$ret .= '<a href="' . $urladvanced . '">';
9773
+						$ret .= '<a href="'.$urladvanced.'">';
9774 9774
 					} else {
9775
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9775
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9776 9776
 					}
9777 9777
 				}
9778
-				$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 . '">';
9778
+				$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.'">';
9779 9779
 				if ($addlinktofullsize) {
9780 9780
 					$ret .= '</a>';
9781 9781
 				}
9782 9782
 			} else {
9783 9783
 				$nophoto = '/public/theme/common/nophoto.png';
9784
-				$defaultimg = 'identicon';        // For gravatar
9784
+				$defaultimg = 'identicon'; // For gravatar
9785 9785
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
9786 9786
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) {
9787 9787
 						$nophoto = 'company';
@@ -9799,13 +9799,13 @@  discard block
 block discarded – undo
9799 9799
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
9800 9800
 					// see https://gravatar.com/site/implement/images/php/
9801 9801
 					$ret .= '<!-- Put link to gravatar -->';
9802
-					$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash
9802
+					$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash
9803 9803
 				} else {
9804 9804
 					if ($nophoto == 'company') {
9805
-						$ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
9805
+						$ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
9806 9806
 						$ret .= '<div class="difforspanimgright"></div>';
9807 9807
 					} else {
9808
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
9808
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
9809 9809
 					}
9810 9810
 				}
9811 9811
 			}
@@ -9816,20 +9816,20 @@  discard block
 block discarded – undo
9816 9816
 				}
9817 9817
 				$ret .= '<table class="nobordernopadding centpercent">';
9818 9818
 				if ($object->photo) {
9819
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
9819
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
9820 9820
 				}
9821 9821
 				$ret .= '<tr><td class="tdoverflow">';
9822 9822
 				$maxfilesizearray = getMaxFileSizeArray();
9823 9823
 				$maxmin = $maxfilesizearray['maxmin'];
9824 9824
 				if ($maxmin > 0) {
9825
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
9825
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
9826 9826
 				}
9827
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
9827
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
9828 9828
 				$ret .= '</td></tr>';
9829 9829
 				$ret .= '</table>';
9830 9830
 			}
9831 9831
 		} else {
9832
-			dol_print_error('', 'Call of showphoto with wrong parameters modulepart=' . $modulepart);
9832
+			dol_print_error('', 'Call of showphoto with wrong parameters modulepart='.$modulepart);
9833 9833
 		}
9834 9834
 
9835 9835
 		return $ret;
@@ -9880,38 +9880,38 @@  discard block
 block discarded – undo
9880 9880
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
9881 9881
 			$sql .= ", e.label";
9882 9882
 		}
9883
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
9883
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
9884 9884
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
9885
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
9885
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
9886 9886
 			if ($force_entity) {
9887
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
9887
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
9888 9888
 			} else {
9889 9889
 				$sql .= " WHERE ug.entity IS NOT NULL";
9890 9890
 			}
9891 9891
 		} else {
9892
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
9892
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
9893 9893
 		}
9894 9894
 		if (is_array($exclude) && $excludeGroups) {
9895
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
9895
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
9896 9896
 		}
9897 9897
 		if (is_array($include) && $includeGroups) {
9898
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
9898
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
9899 9899
 		}
9900 9900
 		$sql .= " ORDER BY ug.nom ASC";
9901 9901
 
9902
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
9902
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
9903 9903
 		$resql = $this->db->query($sql);
9904 9904
 		if ($resql) {
9905 9905
 			// Enhance with select2
9906
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
9906
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
9907 9907
 
9908
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
9908
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
9909 9909
 
9910 9910
 			$num = $this->db->num_rows($resql);
9911 9911
 			$i = 0;
9912 9912
 			if ($num) {
9913 9913
 				if ($show_empty && !$multiple) {
9914
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9914
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
9915 9915
 				}
9916 9916
 
9917 9917
 				while ($i < $num) {
@@ -9921,7 +9921,7 @@  discard block
 block discarded – undo
9921 9921
 						$disableline = 1;
9922 9922
 					}
9923 9923
 
9924
-					$out .= '<option value="' . $obj->rowid . '"';
9924
+					$out .= '<option value="'.$obj->rowid.'"';
9925 9925
 					if ($disableline) {
9926 9926
 						$out .= ' disabled';
9927 9927
 					}
@@ -9932,7 +9932,7 @@  discard block
 block discarded – undo
9932 9932
 
9933 9933
 					$out .= $obj->name;
9934 9934
 					if (isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) {
9935
-						$out .= " (" . $obj->label . ")";
9935
+						$out .= " (".$obj->label.")";
9936 9936
 					}
9937 9937
 
9938 9938
 					$out .= '</option>';
@@ -9940,9 +9940,9 @@  discard block
 block discarded – undo
9940 9940
 				}
9941 9941
 			} else {
9942 9942
 				if ($show_empty) {
9943
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
9943
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
9944 9944
 				}
9945
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
9945
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
9946 9946
 			}
9947 9947
 			$out .= '</select>';
9948 9948
 
@@ -9991,25 +9991,25 @@  discard block
 block discarded – undo
9991 9991
 		$out = '';
9992 9992
 
9993 9993
 		if (!empty($conf->use_javascript_ajax)) {
9994
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
9994
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
9995 9995
 		}
9996
-		$out .= '<script nonce="' . getNonce() . '">
9996
+		$out .= '<script nonce="'.getNonce().'">
9997 9997
             $(document).ready(function() {
9998
-                $("#' . $cssclass . 's").click(function() {
9998
+                $("#' . $cssclass.'s").click(function() {
9999 9999
                     if($(this).is(\':checked\')){
10000
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10001
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10000
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10001
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10002 10002
                     }
10003 10003
                     else
10004 10004
                     {
10005 10005
                         console.log("We uncheck all");
10006
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10006
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10007 10007
                     }' . "\n";
10008 10008
 		if ($calljsfunction) {
10009
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10009
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10010 10010
 		}
10011 10011
 		$out .= '         });
10012
-        	        $(".' . $cssclass . '").change(function() {
10012
+        	        $(".' . $cssclass.'").change(function() {
10013 10013
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10014 10014
 				});
10015 10015
 		 	});
@@ -10054,67 +10054,67 @@  discard block
 block discarded – undo
10054 10054
 		global $langs, $user;
10055 10055
 
10056 10056
 		$out = '';
10057
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10058
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10057
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10058
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10059 10059
 		if (!empty($excludeid)) {
10060
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10060
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10061 10061
 		}
10062 10062
 		$sql .= " ORDER BY label";
10063 10063
 
10064 10064
 		$resql = $this->db->query($sql);
10065 10065
 		if ($resql) {
10066
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10066
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10067 10067
 			if ($useempty) {
10068 10068
 				$out .= '<option value="0">&nbsp;</option>';
10069 10069
 			}
10070 10070
 
10071 10071
 			while ($obj = $this->db->fetch_object($resql)) {
10072
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10072
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10073 10073
 			}
10074 10074
 			$out .= '</select>';
10075
-			$out .= ajax_combobox('select_' . $htmlname);
10075
+			$out .= ajax_combobox('select_'.$htmlname);
10076 10076
 
10077 10077
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10078
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10078
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10079 10079
 			}
10080 10080
 
10081 10081
 			if (!empty($target)) {
10082
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10082
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10083 10083
 				$resql = $this->db->query($sql);
10084 10084
 				if ($resql) {
10085 10085
 					if ($this->db->num_rows($resql) > 0) {
10086 10086
 						$obj = $this->db->fetch_object($resql);
10087
-						$out .= '<script nonce="' . getNonce() . '">
10087
+						$out .= '<script nonce="'.getNonce().'">
10088 10088
 							$(function() {
10089
-								$("select[name=' . $target . ']").on("change", function() {
10089
+								$("select[name=' . $target.']").on("change", function() {
10090 10090
 									var current_val = $(this).val();
10091
-									if (current_val == ' . $obj->id . ') {';
10091
+									if (current_val == ' . $obj->id.') {';
10092 10092
 						if (!empty($default_selected) || !empty($selected)) {
10093
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10093
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10094 10094
 						}
10095 10095
 
10096 10096
 						$out .= '
10097
-										$("select[name=' . $htmlname . ']").change();
10097
+										$("select[name=' . $htmlname.']").change();
10098 10098
 									}
10099 10099
 								});
10100 10100
 
10101
-								$("select[name=' . $htmlname . ']").change(function() {
10101
+								$("select[name=' . $htmlname.']").change(function() {
10102 10102
 
10103
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10103
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10104 10104
 										// get price of kilometer to fill the unit price
10105 10105
 										$.ajax({
10106 10106
 											method: "POST",
10107 10107
 											dataType: "json",
10108
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10109
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . join('&', $params)) . '",
10108
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10109
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.join('&', $params)).'",
10110 10110
 										}).done(function( data, textStatus, jqXHR ) {
10111 10111
 											console.log(data);
10112 10112
 											if (typeof data.up != "undefined") {
10113 10113
 												$("input[name=value_unit]").val(data.up);
10114
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10114
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10115 10115
 											} else {
10116 10116
 												$("input[name=value_unit]").val("");
10117
-												$("select[name=' . $htmlname . ']").attr("title", "");
10117
+												$("select[name=' . $htmlname.']").attr("title", "");
10118 10118
 											}
10119 10119
 										});
10120 10120
 									}
@@ -10144,18 +10144,18 @@  discard block
 block discarded – undo
10144 10144
 		global $conf, $langs;
10145 10145
 
10146 10146
 		$out = '';
10147
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10148
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10147
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10148
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10149 10149
 
10150 10150
 		$resql = $this->db->query($sql);
10151 10151
 		if ($resql) {
10152
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10152
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10153 10153
 			if ($useempty) {
10154 10154
 				$out .= '<option value="0"></option>';
10155 10155
 			}
10156 10156
 
10157 10157
 			while ($obj = $this->db->fetch_object($resql)) {
10158
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10158
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10159 10159
 			}
10160 10160
 			$out .= '</select>';
10161 10161
 		} else {
@@ -10180,17 +10180,17 @@  discard block
 block discarded – undo
10180 10180
 		global $langs;
10181 10181
 
10182 10182
 		$out = '';
10183
-		$sql = "SELECT id, code, label FROM " . $this->db->prefix() . "c_type_fees";
10183
+		$sql = "SELECT id, code, label FROM ".$this->db->prefix()."c_type_fees";
10184 10184
 		$sql .= " WHERE active = 1";
10185 10185
 
10186 10186
 		$resql = $this->db->query($sql);
10187 10187
 		if ($resql) {
10188
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10188
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10189 10189
 			if ($useempty) {
10190 10190
 				$out .= '<option value="0"></option>';
10191 10191
 			}
10192 10192
 			if ($allchoice) {
10193
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10193
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10194 10194
 			}
10195 10195
 
10196 10196
 			$field = 'code';
@@ -10200,7 +10200,7 @@  discard block
 block discarded – undo
10200 10200
 
10201 10201
 			while ($obj = $this->db->fetch_object($resql)) {
10202 10202
 				$key = $langs->trans($obj->code);
10203
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10203
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10204 10204
 			}
10205 10205
 			$out .= '</select>';
10206 10206
 		} else {
@@ -10232,7 +10232,7 @@  discard block
 block discarded – undo
10232 10232
 	{
10233 10233
 		global $user, $conf, $langs;
10234 10234
 
10235
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10235
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10236 10236
 
10237 10237
 		if (is_null($usertofilter)) {
10238 10238
 			$usertofilter = $user;
@@ -10256,10 +10256,10 @@  discard block
 block discarded – undo
10256 10256
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10257 10257
             p.title, p.fk_soc, p.fk_statut, p.public,";
10258 10258
 		$sql .= ' s.nom as name';
10259
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10260
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10261
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10262
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10259
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10260
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10261
+		$sql .= ' '.$this->db->prefix().'facture as f';
10262
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10263 10263
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10264 10264
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10265 10265
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10270,14 +10270,14 @@  discard block
 block discarded – undo
10270 10270
 		if ($resql) {
10271 10271
 			// Use select2 selector
10272 10272
 			if (!empty($conf->use_javascript_ajax)) {
10273
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10273
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10274 10274
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10275 10275
 				$out .= $comboenhancement;
10276 10276
 				$morecss = 'minwidth200imp maxwidth500';
10277 10277
 			}
10278 10278
 
10279 10279
 			if (empty($option_only)) {
10280
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10280
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10281 10281
 			}
10282 10282
 			if (!empty($show_empty)) {
10283 10283
 				$out .= '<option value="0" class="optiongrey">';
@@ -10307,33 +10307,33 @@  discard block
 block discarded – undo
10307 10307
 						if ($showproject == 'all') {
10308 10308
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10309 10309
 							if ($obj->name) {
10310
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10310
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10311 10311
 							}
10312 10312
 
10313 10313
 							$disabled = 0;
10314 10314
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10315 10315
 								$disabled = 1;
10316
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10316
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10317 10317
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10318 10318
 								if ($discard_closed == 2) {
10319 10319
 									$disabled = 1;
10320 10320
 								}
10321
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10321
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10322 10322
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10323 10323
 								$disabled = 1;
10324
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10324
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10325 10325
 							}
10326 10326
 						}
10327 10327
 
10328 10328
 						if (!empty($selected) && $selected == $obj->rowid) {
10329
-							$out .= '<option value="' . $obj->rowid . '" selected';
10329
+							$out .= '<option value="'.$obj->rowid.'" selected';
10330 10330
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10331
-							$out .= '>' . $labeltoshow . '</option>';
10331
+							$out .= '>'.$labeltoshow.'</option>';
10332 10332
 						} else {
10333 10333
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10334 10334
 								$resultat = '';
10335 10335
 							} else {
10336
-								$resultat = '<option value="' . $obj->rowid . '"';
10336
+								$resultat = '<option value="'.$obj->rowid.'"';
10337 10337
 								if ($disabled) {
10338 10338
 									$resultat .= ' disabled';
10339 10339
 								}
@@ -10385,22 +10385,22 @@  discard block
 block discarded – undo
10385 10385
 
10386 10386
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10387 10387
 		//$sql.= ', el.fk_source';
10388
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10389
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10388
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10389
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10390 10390
 		$sql .= " ORDER BY f.titre ASC";
10391 10391
 
10392 10392
 		$resql = $this->db->query($sql);
10393 10393
 		if ($resql) {
10394 10394
 			// Use select2 selector
10395 10395
 			if (!empty($conf->use_javascript_ajax)) {
10396
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10396
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10397 10397
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10398 10398
 				$out .= $comboenhancement;
10399 10399
 				$morecss = 'minwidth200imp maxwidth500';
10400 10400
 			}
10401 10401
 
10402 10402
 			if (empty($option_only)) {
10403
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10403
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10404 10404
 			}
10405 10405
 			if (!empty($show_empty)) {
10406 10406
 				$out .= '<option value="0" class="optiongrey">';
@@ -10419,19 +10419,19 @@  discard block
 block discarded – undo
10419 10419
 					$disabled = 0;
10420 10420
 					if (!empty($obj->suspended)) {
10421 10421
 						$disabled = 1;
10422
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10422
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10423 10423
 					}
10424 10424
 
10425 10425
 
10426 10426
 					if (!empty($selected) && $selected == $obj->rowid) {
10427
-						$out .= '<option value="' . $obj->rowid . '" selected';
10427
+						$out .= '<option value="'.$obj->rowid.'" selected';
10428 10428
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10429
-						$out .= '>' . $labeltoshow . '</option>';
10429
+						$out .= '>'.$labeltoshow.'</option>';
10430 10430
 					} else {
10431 10431
 						if ($disabled && ($selected != $obj->rowid)) {
10432 10432
 							$resultat = '';
10433 10433
 						} else {
10434
-							$resultat = '<option value="' . $obj->rowid . '"';
10434
+							$resultat = '<option value="'.$obj->rowid.'"';
10435 10435
 							if ($disabled) {
10436 10436
 								$resultat .= ' disabled';
10437 10437
 							}
@@ -10471,14 +10471,14 @@  discard block
 block discarded – undo
10471 10471
 		global $langs;
10472 10472
 
10473 10473
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10474
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10474
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10475 10475
 		}
10476 10476
 
10477 10477
 		$ret = '';
10478 10478
 
10479 10479
 		$ret .= '<div class="divadvancedsearchfieldcomp inline-block">';
10480 10480
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10481
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10481
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10482 10482
 		$ret .= '</a>';
10483 10483
 
10484 10484
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -10504,13 +10504,13 @@  discard block
 block discarded – undo
10504 10504
 				}
10505 10505
 
10506 10506
 				if ($countparenthesis == 0) {
10507
-					$char2 = dol_substr($search_component_params_hidden, $i+1, 1);
10508
-					$char3 = dol_substr($search_component_params_hidden, $i+2, 1);
10507
+					$char2 = dol_substr($search_component_params_hidden, $i + 1, 1);
10508
+					$char3 = dol_substr($search_component_params_hidden, $i + 2, 1);
10509 10509
 					if ($char == 'A' && $char2 == 'N' && $char3 == 'D') {
10510 10510
 						// We found a AND
10511 10511
 						$arrayofandtags[] = trim($s);
10512 10512
 						$s = '';
10513
-						$i+=2;
10513
+						$i += 2;
10514 10514
 					} else {
10515 10515
 						$s .= $char;
10516 10516
 					}
@@ -10534,8 +10534,8 @@  discard block
 block discarded – undo
10534 10534
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
10535 10535
 				$searchtags = removeGlobalParenthesis($searchtags);
10536 10536
 
10537
-				$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
10538
-				$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> ';
10537
+				$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
10538
+				$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> ';
10539 10539
 				$ret .= dol_escape_htmltag($searchtags);
10540 10540
 				$ret .= '</span>';
10541 10541
 			}
@@ -10552,29 +10552,29 @@  discard block
 block discarded – undo
10552 10552
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
10553 10553
 		}
10554 10554
 		$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%')) -->";
10555
-		$ret .= '<input type="hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
10555
+		$ret .= '<input type="hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
10556 10556
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
10557 10557
 
10558 10558
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
10559 10559
 		foreach ($arrayofcriterias as $criterias) {
10560 10560
 			foreach ($criterias as $criteriafamilykey => $criteriafamilyval) {
10561
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10561
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10562 10562
 					continue;
10563 10563
 				}
10564 10564
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
10565 10565
 					continue;
10566 10566
 				}
10567 10567
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
10568
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
10569
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
10570
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
10571
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
10572
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
10573
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
10574
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
10575
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
10568
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
10569
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
10570
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
10571
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
10572
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
10573
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
10574
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
10575
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
10576 10576
 				} else {
10577
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
10577
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
10578 10578
 				}
10579 10579
 			}
10580 10580
 		}
@@ -10582,7 +10582,7 @@  discard block
 block discarded – undo
10582 10582
 		$ret .= '</div>';
10583 10583
 
10584 10584
 		$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";
10585
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Search") . '" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10585
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Search").'" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10586 10586
 
10587 10587
 		$ret .= '</div>';
10588 10588
 		$ret .= '</div>';
@@ -10618,7 +10618,7 @@  discard block
 block discarded – undo
10618 10618
 
10619 10619
 		$TModels = array();
10620 10620
 
10621
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
10621
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
10622 10622
 		$formmail = new FormMail($this->db);
10623 10623
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
10624 10624
 
@@ -10631,17 +10631,17 @@  discard block
 block discarded – undo
10631 10631
 			}
10632 10632
 		}
10633 10633
 
10634
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
10634
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
10635 10635
 
10636 10636
 		foreach ($TModels as $id_model => $label_model) {
10637
-			$retstring .= '<option value="' . $id_model . '"';
10638
-			$retstring .= ">" . $label_model . "</option>";
10637
+			$retstring .= '<option value="'.$id_model.'"';
10638
+			$retstring .= ">".$label_model."</option>";
10639 10639
 		}
10640 10640
 
10641 10641
 		$retstring .= "</select>";
10642 10642
 
10643 10643
 		if ($addjscombo) {
10644
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
10644
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
10645 10645
 		}
10646 10646
 
10647 10647
 		return $retstring;
@@ -10692,16 +10692,16 @@  discard block
 block discarded – undo
10692 10692
 
10693 10693
 		foreach ($buttons as $button) {
10694 10694
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
10695
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
10695
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
10696 10696
 		}
10697 10697
 		$retstring .= $withoutdiv ? '' : '</div>';
10698 10698
 
10699 10699
 		if ($dol_openinpopup) {
10700
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n";
10701
-			$retstring .= '<script nonce="' . getNonce() . '">';
10700
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n";
10701
+			$retstring .= '<script nonce="'.getNonce().'">';
10702 10702
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
10703
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\');
10704
-				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\');
10703
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\');
10704
+				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\');
10705 10705
 				 });';
10706 10706
 			$retstring .= '</script>';
10707 10707
 		}
Please login to merge, or discard this patch.