Completed
Branch develop (14e9c9)
by
unknown
14:28
created
htdocs/core/modules/modFacture.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 			'fd.localtax2_tx'=>"LineLT2Rate", 'fd.localtax2_type'=>"LineLT2Type", 'fd.total_localtax2'=>"LineTotalLT2",
561 561
 			'fd.buy_price_ht'=>'BuyingPrice', 'fd.date_start'=>"DateStart", 'fd.date_end'=>"DateEnd", 'fd.special_code'=>'SpecialCode',
562 562
 			'fd.product_type'=>"TypeOfLineServiceOrProduct", 'fd.fk_product'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel',
563
-			$alias_product_perentity . '.accountancy_code_sell'=>'ProductAccountancySellCode',
563
+			$alias_product_perentity.'.accountancy_code_sell'=>'ProductAccountancySellCode',
564 564
 			'aa.account_number' => 'AccountingAffectation'
565 565
 		);
566 566
 		if (!$uselocaltax1) {
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 			'fd.total_ht'=>"Numeric", 'fd.total_tva'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.total_localtax1'=>"Numeric", 'fd.total_localtax2'=>"Numeric",
593 593
 			'fd.localtax1_tx'=>'Numeric', 'fd.localtax2_tx'=>'Numeric', 'fd.localtax1_type'=>'Numeric', 'fd.localtax2_type'=>'Numeric',
594 594
 			'fd.special_code'=>'Numeric', 'fd.product_type'=>"Numeric", 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text',
595
-			$alias_product_perentity . '.accountancy_code_sell'=>'Text',
595
+			$alias_product_perentity.'.accountancy_code_sell'=>'Text',
596 596
 			'aa.account_number' => 'Text',
597 597
 			'f.multicurrency_code' => 'Text',
598 598
 			'f.multicurrency_tx' => 'Number', 'f.multicurrency_total_ht' => 'Number', 'f.multicurrency_total_tva' => 'Number', 'f.multicurrency_total_ttc' => 'Number'
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 			'fd.total_ht'=>"invoice_line", 'fd.total_tva'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.total_localtax1'=>"invoice_line", 'fd.total_localtax2'=>"invoice_line",
607 607
 			'fd.tva_tx'=>"invoice_line", 'fd.localtax1_tx'=>"invoice_line", 'fd.localtax2_tx'=>"invoice_line", 'fd.localtax1_type'=>"invoice_line", 'fd.localtax2_type'=>"invoice_line",
608 608
 			'fd.qty'=>"invoice_line", 'fd.date_start'=>"invoice_line", 'fd.date_end'=>"invoice_line", 'fd.special_code'=>'invoice_line',
609
-			'fd.product_type'=>'invoice_line', 'fd.fk_product'=>'product', 'p.ref'=>'product', 'p.label'=>'product', $alias_product_perentity . '.accountancy_code_sell'=>'product',
609
+			'fd.product_type'=>'invoice_line', 'fd.fk_product'=>'product', 'p.ref'=>'product', 'p.label'=>'product', $alias_product_perentity.'.accountancy_code_sell'=>'product',
610 610
 			'f.fk_user_author'=>'user', 'uc.login'=>'user', 'f.fk_user_valid'=>'user', 'uv.login'=>'user',
611 611
 			'aa.account_number' => "invoice_line",
612 612
 		);
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 		$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet_extrafields as extra2 on fd.rowid = extra2.fk_object';
649 649
 		$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
650 650
 		if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
651
-			$this->export_sql_end[$r] .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
651
+			$this->export_sql_end[$r] .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
652 652
 		}
653 653
 		$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object';
654 654
 		$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'accounting_account as aa on fd.fk_code_ventilation = aa.rowid';
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 		$keyforaliasextra = 'extra';
729 729
 		include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
730 730
 		$this->export_sql_start[$r] = 'SELECT DISTINCT ';
731
-		$this->export_sql_end[$r]  = ' FROM '.MAIN_DB_PREFIX.'societe as s';
731
+		$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s';
732 732
 		if (!empty($user) && !$user->hasRight('societe', 'client', 'voir')) {
733 733
 			$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
734 734
 		}
Please login to merge, or discard this patch.
htdocs/core/modules/modFournisseur.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 			'fd.total_ht'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.tva'=>"Numeric", 'fd.total_localtax1'=>"Numeric", 'fd.total_localtax2'=>"Numeric",
402 402
 			'fd.localtax1_tx'=>'Numeric', 'fd.localtax2_tx'=>'Numeric', 'fd.localtax1_type'=>'Numeric', 'fd.localtax2_type'=>'Numeric',
403 403
 			'fd.date_start'=>"Date", 'fd.date_end'=>"Date", 'fd.special_code'=>"Numeric",
404
-			'fd.product_type'=>'Numeric', 'fd.fk_product'=>'List:product:label', $alias_product_perentity . '.accountancy_code_buy'=>'Text',
404
+			'fd.product_type'=>'Numeric', 'fd.fk_product'=>'List:product:label', $alias_product_perentity.'.accountancy_code_buy'=>'Text',
405 405
 			'p.ref'=>'Text', 'p.label'=>'Text', 'project.ref'=>'Text', 'project.title'=>'Text',
406 406
 			'f.multicurrency_code' => 'Text',
407 407
 			'f.multicurrency_tx' => 'Number', 'f.multicurrency_total_ht' => 'Number', 'f.multicurrency_total_tva' => 'Number', 'f.multicurrency_total_ttc' => 'Number'
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 		include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
518 518
 		// End add extra fields object
519 519
 		$this->export_sql_start[$r] = 'SELECT DISTINCT ';
520
-		$this->export_sql_end[$r]  = ' FROM '.MAIN_DB_PREFIX.'societe as s';
520
+		$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s';
521 521
 		if (is_object($user) && !$user->hasRight('societe', 'client', 'voir')) {
522 522
 			$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
523 523
 		}
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 		// Add extra fields object
585 585
 		$keyforselect = 'commande_fournisseur';
586 586
 		$keyforelement = 'order';
587
-		$keyforaliasextra = 'extra';  // @phan-suppress-current-line PhanPluginRedundantAssignment
587
+		$keyforaliasextra = 'extra'; // @phan-suppress-current-line PhanPluginRedundantAssignment
588 588
 		include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
589 589
 		// End add extra fields object
590 590
 		// Add extra fields line
Please login to merge, or discard this patch.
htdocs/core/lib/ticket.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
 	$resql = $db->query($sql);
115 115
 	if ($resql) {
116 116
 		$numrows = $db->num_rows($resql);
117
-		for ($i=0; $i < $numrows; $i++) {
117
+		for ($i = 0; $i < $numrows; $i++) {
118 118
 			$upload_msg_dir = $conf->agenda->dir_output.'/'.$db->fetch_row($resql)[0];
119 119
 			$nbFiles += count(dol_dir_list($upload_msg_dir, "files"));
120 120
 		}
Please login to merge, or discard this patch.
htdocs/core/class/html.formfile.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			$maxphptoshow = $maxfilesizearray['maxphptoshow'];
157 157
 			$maxphptoshowparam = $maxfilesizearray['maxphptoshowparam'];
158 158
 			if ($maxmin > 0) {
159
-				$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
159
+				$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
160 160
 			}
161 161
 			$out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"';
162 162
 			$out .= ((getDolGlobalString('MAIN_DISABLE_MULTIPLE_FILEUPLOAD') || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple');
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 				} else {
595 595
 					include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
596 596
 					//$modellist = ModeleExports::liste_modeles($this->db);		// liste_modeles() does not exists. We are using listOfAvailableExportFormat() method instead that return a different array format.
597
-					$modellist = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
597
+					$modellist = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
598 598
 				}
599 599
 			} elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') {
600 600
 				if (is_array($genallowed)) {
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 			$out .= '<tr class="liste_titre">';
715 715
 			$addcolumforpicto = ($delallowed || $printer || $morepicto);
716 716
 			$colspan = (4 + ($addcolumforpicto ? 1 : 0));
717
-			$colspanmore = 0;  // @phan-suppress-current-line PhanPluginRedundantAssignment
717
+			$colspanmore = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment
718 718
 
719 719
 			$out .= '<th colspan="'.$colspan.'" class="formdoc liste_titre maxwidthonsmartphone center">';
720 720
 
@@ -1357,7 +1357,7 @@  discard block
 block discarded – undo
1357 1357
 					}
1358 1358
 					$filepath = $file['level1name'].'/'.$file['name'];
1359 1359
 					$modulepart = basename(dirname($file['path']));
1360
-					$relativepath = preg_replace('/\/(.+)/', '', $filepath) . '/';
1360
+					$relativepath = preg_replace('/\/(.+)/', '', $filepath).'/';
1361 1361
 
1362 1362
 					$editline = 0;
1363 1363
 					$nboflines++;
Please login to merge, or discard this patch.
htdocs/core/class/extrafields.class.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
 					'start' => isset($value['start']) ? $value['start'] : '',
1140 1140
 					'end'   => isset($value['end']) ? $value['end'] : ''
1141 1141
 				);
1142
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1142
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1143 1143
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
1144 1144
 				$out .= '</div><div class="nowrap">';
1145 1145
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
@@ -1164,7 +1164,7 @@  discard block
 block discarded – undo
1164 1164
 					'start' => isset($value['start']) ? $value['start'] : '',
1165 1165
 					'end'   => isset($value['end']) ? $value['end'] : ''
1166 1166
 				);
1167
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1167
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1168 1168
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel');
1169 1169
 				$out .= '</div><div class="nowrap">';
1170 1170
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
 			} else {
1235 1235
 				$out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1);
1236 1236
 			}
1237
-			$out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">';	// A hidden field ending with "_boolean" that is always set to 1.
1237
+			$out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1.
1238 1238
 		} elseif ($type == 'price') {
1239 1239
 			if (!empty($value)) {		// $value in memory is a php numeric, we format it into user number format.
1240 1240
 				$value = price($value);
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
 			}
1257 1257
 			$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> ';
1258 1258
 		} elseif ($type == 'select') {
1259
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
1259
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
1260 1260
 			if ($mode) {
1261 1261
 				$options = array();
1262 1262
 				foreach ($param['options'] as $okey => $val) {
@@ -1311,7 +1311,7 @@  discard block
 block discarded – undo
1311 1311
 				$out .= '</select>';
1312 1312
 			}
1313 1313
 		} elseif ($type == 'sellist') {
1314
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
1314
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
1315 1315
 			if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
1316 1316
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1317 1317
 				$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
@@ -1474,7 +1474,7 @@  discard block
 block discarded – undo
1474 1474
 			}
1475 1475
 			$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, '', 0, '', 0, '100%');
1476 1476
 		} elseif ($type == 'radio') {
1477
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
1477
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
1478 1478
 			foreach ($param['options'] as $keyopt => $val) {
1479 1479
 				$out .= '<input class="flat '.$morecss.'" type="radio" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '');
1480 1480
 				$out .= ' value="'.$keyopt.'"';
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
 
1703 1703
 			$tmparray = explode(':', $param_list[0]);
1704 1704
 
1705
-			$element = $extrafieldsobjectkey;		// $extrafieldsobjectkey comes from $object->table_element but we need $object->element
1705
+			$element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element
1706 1706
 			if ($element == 'socpeople') {
1707 1707
 				$element = 'contact';
1708 1708
 			} elseif ($element == 'projet') {
@@ -1773,7 +1773,7 @@  discard block
 block discarded – undo
1773 1773
 
1774 1774
 		$label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
1775 1775
 		$type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
1776
-		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key];			// Can be '255', '24,8'...
1776
+		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'...
1777 1777
 		$default = $this->attributes[$extrafieldsobjectkey]['default'][$key];
1778 1778
 		$computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key];
1779 1779
 		$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
@@ -1795,7 +1795,7 @@  discard block
 block discarded – undo
1795 1795
 		if ($type == 'date') {
1796 1796
 			$showsize = 10;
1797 1797
 			if ($value !== '') {
1798
-				$value = dol_print_date($value, 'day');	// For date without hour, date is always GMT for storage and output
1798
+				$value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output
1799 1799
 			}
1800 1800
 		} elseif ($type == 'datetime') {
1801 1801
 			$showsize = 19;
@@ -1920,9 +1920,9 @@  discard block
 block discarded – undo
1920 1920
 								$translabel = $outputlangs->trans($obj->$field_toshow);
1921 1921
 
1922 1922
 								if ($translabel != $obj->$field_toshow) {
1923
-									$value .= dol_trunc($translabel, 24) . ' ';
1923
+									$value .= dol_trunc($translabel, 24).' ';
1924 1924
 								} else {
1925
-									$value .= $obj->$field_toshow . ' ';
1925
+									$value .= $obj->$field_toshow.' ';
1926 1926
 								}
1927 1927
 							}
1928 1928
 						}
@@ -1943,13 +1943,13 @@  discard block
 block discarded – undo
1943 1943
 					$toprint = array();
1944 1944
 					$obj = $this->db->fetch_object($resql);
1945 1945
 					if ($obj->rowid) {
1946
-						require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1946
+						require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1947 1947
 						$c = new Categorie($this->db);
1948 1948
 						$result = $c->fetch($obj->rowid);
1949 1949
 						if ($result > 0) {
1950 1950
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
1951 1951
 							foreach ($ways as $way) {
1952
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
1952
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>';
1953 1953
 							}
1954 1954
 						}
1955 1955
 					}
@@ -2101,7 +2101,7 @@  discard block
 block discarded – undo
2101 2101
 			} else {
2102 2102
 				$value = '';
2103 2103
 			}
2104
-		} elseif (in_array($type, ['multipts','linestrg', 'polygon'])) {
2104
+		} elseif (in_array($type, ['multipts', 'linestrg', 'polygon'])) {
2105 2105
 			if (!empty($value)) {
2106 2106
 				require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeophp.class.php';
2107 2107
 				$dolgeophp = new DolGeoPHP($this->db);
@@ -2205,12 +2205,12 @@  discard block
 block discarded – undo
2205 2205
 		if ($mode == 'create') {
2206 2206
 			// On create mode, force separator group to not be collapsible
2207 2207
 			$extrafield_collapse_display_value = 1;
2208
-			$expand_display = true;	// We force group to be shown expanded
2208
+			$expand_display = true; // We force group to be shown expanded
2209 2209
 			$disabledcookiewrite = 1; // We keep status of group unchanged into the cookie
2210 2210
 		}
2211 2211
 
2212 2212
 		$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">';
2213
-		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="' . $colspan . '"' : '').'>';
2213
+		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>';
2214 2214
 		// Some js code will be injected here to manage the collapsing of extrafields
2215 2215
 		// Output the picto
2216 2216
 		$out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>';
@@ -2292,7 +2292,7 @@  discard block
 block discarded – undo
2292 2292
 					continue;
2293 2293
 				}
2294 2294
 
2295
-				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) {
2295
+				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) {
2296 2296
 					//when unticking boolean field, it's not set in POST
2297 2297
 					continue;
2298 2298
 				}
@@ -2321,7 +2321,7 @@  discard block
 block discarded – undo
2321 2321
 						$onlykey === '@GETPOSTISSET'
2322 2322
 						&& in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst'))
2323 2323
 						&& in_array(abs($enabled), array(2, 5))
2324
-						&& ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided
2324
+						&& !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided
2325 2325
 					)
2326 2326
 				) {
2327 2327
 					continue;
@@ -2458,16 +2458,16 @@  discard block
 block discarded – undo
2458 2458
 				}
2459 2459
 
2460 2460
 				if (in_array($key_type, array('date'))) {
2461
-					$dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start';
2462
-					$dateparamname_end   = $keysuffix . 'options_' . $key . $keyprefix . '_end';
2463
-					if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) {
2461
+					$dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start';
2462
+					$dateparamname_end   = $keysuffix.'options_'.$key.$keyprefix.'_end';
2463
+					if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) {
2464 2464
 						$value_key = array();
2465 2465
 						// values provided as a component year, month, day, etc.
2466
-						if (GETPOST($dateparamname_start . 'year')) {
2467
-							$value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'));
2466
+						if (GETPOST($dateparamname_start.'year')) {
2467
+							$value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'));
2468 2468
 						}
2469
-						if (GETPOST($dateparamname_start . 'year')) {
2470
-							$value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'));
2469
+						if (GETPOST($dateparamname_start.'year')) {
2470
+							$value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'));
2471 2471
 						}
2472 2472
 					} elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) {
2473 2473
 						// Clean parameters
@@ -2476,22 +2476,22 @@  discard block
 block discarded – undo
2476 2476
 						continue; // Value was not provided, we should not set it.
2477 2477
 					}
2478 2478
 				} elseif (in_array($key_type, array('datetime', 'datetimegmt'))) {
2479
-					$dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start';
2480
-					$dateparamname_end   = $keysuffix . 'options_' . $key . $keyprefix . '_end';
2481
-					if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) {
2479
+					$dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start';
2480
+					$dateparamname_end   = $keysuffix.'options_'.$key.$keyprefix.'_end';
2481
+					if (GETPOST($dateparamname_start.'year') && GETPOST($dateparamname_end.'year')) {
2482 2482
 						// values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc.
2483
-						$dateparamname_end_hour = GETPOSTINT($dateparamname_end . 'hour') != '-1' ? GETPOSTINT($dateparamname_end . 'hour') : '23';
2484
-						$dateparamname_end_min = GETPOSTINT($dateparamname_end . 'min') != '-1' ? GETPOSTINT($dateparamname_end . 'min') : '59';
2485
-						$dateparamname_end_sec = GETPOSTINT($dateparamname_end . 'sec') != '-1' ? GETPOSTINT($dateparamname_end . 'sec') : '59';
2483
+						$dateparamname_end_hour = GETPOSTINT($dateparamname_end.'hour') != '-1' ? GETPOSTINT($dateparamname_end.'hour') : '23';
2484
+						$dateparamname_end_min = GETPOSTINT($dateparamname_end.'min') != '-1' ? GETPOSTINT($dateparamname_end.'min') : '59';
2485
+						$dateparamname_end_sec = GETPOSTINT($dateparamname_end.'sec') != '-1' ? GETPOSTINT($dateparamname_end.'sec') : '59';
2486 2486
 						if ($key_type == 'datetimegmt') {
2487 2487
 							$value_key = array(
2488
-								'start' => dol_mktime(GETPOSTINT($dateparamname_start . 'hour'), GETPOSTINT($dateparamname_start . 'min'), GETPOSTINT($dateparamname_start . 'sec'), GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'gmt'),
2489
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'gmt')
2488
+								'start' => dol_mktime(GETPOSTINT($dateparamname_start.'hour'), GETPOSTINT($dateparamname_start.'min'), GETPOSTINT($dateparamname_start.'sec'), GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'gmt'),
2489
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'gmt')
2490 2490
 							);
2491 2491
 						} else {
2492 2492
 							$value_key = array(
2493
-								'start' => dol_mktime(GETPOSTINT($dateparamname_start . 'hour'), GETPOSTINT($dateparamname_start . 'min'), GETPOSTINT($dateparamname_start . 'sec'), GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'tzuserrel'),
2494
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'tzuserrel')
2493
+								'start' => dol_mktime(GETPOSTINT($dateparamname_start.'hour'), GETPOSTINT($dateparamname_start.'min'), GETPOSTINT($dateparamname_start.'sec'), GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'tzuserrel'),
2494
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'tzuserrel')
2495 2495
 							);
2496 2496
 						}
2497 2497
 					} elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) {
Please login to merge, or discard this patch.
htdocs/core/class/dolgeophp.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
 	public function getPointString($value)
85 85
 	{
86 86
 		$geom = geoPHP::load($value, 'wkt');
87
-		$value = get_class($geom) . ' : '. $geom->numPoints() . ' Points';
87
+		$value = get_class($geom).' : '.$geom->numPoints().' Points';
88 88
 
89 89
 		return $value;
90 90
 	}
Please login to merge, or discard this patch.
htdocs/core/class/geomapeditor.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 	{
50 50
 		global $langs;
51 51
 
52
-		$out = '<input id="' . $htmlname . '" name="' . $htmlname . '" size="100" value="' . htmlentities($geojson, ENT_QUOTES) . '"/>';
53
-		$out .= '<div id="map_' . $htmlname . '" style="width: 600px; height: 350px;"></div>';
52
+		$out = '<input id="'.$htmlname.'" name="'.$htmlname.'" size="100" value="'.htmlentities($geojson, ENT_QUOTES).'"/>';
53
+		$out .= '<div id="map_'.$htmlname.'" style="width: 600px; height: 350px;"></div>';
54 54
 		if ($geojson != '{}') {
55 55
 			// OpenLayers it's "longitude, latitude".
56 56
 			// inverting coordinates
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
 		}
98 98
 		$out .= '
99 99
 		<script>
100
-			var geoms = JSON.parse(\'' . $geojson . '\');
101
-			var centroid = JSON.parse(\'' . $centroidjson . '\');
102
-			var markerType = "' . $markertype . '";
103
-			var map = L.map("map_' . $htmlname . '");
100
+			var geoms = JSON.parse(\'' . $geojson.'\');
101
+			var centroid = JSON.parse(\'' . $centroidjson.'\');
102
+			var markerType = "' . $markertype.'";
103
+			var map = L.map("map_' . $htmlname.'");
104 104
 			console.log(markerType);
105 105
 			console.log(geoms);
106 106
 			map.pm.addControls({
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 				maxZoom: 19,
145 145
 				attribution: \'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>\'
146 146
 			}).addTo(map);
147
-			map.pm.setLang("' . ($langs->shortlang ?? 'en') . '");
147
+			map.pm.setLang("' . ($langs->shortlang ?? 'en').'");
148 148
 
149 149
 			enableMarker(markerType);
150 150
 			// if (geoms && geoms.type == "Point") {
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 			map.on("pm:remove", (e) => {
167 167
 				enableMarker();
168 168
 				console.log(e);
169
-				$("#' . $htmlname . '").val ("{}");
169
+				$("#' . $htmlname.'").val ("{}");
170 170
 			});
171 171
 			map.on("pm:edit", (e) => {
172 172
 				console.log("pm:edit");
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 					fg.addLayer(layer);
204 204
 				});
205 205
 				console.log(fg.toGeoJSON());
206
-				$("#' . $htmlname . '").val (JSON.stringify(fg.toGeoJSON().features[0].geometry));
206
+				$("#' . $htmlname.'").val (JSON.stringify(fg.toGeoJSON().features[0].geometry));
207 207
 			}
208 208
 			function findLayers(map) {
209 209
 				// https://stackoverflow.com/questions/62887120/leafletjs-geoman-into-json-data
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
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
123 123
 			if (!empty($perm)) {
124 124
 				$tmp = explode(':', $typeofdata);
125
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
125
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
126 126
 				if ($fieldrequired) {
127 127
 					$ret .= '<span class="fieldrequired">';
128 128
 				}
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 				if ($fieldrequired) {
135 135
 					$ret .= '</span>';
136 136
 				}
137
-				$ret .= '</div>' . "\n";
137
+				$ret .= '</div>'."\n";
138 138
 			} else {
139 139
 				if ($fieldrequired) {
140 140
 					$ret .= '<span class="fieldrequired">';
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 			if (empty($notabletag) && $perm) {
173 173
 				$ret .= '<td class="right">';
174 174
 			}
175
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
176
-				$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>';
175
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
176
+				$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>';
177 177
 			}
178 178
 			if (!empty($notabletag) && $notabletag == 1) {
179 179
 				if ($text) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 			} elseif ($reg[1] == 'int') {
241 241
 				$typeofdata = 'numeric';
242 242
 			} else {
243
-				return 'ErrorBadParameter ' . $typeofdata;
243
+				return 'ErrorBadParameter '.$typeofdata;
244 244
 			}
245 245
 		}
246 246
 
@@ -251,13 +251,13 @@  discard block
 block discarded – undo
251 251
 			if ($editaction == '') {
252 252
 				$editaction = GETPOST('action', 'aZ09');
253 253
 			}
254
-			$editmode = ($editaction == 'edit' . $htmlname);
254
+			$editmode = ($editaction == 'edit'.$htmlname);
255 255
 			if ($editmode) {	// edit mode
256 256
 				$ret .= "\n";
257
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
258
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
259
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
260
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
257
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
258
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
259
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
260
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
261 261
 				if (empty($notabletag)) {
262 262
 					$ret .= '<table class="nobordernopadding centpercent">';
263 263
 				}
@@ -266,28 +266,28 @@  discard block
 block discarded – undo
266 266
 				}
267 267
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
268 268
 					$tmp = explode(':', $typeofdata);
269
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
269
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
270 270
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
271 271
 					$tmp = explode(':', $typeofdata);
272 272
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
273
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
273
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
274 274
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
275 275
 					$tmp = explode(':', $typeofdata);
276 276
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
277
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
277
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
278 278
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
279 279
 					$tmp = explode(':', $typeofdata);
280
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
280
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
281 281
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
282 282
 					$tmp = explode(':', $typeofdata);
283 283
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
284 284
 					$morealt = '';
285 285
 					if (preg_match('/%/', $cols)) {
286
-						$morealt = ' style="width: ' . $cols . '"';
286
+						$morealt = ' style="width: '.$cols.'"';
287 287
 						$cols = '';
288 288
 					}
289 289
 					$valuetoshow = ($editvalue ? $editvalue : $value);
290
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
290
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
291 291
 					// textarea convert automatically entities chars into simple chars.
292 292
 					// 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.
293 293
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -297,12 +297,12 @@  discard block
 block discarded – undo
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, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
300
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
301 301
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
302 302
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
303 303
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
304 304
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
305
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
305
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
306 306
 				} elseif (preg_match('/^select;/', $typeofdata)) {
307 307
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
308 308
 					$arraylist = array();
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 					// TODO Not yet implemented. See code for extrafields
317 317
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
318 318
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
319
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
319
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
320 320
 					$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]));
321 321
 					$ret .= $doleditor->Create(1);
322 322
 				} elseif ($typeofdata == 'asis') {
@@ -331,19 +331,19 @@  discard block
 block discarded – undo
331 331
 					$ret .= '<td>';
332 332
 				}
333 333
 				//else $ret.='<div class="clearboth"></div>';
334
-				$ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
334
+				$ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
335 335
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
336
-					$ret .= '<br>' . "\n";
336
+					$ret .= '<br>'."\n";
337 337
 				}
338
-				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
338
+				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
339 339
 				if (empty($notabletag)) {
340 340
 					$ret .= '</td>';
341 341
 				}
342 342
 
343 343
 				if (empty($notabletag)) {
344
-					$ret .= '</tr></table>' . "\n";
344
+					$ret .= '</tr></table>'."\n";
345 345
 				}
346
-				$ret .= '</form>' . "\n";
346
+				$ret .= '</form>'."\n";
347 347
 			} else {		// view mode
348 348
 				if (preg_match('/^email/', $typeofdata)) {
349 349
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -355,15 +355,15 @@  discard block
 block discarded – undo
355 355
 					$ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : '');
356 356
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
357 357
 					$tmp = explode(':', $typeofdata);
358
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
358
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
359 359
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
360 360
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
361 361
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
362 362
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
363 363
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
364
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
364
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
365 365
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
366
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
366
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
367 367
 				} elseif (preg_match('/^select;/', $typeofdata)) {
368 368
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
369 369
 					$arraylist = array();
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
 					$ret .= $arraylist[$value];
375 375
 					if ($htmlname == 'fk_product_type') {
376 376
 						if ($value == 0) {
377
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
377
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
378 378
 						} else {
379
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
379
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
380 380
 						}
381 381
 					}
382 382
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
385 385
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
386 386
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
387
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
387
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
388 388
 					}
389 389
 					// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also
390 390
 					// clean data from some dangerous html
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
394 394
 						$ret .= dol_escape_htmltag($value);
395 395
 					} else {
396
-						$ret .= $value;        // $value must be already html escaped.
396
+						$ret .= $value; // $value must be already html escaped.
397 397
 					}
398 398
 				}
399 399
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 
432 432
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
433 433
 			if (!is_object($extralanguages)) {
434
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
434
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
435 435
 				$extralanguages = new ExtraLanguages($this->db);
436 436
 			}
437 437
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -440,17 +440,17 @@  discard block
 block discarded – undo
440 440
 				return ''; // No extralang field to show
441 441
 			}
442 442
 
443
-			$result .= '<!-- Widget for translation -->' . "\n";
444
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
443
+			$result .= '<!-- Widget for translation -->'."\n";
444
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
445 445
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
446 446
 			$result .= $s;
447 447
 			$result .= '</div>';
448 448
 
449
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
449
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
450 450
 
451 451
 			$resultforextrlang = '';
452 452
 			foreach ($arrayoflangcode as $langcode) {
453
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
453
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
454 454
 				if (empty($valuetoshow)) {
455 455
 					$object->fetchValuesForExtraLanguages();
456 456
 					//var_dump($object->array_languages);
@@ -462,17 +462,17 @@  discard block
 block discarded – undo
462 462
 
463 463
 				// TODO Use the showInputField() method of ExtraLanguages object
464 464
 				if ($typeofdata == 'textarea') {
465
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
465
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
466 466
 					$resultforextrlang .= $valuetoshow;
467 467
 					$resultforextrlang .= '</textarea>';
468 468
 				} else {
469
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
469
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
470 470
 				}
471 471
 			}
472 472
 			$result .= $resultforextrlang;
473 473
 
474 474
 			$result .= '</div>';
475
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
475
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
476 476
 		}
477 477
 
478 478
 		return $result;
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 				if (!empty($tmp[2])) {
536 536
 					$savemethod = $tmp[2];
537 537
 				}
538
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
538
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
539 539
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
540 540
 				$tmp = explode(':', $inputType);
541 541
 				$inputType = $tmp[0];
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 					$savemethod = $tmp[2];
547 547
 				}
548 548
 
549
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
549
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
550 550
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
551 551
 				$tmp = explode(':', $inputType);
552 552
 				$inputType = $tmp[0];
@@ -577,40 +577,40 @@  discard block
 block discarded – undo
577 577
 				}
578 578
 
579 579
 				if (isModEnabled('fckeditor')) {
580
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
580
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
581 581
 				} else {
582 582
 					$inputType = 'textarea';
583 583
 				}
584 584
 			}
585 585
 
586
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
587
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
588
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
589
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
586
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
587
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
588
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
589
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
590 590
 			if (!empty($savemethod)) {
591
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
591
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
592 592
 			}
593 593
 			if (!empty($ext_element)) {
594
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
594
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
595 595
 			}
596 596
 			if (!empty($custommsg)) {
597 597
 				if (is_array($custommsg)) {
598 598
 					if (!empty($custommsg['success'])) {
599
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
599
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
600 600
 					}
601 601
 					if (!empty($custommsg['error'])) {
602
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
602
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
603 603
 					}
604 604
 				} else {
605
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
605
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
606 606
 				}
607 607
 			}
608 608
 			if ($inputType == 'textarea') {
609
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
610
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
609
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
610
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
611 611
 			}
612
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
613
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
612
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
613
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
614 614
 		} else {
615 615
 			$out = $value;
616 616
 		}
@@ -639,12 +639,12 @@  discard block
 block discarded – undo
639 639
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
640 640
 	{
641 641
 		if ($incbefore) {
642
-			$text = $incbefore . $text;
642
+			$text = $incbefore.$text;
643 643
 		}
644 644
 		if (!$htmltext) {
645 645
 			return $text;
646 646
 		}
647
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
647
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
648 648
 
649 649
 		$tag = 'td';
650 650
 		if ($notabs == 2) {
@@ -658,11 +658,11 @@  discard block
 block discarded – undo
658 658
 
659 659
 		$extrastyle = '';
660 660
 		if ($direction < 0) {
661
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
661
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
662 662
 			$extrastyle = 'padding: 0px; padding-left: 3px;';
663 663
 		}
664 664
 		if ($direction > 0) {
665
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
665
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
666 666
 			$extrastyle = 'padding: 0px; padding-right: 3px;';
667 667
 		}
668 668
 
@@ -675,53 +675,53 @@  discard block
 block discarded – undo
675 675
 			$htmltext = str_replace('"', '&quot;', $htmltext);
676 676
 		} else {
677 677
 			$classfortooltip = 'classfortooltiponclick';
678
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
678
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
679 679
 		}
680 680
 		if ($tooltipon == 2 || $tooltipon == 3) {
681
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
681
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
682 682
 			if ($tooltiptrigger == '') {
683
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip
683
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip
684 684
 			} else {
685
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
685
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
686 686
 			}
687 687
 		} else {
688
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
688
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
689 689
 		}
690 690
 		if ($tooltipon == 1 || $tooltipon == 3) {
691
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
691
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
692 692
 			if ($tooltiptrigger == '') {
693
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip
693
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip
694 694
 			} else {
695
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
695
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
696 696
 			}
697 697
 		} else {
698
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
698
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
699 699
 		}
700 700
 		if (empty($notabs)) {
701 701
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
702 702
 		} elseif ($notabs == 2) {
703
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
703
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
704 704
 		}
705 705
 		// Define value if value is before
706 706
 		if ($direction < 0) {
707
-			$s .= '<' . $tag . $paramfortooltipimg;
707
+			$s .= '<'.$tag.$paramfortooltipimg;
708 708
 			if ($tag == 'td') {
709 709
 				$s .= ' class="valigntop" width="14"';
710 710
 			}
711
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
711
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
712 712
 		}
713 713
 		// Use another method to help avoid having a space in value in order to use this value with jquery
714 714
 		// Define label
715 715
 		if ((string) $text != '') {
716
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
716
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
717 717
 		}
718 718
 		// Define value if value is after
719 719
 		if ($direction > 0) {
720
-			$s .= '<' . $tag . $paramfortooltipimg;
720
+			$s .= '<'.$tag.$paramfortooltipimg;
721 721
 			if ($tag == 'td') {
722 722
 				$s .= ' class="valignmiddle" width="14"';
723 723
 			}
724
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
724
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
725 725
 		}
726 726
 		if (empty($notabs)) {
727 727
 			$s .= '</tr></table>';
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 
829 829
 		$disabled = 0;
830 830
 		$ret = '<div class="centpercent center">';
831
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
831
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
832 832
 
833 833
 		// 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.
834 834
 		$parameters = array();
@@ -839,10 +839,10 @@  discard block
 block discarded – undo
839 839
 			return;
840 840
 		}
841 841
 		if (empty($reshook)) {
842
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
842
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
843 843
 			if (is_array($arrayofaction)) {
844 844
 				foreach ($arrayofaction as $code => $label) {
845
-					$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
845
+					$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
846 846
 				}
847 847
 			}
848 848
 		}
@@ -851,17 +851,17 @@  discard block
 block discarded – undo
851 851
 		$ret .= '</select>';
852 852
 
853 853
 		if (empty($conf->dol_optimize_smallscreen)) {
854
-			$ret .= ajax_combobox('.' . $name . 'select');
854
+			$ret .= ajax_combobox('.'.$name.'select');
855 855
 		}
856 856
 
857 857
 		// 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
858 858
 		$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.
859
-		$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")) . '">';
859
+		$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
860 860
 		$ret .= '</div>';
861 861
 
862 862
 		if (!empty($conf->use_javascript_ajax)) {
863 863
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
864
-    		<script nonce="' . getNonce() . '">
864
+    		<script nonce="' . getNonce().'">
865 865
                         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 */
866 866
         		{
867 867
         			atleastoneselected=0;
@@ -872,11 +872,11 @@  discard block
 block discarded – undo
872 872
 
873 873
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
874 874
 
875
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
875
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
876 876
     	  			{
877 877
                                     jQuery("."+name).show();
878
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
879
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
878
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
879
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
880 880
     	  			}
881 881
     	  			else
882 882
     	  			{
@@ -886,11 +886,11 @@  discard block
 block discarded – undo
886 886
         		}
887 887
 
888 888
         	jQuery(document).ready(function () {
889
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
890
-                    jQuery(".' . $cssclass . '").click(function() {
891
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
889
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
890
+                    jQuery(".' . $cssclass.'").click(function() {
891
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
892 892
                     });
893
-                        jQuery(".' . $name . 'select").change(function() {
893
+                        jQuery(".' . $name.'select").change(function() {
894 894
         			var massaction = $( this ).val();
895 895
         			var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
896 896
         			if (massaction == "builddoc")
@@ -898,18 +898,18 @@  discard block
 block discarded – undo
898 898
                         urlform = urlform + "#show_files";
899 899
     	            }
900 900
         			$( this ).closest("form").attr("action", urlform);
901
-                    console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
901
+                    console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
902 902
         	        /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
903 903
         			if ($(this).val() != \'0\')
904 904
     	  			{
905
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
906
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
907
-                                        jQuery(".' . $name . '"+massaction).show();
905
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
906
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
907
+                                        jQuery(".' . $name.'"+massaction).show();
908 908
     	  			}
909 909
     	  			else
910 910
     	  			{
911
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
912
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
911
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
912
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
913 913
     	  			}
914 914
     	        });
915 915
         	});
@@ -952,14 +952,14 @@  discard block
 block discarded – undo
952 952
 		$atleastonefavorite = 0;
953 953
 
954 954
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
955
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
955
+		$sql .= " FROM ".$this->db->prefix()."c_country";
956 956
 		$sql .= " WHERE active > 0";
957 957
 		//$sql.= " ORDER BY code ASC";
958 958
 
959
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
959
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
960 960
 		$resql = $this->db->query($sql);
961 961
 		if ($resql) {
962
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
962
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
963 963
 			$num = $this->db->num_rows($resql);
964 964
 			$i = 0;
965 965
 			if ($num) {
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 					$countryArray[$i]['rowid'] = $obj->rowid;
970 970
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
971 971
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
972
-					$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 : ''));
972
+					$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 : ''));
973 973
 					$countryArray[$i]['favorite'] = $obj->favorite;
974 974
 					$countryArray[$i]['eec'] = $obj->eec;
975 975
 					$favorite[$i] = $obj->favorite;
@@ -987,20 +987,20 @@  discard block
 block discarded – undo
987 987
 
988 988
 				if ($showempty) {
989 989
 					if (is_numeric($showempty)) {
990
-						$out .= '<option value="">&nbsp;</option>' . "\n";
990
+						$out .= '<option value="">&nbsp;</option>'."\n";
991 991
 					} else {
992
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
992
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
993 993
 					}
994 994
 				}
995 995
 
996 996
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
997 997
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
998
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
999
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
998
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
999
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
1000 1000
 					if ($mysoc->isInEEC()) {
1001
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
1001
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
1002 1002
 					}
1003
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
1003
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
1004 1004
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
1005 1005
 				}
1006 1006
 
@@ -1028,20 +1028,20 @@  discard block
 block discarded – undo
1028 1028
 						$labeltoshow .= '&nbsp;';
1029 1029
 					}
1030 1030
 					if ($row['code_iso']) {
1031
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1031
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1032 1032
 						if (empty($hideflags)) {
1033 1033
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1034
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1034
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1035 1035
 						}
1036 1036
 					}
1037 1037
 
1038 1038
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1039
-						$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']) . '">';
1039
+						$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']).'">';
1040 1040
 					} else {
1041
-						$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']) . '">';
1041
+						$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']).'">';
1042 1042
 					}
1043 1043
 					$out .= $labeltoshow;
1044
-					$out .= '</option>' . "\n";
1044
+					$out .= '</option>'."\n";
1045 1045
 				}
1046 1046
 			}
1047 1047
 			$out .= '</select>';
@@ -1050,8 +1050,8 @@  discard block
 block discarded – undo
1050 1050
 		}
1051 1051
 
1052 1052
 		// Make select dynamic
1053
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1054
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1053
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1054
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1055 1055
 
1056 1056
 		return $out;
1057 1057
 	}
@@ -1083,25 +1083,25 @@  discard block
 block discarded – undo
1083 1083
 		$incotermArray = array();
1084 1084
 
1085 1085
 		$sql = "SELECT rowid, code";
1086
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1086
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1087 1087
 		$sql .= " WHERE active > 0";
1088 1088
 		$sql .= " ORDER BY code ASC";
1089 1089
 
1090
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1090
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1091 1091
 		$resql = $this->db->query($sql);
1092 1092
 		if ($resql) {
1093 1093
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1094
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1094
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1095 1095
 				$out .= ajax_combobox($htmlname, $events);
1096 1096
 			}
1097 1097
 
1098 1098
 			if (!empty($page)) {
1099
-				$out .= '<form method="post" action="' . $page . '">';
1099
+				$out .= '<form method="post" action="'.$page.'">';
1100 1100
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1101
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1101
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1102 1102
 			}
1103 1103
 
1104
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1104
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1105 1105
 			$out .= '<option value="0">&nbsp;</option>';
1106 1106
 			$num = $this->db->num_rows($resql);
1107 1107
 			$i = 0;
@@ -1115,9 +1115,9 @@  discard block
 block discarded – undo
1115 1115
 
1116 1116
 				foreach ($incotermArray as $row) {
1117 1117
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1118
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1118
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1119 1119
 					} else {
1120
-						$out .= '<option value="' . $row['rowid'] . '">';
1120
+						$out .= '<option value="'.$row['rowid'].'">';
1121 1121
 					}
1122 1122
 
1123 1123
 					if ($row['code']) {
@@ -1130,13 +1130,13 @@  discard block
 block discarded – undo
1130 1130
 			$out .= '</select>';
1131 1131
 
1132 1132
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1133
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1133
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1134 1134
 				$moreattrib .= ' autocomplete="off"';
1135 1135
 			}
1136
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1136
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1137 1137
 
1138 1138
 			if (!empty($page)) {
1139
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1139
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1140 1140
 			}
1141 1141
 		} else {
1142 1142
 			dol_print_error($this->db);
@@ -1168,9 +1168,9 @@  discard block
 block discarded – undo
1168 1168
 		if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
1169 1169
 			|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
1170 1170
 			if (empty($hidetext)) {
1171
-				print $langs->trans("Type") . ': ';
1171
+				print $langs->trans("Type").': ';
1172 1172
 			}
1173
-			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1173
+			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1174 1174
 			if ($showempty) {
1175 1175
 				print '<option value="-1"';
1176 1176
 				if ($selected == -1) {
@@ -1189,28 +1189,28 @@  discard block
 block discarded – undo
1189 1189
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1190 1190
 				print ' selected';
1191 1191
 			}
1192
-			print '>' . $langs->trans("Product");
1192
+			print '>'.$langs->trans("Product");
1193 1193
 
1194 1194
 			print '<option value="1"';
1195 1195
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1196 1196
 				print ' selected';
1197 1197
 			}
1198
-			print '>' . $langs->trans("Service");
1198
+			print '>'.$langs->trans("Service");
1199 1199
 
1200 1200
 			print '</select>';
1201
-			print ajax_combobox('select_' . $htmlname);
1201
+			print ajax_combobox('select_'.$htmlname);
1202 1202
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1203 1203
 		}
1204 1204
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1205 1205
 			print $langs->trans("Service");
1206
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1206
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1207 1207
 		}
1208 1208
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1209 1209
 			print $langs->trans("Product");
1210
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1210
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1211 1211
 		}
1212 1212
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1213
-			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
1213
+			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
1214 1214
 		}
1215 1215
 	}
1216 1216
 
@@ -1236,7 +1236,7 @@  discard block
 block discarded – undo
1236 1236
 		$langs->load("trips");
1237 1237
 
1238 1238
 		$sql = "SELECT c.code, c.label";
1239
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1239
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1240 1240
 		$sql .= " WHERE active > 0";
1241 1241
 
1242 1242
 		$resql = $this->db->query($sql);
@@ -1277,11 +1277,11 @@  discard block
 block discarded – undo
1277 1277
 		// phpcs:enable
1278 1278
 		global $user, $langs;
1279 1279
 
1280
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1280
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1281 1281
 
1282 1282
 		$this->load_cache_types_fees();
1283 1283
 
1284
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1284
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1285 1285
 		if ($showempty) {
1286 1286
 			print '<option value="-1"';
1287 1287
 			if ($selected == -1) {
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 		}
1292 1292
 
1293 1293
 		foreach ($this->cache_types_fees as $key => $value) {
1294
-			print '<option value="' . $key . '"';
1294
+			print '<option value="'.$key.'"';
1295 1295
 			if ($key == $selected) {
1296 1296
 				print ' selected';
1297 1297
 			}
@@ -1342,12 +1342,12 @@  discard block
 block discarded – undo
1342 1342
 				$ajaxoptions = array();
1343 1343
 			}
1344 1344
 
1345
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1345
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1346 1346
 
1347 1347
 			// No immediate load of all database
1348 1348
 			$placeholder = '';
1349 1349
 			if ($selected && empty($selected_input_value)) {
1350
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1350
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1351 1351
 				$societetmp = new Societe($this->db);
1352 1352
 				$societetmp->fetch($selected);
1353 1353
 				$selected_input_value = $societetmp->name;
@@ -1355,25 +1355,25 @@  discard block
 block discarded – undo
1355 1355
 			}
1356 1356
 
1357 1357
 			// mode 1
1358
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : '');
1358
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode((string) ($showtype)) : '').($showcode ? '&showcode='.urlencode((string) ($showcode)) : '');
1359 1359
 
1360 1360
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1361 1361
 			if (empty($hidelabel)) {
1362
-				print $langs->trans("RefOrLabel") . ' : ';
1362
+				print $langs->trans("RefOrLabel").' : ';
1363 1363
 			} elseif ($hidelabel > 1) {
1364 1364
 				$placeholder = $langs->trans("RefOrLabel");
1365 1365
 				if ($hidelabel == 2) {
1366 1366
 					$out .= img_picto($langs->trans("Search"), 'search');
1367 1367
 				}
1368 1368
 			}
1369
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
1369
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
1370 1370
 			if ($hidelabel == 3) {
1371 1371
 				$out .= img_picto($langs->trans("Search"), 'search');
1372 1372
 			}
1373 1373
 
1374 1374
 			$out .= ajax_event($htmlname, $events);
1375 1375
 
1376
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1376
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1377 1377
 		} else {
1378 1378
 			// Immediate load of all database
1379 1379
 			$out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode);
@@ -1458,30 +1458,30 @@  discard block
 block discarded – undo
1458 1458
 			$sql .= ", s.address, s.zip, s.town";
1459 1459
 			$sql .= ", dictp.code as country_code";
1460 1460
 		}
1461
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1461
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1462 1462
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1463
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1463
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1464 1464
 		}
1465 1465
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1466
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1466
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1467 1467
 		}
1468
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1468
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1469 1469
 		if (!empty($user->socid)) {
1470
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1470
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1471 1471
 		}
1472 1472
 		if ($filter) {
1473 1473
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1474 1474
 			// if not, by testSqlAndScriptInject() only.
1475
-			$sql .= " AND (" . $filter . ")";
1475
+			$sql .= " AND (".$filter.")";
1476 1476
 		}
1477 1477
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1478
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1478
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1479 1479
 		}
1480 1480
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1481 1481
 			$sql .= " AND s.status <> 0";
1482 1482
 		}
1483 1483
 		if (!empty($excludeids)) {
1484
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")";
1484
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")";
1485 1485
 		}
1486 1486
 		// Add where from hooks
1487 1487
 		$parameters = array();
@@ -1501,17 +1501,17 @@  discard block
 block discarded – undo
1501 1501
 				if ($i > 0) {
1502 1502
 					$sql .= " AND ";
1503 1503
 				}
1504
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1504
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1505 1505
 				$i++;
1506 1506
 			}
1507 1507
 			if (count($search_crit) > 1) {
1508 1508
 				$sql .= ")";
1509 1509
 			}
1510 1510
 			if (isModEnabled('barcode')) {
1511
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1511
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1512 1512
 			}
1513
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1514
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1513
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1514
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1515 1515
 			$sql .= ")";
1516 1516
 		}
1517 1517
 		$sql .= $this->db->order("nom", "ASC");
@@ -1522,7 +1522,7 @@  discard block
 block discarded – undo
1522 1522
 		$resql = $this->db->query($sql);
1523 1523
 		if ($resql) {
1524 1524
 			// Construct $out and $outarray
1525
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1525
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1526 1526
 
1527 1527
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1528 1528
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1535,7 +1535,7 @@  discard block
 block discarded – undo
1535 1535
 				}
1536 1536
 			}
1537 1537
 			if ($showempty) {
1538
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1538
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1539 1539
 			}
1540 1540
 
1541 1541
 			$companytemp = new Societe($this->db);
@@ -1548,18 +1548,18 @@  discard block
 block discarded – undo
1548 1548
 					$label = '';
1549 1549
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1550 1550
 						if (($obj->client) && (!empty($obj->code_client))) {
1551
-							$label = $obj->code_client . ' - ';
1551
+							$label = $obj->code_client.' - ';
1552 1552
 						}
1553 1553
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1554
-							$label .= $obj->code_fournisseur . ' - ';
1554
+							$label .= $obj->code_fournisseur.' - ';
1555 1555
 						}
1556
-						$label .= ' ' . $obj->name;
1556
+						$label .= ' '.$obj->name;
1557 1557
 					} else {
1558 1558
 						$label = $obj->name;
1559 1559
 					}
1560 1560
 
1561 1561
 					if (!empty($obj->name_alias)) {
1562
-						$label .= ' (' . $obj->name_alias . ')';
1562
+						$label .= ' ('.$obj->name_alias.')';
1563 1563
 					}
1564 1564
 
1565 1565
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1574,7 +1574,7 @@  discard block
 block discarded – undo
1574 1574
 						$companytemp->fournisseur = $obj->fournisseur;
1575 1575
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1576 1576
 						if ($tmptype) {
1577
-							$labelhtml .= ' ' . $tmptype;
1577
+							$labelhtml .= ' '.$tmptype;
1578 1578
 						}
1579 1579
 
1580 1580
 						if ($obj->client || $obj->fournisseur) {
@@ -1584,10 +1584,10 @@  discard block
 block discarded – undo
1584 1584
 							$label .= $langs->trans("Customer");
1585 1585
 						}
1586 1586
 						if ($obj->client == 2 || $obj->client == 3) {
1587
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1587
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1588 1588
 						}
1589 1589
 						if ($obj->fournisseur) {
1590
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1590
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1591 1591
 						}
1592 1592
 						if ($obj->client || $obj->fournisseur) {
1593 1593
 							$label .= ')';
@@ -1595,9 +1595,9 @@  discard block
 block discarded – undo
1595 1595
 					}
1596 1596
 
1597 1597
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1598
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1598
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1599 1599
 						if (!empty($obj->country_code)) {
1600
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1600
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1601 1601
 						}
1602 1602
 						$label .= $s;
1603 1603
 						$labelhtml .= $s;
@@ -1605,9 +1605,9 @@  discard block
 block discarded – undo
1605 1605
 
1606 1606
 					if (empty($outputmode)) {
1607 1607
 						if (in_array($obj->rowid, $selected)) {
1608
-							$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>';
1608
+							$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>';
1609 1609
 						} else {
1610
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1610
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1611 1611
 						}
1612 1612
 					} else {
1613 1613
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1619,9 +1619,9 @@  discard block
 block discarded – undo
1619 1619
 					}
1620 1620
 				}
1621 1621
 			}
1622
-			$out .= '</select>' . "\n";
1622
+			$out .= '</select>'."\n";
1623 1623
 			if (!$forcecombo) {
1624
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1624
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1625 1625
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT"));
1626 1626
 			}
1627 1627
 		} else {
@@ -1657,18 +1657,18 @@  discard block
 block discarded – undo
1657 1657
 		// On recherche les remises
1658 1658
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
1659 1659
 		$sql .= " re.description, re.fk_facture_source";
1660
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
1661
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
1662
-		$sql .= " AND re.entity = " . $conf->entity;
1660
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
1661
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
1662
+		$sql .= " AND re.entity = ".$conf->entity;
1663 1663
 		if ($filter) {
1664
-			$sql .= " AND " . $filter;
1664
+			$sql .= " AND ".$filter;
1665 1665
 		}
1666 1666
 		$sql .= " ORDER BY re.description ASC";
1667 1667
 
1668
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
1668
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
1669 1669
 		$resql = $this->db->query($sql);
1670 1670
 		if ($resql) {
1671
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
1671
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
1672 1672
 			$num = $this->db->num_rows($resql);
1673 1673
 
1674 1674
 			$qualifiedlines = $num;
@@ -1706,16 +1706,16 @@  discard block
 block discarded – undo
1706 1706
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
1707 1707
 						$tmpfac = new Facture($this->db);
1708 1708
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
1709
-							$desc = $desc . ' - ' . $tmpfac->ref;
1709
+							$desc = $desc.' - '.$tmpfac->ref;
1710 1710
 						}
1711 1711
 					}
1712 1712
 
1713
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
1713
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
1714 1714
 					$i++;
1715 1715
 				}
1716 1716
 			}
1717 1717
 			print '</select>';
1718
-			print ajax_combobox('select_' . $htmlname);
1718
+			print ajax_combobox('select_'.$htmlname);
1719 1719
 
1720 1720
 			return $qualifiedlines;
1721 1721
 		} else {
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
 		$out = '';
1797 1797
 
1798 1798
 		if (!is_object($hookmanager)) {
1799
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1799
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1800 1800
 			$hookmanager = new HookManager($this->db);
1801 1801
 		}
1802 1802
 
@@ -1805,13 +1805,13 @@  discard block
 block discarded – undo
1805 1805
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1806 1806
 			$sql .= ", s.nom as company, s.town AS company_town";
1807 1807
 		}
1808
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1808
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1809 1809
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1810
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1810
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1811 1811
 		}
1812
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1812
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1813 1813
 		if ($socid > 0 || $socid == -1) {
1814
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1814
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1815 1815
 		}
1816 1816
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1817 1817
 			$sql .= " AND sp.statut <> 0";
@@ -1822,30 +1822,30 @@  discard block
 block discarded – undo
1822 1822
 		$sql .= $hookmanager->resPrint;
1823 1823
 		$sql .= " ORDER BY sp.lastname ASC";
1824 1824
 
1825
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1825
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1826 1826
 		$resql = $this->db->query($sql);
1827 1827
 		if ($resql) {
1828 1828
 			$num = $this->db->num_rows($resql);
1829 1829
 
1830 1830
 			if ($htmlname != 'none' && !$options_only) {
1831
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1831
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1832 1832
 			}
1833 1833
 
1834 1834
 			if ($showempty && !is_numeric($showempty)) {
1835 1835
 				$textforempty = $showempty;
1836
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1836
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1837 1837
 			} else {
1838 1838
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1839
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1839
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1840 1840
 				}
1841 1841
 				if ($showempty == 2) {
1842
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1842
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1843 1843
 				}
1844 1844
 			}
1845 1845
 
1846 1846
 			$i = 0;
1847 1847
 			if ($num) {
1848
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1848
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1849 1849
 				$contactstatic = new Contact($this->db);
1850 1850
 
1851 1851
 				while ($i < $num) {
@@ -1881,7 +1881,7 @@  discard block
 block discarded – undo
1881 1881
 						}
1882 1882
 						$extendedInfos = implode(' - ', $extendedInfos);
1883 1883
 						if (!empty($extendedInfos)) {
1884
-							$extendedInfos = ' - ' . $extendedInfos;
1884
+							$extendedInfos = ' - '.$extendedInfos;
1885 1885
 						}
1886 1886
 					}
1887 1887
 
@@ -1898,42 +1898,42 @@  discard block
 block discarded – undo
1898 1898
 								$disabled = 1;
1899 1899
 							}
1900 1900
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1901
-								$out .= '<option value="' . $obj->rowid . '"';
1901
+								$out .= '<option value="'.$obj->rowid.'"';
1902 1902
 								if ($disabled) {
1903 1903
 									$out .= ' disabled';
1904 1904
 								}
1905 1905
 								$out .= ' selected>';
1906
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1906
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1907 1907
 								if ($showfunction && $obj->poste) {
1908
-									$out .= ' (' . $obj->poste . ')';
1908
+									$out .= ' ('.$obj->poste.')';
1909 1909
 								}
1910 1910
 								if (($showsoc > 0) && $obj->company) {
1911
-									$out .= ' - (' . $obj->company . ')';
1911
+									$out .= ' - ('.$obj->company.')';
1912 1912
 								}
1913 1913
 								$out .= '</option>';
1914 1914
 							} else {
1915
-								$out .= '<option value="' . $obj->rowid . '"';
1915
+								$out .= '<option value="'.$obj->rowid.'"';
1916 1916
 								if ($disabled) {
1917 1917
 									$out .= ' disabled';
1918 1918
 								}
1919 1919
 								$out .= '>';
1920
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1920
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1921 1921
 								if ($showfunction && $obj->poste) {
1922
-									$out .= ' (' . $obj->poste . ')';
1922
+									$out .= ' ('.$obj->poste.')';
1923 1923
 								}
1924 1924
 								if (($showsoc > 0) && $obj->company) {
1925
-									$out .= ' - (' . $obj->company . ')';
1925
+									$out .= ' - ('.$obj->company.')';
1926 1926
 								}
1927 1927
 								$out .= '</option>';
1928 1928
 							}
1929 1929
 						} else {
1930 1930
 							if (in_array($obj->rowid, $selected)) {
1931
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1931
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1932 1932
 								if ($showfunction && $obj->poste) {
1933
-									$out .= ' (' . $obj->poste . ')';
1933
+									$out .= ' ('.$obj->poste.')';
1934 1934
 								}
1935 1935
 								if (($showsoc > 0) && $obj->company) {
1936
-									$out .= ' - (' . $obj->company . ')';
1936
+									$out .= ' - ('.$obj->company.')';
1937 1937
 								}
1938 1938
 							}
1939 1939
 						}
@@ -1942,7 +1942,7 @@  discard block
 block discarded – undo
1942 1942
 				}
1943 1943
 			} else {
1944 1944
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1945
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1945
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1946 1946
 				$out .= $labeltoshow;
1947 1947
 				$out .= '</option>';
1948 1948
 			}
@@ -1963,7 +1963,7 @@  discard block
 block discarded – undo
1963 1963
 			}
1964 1964
 
1965 1965
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1966
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1966
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1967 1967
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
1968 1968
 			}
1969 1969
 
@@ -2072,14 +2072,14 @@  discard block
 block discarded – undo
2072 2072
 		if ($showlabelofentity) {
2073 2073
 			$sql .= ", e.label";
2074 2074
 		}
2075
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2075
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2076 2076
 		if ($showlabelofentity) {
2077
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2077
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2078 2078
 		}
2079 2079
 		// Condition here should be the same than into societe->getSalesRepresentatives().
2080 2080
 		if ($userissuperadminentityone && $force_entity != 'default') {
2081 2081
 			if (!empty($force_entity)) {
2082
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2082
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2083 2083
 			} else {
2084 2084
 				$sql .= " WHERE u.entity IS NOT NULL";
2085 2085
 			}
@@ -2087,18 +2087,18 @@  discard block
 block discarded – undo
2087 2087
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2088 2088
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2089 2089
 			} else {
2090
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2090
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2091 2091
 			}
2092 2092
 		}
2093 2093
 
2094 2094
 		if (!empty($user->socid)) {
2095
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2095
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2096 2096
 		}
2097 2097
 		if (is_array($exclude) && $excludeUsers) {
2098
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2098
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2099 2099
 		}
2100 2100
 		if ($includeUsers) {
2101
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2101
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2102 2102
 		}
2103 2103
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2104 2104
 			$sql .= " AND u.statut <> 0";
@@ -2110,7 +2110,7 @@  discard block
 block discarded – undo
2110 2110
 			$sql .= " AND u.fk_soc IS NULL";
2111 2111
 		}
2112 2112
 		if (!empty($morefilter)) {
2113
-			$sql .= " " . $morefilter;
2113
+			$sql .= " ".$morefilter;
2114 2114
 		}
2115 2115
 
2116 2116
 		//Add hook to filter on user (for example on usergroup define in custom modules)
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2126 2126
 		}
2127 2127
 
2128
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2128
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2129 2129
 
2130 2130
 		$resql = $this->db->query($sql);
2131 2131
 		if ($resql) {
@@ -2133,7 +2133,7 @@  discard block
 block discarded – undo
2133 2133
 			$i = 0;
2134 2134
 			if ($num) {
2135 2135
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2136
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2136
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2137 2137
 				if ($show_empty && !$multiple) {
2138 2138
 					$textforempty = ' ';
2139 2139
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2142,10 +2142,10 @@  discard block
 block discarded – undo
2142 2142
 					if (!is_numeric($show_empty)) {
2143 2143
 						$textforempty = $show_empty;
2144 2144
 					}
2145
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2145
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2146 2146
 				}
2147 2147
 				if ($show_every) {
2148
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2148
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2149 2149
 				}
2150 2150
 
2151 2151
 				$userstatic = new User($this->db);
@@ -2192,21 +2192,21 @@  discard block
 block discarded – undo
2192 2192
 					}
2193 2193
 					if ($showstatus >= 0) {
2194 2194
 						if ($obj->status == 1 && $showstatus == 1) {
2195
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2196
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2195
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2196
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2197 2197
 						}
2198 2198
 						if ($obj->status == 0 && $showstatus == 1) {
2199
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2200
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2199
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2200
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2201 2201
 						}
2202 2202
 					}
2203 2203
 					if ($showlabelofentity) {
2204 2204
 						if (empty($obj->entity)) {
2205
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2206
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2205
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2206
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2207 2207
 						} else {
2208 2208
 							if ($obj->entity != $conf->entity) {
2209
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2209
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2210 2210
 								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2211 2211
 							}
2212 2212
 						}
@@ -2215,13 +2215,13 @@  discard block
 block discarded – undo
2215 2215
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2216 2216
 					if (!empty($disableline) && $disableline != '1') {
2217 2217
 						// Add text from $enableonlytext parameter
2218
-						$moreinfo .= ' - ' . $disableline;
2219
-						$moreinfohtml .= ' - ' . $disableline;
2218
+						$moreinfo .= ' - '.$disableline;
2219
+						$moreinfohtml .= ' - '.$disableline;
2220 2220
 					}
2221 2221
 					$labeltoshow .= $moreinfo;
2222 2222
 					$labeltoshowhtml .= $moreinfohtml;
2223 2223
 
2224
-					$out .= '<option value="' . $obj->rowid . '"';
2224
+					$out .= '<option value="'.$obj->rowid.'"';
2225 2225
 					if (!empty($disableline)) {
2226 2226
 						$out .= ' disabled';
2227 2227
 					}
@@ -2229,7 +2229,7 @@  discard block
 block discarded – undo
2229 2229
 						$out .= ' selected';
2230 2230
 					}
2231 2231
 					$out .= ' data-html="';
2232
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2232
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2233 2233
 					if ($showstatus >= 0 && $obj->status == 0) {
2234 2234
 						$outhtml .= '<strike class="opacitymediumxxx">';
2235 2235
 					}
@@ -2242,7 +2242,7 @@  discard block
 block discarded – undo
2242 2242
 					$out .= $labeltoshow;
2243 2243
 					$out .= '</option>';
2244 2244
 
2245
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2245
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2246 2246
 					$outarray2[$userstatic->id] = array(
2247 2247
 						'id' => $userstatic->id,
2248 2248
 						'label' => $labeltoshow,
@@ -2254,14 +2254,14 @@  discard block
 block discarded – undo
2254 2254
 					$i++;
2255 2255
 				}
2256 2256
 			} else {
2257
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2258
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2257
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2258
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2259 2259
 			}
2260 2260
 			$out .= '</select>';
2261 2261
 
2262 2262
 			if ($num && !$forcecombo) {
2263 2263
 				// Enhance with select2
2264
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2264
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2265 2265
 				$out .= ajax_combobox($htmlname);
2266 2266
 			}
2267 2267
 		} else {
@@ -2335,16 +2335,16 @@  discard block
 block discarded – undo
2335 2335
 			$out .= $userstatic->getNomUrl(-1);
2336 2336
 			if ($i == 0) {
2337 2337
 				$ownerid = $value['id'];
2338
-				$out .= ' (' . $langs->trans("Owner") . ')';
2338
+				$out .= ' ('.$langs->trans("Owner").')';
2339 2339
 			}
2340 2340
 			if ($nbassignetouser > 1 && $action != 'view') {
2341
-				$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 . '">';
2341
+				$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.'">';
2342 2342
 			}
2343 2343
 			// Show my availability
2344 2344
 			if ($showproperties) {
2345 2345
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2346 2346
 					$out .= '<div class="myavailability inline-block">';
2347
-					$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>';
2347
+					$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>';
2348 2348
 					$out .= '</div>';
2349 2349
 				}
2350 2350
 			}
@@ -2361,15 +2361,15 @@  discard block
 block discarded – undo
2361 2361
 		// Method with no ajax
2362 2362
 		if ($action != 'view') {
2363 2363
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2364
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2364
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2365 2365
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2366 2366
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2367
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2368
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2367
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2368
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2369 2369
 			$out .= '});';
2370 2370
 			$out .= '})</script>';
2371 2371
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2372
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2372
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2373 2373
 			$out .= '<br>';
2374 2374
 		}
2375 2375
 
@@ -2428,13 +2428,13 @@  discard block
 block discarded – undo
2428 2428
 			$resourcestatic->fetch($value['id']);
2429 2429
 			$out .= $resourcestatic->getNomUrl(-1);
2430 2430
 			if ($nbassignetoresource > 1 && $action != 'view') {
2431
-				$out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassigned reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">';
2431
+				$out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassigned reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">';
2432 2432
 			}
2433 2433
 			// Show my availability
2434 2434
 			if ($showproperties) {
2435 2435
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2436 2436
 					$out .= '<div class="myavailability inline-block">';
2437
-					$out .= '<span class="hideonsmartphone">&nbsp;-&nbsp;<span class="opacitymedium">' . $langs->trans("Availability") . ':</span>  </span><input id="transparencyresource" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofresourceid[$value['id']]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>';
2437
+					$out .= '<span class="hideonsmartphone">&nbsp;-&nbsp;<span class="opacitymedium">'.$langs->trans("Availability").':</span>  </span><input id="transparencyresource" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofresourceid[$value['id']]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>';
2438 2438
 					$out .= '</div>';
2439 2439
 				}
2440 2440
 			}
@@ -2451,11 +2451,11 @@  discard block
 block discarded – undo
2451 2451
 		// Method with no ajax
2452 2452
 		if ($action != 'view') {
2453 2453
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">';
2454
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2454
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2455 2455
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2456 2456
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2457
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2458
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2457
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2458
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2459 2459
 			$out .= '});';
2460 2460
 			$out .= '})</script>';
2461 2461
 
@@ -2463,7 +2463,7 @@  discard block
 block discarded – undo
2463 2463
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2464 2464
 			$out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0);
2465 2465
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2466
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2466
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2467 2467
 			$out .= '<br>';
2468 2468
 		}
2469 2469
 
@@ -2524,7 +2524,7 @@  discard block
 block discarded – undo
2524 2524
 			$placeholder = '';
2525 2525
 
2526 2526
 			if ($selected && empty($selected_input_value)) {
2527
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2527
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2528 2528
 				$producttmpselect = new Product($this->db);
2529 2529
 				$producttmpselect->fetch($selected);
2530 2530
 				$selected_input_value = $producttmpselect->ref;
@@ -2539,17 +2539,17 @@  discard block
 block discarded – undo
2539 2539
 				}
2540 2540
 			}
2541 2541
 			// mode=1 means customers products
2542
-			$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;
2543
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2542
+			$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;
2543
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2544 2544
 
2545 2545
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2546 2546
 				// Code to automatically insert with javascript the select of attributes under the select of product
2547 2547
 				// when a parent of variant has been selected.
2548 2548
 				$out .= '
2549 2549
 				<!-- script to auto show attributes select tags if a variant was selected -->
2550
-				<script nonce="' . getNonce() . '">
2550
+				<script nonce="' . getNonce().'">
2551 2551
 					// auto show attributes fields
2552
-					selected = ' . json_encode($selected_combinations) . ';
2552
+					selected = ' . json_encode($selected_combinations).';
2553 2553
 					combvalues = {};
2554 2554
 
2555 2555
 					jQuery(document).ready(function () {
@@ -2560,7 +2560,7 @@  discard block
 block discarded – undo
2560 2560
 							}
2561 2561
 						});
2562 2562
 
2563
-						jQuery("input#' . $htmlname . '").change(function () {
2563
+						jQuery("input#' . $htmlname.'").change(function () {
2564 2564
 
2565 2565
 							if (!jQuery(this).val()) {
2566 2566
 								jQuery(\'div#attributes_box\').empty();
@@ -2569,7 +2569,7 @@  discard block
 block discarded – undo
2569 2569
 
2570 2570
 							console.log("A change has started. We get variants fields to inject html select");
2571 2571
 
2572
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2572
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2573 2573
 								id: jQuery(this).val()
2574 2574
 							}, function (data) {
2575 2575
 								jQuery(\'div#attributes_box\').empty();
@@ -2612,21 +2612,21 @@  discard block
 block discarded – undo
2612 2612
 							})
2613 2613
 						});
2614 2614
 
2615
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2615
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2616 2616
 					});
2617 2617
 				</script>
2618 2618
                 ';
2619 2619
 			}
2620 2620
 
2621 2621
 			if (empty($hidelabel)) {
2622
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2622
+				$out .= $langs->trans("RefOrLabel").' : ';
2623 2623
 			} elseif ($hidelabel > 1) {
2624
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2624
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2625 2625
 				if ($hidelabel == 2) {
2626 2626
 					$out .= img_picto($langs->trans("Search"), 'search');
2627 2627
 				}
2628 2628
 			}
2629
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2629
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2630 2630
 			if ($hidelabel == 3) {
2631 2631
 				$out .= img_picto($langs->trans("Search"), 'search');
2632 2632
 			}
@@ -2663,33 +2663,33 @@  discard block
 block discarded – undo
2663 2663
 		// phpcs:enable
2664 2664
 		global $conf, $user, $langs, $db;
2665 2665
 
2666
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2666
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2667 2667
 
2668 2668
 		$error = 0;
2669 2669
 		$out = '';
2670 2670
 
2671 2671
 		if (!$forcecombo) {
2672
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2672
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2673 2673
 			$events = array();
2674 2674
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2675 2675
 		}
2676 2676
 
2677
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2677
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2678 2678
 
2679 2679
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2680
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2681
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2680
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2681
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2682 2682
 		if (!empty($status)) {
2683
-			$sql .= ' AND status = ' . (int) $status;
2683
+			$sql .= ' AND status = '.(int) $status;
2684 2684
 		}
2685 2685
 		if (!empty($type)) {
2686
-			$sql .= ' AND bomtype = ' . (int) $type;
2686
+			$sql .= ' AND bomtype = '.(int) $type;
2687 2687
 		}
2688 2688
 		if (!empty($TProducts)) {
2689
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2689
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2690 2690
 		}
2691 2691
 		if (!empty($limit)) {
2692
-			$sql .= ' LIMIT ' . (int) $limit;
2692
+			$sql .= ' LIMIT '.(int) $limit;
2693 2693
 		}
2694 2694
 		$resql = $db->query($sql);
2695 2695
 		if ($resql) {
@@ -2703,11 +2703,11 @@  discard block
 block discarded – undo
2703 2703
 			while ($obj = $db->fetch_object($resql)) {
2704 2704
 				$product = new Product($db);
2705 2705
 				$res = $product->fetch($obj->fk_product);
2706
-				$out .= '<option value="' . $obj->rowid . '"';
2706
+				$out .= '<option value="'.$obj->rowid.'"';
2707 2707
 				if ($obj->rowid == $selected) {
2708 2708
 					$out .= 'selected';
2709 2709
 				}
2710
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2710
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2711 2711
 			}
2712 2712
 		} else {
2713 2713
 			$error++;
@@ -2764,7 +2764,7 @@  discard block
 block discarded – undo
2764 2764
 
2765 2765
 		$warehouseStatusArray = array();
2766 2766
 		if (!empty($warehouseStatus)) {
2767
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2767
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2768 2768
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2769 2769
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2770 2770
 			}
@@ -2778,9 +2778,9 @@  discard block
 block discarded – undo
2778 2778
 
2779 2779
 		$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";
2780 2780
 		if (count($warehouseStatusArray)) {
2781
-			$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
2781
+			$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
2782 2782
 		} else {
2783
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2783
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2784 2784
 		}
2785 2785
 
2786 2786
 		$sql = "SELECT ";
@@ -2796,9 +2796,9 @@  discard block
 block discarded – undo
2796 2796
 
2797 2797
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2798 2798
 			//Product category
2799
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2800
-						FROM " . $this->db->prefix() . "categorie_product
2801
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2799
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2800
+						FROM " . $this->db->prefix()."categorie_product
2801
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2802 2802
 						LIMIT 1
2803 2803
 				) AS categorie_product_id ";
2804 2804
 		}
@@ -2824,15 +2824,15 @@  discard block
 block discarded – undo
2824 2824
 		}
2825 2825
 		// Price by quantity
2826 2826
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2827
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2827
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2828 2828
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2829
-				$sql .= " AND price_level = " . ((int) $price_level);
2829
+				$sql .= " AND price_level = ".((int) $price_level);
2830 2830
 			}
2831 2831
 			$sql .= " ORDER BY date_price";
2832 2832
 			$sql .= " DESC LIMIT 1) as price_rowid";
2833
-			$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
2833
+			$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
2834 2834
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2835
-				$sql .= " AND price_level = " . ((int) $price_level);
2835
+				$sql .= " AND price_level = ".((int) $price_level);
2836 2836
 			}
2837 2837
 			$sql .= " ORDER BY date_price";
2838 2838
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -2841,58 +2841,58 @@  discard block
 block discarded – undo
2841 2841
 
2842 2842
 		$sql .= " FROM ".$this->db->prefix()."product as p";
2843 2843
 		// Add from (left join) from hooks
2844
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
2844
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
2845 2845
 		$reshook = $hookmanager->executeHooks('selectProductsListFrom', $parameters); // Note that $action and $object may have been modified by hook
2846 2846
 		$sql .= $hookmanager->resPrint;
2847 2847
 
2848 2848
 		if (count($warehouseStatusArray)) {
2849
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
2850
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
2851
-			$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.
2849
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
2850
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
2851
+			$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.
2852 2852
 		}
2853 2853
 
2854 2854
 		// include search in supplier ref
2855 2855
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2856
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2856
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2857 2857
 		}
2858 2858
 
2859 2859
 		//Price by customer
2860 2860
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2861
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
2861
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
2862 2862
 		}
2863 2863
 		// Units
2864 2864
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
2865
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
2865
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
2866 2866
 		}
2867 2867
 		// Multilang : we add translation
2868 2868
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
2869
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
2869
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
2870 2870
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
2871
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
2871
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
2872 2872
 				$soc = new Societe($this->db);
2873 2873
 				$result = $soc->fetch($socid);
2874 2874
 				if ($result > 0 && !empty($soc->default_lang)) {
2875
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
2875
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
2876 2876
 				} else {
2877
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2877
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2878 2878
 				}
2879 2879
 			} else {
2880
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2880
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2881 2881
 			}
2882 2882
 		}
2883 2883
 
2884 2884
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2885
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2885
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2886 2886
 		}
2887 2887
 
2888
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
2888
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
2889 2889
 
2890 2890
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2891 2891
 			$sql .= " AND pac.rowid IS NULL";
2892 2892
 		}
2893 2893
 
2894 2894
 		if ($finished == 0) {
2895
-			$sql .= " AND p.finished = " . ((int) $finished);
2895
+			$sql .= " AND p.finished = ".((int) $finished);
2896 2896
 		} elseif ($finished == 1) {
2897 2897
 			$sql .= " AND p.finished = ".((int) $finished);
2898 2898
 		}
@@ -2900,18 +2900,18 @@  discard block
 block discarded – undo
2900 2900
 			$sql .= " AND p.tosell = ".((int) $status);
2901 2901
 		}
2902 2902
 		if ($status_purchase >= 0) {
2903
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
2903
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
2904 2904
 		}
2905 2905
 		// Filter by product type
2906 2906
 		if (strval($filtertype) != '') {
2907
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
2907
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
2908 2908
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
2909 2909
 			$sql .= " AND p.fk_product_type = 1";
2910 2910
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
2911 2911
 			$sql .= " AND p.fk_product_type = 0";
2912 2912
 		}
2913 2913
 		// Add where from hooks
2914
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
2914
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
2915 2915
 		$reshook = $hookmanager->executeHooks('selectProductsListWhere', $parameters); // Note that $action and $object may have been modified by hook
2916 2916
 		$sql .= $hookmanager->resPrint;
2917 2917
 		// Add criteria on ref/label
@@ -2928,21 +2928,21 @@  discard block
 block discarded – undo
2928 2928
 				if ($i > 0) {
2929 2929
 					$sql .= " AND ";
2930 2930
 				}
2931
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2931
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2932 2932
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
2933
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2933
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2934 2934
 				}
2935 2935
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2936
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2936
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
2937 2937
 				}
2938 2938
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
2939
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2939
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2940 2940
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
2941
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2941
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2942 2942
 					}
2943 2943
 				}
2944 2944
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2945
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2945
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
2946 2946
 				}
2947 2947
 				$sql .= ")";
2948 2948
 				$i++;
@@ -2951,12 +2951,12 @@  discard block
 block discarded – undo
2951 2951
 				$sql .= ")";
2952 2952
 			}
2953 2953
 			if (isModEnabled('barcode')) {
2954
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
2954
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
2955 2955
 			}
2956 2956
 			$sql .= ')';
2957 2957
 		}
2958 2958
 		if (count($warehouseStatusArray)) {
2959
-			$sql .= " GROUP BY " . $selectFields;
2959
+			$sql .= " GROUP BY ".$selectFields;
2960 2960
 		}
2961 2961
 
2962 2962
 		//Sort by category
@@ -2971,23 +2971,23 @@  discard block
 block discarded – undo
2971 2971
 		$sql .= $this->db->plimit($limit, 0);
2972 2972
 
2973 2973
 		// Build output string
2974
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
2974
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
2975 2975
 		$result = $this->db->query($sql);
2976 2976
 		if ($result) {
2977
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2978
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2979
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
2977
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2978
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2979
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
2980 2980
 
2981 2981
 			$num = $this->db->num_rows($result);
2982 2982
 
2983 2983
 			$events = array();
2984 2984
 
2985 2985
 			if (!$forcecombo) {
2986
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2986
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2987 2987
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2988 2988
 			}
2989 2989
 
2990
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2990
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2991 2991
 
2992 2992
 			$textifempty = '';
2993 2993
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -3004,7 +3004,7 @@  discard block
 block discarded – undo
3004 3004
 				}
3005 3005
 			}
3006 3006
 			if ($showempty) {
3007
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
3007
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
3008 3008
 			}
3009 3009
 
3010 3010
 			$i = 0;
@@ -3015,11 +3015,11 @@  discard block
 block discarded – undo
3015 3015
 
3016 3016
 				if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product
3017 3017
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
3018
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
3019
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
3018
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
3019
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
3020 3020
 					$sql .= " ORDER BY quantity ASC";
3021 3021
 
3022
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
3022
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
3023 3023
 					$result2 = $this->db->query($sql);
3024 3024
 					if ($result2) {
3025 3025
 						$nb_prices = $this->db->num_rows($result2);
@@ -3057,7 +3057,7 @@  discard block
 block discarded – undo
3057 3057
 						$price_product = new Product($this->db);
3058 3058
 						$price_product->fetch($objp->rowid, '', '', 1);
3059 3059
 
3060
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3060
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3061 3061
 						$priceparser = new PriceParser($this->db);
3062 3062
 						$price_result = $priceparser->parseProduct($price_product);
3063 3063
 						if ($price_result >= 0) {
@@ -3141,7 +3141,7 @@  discard block
 block discarded – undo
3141 3141
 			$label = $objp->label_translated;
3142 3142
 		}
3143 3143
 		if (!empty($filterkey) && $filterkey != '') {
3144
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3144
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3145 3145
 		}
3146 3146
 
3147 3147
 		$outkey = $objp->rowid;
@@ -3162,32 +3162,32 @@  discard block
 block discarded – undo
3162 3162
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3163 3163
 
3164 3164
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3165
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3165
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3166 3166
 		}
3167 3167
 
3168 3168
 		// Units
3169 3169
 		$outvalUnits = '';
3170 3170
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3171 3171
 			if (!empty($objp->unit_short)) {
3172
-				$outvalUnits .= ' - ' . $objp->unit_short;
3172
+				$outvalUnits .= ' - '.$objp->unit_short;
3173 3173
 			}
3174 3174
 		}
3175 3175
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3176 3176
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3177 3177
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3178
-				$outvalUnits .= ' - ' . $unitToShow;
3178
+				$outvalUnits .= ' - '.$unitToShow;
3179 3179
 			}
3180 3180
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3181
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3182
-				$outvalUnits .= ' - ' . $unitToShow;
3181
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3182
+				$outvalUnits .= ' - '.$unitToShow;
3183 3183
 			}
3184 3184
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3185 3185
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3186
-				$outvalUnits .= ' - ' . $unitToShow;
3186
+				$outvalUnits .= ' - '.$unitToShow;
3187 3187
 			}
3188 3188
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3189 3189
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3190
-				$outvalUnits .= ' - ' . $unitToShow;
3190
+				$outvalUnits .= ' - '.$unitToShow;
3191 3191
 			}
3192 3192
 		}
3193 3193
 		if ($outdurationvalue && $outdurationunit) {
@@ -3199,14 +3199,14 @@  discard block
 block discarded – undo
3199 3199
 				'y' => $langs->trans('Year')
3200 3200
 			);
3201 3201
 			if (isset($da[$outdurationunit])) {
3202
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3202
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3203 3203
 			}
3204 3204
 		}
3205 3205
 
3206
-		$opt = '<option value="' . $objp->rowid . '"';
3206
+		$opt = '<option value="'.$objp->rowid.'"';
3207 3207
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3208 3208
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3209
-			$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 . '"';
3209
+			$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.'"';
3210 3210
 		}
3211 3211
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3212 3212
 			if ($user->hasRight('stock', 'lire')) {
@@ -3218,36 +3218,36 @@  discard block
 block discarded – undo
3218 3218
 			}
3219 3219
 		}
3220 3220
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3221
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3222
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3221
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3222
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3223 3223
 		}
3224 3224
 		$opt .= '>';
3225 3225
 		$opt .= $objp->ref;
3226 3226
 		if (!empty($objp->custref)) {
3227
-			$opt .= ' (' . $objp->custref . ')';
3227
+			$opt .= ' ('.$objp->custref.')';
3228 3228
 		}
3229 3229
 		if ($outbarcode) {
3230
-			$opt .= ' (' . $outbarcode . ')';
3230
+			$opt .= ' ('.$outbarcode.')';
3231 3231
 		}
3232
-		$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
3232
+		$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
3233 3233
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3234
-			$opt .= ' (' . getCountry($outorigin, 1) . ')';
3234
+			$opt .= ' ('.getCountry($outorigin, 1).')';
3235 3235
 		}
3236 3236
 
3237 3237
 		$objRef = $objp->ref;
3238 3238
 		if (!empty($objp->custref)) {
3239
-			$objRef .= ' (' . $objp->custref . ')';
3239
+			$objRef .= ' ('.$objp->custref.')';
3240 3240
 		}
3241 3241
 		if (!empty($filterkey) && $filterkey != '') {
3242
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3242
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3243 3243
 		}
3244 3244
 		$outval .= $objRef;
3245 3245
 		if ($outbarcode) {
3246
-			$outval .= ' (' . $outbarcode . ')';
3246
+			$outval .= ' ('.$outbarcode.')';
3247 3247
 		}
3248
-		$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
3248
+		$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
3249 3249
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3250
-			$outval .= ' (' . getCountry($outorigin, 1) . ')';
3250
+			$outval .= ' ('.getCountry($outorigin, 1).')';
3251 3251
 		}
3252 3252
 
3253 3253
 		// Units
@@ -3260,35 +3260,35 @@  discard block
 block discarded – undo
3260 3260
 		// If we need a particular price level (from 1 to n)
3261 3261
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
3262 3262
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3263
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3264
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3265
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3266
-			$sql .= " AND price_level = " . ((int) $price_level);
3263
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3264
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3265
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3266
+			$sql .= " AND price_level = ".((int) $price_level);
3267 3267
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3268 3268
 			$sql .= " LIMIT 1";
3269 3269
 
3270
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3270
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3271 3271
 			$result2 = $this->db->query($sql);
3272 3272
 			if ($result2) {
3273 3273
 				$objp2 = $this->db->fetch_object($result2);
3274 3274
 				if ($objp2) {
3275 3275
 					$found = 1;
3276 3276
 					if ($objp2->price_base_type == 'HT') {
3277
-						$opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3278
-						$outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3277
+						$opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3278
+						$outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3279 3279
 					} else {
3280
-						$opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3281
-						$outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3280
+						$opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3281
+						$outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3282 3282
 					}
3283 3283
 					$outprice_ht = price($objp2->price);
3284 3284
 					$outprice_ttc = price($objp2->price_ttc);
3285 3285
 					$outpricebasetype = $objp2->price_base_type;
3286 3286
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3287
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3288
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3287
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3288
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3289 3289
 					} else {
3290
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3291
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3290
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3291
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3292 3292
 					}
3293 3293
 				}
3294 3294
 			} else {
@@ -3302,13 +3302,13 @@  discard block
 block discarded – undo
3302 3302
 			$outqty = $objp->quantity;
3303 3303
 			$outdiscount = $objp->remise_percent;
3304 3304
 			if ($objp->quantity == 1) {
3305
-				$opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3306
-				$outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3305
+				$opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3306
+				$outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3307 3307
 				$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3308 3308
 				$outval .= $langs->transnoentities("Unit");
3309 3309
 			} else {
3310
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3311
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3310
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3311
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3312 3312
 				$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3313 3313
 				$outval .= $langs->transnoentities("Units");
3314 3314
 			}
@@ -3316,16 +3316,16 @@  discard block
 block discarded – undo
3316 3316
 			$outprice_ht = price($objp->unitprice);
3317 3317
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3318 3318
 			$outpricebasetype = $objp->price_base_type;
3319
-			$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
3320
-			$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
3319
+			$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
3320
+			$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
3321 3321
 		}
3322 3322
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3323
-			$opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3324
-			$outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3323
+			$opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3324
+			$outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3325 3325
 		}
3326 3326
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3327
-			$opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3328
-			$outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3327
+			$opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3328
+			$outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3329 3329
 		}
3330 3330
 
3331 3331
 		// Price by customer
@@ -3334,11 +3334,11 @@  discard block
 block discarded – undo
3334 3334
 				$found = 1;
3335 3335
 
3336 3336
 				if ($objp->custprice_base_type == 'HT') {
3337
-					$opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3338
-					$outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3337
+					$opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3338
+					$outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3339 3339
 				} else {
3340
-					$opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3341
-					$outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3340
+					$opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3341
+					$outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3342 3342
 				}
3343 3343
 
3344 3344
 				$outprice_ht = price($objp->custprice);
@@ -3352,11 +3352,11 @@  discard block
 block discarded – undo
3352 3352
 		// If level no defined or multiprice not found, we used the default price
3353 3353
 		if (empty($hidepriceinlabel) && !$found) {
3354 3354
 			if ($objp->price_base_type == 'HT') {
3355
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3356
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3355
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3356
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3357 3357
 			} else {
3358
-				$opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3359
-				$outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3358
+				$opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3359
+				$outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3360 3360
 			}
3361 3361
 			$outprice_ht = price($objp->price);
3362 3362
 			$outprice_ttc = price($objp->price_ttc);
@@ -3367,14 +3367,14 @@  discard block
 block discarded – undo
3367 3367
 
3368 3368
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3369 3369
 			if ($user->hasRight('stock', 'lire')) {
3370
-				$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3370
+				$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3371 3371
 
3372 3372
 				if ($objp->stock > 0) {
3373 3373
 					$outval .= ' - <span class="product_line_stock_ok">';
3374 3374
 				} elseif ($objp->stock <= 0) {
3375 3375
 					$outval .= ' - <span class="product_line_stock_too_low">';
3376 3376
 				}
3377
-				$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3377
+				$outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3378 3378
 				$outval .= '</span>';
3379 3379
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3380 3380
 					$langs->load("stocks");
@@ -3384,9 +3384,9 @@  discard block
 block discarded – undo
3384 3384
 					$tmpproduct->load_virtual_stock();
3385 3385
 					$virtualstock = $tmpproduct->stock_theorique;
3386 3386
 
3387
-					$opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3387
+					$opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3388 3388
 
3389
-					$outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3389
+					$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
3390 3390
 					if ($virtualstock > 0) {
3391 3391
 						$outval .= '<span class="product_line_stock_ok">';
3392 3392
 					} elseif ($virtualstock <= 0) {
@@ -3464,7 +3464,7 @@  discard block
 block discarded – undo
3464 3464
 		$selected_input_value = '';
3465 3465
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3466 3466
 			if ($selected > 0) {
3467
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3467
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3468 3468
 				$producttmpselect = new Product($this->db);
3469 3469
 				$producttmpselect->fetch($selected);
3470 3470
 				$selected_input_value = $producttmpselect->ref;
@@ -3472,10 +3472,10 @@  discard block
 block discarded – undo
3472 3472
 			}
3473 3473
 
3474 3474
 			// mode=2 means suppliers products
3475
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3476
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3475
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3476
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3477 3477
 
3478
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3478
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3479 3479
 		} else {
3480 3480
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3481 3481
 		}
@@ -3535,25 +3535,25 @@  discard block
 block discarded – undo
3535 3535
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3536 3536
 			$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
3537 3537
 		}
3538
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3539
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3538
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3539
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3540 3540
 		if ($socid > 0) {
3541
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3541
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3542 3542
 		}
3543
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3543
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3544 3544
 		// Units
3545 3545
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3546
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3546
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3547 3547
 		}
3548
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3548
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3549 3549
 		if ($statut != -1) {
3550
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3550
+			$sql .= " AND p.tobuy = ".((int) $statut);
3551 3551
 		}
3552 3552
 		if (strval($filtertype) != '') {
3553
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3553
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3554 3554
 		}
3555 3555
 		if (!empty($filtre)) {
3556
-			$sql .= " " . $filtre;
3556
+			$sql .= " ".$filtre;
3557 3557
 		}
3558 3558
 		// Add where from hooks
3559 3559
 		$parameters = array();
@@ -3573,9 +3573,9 @@  discard block
 block discarded – undo
3573 3573
 				if ($i > 0) {
3574 3574
 					$sql .= " AND ";
3575 3575
 				}
3576
-				$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) . "%'";
3576
+				$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)."%'";
3577 3577
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3578
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3578
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3579 3579
 				}
3580 3580
 				$sql .= ")";
3581 3581
 				$i++;
@@ -3584,8 +3584,8 @@  discard block
 block discarded – undo
3584 3584
 				$sql .= ")";
3585 3585
 			}
3586 3586
 			if (isModEnabled('barcode')) {
3587
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3588
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3587
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3588
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3589 3589
 			}
3590 3590
 			$sql .= ')';
3591 3591
 		}
@@ -3594,20 +3594,20 @@  discard block
 block discarded – undo
3594 3594
 
3595 3595
 		// Build output string
3596 3596
 
3597
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3597
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3598 3598
 		$result = $this->db->query($sql);
3599 3599
 		if ($result) {
3600
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3601
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3600
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3601
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3602 3602
 
3603 3603
 			$num = $this->db->num_rows($result);
3604 3604
 
3605 3605
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3606
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3606
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3607 3607
 			if (!$selected) {
3608
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3608
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3609 3609
 			} else {
3610
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3610
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3611 3611
 			}
3612 3612
 
3613 3613
 			$i = 0;
@@ -3622,7 +3622,7 @@  discard block
 block discarded – undo
3622 3622
 
3623 3623
 				$outkey = $objp->idprodfournprice; // id in table of price
3624 3624
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3625
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3625
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3626 3626
 				}
3627 3627
 
3628 3628
 				$outref = $objp->ref;
@@ -3637,23 +3637,23 @@  discard block
 block discarded – undo
3637 3637
 				$outvalUnits = '';
3638 3638
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3639 3639
 					if (!empty($objp->unit_short)) {
3640
-						$outvalUnits .= ' - ' . $objp->unit_short;
3640
+						$outvalUnits .= ' - '.$objp->unit_short;
3641 3641
 					}
3642 3642
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3643 3643
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3644
-						$outvalUnits .= ' - ' . $unitToShow;
3644
+						$outvalUnits .= ' - '.$unitToShow;
3645 3645
 					}
3646 3646
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3647
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3648
-						$outvalUnits .= ' - ' . $unitToShow;
3647
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3648
+						$outvalUnits .= ' - '.$unitToShow;
3649 3649
 					}
3650 3650
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3651 3651
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3652
-						$outvalUnits .= ' - ' . $unitToShow;
3652
+						$outvalUnits .= ' - '.$unitToShow;
3653 3653
 					}
3654 3654
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3655 3655
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3656
-						$outvalUnits .= ' - ' . $unitToShow;
3656
+						$outvalUnits .= ' - '.$unitToShow;
3657 3657
 					}
3658 3658
 					if ($outdurationvalue && $outdurationunit) {
3659 3659
 						$da = array(
@@ -3664,22 +3664,22 @@  discard block
 block discarded – undo
3664 3664
 							'y' => $langs->trans('Year')
3665 3665
 						);
3666 3666
 						if (isset($da[$outdurationunit])) {
3667
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3667
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3668 3668
 						}
3669 3669
 					}
3670 3670
 				}
3671 3671
 
3672 3672
 				$objRef = $objp->ref;
3673 3673
 				if ($filterkey && $filterkey != '') {
3674
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3674
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3675 3675
 				}
3676 3676
 				$objRefFourn = $objp->ref_fourn;
3677 3677
 				if ($filterkey && $filterkey != '') {
3678
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3678
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3679 3679
 				}
3680 3680
 				$label = $objp->label;
3681 3681
 				if ($filterkey && $filterkey != '') {
3682
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3682
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3683 3683
 				}
3684 3684
 
3685 3685
 				switch ($objp->fk_product_type) {
@@ -3702,21 +3702,21 @@  discard block
 block discarded – undo
3702 3702
 
3703 3703
 				$optlabel .= $objp->ref;
3704 3704
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3705
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3705
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3706 3706
 				}
3707 3707
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3708
-					$optlabel .= ' (' . $outbarcode . ')';
3708
+					$optlabel .= ' ('.$outbarcode.')';
3709 3709
 				}
3710
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3710
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3711 3711
 
3712 3712
 				$outvallabel = $objRef;
3713 3713
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3714
-					$outvallabel .= ' (' . $objRefFourn . ')';
3714
+					$outvallabel .= ' ('.$objRefFourn.')';
3715 3715
 				}
3716 3716
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3717
-					$outvallabel .= ' (' . $outbarcode . ')';
3717
+					$outvallabel .= ' ('.$outbarcode.')';
3718 3718
 				}
3719
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3719
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3720 3720
 
3721 3721
 				// Units
3722 3722
 				$optlabel .= $outvalUnits;
@@ -3733,7 +3733,7 @@  discard block
 block discarded – undo
3733 3733
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3734 3734
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3735 3735
 
3736
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3736
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3737 3737
 						$priceparser = new PriceParser($this->db);
3738 3738
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3739 3739
 						if ($price_result >= 0) {
@@ -3744,57 +3744,57 @@  discard block
 block discarded – undo
3744 3744
 						}
3745 3745
 					}
3746 3746
 					if ($objp->quantity == 1) {
3747
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3748
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3747
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3748
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3749 3749
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3750 3750
 						$outvallabel .= $langs->transnoentities("Unit");
3751 3751
 					} else {
3752
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3753
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3754
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3755
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3752
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3753
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3754
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3755
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3756 3756
 					}
3757 3757
 
3758 3758
 					if ($objp->quantity > 1) {
3759
-						$optlabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3760
-						$outvallabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3759
+						$optlabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3760
+						$outvallabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3761 3761
 					}
3762 3762
 					if ($objp->remise_percent >= 1) {
3763
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3764
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3763
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3764
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3765 3765
 					}
3766 3766
 					if ($objp->duration) {
3767
-						$optlabel .= " - " . $objp->duration;
3768
-						$outvallabel .= " - " . $objp->duration;
3767
+						$optlabel .= " - ".$objp->duration;
3768
+						$outvallabel .= " - ".$objp->duration;
3769 3769
 					}
3770 3770
 					if (!$socid) {
3771
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3772
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3771
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3772
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3773 3773
 					}
3774 3774
 					if ($objp->supplier_reputation) {
3775 3775
 						//TODO dictionary
3776 3776
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3777 3777
 
3778
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3779
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3778
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3779
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3780 3780
 					}
3781 3781
 				} else {
3782
-					$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3783
-					$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3782
+					$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3783
+					$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3784 3784
 				}
3785 3785
 
3786 3786
 				if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3787 3787
 					$novirtualstock = ($showstockinlist == 2);
3788 3788
 
3789 3789
 					if ($user->hasRight('stock', 'lire')) {
3790
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3790
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3791 3791
 
3792 3792
 						if ($objp->stock > 0) {
3793 3793
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3794 3794
 						} elseif ($objp->stock <= 0) {
3795 3795
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3796 3796
 						}
3797
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3797
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3798 3798
 						$optlabel .= '</span>';
3799 3799
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3800 3800
 							$langs->load("stocks");
@@ -3804,9 +3804,9 @@  discard block
 block discarded – undo
3804 3804
 							$tmpproduct->load_virtual_stock();
3805 3805
 							$virtualstock = $tmpproduct->stock_theorique;
3806 3806
 
3807
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3807
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3808 3808
 
3809
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3809
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
3810 3810
 							if ($virtualstock > 0) {
3811 3811
 								$optlabel .= '<span class="product_line_stock_ok">';
3812 3812
 							} elseif ($virtualstock <= 0) {
@@ -3820,7 +3820,7 @@  discard block
 block discarded – undo
3820 3820
 					}
3821 3821
 				}
3822 3822
 
3823
-				$optstart = '<option value="' . $outkey . '"';
3823
+				$optstart = '<option value="'.$outkey.'"';
3824 3824
 				if ($selected && $selected == $objp->idprodfournprice) {
3825 3825
 					$optstart .= ' selected';
3826 3826
 				}
@@ -3829,31 +3829,31 @@  discard block
 block discarded – undo
3829 3829
 				}
3830 3830
 
3831 3831
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
3832
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
3833
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
3834
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
3835
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
3836
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
3837
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
3838
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
3839
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
3840
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
3841
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
3832
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
3833
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
3834
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
3835
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
3836
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
3837
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
3838
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
3839
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
3840
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
3841
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
3842 3842
 					if (isModEnabled('multicurrency')) {
3843
-						$optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"';
3844
-						$optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"';
3843
+						$optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"';
3844
+						$optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"';
3845 3845
 					}
3846 3846
 				}
3847
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
3847
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
3848 3848
 
3849 3849
 				$outarrayentry = array(
3850 3850
 					'key' => $outkey,
3851 3851
 					'value' => $outref,
3852 3852
 					'label' => $outvallabel,
3853 3853
 					'qty' => $outqty,
3854
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
3855
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3856
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3854
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3855
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3856
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3857 3857
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
3858 3858
 					'tva_tx' => price2num($objp->tva_tx),
3859 3859
 					'default_vat_code' => $objp->default_vat_code,
@@ -3882,17 +3882,17 @@  discard block
 block discarded – undo
3882 3882
 				// Add new entry
3883 3883
 				// "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
3884 3884
 				// "label" value of json key array is used by jQuery automatically as text for combo box
3885
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
3885
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
3886 3886
 				$outarraypush = array(
3887 3887
 					'key' => $outkey,
3888 3888
 					'value' => $outref,
3889 3889
 					'label' => $outvallabel,
3890 3890
 					'qty' => $outqty,
3891
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
3891
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3892 3892
 					'price_qty_ht_locale' => price($objp->fprice),
3893
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3893
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3894 3894
 					'price_unit_ht_locale' => price($objp->unitprice),
3895
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3895
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3896 3896
 					'tva_tx_formated' => price($objp->tva_tx),
3897 3897
 					'tva_tx' => price2num($objp->tva_tx),
3898 3898
 					'default_vat_code' => $objp->default_vat_code,
@@ -3924,7 +3924,7 @@  discard block
 block discarded – undo
3924 3924
 
3925 3925
 			$this->db->free($result);
3926 3926
 
3927
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3927
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3928 3928
 			$out .= ajax_combobox($htmlname);
3929 3929
 		} else {
3930 3930
 			dol_print_error($this->db);
@@ -3956,43 +3956,43 @@  discard block
 block discarded – undo
3956 3956
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
3957 3957
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
3958 3958
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
3959
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3960
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3961
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3962
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
3959
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3960
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3961
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3962
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
3963 3963
 		$sql .= " AND p.tobuy = 1";
3964 3964
 		$sql .= " AND s.fournisseur = 1";
3965
-		$sql .= " AND p.rowid = " . ((int) $productid);
3965
+		$sql .= " AND p.rowid = ".((int) $productid);
3966 3966
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
3967 3967
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
3968 3968
 		} else {
3969 3969
 			$sql .= " ORDER BY pfp.unitprice ASC";
3970 3970
 		}
3971 3971
 
3972
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
3972
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
3973 3973
 		$result = $this->db->query($sql);
3974 3974
 
3975 3975
 		if ($result) {
3976 3976
 			$num = $this->db->num_rows($result);
3977 3977
 
3978
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3978
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3979 3979
 
3980 3980
 			if (!$num) {
3981
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
3981
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
3982 3982
 			} else {
3983
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3983
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3984 3984
 				$form .= '<option value="0">&nbsp;</option>';
3985 3985
 
3986 3986
 				$i = 0;
3987 3987
 				while ($i < $num) {
3988 3988
 					$objp = $this->db->fetch_object($result);
3989 3989
 
3990
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
3990
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
3991 3991
 					//if there is only one supplier, preselect it
3992 3992
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
3993 3993
 						$opt .= ' selected';
3994 3994
 					}
3995
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
3995
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
3996 3996
 
3997 3997
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
3998 3998
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -4002,7 +4002,7 @@  discard block
 block discarded – undo
4002 4002
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
4003 4003
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
4004 4004
 
4005
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4005
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4006 4006
 						$priceparser = new PriceParser($this->db);
4007 4007
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
4008 4008
 						if ($price_result >= 0) {
@@ -4013,10 +4013,10 @@  discard block
 block discarded – undo
4013 4013
 						}
4014 4014
 					}
4015 4015
 					if ($objp->quantity == 1) {
4016
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
4016
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
4017 4017
 					}
4018 4018
 
4019
-					$opt .= $objp->quantity . ' ';
4019
+					$opt .= $objp->quantity.' ';
4020 4020
 
4021 4021
 					if ($objp->quantity == 1) {
4022 4022
 						$opt .= $langs->trans("Unit");
@@ -4025,10 +4025,10 @@  discard block
 block discarded – undo
4025 4025
 					}
4026 4026
 					if ($objp->quantity > 1) {
4027 4027
 						$opt .= " - ";
4028
-						$opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit");
4028
+						$opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit");
4029 4029
 					}
4030 4030
 					if ($objp->duration) {
4031
-						$opt .= " - " . $objp->duration;
4031
+						$opt .= " - ".$objp->duration;
4032 4032
 					}
4033 4033
 					$opt .= "</option>\n";
4034 4034
 
@@ -4066,8 +4066,8 @@  discard block
 block discarded – undo
4066 4066
 		dol_syslog(__METHOD__, LOG_DEBUG);
4067 4067
 
4068 4068
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4069
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4070
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4069
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4070
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4071 4071
 		$sql .= " AND active > 0";
4072 4072
 		$sql .= " ORDER BY sortorder";
4073 4073
 
@@ -4079,7 +4079,7 @@  discard block
 block discarded – undo
4079 4079
 				$obj = $this->db->fetch_object($resql);
4080 4080
 
4081 4081
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4082
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4082
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4083 4083
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4084 4084
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4085 4085
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4107,7 +4107,7 @@  discard block
 block discarded – undo
4107 4107
 		// phpcs:enable
4108 4108
 		global $langs;
4109 4109
 
4110
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4110
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4111 4111
 		if ($num > 0) {
4112 4112
 			return 0; // Cache already loaded
4113 4113
 		}
@@ -4117,7 +4117,7 @@  discard block
 block discarded – undo
4117 4117
 		$langs->load('propal');
4118 4118
 
4119 4119
 		$sql = "SELECT rowid, code, label, position";
4120
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4120
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4121 4121
 		$sql .= " WHERE active > 0";
4122 4122
 
4123 4123
 		$resql = $this->db->query($sql);
@@ -4128,7 +4128,7 @@  discard block
 block discarded – undo
4128 4128
 				$obj = $this->db->fetch_object($resql);
4129 4129
 
4130 4130
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4131
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4131
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4132 4132
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4133 4133
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4134 4134
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4160,17 +4160,17 @@  discard block
 block discarded – undo
4160 4160
 
4161 4161
 		$this->load_cache_availability();
4162 4162
 
4163
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4163
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4164 4164
 
4165
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4165
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4166 4166
 		if ($addempty) {
4167 4167
 			print '<option value="0">&nbsp;</option>';
4168 4168
 		}
4169 4169
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4170 4170
 			if ($selected == $id) {
4171
-				print '<option value="' . $id . '" selected>';
4171
+				print '<option value="'.$id.'" selected>';
4172 4172
 			} else {
4173
-				print '<option value="' . $id . '">';
4173
+				print '<option value="'.$id.'">';
4174 4174
 			}
4175 4175
 			print dol_escape_htmltag($arrayavailability['label']);
4176 4176
 			print '</option>';
@@ -4191,13 +4191,13 @@  discard block
 block discarded – undo
4191 4191
 	{
4192 4192
 		global $langs;
4193 4193
 
4194
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4194
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4195 4195
 		if ($num > 0) {
4196 4196
 			return 0; // Cache already loaded
4197 4197
 		}
4198 4198
 
4199 4199
 		$sql = "SELECT rowid, code, label";
4200
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4200
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4201 4201
 		$sql .= " WHERE active > 0";
4202 4202
 
4203 4203
 		$resql = $this->db->query($sql);
@@ -4210,8 +4210,8 @@  discard block
 block discarded – undo
4210 4210
 
4211 4211
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4212 4212
 				$label = ($obj->label != '-' ? $obj->label : '');
4213
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4214
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4213
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4214
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4215 4215
 				}
4216 4216
 				if ($langs->trans($obj->code) != $obj->code) {
4217 4217
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4251,9 +4251,9 @@  discard block
 block discarded – undo
4251 4251
 
4252 4252
 		$this->loadCacheInputReason();
4253 4253
 
4254
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4254
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4255 4255
 		if ($addempty) {
4256
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4256
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4257 4257
 		}
4258 4258
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4259 4259
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4261,9 +4261,9 @@  discard block
 block discarded – undo
4261 4261
 			}
4262 4262
 
4263 4263
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4264
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4264
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4265 4265
 			} else {
4266
-				print '<option value="' . $arraydemandreason['id'] . '">';
4266
+				print '<option value="'.$arraydemandreason['id'].'">';
4267 4267
 			}
4268 4268
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4269 4269
 			print $langs->trans($label);
@@ -4273,7 +4273,7 @@  discard block
 block discarded – undo
4273 4273
 		if ($user->admin && empty($notooltip)) {
4274 4274
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4275 4275
 		}
4276
-		print ajax_combobox('select_' . $htmlname);
4276
+		print ajax_combobox('select_'.$htmlname);
4277 4277
 	}
4278 4278
 
4279 4279
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4288,7 +4288,7 @@  discard block
 block discarded – undo
4288 4288
 		// phpcs:enable
4289 4289
 		global $langs;
4290 4290
 
4291
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4291
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4292 4292
 		if ($num > 0) {
4293 4293
 			return $num; // Cache already loaded
4294 4294
 		}
@@ -4298,8 +4298,8 @@  discard block
 block discarded – undo
4298 4298
 		$this->cache_types_paiements = array();
4299 4299
 
4300 4300
 		$sql = "SELECT id, code, libelle as label, type, active";
4301
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4302
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4301
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4302
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4303 4303
 
4304 4304
 		$resql = $this->db->query($sql);
4305 4305
 		if ($resql) {
@@ -4309,7 +4309,7 @@  discard block
 block discarded – undo
4309 4309
 				$obj = $this->db->fetch_object($resql);
4310 4310
 
4311 4311
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4312
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4312
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4313 4313
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4314 4314
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4315 4315
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4381,17 +4381,17 @@  discard block
 block discarded – undo
4381 4381
 		global $langs, $user, $conf;
4382 4382
 
4383 4383
 		$out = '';
4384
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4384
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4385 4385
 
4386 4386
 		$this->load_cache_conditions_paiements();
4387 4387
 
4388 4388
 		// Set default value if not already set by caller
4389 4389
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4390
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4390
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4391 4391
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4392 4392
 		}
4393 4393
 
4394
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4394
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4395 4395
 		if ($addempty) {
4396 4396
 			$out .= '<option value="0">&nbsp;</option>';
4397 4397
 		}
@@ -4405,9 +4405,9 @@  discard block
 block discarded – undo
4405 4405
 
4406 4406
 			if ($selected == $id) {
4407 4407
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4408
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4408
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4409 4409
 			} else {
4410
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4410
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4411 4411
 			}
4412 4412
 			$label = $arrayconditions['label'];
4413 4413
 
@@ -4425,21 +4425,21 @@  discard block
 block discarded – undo
4425 4425
 		$out .= ajax_combobox($htmlname);
4426 4426
 
4427 4427
 		if ($deposit_percent >= 0) {
4428
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4429
-			$out .= $langs->trans('DepositPercent') . ' : ';
4430
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4428
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4429
+			$out .= $langs->trans('DepositPercent').' : ';
4430
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4431 4431
 			$out .= '</span>';
4432 4432
 			$out .= '
4433
-				<script nonce="' . getNonce() . '">
4433
+				<script nonce="' . getNonce().'">
4434 4434
 					$(document).ready(function () {
4435
-						$("#' . $htmlname . '").change(function () {
4435
+						$("#' . $htmlname.'").change(function () {
4436 4436
 							let $selected = $(this).find("option:selected");
4437 4437
 							let depositPercent = $selected.attr("data-deposit_percent");
4438 4438
 
4439 4439
 							if (depositPercent.length > 0) {
4440
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4440
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4441 4441
 							} else {
4442
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4442
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4443 4443
 							}
4444 4444
 
4445 4445
 							return true;
@@ -4477,7 +4477,7 @@  discard block
 block discarded – undo
4477 4477
 
4478 4478
 		$out = '';
4479 4479
 
4480
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4480
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4481 4481
 
4482 4482
 		$filterarray = array();
4483 4483
 		if ($filtertype == 'CRDT') {
@@ -4492,11 +4492,11 @@  discard block
 block discarded – undo
4492 4492
 
4493 4493
 		// Set default value if not already set by caller
4494 4494
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4495
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4495
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4496 4496
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4497 4497
 		}
4498 4498
 
4499
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4499
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4500 4500
 		if ($empty) {
4501 4501
 			$out .= '<option value="">&nbsp;</option>';
4502 4502
 		}
@@ -4517,13 +4517,13 @@  discard block
 block discarded – undo
4517 4517
 			}
4518 4518
 
4519 4519
 			if ($format == 0) {
4520
-				$out .= '<option value="' . $id . '"';
4520
+				$out .= '<option value="'.$id.'"';
4521 4521
 			} elseif ($format == 1) {
4522
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4522
+				$out .= '<option value="'.$arraytypes['code'].'"';
4523 4523
 			} elseif ($format == 2) {
4524
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4524
+				$out .= '<option value="'.$arraytypes['code'].'"';
4525 4525
 			} elseif ($format == 3) {
4526
-				$out .= '<option value="' . $id . '"';
4526
+				$out .= '<option value="'.$id.'"';
4527 4527
 			}
4528 4528
 			// Print attribute selected or not
4529 4529
 			if ($format == 1 || $format == 2) {
@@ -4553,7 +4553,7 @@  discard block
 block discarded – undo
4553 4553
 		if ($user->admin && !$noadmininfo) {
4554 4554
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4555 4555
 		}
4556
-		$out .= ajax_combobox('select' . $htmlname);
4556
+		$out .= ajax_combobox('select'.$htmlname);
4557 4557
 
4558 4558
 		if (empty($nooutput)) {
4559 4559
 			print $out;
@@ -4575,22 +4575,22 @@  discard block
 block discarded – undo
4575 4575
 	{
4576 4576
 		global $langs;
4577 4577
 
4578
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4578
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4579 4579
 		$options = array(
4580 4580
 			'HT' => $langs->trans("HT"),
4581 4581
 			'TTC' => $langs->trans("TTC")
4582 4582
 		);
4583 4583
 		foreach ($options as $id => $value) {
4584 4584
 			if ($selected == $id) {
4585
-				$return .= '<option value="' . $id . '" selected>' . $value;
4585
+				$return .= '<option value="'.$id.'" selected>'.$value;
4586 4586
 			} else {
4587
-				$return .= '<option value="' . $id . '">' . $value;
4587
+				$return .= '<option value="'.$id.'">'.$value;
4588 4588
 			}
4589 4589
 			$return .= '</option>';
4590 4590
 		}
4591 4591
 		$return .= '</select>';
4592 4592
 		if ($addjscombo) {
4593
-			$return .= ajax_combobox('select_' . $htmlname);
4593
+			$return .= ajax_combobox('select_'.$htmlname);
4594 4594
 		}
4595 4595
 
4596 4596
 		return $return;
@@ -4608,7 +4608,7 @@  discard block
 block discarded – undo
4608 4608
 		// phpcs:enable
4609 4609
 		global $langs;
4610 4610
 
4611
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4611
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4612 4612
 		if ($num > 0) {
4613 4613
 			return $num; // Cache already loaded
4614 4614
 		}
@@ -4618,8 +4618,8 @@  discard block
 block discarded – undo
4618 4618
 		$this->cache_transport_mode = array();
4619 4619
 
4620 4620
 		$sql = "SELECT rowid, code, label, active";
4621
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4622
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4621
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4622
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4623 4623
 
4624 4624
 		$resql = $this->db->query($sql);
4625 4625
 		if ($resql) {
@@ -4629,7 +4629,7 @@  discard block
 block discarded – undo
4629 4629
 				$obj = $this->db->fetch_object($resql);
4630 4630
 
4631 4631
 				// If traduction exist, we use it else we take the default label
4632
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4632
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4633 4633
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4634 4634
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4635 4635
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4663,11 +4663,11 @@  discard block
 block discarded – undo
4663 4663
 	{
4664 4664
 		global $langs, $user;
4665 4665
 
4666
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4666
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4667 4667
 
4668 4668
 		$this->load_cache_transport_mode();
4669 4669
 
4670
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4670
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4671 4671
 		if ($empty) {
4672 4672
 			print '<option value="">&nbsp;</option>';
4673 4673
 		}
@@ -4683,13 +4683,13 @@  discard block
 block discarded – undo
4683 4683
 			}
4684 4684
 
4685 4685
 			if ($format == 0) {
4686
-				print '<option value="' . $id . '"';
4686
+				print '<option value="'.$id.'"';
4687 4687
 			} elseif ($format == 1) {
4688
-				print '<option value="' . $arraytypes['code'] . '"';
4688
+				print '<option value="'.$arraytypes['code'].'"';
4689 4689
 			} elseif ($format == 2) {
4690
-				print '<option value="' . $arraytypes['code'] . '"';
4690
+				print '<option value="'.$arraytypes['code'].'"';
4691 4691
 			} elseif ($format == 3) {
4692
-				print '<option value="' . $id . '"';
4692
+				print '<option value="'.$id.'"';
4693 4693
 			}
4694 4694
 			// If text is selected, we compare with code, else with id
4695 4695
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4737,31 +4737,31 @@  discard block
 block discarded – undo
4737 4737
 		$langs->load("deliveries");
4738 4738
 
4739 4739
 		$sql = "SELECT rowid, code, libelle as label";
4740
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4740
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4741 4741
 		$sql .= " WHERE active > 0";
4742 4742
 		if ($filtre) {
4743
-			$sql .= " AND " . $filtre;
4743
+			$sql .= " AND ".$filtre;
4744 4744
 		}
4745 4745
 		$sql .= " ORDER BY libelle ASC";
4746 4746
 
4747
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4747
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4748 4748
 		$result = $this->db->query($sql);
4749 4749
 		if ($result) {
4750 4750
 			$num = $this->db->num_rows($result);
4751 4751
 			$i = 0;
4752 4752
 			if ($num) {
4753
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4753
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4754 4754
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4755 4755
 					print '<option value="-1">&nbsp;</option>';
4756 4756
 				}
4757 4757
 				while ($i < $num) {
4758 4758
 					$obj = $this->db->fetch_object($result);
4759 4759
 					if ($selected == $obj->rowid) {
4760
-						print '<option value="' . $obj->rowid . '" selected>';
4760
+						print '<option value="'.$obj->rowid.'" selected>';
4761 4761
 					} else {
4762
-						print '<option value="' . $obj->rowid . '">';
4762
+						print '<option value="'.$obj->rowid.'">';
4763 4763
 					}
4764
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4764
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4765 4765
 					print '</option>';
4766 4766
 					$i++;
4767 4767
 				}
@@ -4770,7 +4770,7 @@  discard block
 block discarded – undo
4770 4770
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4771 4771
 				}
4772 4772
 
4773
-				print ajax_combobox('select' . $htmlname);
4773
+				print ajax_combobox('select'.$htmlname);
4774 4774
 			} else {
4775 4775
 				print $langs->trans("NoShippingMethodDefined");
4776 4776
 			}
@@ -4795,16 +4795,16 @@  discard block
 block discarded – undo
4795 4795
 		$langs->load("deliveries");
4796 4796
 
4797 4797
 		if ($htmlname != "none") {
4798
-			print '<form method="POST" action="' . $page . '">';
4798
+			print '<form method="POST" action="'.$page.'">';
4799 4799
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4800
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4800
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4801 4801
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4802
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4802
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4803 4803
 			print '</form>';
4804 4804
 		} else {
4805 4805
 			if ($selected) {
4806 4806
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
4807
-				print $langs->trans("SendingMethod" . strtoupper($code));
4807
+				print $langs->trans("SendingMethod".strtoupper($code));
4808 4808
 			} else {
4809 4809
 				print "&nbsp;";
4810 4810
 			}
@@ -4827,10 +4827,10 @@  discard block
 block discarded – undo
4827 4827
 
4828 4828
 		$opt = '<option value="" selected></option>';
4829 4829
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
4830
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
4831
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
4830
+		$sql .= ' FROM '.$this->db->prefix().'facture';
4831
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
4832 4832
 		$sql .= ' AND situation_counter >= 1';
4833
-		$sql .= ' AND fk_soc = ' . (int) $socid;
4833
+		$sql .= ' AND fk_soc = '.(int) $socid;
4834 4834
 		$sql .= ' AND type <> 2';
4835 4835
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
4836 4836
 		$resql = $this->db->query($sql);
@@ -4848,19 +4848,19 @@  discard block
 block discarded – undo
4848 4848
 						//Not prov?
4849 4849
 						if (substr($obj->ref, 1, 4) != 'PROV') {
4850 4850
 							if ($selected == $obj->rowid) {
4851
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
4851
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
4852 4852
 							} else {
4853
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
4853
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
4854 4854
 							}
4855 4855
 						}
4856 4856
 					}
4857 4857
 				}
4858 4858
 			}
4859 4859
 		} else {
4860
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
4860
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
4861 4861
 		}
4862 4862
 		if ($opt == '<option value ="" selected></option>') {
4863
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
4863
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
4864 4864
 		}
4865 4865
 		return $opt;
4866 4866
 	}
@@ -4880,12 +4880,12 @@  discard block
 block discarded – undo
4880 4880
 
4881 4881
 		$langs->load('products');
4882 4882
 
4883
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
4883
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
4884 4884
 
4885
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
4885
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
4886 4886
 		$sql .= ' WHERE active > 0';
4887 4887
 		if (!empty($unit_type)) {
4888
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
4888
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
4889 4889
 		}
4890 4890
 		$sql .= " ORDER BY sortorder";
4891 4891
 
@@ -4897,14 +4897,14 @@  discard block
 block discarded – undo
4897 4897
 
4898 4898
 			while ($res = $this->db->fetch_object($resql)) {
4899 4899
 				$unitLabel = $res->label;
4900
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
4901
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
4900
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
4901
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
4902 4902
 				}
4903 4903
 
4904 4904
 				if ($selected == $res->rowid) {
4905
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
4905
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
4906 4906
 				} else {
4907
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
4907
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
4908 4908
 				}
4909 4909
 			}
4910 4910
 			$return .= '</select>';
@@ -4939,23 +4939,23 @@  discard block
 block discarded – undo
4939 4939
 		$num = 0;
4940 4940
 
4941 4941
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
4942
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
4943
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
4942
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
4943
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
4944 4944
 		if ($status != 2) {
4945
-			$sql .= " AND clos = " . (int) $status;
4945
+			$sql .= " AND clos = ".(int) $status;
4946 4946
 		}
4947 4947
 		if ($filtre) {	// TODO Support USF
4948
-			$sql .= " AND " . $filtre;
4948
+			$sql .= " AND ".$filtre;
4949 4949
 		}
4950 4950
 		$sql .= " ORDER BY label";
4951 4951
 
4952
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
4952
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
4953 4953
 		$result = $this->db->query($sql);
4954 4954
 		if ($result) {
4955 4955
 			$num = $this->db->num_rows($result);
4956 4956
 			$i = 0;
4957 4957
 			if ($num) {
4958
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4958
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4959 4959
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4960 4960
 					$out .= '<option value="-1">&nbsp;</option>';
4961 4961
 				}
@@ -4963,27 +4963,27 @@  discard block
 block discarded – undo
4963 4963
 				while ($i < $num) {
4964 4964
 					$obj = $this->db->fetch_object($result);
4965 4965
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
4966
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
4966
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
4967 4967
 					} else {
4968
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
4968
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
4969 4969
 					}
4970 4970
 					$out .= trim($obj->label);
4971 4971
 					if ($showcurrency) {
4972
-						$out .= ' (' . $obj->currency_code . ')';
4972
+						$out .= ' ('.$obj->currency_code.')';
4973 4973
 					}
4974 4974
 					if ($status == 2 && $obj->status == 1) {
4975
-						$out .= ' (' . $langs->trans("Closed") . ')';
4975
+						$out .= ' ('.$langs->trans("Closed").')';
4976 4976
 					}
4977 4977
 					$out .= '</option>';
4978 4978
 					$i++;
4979 4979
 				}
4980 4980
 				$out .= "</select>";
4981
-				$out .= ajax_combobox('select' . $htmlname);
4981
+				$out .= ajax_combobox('select'.$htmlname);
4982 4982
 			} else {
4983 4983
 				if ($status == 0) {
4984
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
4984
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
4985 4985
 				} else {
4986
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
4986
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
4987 4987
 				}
4988 4988
 			}
4989 4989
 		} else {
@@ -5019,23 +5019,23 @@  discard block
 block discarded – undo
5019 5019
 		$num = 0;
5020 5020
 
5021 5021
 		$sql = "SELECT rowid, name, fk_country, status, entity";
5022
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
5022
+		$sql .= " FROM ".$this->db->prefix()."establishment";
5023 5023
 		$sql .= " WHERE 1=1";
5024 5024
 		if ($status != 2) {
5025
-			$sql .= " AND status = " . (int) $status;
5025
+			$sql .= " AND status = ".(int) $status;
5026 5026
 		}
5027 5027
 		if ($filtre) {	// TODO Support USF
5028
-			$sql .= " AND " . $filtre;
5028
+			$sql .= " AND ".$filtre;
5029 5029
 		}
5030 5030
 		$sql .= " ORDER BY name";
5031 5031
 
5032
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
5032
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
5033 5033
 		$result = $this->db->query($sql);
5034 5034
 		if ($result) {
5035 5035
 			$num = $this->db->num_rows($result);
5036 5036
 			$i = 0;
5037 5037
 			if ($num) {
5038
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5038
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5039 5039
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5040 5040
 					print '<option value="-1">&nbsp;</option>';
5041 5041
 				}
@@ -5043,13 +5043,13 @@  discard block
 block discarded – undo
5043 5043
 				while ($i < $num) {
5044 5044
 					$obj = $this->db->fetch_object($result);
5045 5045
 					if ($selected == $obj->rowid) {
5046
-						print '<option value="' . $obj->rowid . '" selected>';
5046
+						print '<option value="'.$obj->rowid.'" selected>';
5047 5047
 					} else {
5048
-						print '<option value="' . $obj->rowid . '">';
5048
+						print '<option value="'.$obj->rowid.'">';
5049 5049
 					}
5050 5050
 					print trim($obj->name);
5051 5051
 					if ($status == 2 && $obj->status == 1) {
5052
-						print ' (' . $langs->trans("Closed") . ')';
5052
+						print ' ('.$langs->trans("Closed").')';
5053 5053
 					}
5054 5054
 					print '</option>';
5055 5055
 					$i++;
@@ -5057,9 +5057,9 @@  discard block
 block discarded – undo
5057 5057
 				print "</select>";
5058 5058
 			} else {
5059 5059
 				if ($status == 0) {
5060
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5060
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5061 5061
 				} else {
5062
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5062
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5063 5063
 				}
5064 5064
 			}
5065 5065
 
@@ -5083,20 +5083,20 @@  discard block
 block discarded – undo
5083 5083
 	{
5084 5084
 		global $langs;
5085 5085
 		if ($htmlname != "none") {
5086
-			print '<form method="POST" action="' . $page . '">';
5086
+			print '<form method="POST" action="'.$page.'">';
5087 5087
 			print '<input type="hidden" name="action" value="setbankaccount">';
5088
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5088
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5089 5089
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5090 5090
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5091 5091
 			if ($nbaccountfound > 0) {
5092
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5092
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5093 5093
 			}
5094 5094
 			print '</form>';
5095 5095
 		} else {
5096 5096
 			$langs->load('banks');
5097 5097
 
5098 5098
 			if ($selected) {
5099
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5099
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5100 5100
 				$bankstatic = new Account($this->db);
5101 5101
 				$result = $bankstatic->fetch($selected);
5102 5102
 				if ($result) {
@@ -5135,19 +5135,19 @@  discard block
 block discarded – undo
5135 5135
 		global $conf, $langs;
5136 5136
 		$langs->load("categories");
5137 5137
 
5138
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5138
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5139 5139
 
5140 5140
 		// For backward compatibility
5141 5141
 		if (is_numeric($type)) {
5142
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5142
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5143 5143
 		}
5144 5144
 
5145 5145
 		if ($type === Categorie::TYPE_BANK_LINE) {
5146 5146
 			// TODO Move this into common category feature
5147 5147
 			$cate_arbo = array();
5148 5148
 			$sql = "SELECT c.label, c.rowid";
5149
-			$sql .= " FROM " . $this->db->prefix() . "bank_categ as c";
5150
-			$sql .= " WHERE entity = " . $conf->entity;
5149
+			$sql .= " FROM ".$this->db->prefix()."bank_categ as c";
5150
+			$sql .= " WHERE entity = ".$conf->entity;
5151 5151
 			$sql .= " ORDER BY c.label";
5152 5152
 			$result = $this->db->query($sql);
5153 5153
 			if ($result) {
@@ -5173,12 +5173,12 @@  discard block
 block discarded – undo
5173 5173
 		$outarrayrichhtml = array();
5174 5174
 
5175 5175
 
5176
-		$output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5176
+		$output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5177 5177
 		if (is_array($cate_arbo)) {
5178 5178
 			$num = count($cate_arbo);
5179 5179
 
5180 5180
 			if (!$num) {
5181
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5181
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5182 5182
 			} else {
5183 5183
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5184 5184
 					$output .= '<option value="-1">&nbsp;</option>';
@@ -5190,15 +5190,15 @@  discard block
 block discarded – undo
5190 5190
 						$add = '';
5191 5191
 					}
5192 5192
 
5193
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5193
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5194 5194
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5195 5195
 
5196 5196
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5197 5197
 
5198 5198
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5199 5199
 
5200
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5201
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5200
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5201
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5202 5202
 					$output .= '>';
5203 5203
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5204 5204
 					$output .= '</option>';
@@ -5240,7 +5240,7 @@  discard block
 block discarded – undo
5240 5240
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5241 5241
 	{
5242 5242
 		// phpcs:enable
5243
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5243
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5244 5244
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5245 5245
 	}
5246 5246
 
@@ -5275,7 +5275,7 @@  discard block
 block discarded – undo
5275 5275
 	{
5276 5276
 		global $langs, $conf;
5277 5277
 
5278
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5278
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5279 5279
 		$formconfirm = '';
5280 5280
 		$inputok = array();
5281 5281
 		$inputko = array();
@@ -5299,27 +5299,27 @@  discard block
 block discarded – undo
5299 5299
 			foreach ($formquestion as $key => $input) {
5300 5300
 				if (is_array($input) && !empty($input)) {
5301 5301
 					if ($input['type'] == 'hidden') {
5302
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5303
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5302
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5303
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5304 5304
 
5305
-						$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";
5305
+						$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";
5306 5306
 					}
5307 5307
 				}
5308 5308
 			}
5309 5309
 
5310 5310
 			// Now add questions
5311 5311
 			$moreonecolumn = '';
5312
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5312
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5313 5313
 			foreach ($formquestion as $key => $input) {
5314 5314
 				if (is_array($input) && !empty($input)) {
5315
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5316
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5317
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5315
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5316
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5317
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5318 5318
 
5319 5319
 					if ($input['type'] == 'text') {
5320
-						$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";
5320
+						$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";
5321 5321
 					} elseif ($input['type'] == 'password') {
5322
-						$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";
5322
+						$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";
5323 5323
 					} elseif ($input['type'] == 'textarea') {
5324 5324
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5325 5325
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5327,8 +5327,8 @@  discard block
 block discarded – undo
5327 5327
 						$more .= '</textarea>';
5328 5328
 						$more .= '</div></div>'."\n";*/
5329 5329
 						$moreonecolumn .= '<div class="margintoponly">';
5330
-						$moreonecolumn .= $input['label'] . '<br>';
5331
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5330
+						$moreonecolumn .= $input['label'].'<br>';
5331
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5332 5332
 						$moreonecolumn .= $input['value'];
5333 5333
 						$moreonecolumn .= '</textarea>';
5334 5334
 						$moreonecolumn .= '</div>';
@@ -5345,20 +5345,20 @@  discard block
 block discarded – undo
5345 5345
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5346 5346
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5347 5347
 
5348
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5348
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5349 5349
 						if (!empty($input['label'])) {
5350
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5350
+							$more .= $input['label'].'</div><div class="tagtd left">';
5351 5351
 						}
5352 5352
 						if ($input['type'] == 'select') {
5353 5353
 							$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);
5354 5354
 						} else {
5355 5355
 							$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);
5356 5356
 						}
5357
-						$more .= '</div></div>' . "\n";
5357
+						$more .= '</div></div>'."\n";
5358 5358
 					} elseif ($input['type'] == 'checkbox') {
5359 5359
 						$more .= '<div class="tagtr">';
5360
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5361
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5360
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5361
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5362 5362
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5363 5363
 							$more .= ' checked';
5364 5364
 						}
@@ -5369,19 +5369,19 @@  discard block
 block discarded – undo
5369 5369
 							$more .= ' disabled';
5370 5370
 						}
5371 5371
 						$more .= ' /></div>';
5372
-						$more .= '</div>' . "\n";
5372
+						$more .= '</div>'."\n";
5373 5373
 					} elseif ($input['type'] == 'radio') {
5374 5374
 						$i = 0;
5375 5375
 						foreach ($input['values'] as $selkey => $selval) {
5376 5376
 							$more .= '<div class="tagtr">';
5377 5377
 							if (isset($input['label'])) {
5378 5378
 								if ($i == 0) {
5379
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5379
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5380 5380
 								} else {
5381
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5381
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5382 5382
 								}
5383 5383
 							}
5384
-							$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;
5384
+							$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;
5385 5385
 							if (!empty($input['disabled'])) {
5386 5386
 								$more .= ' disabled';
5387 5387
 							}
@@ -5389,12 +5389,12 @@  discard block
 block discarded – undo
5389 5389
 								$more .= ' checked="checked"';
5390 5390
 							}
5391 5391
 							$more .= ' /> ';
5392
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5393
-							$more .= '</div></div>' . "\n";
5392
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5393
+							$more .= '</div></div>'."\n";
5394 5394
 							$i++;
5395 5395
 						}
5396 5396
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5397
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5397
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5398 5398
 						$more .= '<div class="tagtd">';
5399 5399
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5400 5400
 						$h = $m = 0;
@@ -5412,24 +5412,24 @@  discard block
 block discarded – undo
5412 5412
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5413 5413
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5414 5414
 						if (!empty($input['label'])) {
5415
-							$more .= $input['label'] . '</div><div class="tagtd">';
5415
+							$more .= $input['label'].'</div><div class="tagtd">';
5416 5416
 						}
5417 5417
 						$more .= $input['value'];
5418
-						$more .= '</div></div>' . "\n";
5418
+						$more .= '</div></div>'."\n";
5419 5419
 					} elseif ($input['type'] == 'onecolumn') {
5420 5420
 						$moreonecolumn .= '<div class="margintoponly">';
5421 5421
 						$moreonecolumn .= $input['value'];
5422
-						$moreonecolumn .= '</div>' . "\n";
5422
+						$moreonecolumn .= '</div>'."\n";
5423 5423
 					} elseif ($input['type'] == 'hidden') {
5424 5424
 						// Do nothing more, already added by a previous loop
5425 5425
 					} elseif ($input['type'] == 'separator') {
5426 5426
 						$more .= '<br>';
5427 5427
 					} else {
5428
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5428
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5429 5429
 					}
5430 5430
 				}
5431 5431
 			}
5432
-			$more .= '</div>' . "\n";
5432
+			$more .= '</div>'."\n";
5433 5433
 			$more .= $moreonecolumn;
5434 5434
 		}
5435 5435
 
@@ -5451,10 +5451,10 @@  discard block
 block discarded – undo
5451 5451
 				$button = $useajax;
5452 5452
 				$useajax = 1;
5453 5453
 				$autoOpen = false;
5454
-				$dialogconfirm .= '-' . $button;
5454
+				$dialogconfirm .= '-'.$button;
5455 5455
 			}
5456
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5457
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5456
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5457
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5458 5458
 
5459 5459
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5460 5460
 			if (is_array($formquestion)) {
@@ -5477,24 +5477,24 @@  discard block
 block discarded – undo
5477 5477
 			}
5478 5478
 
5479 5479
 			// Show JQuery confirm box.
5480
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5480
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5481 5481
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5482
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5482
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5483 5483
 			}
5484 5484
 			if (!empty($more)) {
5485
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5485
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5486 5486
 			}
5487
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : '');
5488
-			$formconfirm .= '</div>' . "\n";
5487
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : '');
5488
+			$formconfirm .= '</div>'."\n";
5489 5489
 
5490
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5491
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5490
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5491
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5492 5492
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5493 5493
 			$formconfirm .= 'jQuery(document).ready(function() {
5494 5494
             $(function() {
5495
-            	$( "#' . $dialogconfirm . '" ).dialog(
5495
+            	$( "#' . $dialogconfirm.'" ).dialog(
5496 5496
             	{
5497
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5497
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5498 5498
 			if ($newselectedchoice == 'no') {
5499 5499
 				$formconfirm .= '
5500 5500
 						open: function() {
@@ -5504,24 +5504,24 @@  discard block
 block discarded – undo
5504 5504
 
5505 5505
 			$jsforcursor = '';
5506 5506
 			if ($useajax == 1) {
5507
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5508
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5507
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5508
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5509 5509
 			}
5510 5510
 
5511 5511
 			$postconfirmas = 'GET';
5512 5512
 
5513 5513
 			$formconfirm .= '
5514 5514
                     resizable: false,
5515
-                    height: "' . $height . '",
5516
-                    width: "' . $width . '",
5515
+                    height: "' . $height.'",
5516
+                    width: "' . $width.'",
5517 5517
                     modal: true,
5518 5518
                     closeOnEscape: false,
5519 5519
                     buttons: {
5520
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5521
-							var options = "token=' . urlencode(newToken()) . '";
5522
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5523
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5524
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5520
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5521
+							var options = "token=' . urlencode(newToken()).'";
5522
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5523
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5524
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5525 5525
 
5526 5526
                          	if (inputok.length > 0) {
5527 5527
                          		$.each(inputok, function(i, inputname) {
@@ -5555,11 +5555,11 @@  discard block
 block discarded – undo
5555 5555
 							}
5556 5556
 	                        $(this).dialog("close");
5557 5557
                         },
5558
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5559
-                        	var options = "token=' . urlencode(newToken()) . '";
5560
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5561
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5562
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5558
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5559
+                        	var options = "token=' . urlencode(newToken()).'";
5560
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5561
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5562
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5563 5563
                          	if (inputko.length > 0) {
5564 5564
                          		$.each(inputko, function(i, inputname) {
5565 5565
                          			var more = "";
@@ -5591,10 +5591,10 @@  discard block
 block discarded – undo
5591 5591
                 }
5592 5592
                 );
5593 5593
 
5594
-            	var button = "' . $button . '";
5594
+            	var button = "' . $button.'";
5595 5595
             	if (button.length > 0) {
5596 5596
                 	$( "#" + button ).click(function() {
5597
-                		$("#' . $dialogconfirm . '").dialog("open");
5597
+                		$("#' . $dialogconfirm.'").dialog("open");
5598 5598
         			});
5599 5599
                 }
5600 5600
             });
@@ -5602,44 +5602,44 @@  discard block
 block discarded – undo
5602 5602
             </script>';
5603 5603
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5604 5604
 		} else {
5605
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5605
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5606 5606
 
5607 5607
 			if (empty($disableformtag)) {
5608
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n";
5608
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
5609 5609
 			}
5610 5610
 
5611
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5612
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5611
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5612
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5613 5613
 
5614
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5614
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5615 5615
 
5616 5616
 			// Line title
5617 5617
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5618
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5619
-			$formconfirm .= '</td></tr>' . "\n";
5618
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5619
+			$formconfirm .= '</td></tr>'."\n";
5620 5620
 
5621 5621
 			// Line text
5622 5622
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5623
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5623
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5624 5624
 			}
5625 5625
 
5626 5626
 			// Line form fields
5627 5627
 			if ($more) {
5628
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5628
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5629 5629
 				$formconfirm .= $more;
5630
-				$formconfirm .= '</td></tr>' . "\n";
5630
+				$formconfirm .= '</td></tr>'."\n";
5631 5631
 			}
5632 5632
 
5633 5633
 			// Line with question
5634 5634
 			$formconfirm .= '<tr class="valid">';
5635
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5635
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5636 5636
 			$formconfirm .= '<td class="valid center">';
5637 5637
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5638
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5638
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5639 5639
 			$formconfirm .= '</td>';
5640
-			$formconfirm .= '</tr>' . "\n";
5640
+			$formconfirm .= '</tr>'."\n";
5641 5641
 
5642
-			$formconfirm .= '</table>' . "\n";
5642
+			$formconfirm .= '</table>'."\n";
5643 5643
 
5644 5644
 			if (empty($disableformtag)) {
5645 5645
 				$formconfirm .= "</form>\n";
@@ -5648,7 +5648,7 @@  discard block
 block discarded – undo
5648 5648
 
5649 5649
 			if (!empty($conf->use_javascript_ajax)) {
5650 5650
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5651
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5651
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5652 5652
 				$formconfirm .= '
5653 5653
 				$(document).ready(function () {
5654 5654
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5660,7 +5660,7 @@  discard block
 block discarded – undo
5660 5660
 					});
5661 5661
 				});
5662 5662
 				';
5663
-				$formconfirm .= '</script>' . "\n";
5663
+				$formconfirm .= '</script>'."\n";
5664 5664
 			}
5665 5665
 
5666 5666
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5692,8 +5692,8 @@  discard block
 block discarded – undo
5692 5692
 		// phpcs:enable
5693 5693
 		global $langs;
5694 5694
 
5695
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5696
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5695
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5696
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5697 5697
 
5698 5698
 		$out = '';
5699 5699
 
@@ -5701,11 +5701,11 @@  discard block
 block discarded – undo
5701 5701
 
5702 5702
 		$langs->load("project");
5703 5703
 		if ($htmlname != "none") {
5704
-			$out .= '<form method="post" action="' . $page . '">';
5704
+			$out .= '<form method="post" action="'.$page.'">';
5705 5705
 			$out .= '<input type="hidden" name="action" value="classin">';
5706
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5706
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5707 5707
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5708
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5708
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5709 5709
 			$out .= '</form>';
5710 5710
 		} else {
5711 5711
 			$out .= '<span class="project_head_block">';
@@ -5714,7 +5714,7 @@  discard block
 block discarded – undo
5714 5714
 				$projet->fetch($selected);
5715 5715
 				$out .= $projet->getNomUrl(0, '', 1);
5716 5716
 			} else {
5717
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5717
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5718 5718
 			}
5719 5719
 			$out .= '</span>';
5720 5720
 		}
@@ -5751,14 +5751,14 @@  discard block
 block discarded – undo
5751 5751
 		$out = '';
5752 5752
 
5753 5753
 		if ($htmlname != "none") {
5754
-			$out .= '<form method="POST" action="' . $page . '">';
5754
+			$out .= '<form method="POST" action="'.$page.'">';
5755 5755
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5756
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5756
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5757 5757
 			if ($type) {
5758
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5758
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5759 5759
 			}
5760 5760
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5761
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5761
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5762 5762
 			$out .= '</form>';
5763 5763
 		} else {
5764 5764
 			if ($selected) {
@@ -5803,12 +5803,12 @@  discard block
 block discarded – undo
5803 5803
 		// phpcs:enable
5804 5804
 		global $langs;
5805 5805
 		if ($htmlname != "none") {
5806
-			print '<form method="post" action="' . $page . '">';
5806
+			print '<form method="post" action="'.$page.'">';
5807 5807
 			print '<input type="hidden" name="action" value="setavailability">';
5808
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5808
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5809 5809
 			$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
5810
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5811
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
5810
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5811
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
5812 5812
 			print '</form>';
5813 5813
 		} else {
5814 5814
 			if ($selected) {
@@ -5834,11 +5834,11 @@  discard block
 block discarded – undo
5834 5834
 	{
5835 5835
 		global $langs;
5836 5836
 		if ($htmlname != "none") {
5837
-			print '<form method="post" action="' . $page . '">';
5837
+			print '<form method="post" action="'.$page.'">';
5838 5838
 			print '<input type="hidden" name="action" value="setdemandreason">';
5839
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5839
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5840 5840
 			$this->selectInputReason($selected, $htmlname, -1, $addempty);
5841
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5841
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5842 5842
 			print '</form>';
5843 5843
 		} else {
5844 5844
 			if ($selected) {
@@ -5878,17 +5878,17 @@  discard block
 block discarded – undo
5878 5878
 		$ret = '';
5879 5879
 
5880 5880
 		if ($htmlname != "none") {
5881
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5882
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
5883
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
5881
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5882
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
5883
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
5884 5884
 			if ($type) {
5885
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5885
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5886 5886
 			}
5887 5887
 			$ret .= '<table class="nobordernopadding">';
5888 5888
 			$ret .= '<tr><td>';
5889
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
5889
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
5890 5890
 			$ret .= '</td>';
5891
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
5891
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
5892 5892
 			$ret .= '</tr></table></form>';
5893 5893
 		} else {
5894 5894
 			if ($displayhour) {
@@ -5923,15 +5923,15 @@  discard block
 block discarded – undo
5923 5923
 		global $langs;
5924 5924
 
5925 5925
 		if ($htmlname != "none") {
5926
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5927
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
5928
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5926
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5927
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
5928
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5929 5929
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
5930
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5930
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5931 5931
 			print '</form>';
5932 5932
 		} else {
5933 5933
 			if ($selected) {
5934
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
5934
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
5935 5935
 				$theuser = new User($this->db);
5936 5936
 				$theuser->fetch($selected);
5937 5937
 				print $theuser->getNomUrl(1);
@@ -5964,14 +5964,14 @@  discard block
 block discarded – undo
5964 5964
 
5965 5965
 		$out = '';
5966 5966
 		if ($htmlname != "none") {
5967
-			$out .= '<form method="POST" action="' . $page . '">';
5967
+			$out .= '<form method="POST" action="'.$page.'">';
5968 5968
 			$out .= '<input type="hidden" name="action" value="setmode">';
5969
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5969
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5970 5970
 			if ($type) {
5971
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5971
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5972 5972
 			}
5973 5973
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
5974
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5974
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5975 5975
 			$out .= '</form>';
5976 5976
 		} else {
5977 5977
 			if ($selected) {
@@ -6004,11 +6004,11 @@  discard block
 block discarded – undo
6004 6004
 	{
6005 6005
 		global $langs;
6006 6006
 		if ($htmlname != "none") {
6007
-			print '<form method="POST" action="' . $page . '">';
6007
+			print '<form method="POST" action="'.$page.'">';
6008 6008
 			print '<input type="hidden" name="action" value="settransportmode">';
6009
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6009
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6010 6010
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
6011
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6011
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6012 6012
 			print '</form>';
6013 6013
 		} else {
6014 6014
 			if ($selected) {
@@ -6035,14 +6035,14 @@  discard block
 block discarded – undo
6035 6035
 		// phpcs:enable
6036 6036
 		global $langs;
6037 6037
 		if ($htmlname != "none") {
6038
-			print '<form method="POST" action="' . $page . '">';
6038
+			print '<form method="POST" action="'.$page.'">';
6039 6039
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
6040
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6040
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6041 6041
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
6042
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6042
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6043 6043
 			print '</form>';
6044 6044
 		} else {
6045
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6045
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6046 6046
 			print !empty($selected) ? currency_name($selected, 1) : '&nbsp;';
6047 6047
 		}
6048 6048
 	}
@@ -6064,21 +6064,21 @@  discard block
 block discarded – undo
6064 6064
 		global $langs, $mysoc, $conf;
6065 6065
 
6066 6066
 		if ($htmlname != "none") {
6067
-			print '<form method="POST" action="' . $page . '">';
6067
+			print '<form method="POST" action="'.$page.'">';
6068 6068
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6069
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6070
-			print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6069
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6070
+			print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6071 6071
 			print '<select name="calculation_mode">';
6072
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6073
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6072
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6073
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6074 6074
 			print '</select> ';
6075
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6075
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6076 6076
 			print '</form>';
6077 6077
 		} else {
6078 6078
 			if (!empty($rate)) {
6079 6079
 				print price($rate, 1, $langs, 0, 0);
6080 6080
 				if ($currency && $rate != 1) {
6081
-					print ' &nbsp; (' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')';
6081
+					print ' &nbsp; ('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')';
6082 6082
 				}
6083 6083
 			} else {
6084 6084
 				print 1;
@@ -6109,9 +6109,9 @@  discard block
 block discarded – undo
6109 6109
 		// phpcs:enable
6110 6110
 		global $conf, $langs;
6111 6111
 		if ($htmlname != "none") {
6112
-			print '<form method="post" action="' . $page . '">';
6112
+			print '<form method="post" action="'.$page.'">';
6113 6113
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6114
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6114
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6115 6115
 			print '<div class="inline-block">';
6116 6116
 			if (!empty($discount_type)) {
6117 6117
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6149,24 +6149,24 @@  discard block
 block discarded – undo
6149 6149
 			print '</div>';
6150 6150
 			if (empty($hidelist)) {
6151 6151
 				print '<div class="inline-block" style="padding-right: 10px">';
6152
-				$newfilter = 'discount_type=' . intval($discount_type);
6152
+				$newfilter = 'discount_type='.intval($discount_type);
6153 6153
 				if (!empty($discount_type)) {
6154 6154
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6155 6155
 				} else {
6156 6156
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6157 6157
 				}
6158 6158
 				if ($filter) {
6159
-					$newfilter .= ' AND (' . $filter . ')';
6159
+					$newfilter .= ' AND ('.$filter.')';
6160 6160
 				}
6161 6161
 				// output the combo of discounts
6162 6162
 				$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
6163 6163
 				if ($nbqualifiedlines > 0) {
6164
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6164
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6165 6165
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6166
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6166
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6167 6167
 					}
6168 6168
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6169
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6169
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6170 6170
 					}
6171 6171
 
6172 6172
 					print '>';
@@ -6206,23 +6206,23 @@  discard block
 block discarded – undo
6206 6206
 		global $langs, $conf;
6207 6207
 
6208 6208
 		if ($htmlname != "none") {
6209
-			print '<form method="post" action="' . $page . '">';
6209
+			print '<form method="post" action="'.$page.'">';
6210 6210
 			print '<input type="hidden" name="action" value="set_contact">';
6211
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6211
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6212 6212
 			print '<table class="nobordernopadding">';
6213 6213
 			print '<tr><td>';
6214 6214
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6215 6215
 			$num = $this->num;
6216 6216
 			if ($num == 0) {
6217 6217
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6218
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6218
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6219 6219
 			}
6220 6220
 			print '</td>';
6221
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6221
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6222 6222
 			print '</tr></table></form>';
6223 6223
 		} else {
6224 6224
 			if ($selected) {
6225
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6225
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6226 6226
 				$contact = new Contact($this->db);
6227 6227
 				$contact->fetch($selected);
6228 6228
 				print $contact->getFullName($langs);
@@ -6257,20 +6257,20 @@  discard block
 block discarded – undo
6257 6257
 
6258 6258
 		$out = '';
6259 6259
 		if ($htmlname != "none") {
6260
-			$out .= '<form method="post" action="' . $page . '">';
6260
+			$out .= '<form method="post" action="'.$page.'">';
6261 6261
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6262
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6262
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6263 6263
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6264
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6264
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6265 6265
 			$out .= '</form>';
6266 6266
 		} else {
6267 6267
 			if ($selected) {
6268
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6268
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6269 6269
 				$soc = new Societe($this->db);
6270 6270
 				$soc->fetch($selected);
6271 6271
 				$out .= $soc->getNomUrl(0, '');
6272 6272
 			} else {
6273
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6273
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6274 6274
 			}
6275 6275
 		}
6276 6276
 
@@ -6320,22 +6320,22 @@  discard block
 block discarded – undo
6320 6320
 			$selected = 'EUR'; // Pour compatibilite
6321 6321
 		}
6322 6322
 
6323
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6323
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6324 6324
 		if ($useempty) {
6325 6325
 			$out .= '<option value="-1" selected></option>';
6326 6326
 		}
6327 6327
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6328 6328
 			$labeltoshow = $currency['label'];
6329 6329
 			if ($mode == 1) {
6330
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6330
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6331 6331
 			} else {
6332
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6332
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6333 6333
 			}
6334 6334
 
6335 6335
 			if ($selected && $selected == $code_iso) {
6336
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6336
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6337 6337
 			} else {
6338
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6338
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6339 6339
 			}
6340 6340
 			$out .= $labeltoshow;
6341 6341
 			$out .= '</option>';
@@ -6346,7 +6346,7 @@  discard block
 block discarded – undo
6346 6346
 		}
6347 6347
 
6348 6348
 		// Make select dynamic
6349
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6349
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6350 6350
 		$out .= ajax_combobox($htmlname);
6351 6351
 
6352 6352
 		return $out;
@@ -6372,10 +6372,10 @@  discard block
 block discarded – undo
6372 6372
 
6373 6373
 		$TCurrency = array();
6374 6374
 
6375
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6376
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6375
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6376
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6377 6377
 		if ($filter) {
6378
-			$sql .= " AND " . $filter;
6378
+			$sql .= " AND ".$filter;
6379 6379
 		}
6380 6380
 		$resql = $this->db->query($sql);
6381 6381
 		if ($resql) {
@@ -6385,7 +6385,7 @@  discard block
 block discarded – undo
6385 6385
 		}
6386 6386
 
6387 6387
 		$out = '';
6388
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6388
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6389 6389
 		if ($useempty) {
6390 6390
 			$out .= '<option value="">&nbsp;</option>';
6391 6391
 		}
@@ -6397,13 +6397,13 @@  discard block
 block discarded – undo
6397 6397
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6398 6398
 				if (isset($TCurrency[$code_iso])) {
6399 6399
 					if (!empty($selected) && $selected == $code_iso) {
6400
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6400
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6401 6401
 					} else {
6402
-						$out .= '<option value="' . $code_iso . '">';
6402
+						$out .= '<option value="'.$code_iso.'">';
6403 6403
 					}
6404 6404
 
6405 6405
 					$out .= $currency['label'];
6406
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6406
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6407 6407
 					$out .= '</option>';
6408 6408
 				}
6409 6409
 			}
@@ -6412,7 +6412,7 @@  discard block
 block discarded – undo
6412 6412
 		$out .= '</select>';
6413 6413
 
6414 6414
 		// Make select dynamic
6415
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6415
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6416 6416
 		$out .= ajax_combobox($htmlname);
6417 6417
 
6418 6418
 		return $out;
@@ -6443,7 +6443,7 @@  discard block
 block discarded – undo
6443 6443
 		$sql .= " WHERE t.fk_pays = c.rowid";
6444 6444
 		$sql .= " AND t.active > 0";
6445 6445
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6446
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6446
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6447 6447
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6448 6448
 
6449 6449
 		$resql = $this->db->query($sql);
@@ -6455,30 +6455,30 @@  discard block
 block discarded – undo
6455 6455
 
6456 6456
 					$tmparray = array();
6457 6457
 					$tmparray['rowid']			= $obj->rowid;
6458
-					$tmparray['type_vat']		= $obj->type_vat;
6459
-					$tmparray['code']			= $obj->code;
6458
+					$tmparray['type_vat'] = $obj->type_vat;
6459
+					$tmparray['code'] = $obj->code;
6460 6460
 					$tmparray['txtva']			= $obj->taux;
6461
-					$tmparray['nprtva']			= $obj->recuperableonly;
6461
+					$tmparray['nprtva'] = $obj->recuperableonly;
6462 6462
 					$tmparray['localtax1']	    = $obj->localtax1;
6463 6463
 					$tmparray['localtax1_type']	= $obj->localtax1_type;
6464 6464
 					$tmparray['localtax2']	    = $obj->localtax2;
6465 6465
 					$tmparray['localtax2_type']	= $obj->localtax1_type;
6466
-					$tmparray['label']			= $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6467
-					$tmparray['labelallrates']	= $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6466
+					$tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6467
+					$tmparray['labelallrates']	= $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6468 6468
 					$positiverates = '';
6469 6469
 					if ($obj->taux) {
6470
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6470
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6471 6471
 					}
6472 6472
 					if ($obj->localtax1) {
6473
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6473
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6474 6474
 					}
6475 6475
 					if ($obj->localtax2) {
6476
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6476
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6477 6477
 					}
6478 6478
 					if (empty($positiverates)) {
6479 6479
 						$positiverates = '0';
6480 6480
 					}
6481
-					$tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6481
+					$tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6482 6482
 
6483 6483
 					$this->cache_vatrates[$obj->rowid] = $tmparray;
6484 6484
 				}
@@ -6498,7 +6498,7 @@  discard block
 block discarded – undo
6498 6498
 				return -1;
6499 6499
 			}
6500 6500
 		} else {
6501
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6501
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6502 6502
 			return -2;
6503 6503
 		}
6504 6504
 	}
@@ -6551,9 +6551,9 @@  discard block
 block discarded – undo
6551 6551
 		// Check parameters
6552 6552
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6553 6553
 			if ($societe_vendeuse->id == $mysoc->id) {
6554
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6554
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6555 6555
 			} else {
6556
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6556
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6557 6557
 			}
6558 6558
 			return $return;
6559 6559
 		}
@@ -6565,12 +6565,12 @@  discard block
 block discarded – undo
6565 6565
 		// Define list of countries to use to search VAT rates to show
6566 6566
 		// First we defined code_country to use to find list
6567 6567
 		if (is_object($societe_vendeuse)) {
6568
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6568
+			$code_country = "'".$societe_vendeuse->country_code."'";
6569 6569
 		} else {
6570
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6570
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6571 6571
 		}
6572 6572
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6573
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6573
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6574 6574
 			// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
6575 6575
 			// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
6576 6576
 			$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
@@ -6580,27 +6580,27 @@  discard block
 block discarded – undo
6580 6580
 					if ($type == 1) { // We know product is a service
6581 6581
 						switch ($selectVatComboMode) {
6582 6582
 							case '1':
6583
-								$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6583
+								$code_country .= ",'".$societe_acheteuse->country_code."'";
6584 6584
 								break;
6585 6585
 							case '2':
6586
-								$code_country = "'" . $societe_acheteuse->country_code . "'";
6586
+								$code_country = "'".$societe_acheteuse->country_code."'";
6587 6587
 								break;
6588 6588
 						}
6589 6589
 					}
6590 6590
 				} elseif (!$idprod) {  // We don't know type of product
6591 6591
 					switch ($selectVatComboMode) {
6592 6592
 						case '1':
6593
-							$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6593
+							$code_country .= ",'".$societe_acheteuse->country_code."'";
6594 6594
 							break;
6595 6595
 						case '2':
6596
-							$code_country = "'" . $societe_acheteuse->country_code . "'";
6596
+							$code_country = "'".$societe_acheteuse->country_code."'";
6597 6597
 							break;
6598 6598
 					}
6599 6599
 				} else {
6600 6600
 					$prodstatic = new Product($this->db);
6601 6601
 					$prodstatic->fetch($idprod);
6602 6602
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6603
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6603
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6604 6604
 					}
6605 6605
 				}
6606 6606
 			}
@@ -6662,13 +6662,13 @@  discard block
 block discarded – undo
6662 6662
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6663 6663
 				// of using supplier invoices (this is a very bad idea !)
6664 6664
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
6665
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6665
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6666 6666
 					$disabled = true;
6667 6667
 				}
6668 6668
 			}
6669 6669
 
6670 6670
 			if (!$options_only) {
6671
-				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6671
+				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6672 6672
 			}
6673 6673
 
6674 6674
 			$selectedfound = false;
@@ -6682,13 +6682,13 @@  discard block
 block discarded – undo
6682 6682
 				$key = $rate['txtva'];
6683 6683
 				$key .= $rate['nprtva'] ? '*' : '';
6684 6684
 				if ($mode > 0 && $rate['code']) {
6685
-					$key .= ' (' . $rate['code'] . ')';
6685
+					$key .= ' ('.$rate['code'].')';
6686 6686
 				}
6687 6687
 				if ($mode < 0) {
6688 6688
 					$key = $rate['rowid'];
6689 6689
 				}
6690 6690
 
6691
-				$return .= '<option value="' . $key . '"';
6691
+				$return .= '<option value="'.$key.'"';
6692 6692
 				if (!$selectedfound) {
6693 6693
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6694 6694
 						if ($defaultcode == $rate['code']) {
@@ -6759,7 +6759,7 @@  discard block
 block discarded – undo
6759 6759
 	public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = 0, $addplusone = '', $adddateof = '')
6760 6760
 	{
6761 6761
 		// phpcs:enable
6762
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6762
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6763 6763
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
6764 6764
 		if (!empty($nooutput)) {
6765 6765
 			return $retstring;
@@ -6788,11 +6788,11 @@  discard block
 block discarded – undo
6788 6788
 	{
6789 6789
 		global $langs;
6790 6790
 
6791
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6791
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6792 6792
 		if ($forcenewline) {
6793 6793
 			$ret .= '<br>';
6794 6794
 		}
6795
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6795
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6796 6796
 		return $ret;
6797 6797
 	}
6798 6798
 
@@ -6858,7 +6858,7 @@  discard block
 block discarded – undo
6858 6858
 		$orig_set_time = $set_time;
6859 6859
 
6860 6860
 		if ($set_time === '' && $emptydate == 0) {
6861
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
6861
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
6862 6862
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
6863 6863
 				$set_time = dol_now($gm);
6864 6864
 			} else {
@@ -6930,38 +6930,38 @@  discard block
 block discarded – undo
6930 6930
 				// Calendrier popup version eldy
6931 6931
 				if ($usecalendar == "eldy") {
6932 6932
 					// Input area to enter date manually
6933
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
6933
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6934 6934
 					$retstring .= ($disabled ? ' disabled' : '');
6935
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6935
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6936 6936
 					$retstring .= ' autocomplete="off">';
6937 6937
 
6938 6938
 					// Icon calendar
6939 6939
 					$retstringbuttom = '';
6940 6940
 					if (!$disabled) {
6941
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
6942
-						$base = DOL_URL_ROOT . '/core/';
6943
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
6944
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
6941
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
6942
+						$base = DOL_URL_ROOT.'/core/';
6943
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
6944
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
6945 6945
 					} else {
6946
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6946
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6947 6947
 					}
6948
-					$retstring = $retstringbuttom . $retstring;
6948
+					$retstring = $retstringbuttom.$retstring;
6949 6949
 
6950
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6951
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6952
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6950
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6951
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6952
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6953 6953
 				} elseif ($usecalendar == 'jquery' || $usecalendar == 'html') {
6954 6954
 					if (!$disabled && $usecalendar != 'html') {
6955 6955
 						// Output javascript for datepicker
6956 6956
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100));
6957 6957
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100));
6958 6958
 
6959
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
6960
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
6961
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
6959
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
6960
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
6961
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
6962 6962
 							autoclose: true,
6963 6963
 							todayHighlight: true,
6964
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
6964
+							yearRange: '" . $minYear.":".$maxYear."',";
6965 6965
 						if (!empty($conf->dol_use_jmobile)) {
6966 6966
 							$retstring .= "
6967 6967
 								beforeShow: function (input, datePicker) {
@@ -6976,7 +6976,7 @@  discard block
 block discarded – undo
6976 6976
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
6977 6977
 							$retstring .= "
6978 6978
 								showOn: 'button',	/* both has problem with autocompletion */
6979
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
6979
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
6980 6980
 								buttonImageOnly: true";
6981 6981
 						}
6982 6982
 						$retstring .= "
@@ -6988,46 +6988,46 @@  discard block
 block discarded – undo
6988 6988
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
6989 6989
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6990 6990
 					$retstring .= ($disabled ? ' disabled' : '');
6991
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
6992
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6991
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
6992
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6993 6993
 					$retstring .= ' autocomplete="off">';
6994 6994
 
6995 6995
 					// Icone calendrier
6996 6996
 					if ($disabled) {
6997
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6998
-						$retstring = $retstringbutton . $retstring;
6997
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6998
+						$retstring = $retstringbutton.$retstring;
6999 6999
 					}
7000 7000
 
7001 7001
 					$retstring .= '</div>';
7002
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7003
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7004
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7002
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7003
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7004
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7005 7005
 				} else {
7006 7006
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
7007 7007
 				}
7008 7008
 			} else {
7009 7009
 				// Show date with combo selects
7010 7010
 				// Day
7011
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
7011
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
7012 7012
 
7013 7013
 				if ($emptydate || $set_time == -1) {
7014 7014
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7015 7015
 				}
7016 7016
 
7017 7017
 				for ($day = 1; $day <= 31; $day++) {
7018
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
7018
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
7019 7019
 				}
7020 7020
 
7021 7021
 				$retstring .= "</select>";
7022 7022
 
7023
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
7023
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
7024 7024
 				if ($emptydate || $set_time == -1) {
7025 7025
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7026 7026
 				}
7027 7027
 
7028 7028
 				// Month
7029 7029
 				for ($month = 1; $month <= 12; $month++) {
7030
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
7030
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
7031 7031
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
7032 7032
 					$retstring .= "</option>";
7033 7033
 				}
@@ -7035,13 +7035,13 @@  discard block
 block discarded – undo
7035 7035
 
7036 7036
 				// Year
7037 7037
 				if ($emptydate || $set_time == -1) {
7038
-					$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 . '">';
7038
+					$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.'">';
7039 7039
 				} else {
7040
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
7040
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
7041 7041
 
7042 7042
 					$syear = (int) $syear;
7043 7043
 					for ($year = $syear - 10; $year < (int) $syear + 10; $year++) {
7044
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
7044
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
7045 7045
 					}
7046 7046
 					$retstring .= "</select>\n";
7047 7047
 				}
@@ -7065,15 +7065,15 @@  discard block
 block discarded – undo
7065 7065
 				}
7066 7066
 			}
7067 7067
 			// Show hour
7068
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
7068
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
7069 7069
 			if ($emptyhours) {
7070 7070
 				$retstring .= '<option value="-1">&nbsp;</option>';
7071 7071
 			}
7072 7072
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
7073 7073
 				if (strlen($hour) < 2) {
7074
-					$hour = "0" . $hour;
7074
+					$hour = "0".$hour;
7075 7075
 				}
7076
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7076
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7077 7077
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7078 7078
 				$retstring .= '</option>';
7079 7079
 			}
@@ -7086,17 +7086,17 @@  discard block
 block discarded – undo
7086 7086
 
7087 7087
 		if ($m) {
7088 7088
 			// Show minutes
7089
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7089
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7090 7090
 			if ($emptyhours) {
7091 7091
 				$retstring .= '<option value="-1">&nbsp;</option>';
7092 7092
 			}
7093 7093
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7094 7094
 				$min_str = sprintf("%02d", $min);
7095
-				$retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>';
7095
+				$retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>';
7096 7096
 			}
7097 7097
 			$retstring .= '</select>';
7098 7098
 
7099
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7099
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7100 7100
 		}
7101 7101
 
7102 7102
 		if ($d && $h) {
@@ -7119,10 +7119,10 @@  discard block
 block discarded – undo
7119 7119
 
7120 7120
 			// Generate the date part, depending on the use or not of the javascript calendar
7121 7121
 			if ($addnowlink == 1) { // server time expressed in user time setup
7122
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7123
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7124
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7125
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7122
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7123
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7124
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7125
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7126 7126
 			} elseif ($addnowlink == 2) {
7127 7127
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7128 7128
 				 * This break application for foreign languages.
@@ -7131,10 +7131,10 @@  discard block
 block discarded – undo
7131 7131
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7132 7132
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7133 7133
 				*/
7134
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7135
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7136
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7137
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7134
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7135
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7136
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7137
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7138 7138
 			}
7139 7139
 			/*if ($usecalendar == "eldy")
7140 7140
 			{
@@ -7154,11 +7154,11 @@  discard block
 block discarded – undo
7154 7154
 				}
7155 7155
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7156 7156
 				if ($addnowlink == 1) {
7157
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7158
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7157
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7158
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7159 7159
 				} elseif ($addnowlink == 2) {
7160
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7161
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7160
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7161
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7162 7162
 				}
7163 7163
 
7164 7164
 				if ($fullday) {
@@ -7172,11 +7172,11 @@  discard block
 block discarded – undo
7172 7172
 				}
7173 7173
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7174 7174
 				if ($addnowlink == 1) {
7175
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7176
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7175
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7176
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7177 7177
 				} elseif ($addnowlink == 2) {
7178
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7179
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7178
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7179
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7180 7180
 				}
7181 7181
 				if ($fullday) {
7182 7182
 					$reset_scripts .= ' } ';
@@ -7184,7 +7184,7 @@  discard block
 block discarded – undo
7184 7184
 			}
7185 7185
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7186 7186
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7187
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7187
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7188 7188
 				$retstring .= $langs->trans("Now");
7189 7189
 				$retstring .= '</button> ';
7190 7190
 			}
@@ -7196,16 +7196,16 @@  discard block
 block discarded – undo
7196 7196
 			$reset_scripts = "";
7197 7197
 
7198 7198
 			// Generate the date part, depending on the use or not of the javascript calendar
7199
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7200
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7201
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7202
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7199
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7200
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7201
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7202
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7203 7203
 			// Update the hour part
7204 7204
 			if ($h) {
7205 7205
 				if ($fullday) {
7206 7206
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7207 7207
 				}
7208
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7208
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7209 7209
 				if ($fullday) {
7210 7210
 					$reset_scripts .= ' } ';
7211 7211
 				}
@@ -7215,14 +7215,14 @@  discard block
 block discarded – undo
7215 7215
 				if ($fullday) {
7216 7216
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7217 7217
 				}
7218
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7218
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7219 7219
 				if ($fullday) {
7220 7220
 					$reset_scripts .= ' } ';
7221 7221
 				}
7222 7222
 			}
7223 7223
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7224 7224
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7225
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7225
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7226 7226
 				$retstring .= $langs->trans("DateStartPlusOne");
7227 7227
 				$retstring .= '</button> ';
7228 7228
 			}
@@ -7280,17 +7280,17 @@  discard block
 block discarded – undo
7280 7280
 			unset($TDurationTypes[$value]);
7281 7281
 		}
7282 7282
 
7283
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7283
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7284 7284
 		foreach ($TDurationTypes as $key => $typeduration) {
7285
-			$retstring .= '<option value="' . $key . '"';
7285
+			$retstring .= '<option value="'.$key.'"';
7286 7286
 			if ($key == $selected) {
7287 7287
 				$retstring .= " selected";
7288 7288
 			}
7289
-			$retstring .= ">" . $typeduration . "</option>";
7289
+			$retstring .= ">".$typeduration."</option>";
7290 7290
 		}
7291 7291
 		$retstring .= "</select>";
7292 7292
 
7293
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7293
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7294 7294
 
7295 7295
 		return $retstring;
7296 7296
 	}
@@ -7322,30 +7322,30 @@  discard block
 block discarded – undo
7322 7322
 
7323 7323
 		// Hours
7324 7324
 		if ($iSecond != '') {
7325
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7325
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7326 7326
 
7327 7327
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7328 7328
 			$minSelected = convertSecondToTime($iSecond, 'min');
7329 7329
 		}
7330 7330
 
7331 7331
 		if ($typehour == 'select') {
7332
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7332
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7333 7333
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7334
-				$retstring .= '<option value="' . $hour . '"';
7334
+				$retstring .= '<option value="'.$hour.'"';
7335 7335
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7336 7336
 					$retstring .= " selected";
7337 7337
 				}
7338
-				$retstring .= ">" . $hour . "</option>";
7338
+				$retstring .= ">".$hour."</option>";
7339 7339
 			}
7340 7340
 			$retstring .= "</select>";
7341 7341
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7342
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7342
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7343 7343
 		} else {
7344 7344
 			return 'BadValueForParameterTypeHour';
7345 7345
 		}
7346 7346
 
7347 7347
 		if ($typehour != 'text') {
7348
-			$retstring .= ' ' . $langs->trans('HourShort');
7348
+			$retstring .= ' '.$langs->trans('HourShort');
7349 7349
 		} else {
7350 7350
 			$retstring .= '<span class="">:</span>';
7351 7351
 		}
@@ -7360,21 +7360,21 @@  discard block
 block discarded – undo
7360 7360
 		}
7361 7361
 
7362 7362
 		if ($typehour == 'select' || $typehour == 'textselect') {
7363
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7363
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7364 7364
 			for ($min = 0; $min <= 55; $min += 5) {
7365
-				$retstring .= '<option value="' . $min . '"';
7365
+				$retstring .= '<option value="'.$min.'"';
7366 7366
 				if (is_numeric($minSelected) && $minSelected == $min) {
7367 7367
 					$retstring .= ' selected';
7368 7368
 				}
7369
-				$retstring .= '>' . $min . '</option>';
7369
+				$retstring .= '>'.$min.'</option>';
7370 7370
 			}
7371 7371
 			$retstring .= "</select>";
7372 7372
 		} elseif ($typehour == 'text') {
7373
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7373
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7374 7374
 		}
7375 7375
 
7376 7376
 		if ($typehour != 'text') {
7377
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7377
+			$retstring .= ' '.$langs->trans('MinuteShort');
7378 7378
 		}
7379 7379
 
7380 7380
 		$retstring .= "</span>";
@@ -7422,7 +7422,7 @@  discard block
 block discarded – undo
7422 7422
 			$placeholder = '';
7423 7423
 
7424 7424
 			if ($selected && empty($selected_input_value)) {
7425
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7425
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7426 7426
 				$tickettmpselect = new Ticket($this->db);
7427 7427
 				$tickettmpselect->fetch($selected);
7428 7428
 				$selected_input_value = $tickettmpselect->ref;
@@ -7430,17 +7430,17 @@  discard block
 block discarded – undo
7430 7430
 			}
7431 7431
 
7432 7432
 			$urloption = '';
7433
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7433
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7434 7434
 
7435 7435
 			if (empty($hidelabel)) {
7436
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7436
+				$out .= $langs->trans("RefOrLabel").' : ';
7437 7437
 			} elseif ($hidelabel > 1) {
7438
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7438
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7439 7439
 				if ($hidelabel == 2) {
7440 7440
 					$out .= img_picto($langs->trans("Search"), 'search');
7441 7441
 				}
7442 7442
 			}
7443
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7443
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7444 7444
 			if ($hidelabel == 3) {
7445 7445
 				$out .= img_picto($langs->trans("Search"), 'search');
7446 7446
 			}
@@ -7484,8 +7484,8 @@  discard block
 block discarded – undo
7484 7484
 
7485 7485
 		$sql = "SELECT ";
7486 7486
 		$sql .= $selectFields;
7487
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7488
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7487
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7488
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7489 7489
 
7490 7490
 		// Add criteria on ref/label
7491 7491
 		if ($filterkey != '') {
@@ -7501,7 +7501,7 @@  discard block
 block discarded – undo
7501 7501
 				if ($i > 0) {
7502 7502
 					$sql .= " AND ";
7503 7503
 				}
7504
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7504
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7505 7505
 				$sql .= ")";
7506 7506
 				$i++;
7507 7507
 			}
@@ -7514,22 +7514,22 @@  discard block
 block discarded – undo
7514 7514
 		$sql .= $this->db->plimit($limit, 0);
7515 7515
 
7516 7516
 		// Build output string
7517
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7517
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7518 7518
 		$result = $this->db->query($sql);
7519 7519
 		if ($result) {
7520
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7521
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7520
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7521
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7522 7522
 
7523 7523
 			$num = $this->db->num_rows($result);
7524 7524
 
7525 7525
 			$events = array();
7526 7526
 
7527 7527
 			if (!$forcecombo) {
7528
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7528
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7529 7529
 				$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT);
7530 7530
 			}
7531 7531
 
7532
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7532
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7533 7533
 
7534 7534
 			$textifempty = '';
7535 7535
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7546,7 +7546,7 @@  discard block
 block discarded – undo
7546 7546
 				}
7547 7547
 			}
7548 7548
 			if ($showempty) {
7549
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7549
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7550 7550
 			}
7551 7551
 
7552 7552
 			$i = 0;
@@ -7601,13 +7601,13 @@  discard block
 block discarded – undo
7601 7601
 		$outref = $objp->ref;
7602 7602
 		$outtype = $objp->fk_product_type;
7603 7603
 
7604
-		$opt = '<option value="' . $objp->rowid . '"';
7604
+		$opt = '<option value="'.$objp->rowid.'"';
7605 7605
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7606 7606
 		$opt .= '>';
7607 7607
 		$opt .= $objp->ref;
7608 7608
 		$objRef = $objp->ref;
7609 7609
 		if (!empty($filterkey) && $filterkey != '') {
7610
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7610
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7611 7611
 		}
7612 7612
 
7613 7613
 		$opt .= "</option>\n";
@@ -7648,7 +7648,7 @@  discard block
 block discarded – undo
7648 7648
 			$placeholder = '';
7649 7649
 
7650 7650
 			if ($selected && empty($selected_input_value)) {
7651
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7651
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7652 7652
 				$projecttmpselect = new Project($this->db);
7653 7653
 				$projecttmpselect->fetch($selected);
7654 7654
 				$selected_input_value = $projecttmpselect->ref;
@@ -7656,17 +7656,17 @@  discard block
 block discarded – undo
7656 7656
 			}
7657 7657
 
7658 7658
 			$urloption = '';
7659
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7659
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7660 7660
 
7661 7661
 			if (empty($hidelabel)) {
7662
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7662
+				$out .= $langs->trans("RefOrLabel").' : ';
7663 7663
 			} elseif ($hidelabel > 1) {
7664
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7664
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7665 7665
 				if ($hidelabel == 2) {
7666 7666
 					$out .= img_picto($langs->trans("Search"), 'search');
7667 7667
 				}
7668 7668
 			}
7669
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7669
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7670 7670
 			if ($hidelabel == 3) {
7671 7671
 				$out .= img_picto($langs->trans("Search"), 'search');
7672 7672
 			}
@@ -7709,8 +7709,8 @@  discard block
 block discarded – undo
7709 7709
 
7710 7710
 		$sql = "SELECT ";
7711 7711
 		$sql .= $selectFields;
7712
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7713
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7712
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7713
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7714 7714
 
7715 7715
 		// Add criteria on ref/label
7716 7716
 		if ($filterkey != '') {
@@ -7726,7 +7726,7 @@  discard block
 block discarded – undo
7726 7726
 				if ($i > 0) {
7727 7727
 					$sql .= " AND ";
7728 7728
 				}
7729
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7729
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7730 7730
 				$sql .= "";
7731 7731
 				$i++;
7732 7732
 			}
@@ -7739,22 +7739,22 @@  discard block
 block discarded – undo
7739 7739
 		$sql .= $this->db->plimit($limit, 0);
7740 7740
 
7741 7741
 		// Build output string
7742
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7742
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7743 7743
 		$result = $this->db->query($sql);
7744 7744
 		if ($result) {
7745
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7746
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7745
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7746
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7747 7747
 
7748 7748
 			$num = $this->db->num_rows($result);
7749 7749
 
7750 7750
 			$events = array();
7751 7751
 
7752 7752
 			if (!$forcecombo) {
7753
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7753
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7754 7754
 				$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
7755 7755
 			}
7756 7756
 
7757
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7757
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7758 7758
 
7759 7759
 			$textifempty = '';
7760 7760
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7771,7 +7771,7 @@  discard block
 block discarded – undo
7771 7771
 				}
7772 7772
 			}
7773 7773
 			if ($showempty) {
7774
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7774
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7775 7775
 			}
7776 7776
 
7777 7777
 			$i = 0;
@@ -7829,13 +7829,13 @@  discard block
 block discarded – undo
7829 7829
 		$outlabel = $objp->label;
7830 7830
 		$outtype = $objp->fk_product_type;
7831 7831
 
7832
-		$opt = '<option value="' . $objp->rowid . '"';
7832
+		$opt = '<option value="'.$objp->rowid.'"';
7833 7833
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7834 7834
 		$opt .= '>';
7835 7835
 		$opt .= $objp->ref;
7836 7836
 		$objRef = $objp->ref;
7837 7837
 		if (!empty($filterkey) && $filterkey != '') {
7838
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7838
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7839 7839
 		}
7840 7840
 
7841 7841
 		$opt .= "</option>\n";
@@ -7877,7 +7877,7 @@  discard block
 block discarded – undo
7877 7877
 			$placeholder = '';
7878 7878
 
7879 7879
 			if ($selected && empty($selected_input_value)) {
7880
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7880
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7881 7881
 				$adherenttmpselect = new Adherent($this->db);
7882 7882
 				$adherenttmpselect->fetch($selected);
7883 7883
 				$selected_input_value = $adherenttmpselect->ref;
@@ -7886,17 +7886,17 @@  discard block
 block discarded – undo
7886 7886
 
7887 7887
 			$urloption = '';
7888 7888
 
7889
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7889
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7890 7890
 
7891 7891
 			if (empty($hidelabel)) {
7892
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7892
+				$out .= $langs->trans("RefOrLabel").' : ';
7893 7893
 			} elseif ($hidelabel > 1) {
7894
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7894
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7895 7895
 				if ($hidelabel == 2) {
7896 7896
 					$out .= img_picto($langs->trans("Search"), 'search');
7897 7897
 				}
7898 7898
 			}
7899
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7899
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7900 7900
 			if ($hidelabel == 3) {
7901 7901
 				$out .= img_picto($langs->trans("Search"), 'search');
7902 7902
 			}
@@ -7941,8 +7941,8 @@  discard block
 block discarded – undo
7941 7941
 
7942 7942
 		$sql = "SELECT ";
7943 7943
 		$sql .= $selectFields;
7944
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
7945
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
7944
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
7945
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
7946 7946
 
7947 7947
 		// Add criteria on ref/label
7948 7948
 		if ($filterkey != '') {
@@ -7958,8 +7958,8 @@  discard block
 block discarded – undo
7958 7958
 				if ($i > 0) {
7959 7959
 					$sql .= " AND ";
7960 7960
 				}
7961
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7962
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
7961
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
7962
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
7963 7963
 				$i++;
7964 7964
 			}
7965 7965
 			if (count($search_crit) > 1) {
@@ -7968,27 +7968,27 @@  discard block
 block discarded – undo
7968 7968
 			$sql .= ')';
7969 7969
 		}
7970 7970
 		if ($status != -1) {
7971
-			$sql .= ' AND statut = ' . ((int) $status);
7971
+			$sql .= ' AND statut = '.((int) $status);
7972 7972
 		}
7973 7973
 		$sql .= $this->db->plimit($limit, 0);
7974 7974
 
7975 7975
 		// Build output string
7976
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
7976
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
7977 7977
 		$result = $this->db->query($sql);
7978 7978
 		if ($result) {
7979
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7980
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
7979
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7980
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
7981 7981
 
7982 7982
 			$num = $this->db->num_rows($result);
7983 7983
 
7984 7984
 			$events = array();
7985 7985
 
7986 7986
 			if (!$forcecombo) {
7987
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7987
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7988 7988
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
7989 7989
 			}
7990 7990
 
7991
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7991
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7992 7992
 
7993 7993
 			$textifempty = '';
7994 7994
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -8005,7 +8005,7 @@  discard block
 block discarded – undo
8005 8005
 				}
8006 8006
 			}
8007 8007
 			if ($showempty) {
8008
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
8008
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
8009 8009
 			}
8010 8010
 
8011 8011
 			$i = 0;
@@ -8061,11 +8061,11 @@  discard block
 block discarded – undo
8061 8061
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
8062 8062
 		$outtype = $objp->fk_adherent_type;
8063 8063
 
8064
-		$opt = '<option value="' . $objp->rowid . '"';
8064
+		$opt = '<option value="'.$objp->rowid.'"';
8065 8065
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8066 8066
 		$opt .= '>';
8067 8067
 		if (!empty($filterkey) && $filterkey != '') {
8068
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
8068
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
8069 8069
 		}
8070 8070
 		$opt .= $outlabel;
8071 8071
 		$opt .= "</option>\n";
@@ -8101,8 +8101,8 @@  discard block
 block discarded – undo
8101 8101
 		$objecttmp = null;
8102 8102
 		$InfoFieldList = array();
8103 8103
 		$classname = '';
8104
-		$filter = '';  // Ensure filter has value (for static analysis)
8105
-		$sortfield = '';  // Ensure filter has value (for static analysis)
8104
+		$filter = ''; // Ensure filter has value (for static analysis)
8105
+		$sortfield = ''; // Ensure filter has value (for static analysis)
8106 8106
 
8107 8107
 		if ($objectfield) {	// We must retrieve the objectdesc from the field or extrafield
8108 8108
 			// Example: $objectfield = 'product:options_package'
@@ -8143,9 +8143,9 @@  discard block
 block discarded – undo
8143 8143
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8144 8144
 			$reg = array();
8145 8145
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8146
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8146
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8147 8147
 			}
8148
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8148
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8149 8149
 
8150 8150
 			$classname = $InfoFieldList[0];
8151 8151
 			$classpath = $InfoFieldList[1];
@@ -8176,8 +8176,8 @@  discard block
 block discarded – undo
8176 8176
 		);
8177 8177
 
8178 8178
 		if (!is_object($objecttmp)) {
8179
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8180
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8179
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8180
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8181 8181
 		}
8182 8182
 		'@phan-var-force CommonObject $objecttmp';
8183 8183
 
@@ -8189,9 +8189,9 @@  discard block
 block discarded – undo
8189 8189
 		if ($prefixforautocompletemode == 'product') {
8190 8190
 			$prefixforautocompletemode = 'produit';
8191 8191
 		}
8192
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8192
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8193 8193
 
8194
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8194
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8195 8195
 
8196 8196
 		// Generate the combo HTML component
8197 8197
 		$out = '';
@@ -8220,13 +8220,13 @@  discard block
 block discarded – undo
8220 8220
 			}
8221 8221
 
8222 8222
 			// Set url and param to call to get json of the search results
8223
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8224
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8223
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8224
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8225 8225
 
8226 8226
 			// Activate the auto complete using ajax call.
8227 8227
 			$out .= ajax_autocompleter($preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0);
8228 8228
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8229
-			$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) . '"' : '') . ' />';
8229
+			$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).'"' : '').' />';
8230 8230
 		} else {
8231 8231
 			// Immediate load of table record.
8232 8232
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8266,16 +8266,16 @@  discard block
 block discarded – undo
8266 8266
 		if ($prefixforautocompletemode == 'societe') {
8267 8267
 			$prefixforautocompletemode = 'company';
8268 8268
 		}
8269
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8269
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8270 8270
 
8271 8271
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8272 8272
 			$tmpfieldstoshow = '';
8273 8273
 			foreach ($objecttmp->fields as $key => $val) {
8274
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
8274
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
8275 8275
 					continue;
8276 8276
 				}
8277 8277
 				if (!empty($val['showoncombobox'])) {
8278
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8278
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8279 8279
 				}
8280 8280
 			}
8281 8281
 			if ($tmpfieldstoshow) {
@@ -8303,18 +8303,18 @@  discard block
 block discarded – undo
8303 8303
 		$num = 0;
8304 8304
 
8305 8305
 		// Search data
8306
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8306
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8307 8307
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8308
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object";
8308
+			$sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object";
8309 8309
 		}
8310 8310
 		if (isset($objecttmp->ismultientitymanaged)) {
8311 8311
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8312 8312
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8313
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8313
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8314 8314
 			}
8315 8315
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8316 8316
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8317
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8317
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8318 8318
 				}
8319 8319
 			}
8320 8320
 		}
@@ -8334,21 +8334,21 @@  discard block
 block discarded – undo
8334 8334
 			$sql .= " WHERE 1=1";
8335 8335
 			if (isset($objecttmp->ismultientitymanaged)) {
8336 8336
 				if ($objecttmp->ismultientitymanaged == 1) {
8337
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8337
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8338 8338
 				}
8339 8339
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8340
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8340
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8341 8341
 				}
8342 8342
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8343 8343
 					if ($objecttmp->element == 'societe') {
8344
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8344
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8345 8345
 					} else {
8346
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8346
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8347 8347
 					}
8348 8348
 				}
8349 8349
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8350 8350
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8351
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8351
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8352 8352
 					}
8353 8353
 				}
8354 8354
 			}
@@ -8360,7 +8360,7 @@  discard block
 block discarded – undo
8360 8360
 				$errormessage = '';
8361 8361
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8362 8362
 				if ($errormessage) {
8363
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8363
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8364 8364
 				}
8365 8365
 			}
8366 8366
 		}
@@ -8372,7 +8372,7 @@  discard block
 block discarded – undo
8372 8372
 		$resql = $this->db->query($sql);
8373 8373
 		if ($resql) {
8374 8374
 			// Construct $out and $outarray
8375
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8375
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8376 8376
 
8377 8377
 			// 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
8378 8378
 			$textifempty = '&nbsp;';
@@ -8386,7 +8386,7 @@  discard block
 block discarded – undo
8386 8386
 				}
8387 8387
 			}
8388 8388
 			if ($showempty) {
8389
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8389
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8390 8390
 			}
8391 8391
 
8392 8392
 			$num = $this->db->num_rows($resql);
@@ -8409,9 +8409,9 @@  discard block
 block discarded – undo
8409 8409
 					}
8410 8410
 					if (empty($outputmode)) {
8411 8411
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8412
-							$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>';
8412
+							$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>';
8413 8413
 						} else {
8414
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8414
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8415 8415
 						}
8416 8416
 					} else {
8417 8417
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8424,10 +8424,10 @@  discard block
 block discarded – undo
8424 8424
 				}
8425 8425
 			}
8426 8426
 
8427
-			$out .= '</select>' . "\n";
8427
+			$out .= '</select>'."\n";
8428 8428
 
8429 8429
 			if (!$forcecombo) {
8430
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8430
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8431 8431
 				$out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0));
8432 8432
 			}
8433 8433
 		} else {
@@ -8491,8 +8491,8 @@  discard block
 block discarded – undo
8491 8491
 			}
8492 8492
 		}
8493 8493
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8494
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8495
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8494
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8495
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8496 8496
 		$out .= '>'."\n";
8497 8497
 
8498 8498
 		if ($show_empty) {
@@ -8503,7 +8503,7 @@  discard block
 block discarded – undo
8503 8503
 			if (!is_numeric($show_empty)) {
8504 8504
 				$textforempty = $show_empty;
8505 8505
 			}
8506
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8506
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8507 8507
 		}
8508 8508
 		if (is_array($array)) {
8509 8509
 			// Translate
@@ -8528,7 +8528,7 @@  discard block
 block discarded – undo
8528 8528
 					$value = $tmpvalue['label'];
8529 8529
 					//$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html'];
8530 8530
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8531
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8531
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8532 8532
 				} else {
8533 8533
 					$value = $tmpvalue;
8534 8534
 					//$valuehtml = $tmpvalue;
@@ -8544,9 +8544,9 @@  discard block
 block discarded – undo
8544 8544
 				}
8545 8545
 				if ($key_in_label) {
8546 8546
 					if (empty($nohtmlescape)) {
8547
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8547
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8548 8548
 					} else {
8549
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8549
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8550 8550
 					}
8551 8551
 				} else {
8552 8552
 					if (empty($nohtmlescape)) {
@@ -8558,8 +8558,8 @@  discard block
 block discarded – undo
8558 8558
 						$selectOptionValue = '&nbsp;';
8559 8559
 					}
8560 8560
 				}
8561
-				$out .= '<option value="' . $key . '"';
8562
-				$out .= $style . $disabled;
8561
+				$out .= '<option value="'.$key.'"';
8562
+				$out .= $style.$disabled;
8563 8563
 				if (is_array($id)) {
8564 8564
 					if (in_array($key, $id) && !$disabled) {
8565 8565
 						$out .= ' selected'; // To preselect a value
@@ -8571,7 +8571,7 @@  discard block
 block discarded – undo
8571 8571
 					}
8572 8572
 				}
8573 8573
 				if (!empty($nohtmlescape)) {	// deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content.
8574
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8574
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8575 8575
 				}
8576 8576
 
8577 8577
 				if (is_array($tmpvalue)) {
@@ -8590,7 +8590,7 @@  discard block
 block discarded – undo
8590 8590
 		// Add code for jquery to use multiselect
8591 8591
 		if ($addjscombo && $jsbeautify) {
8592 8592
 			// Enhance with select2
8593
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8593
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8594 8594
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
8595 8595
 		}
8596 8596
 
@@ -8618,28 +8618,28 @@  discard block
 block discarded – undo
8618 8618
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8619 8619
 	{
8620 8620
 		global $conf, $langs;
8621
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8621
+		global $delayedhtmlcontent; // Will be used later outside of this function
8622 8622
 
8623 8623
 		// TODO Use an internal dolibarr component instead of select2
8624 8624
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8625 8625
 			return '';
8626 8626
 		}
8627 8627
 
8628
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8628
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8629 8629
 
8630 8630
 		$outdelayed = '';
8631 8631
 		if (!empty($conf->use_javascript_ajax)) {
8632 8632
 			$tmpplugin = 'select2';
8633
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8634
-		    	<script nonce="' . getNonce() . '">
8633
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8634
+		    	<script nonce="' . getNonce().'">
8635 8635
 		    	$(document).ready(function () {
8636 8636
 
8637
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8637
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8638 8638
 
8639
-	                $(".' . $htmlname . '").select2({
8639
+	                $(".' . $htmlname.'").select2({
8640 8640
 				    	ajax: {
8641 8641
 					    	dir: "ltr",
8642
-					    	url: "' . $url . '",
8642
+					    	url: "' . $url.'",
8643 8643
 					    	dataType: \'json\',
8644 8644
 					    	delay: 250,
8645 8645
 					    	data: function (params) {
@@ -8666,9 +8666,9 @@  discard block
 block discarded – undo
8666 8666
 				    	},
8667 8667
 		 				language: select2arrayoflanguage,
8668 8668
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8669
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8669
+					    placeholder: "' . dol_escape_js($placeholder).'",
8670 8670
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8671
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8671
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8672 8672
 				        formatResult: function (result, container, query, escapeMarkup) {
8673 8673
 	                        return escapeMarkup(result.text);
8674 8674
 	                    },
@@ -8676,10 +8676,10 @@  discard block
 block discarded – undo
8676 8676
 
8677 8677
 	                ' . ($callurlonselect ? '
8678 8678
 	                /* Code to execute a GET when we select a value */
8679
-	                $(".' . $htmlname . '").change(function() {
8680
-				    	var selected = $(".' . $htmlname . '").val();
8679
+	                $(".' . $htmlname.'").change(function() {
8680
+				    	var selected = $(".' . $htmlname.'").val();
8681 8681
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8682
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8682
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8683 8683
 	    			    $.each( saveRemoteData, function( key, value ) {
8684 8684
 	    				        if (key == selected)
8685 8685
 	    			            {
@@ -8687,7 +8687,7 @@  discard block
 block discarded – undo
8687 8687
 	    			                 location.assign(value.url);
8688 8688
 	    			            }
8689 8689
 	                    });
8690
-	    			});' : '') . '
8690
+	    			});' : '').'
8691 8691
 
8692 8692
 	    	   });
8693 8693
 		       </script>';
@@ -8723,14 +8723,14 @@  discard block
 block discarded – undo
8723 8723
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8724 8724
 	{
8725 8725
 		global $conf, $langs;
8726
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8726
+		global $delayedhtmlcontent; // Will be used later outside of this function
8727 8727
 
8728 8728
 		// TODO Use an internal dolibarr component instead of select2
8729 8729
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8730 8730
 			return '';
8731 8731
 		}
8732 8732
 
8733
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8733
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8734 8734
 
8735 8735
 		$formattedarrayresult = array();
8736 8736
 
@@ -8745,20 +8745,20 @@  discard block
 block discarded – undo
8745 8745
 		$outdelayed = '';
8746 8746
 		if (!empty($conf->use_javascript_ajax)) {
8747 8747
 			$tmpplugin = 'select2';
8748
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8749
-				<script nonce="' . getNonce() . '">
8748
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8749
+				<script nonce="' . getNonce().'">
8750 8750
 				$(document).ready(function () {
8751
-					var data = ' . json_encode($formattedarrayresult) . ';
8751
+					var data = ' . json_encode($formattedarrayresult).';
8752 8752
 
8753
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8753
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8754 8754
 
8755
-					$(".' . $htmlname . '").select2({
8755
+					$(".' . $htmlname.'").select2({
8756 8756
 						data: data,
8757 8757
 						language: select2arrayoflanguage,
8758 8758
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8759
-						placeholder: "' . dol_escape_js($placeholder) . '",
8759
+						placeholder: "' . dol_escape_js($placeholder).'",
8760 8760
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8761
-						minimumInputLength: ' . $minimumInputLength . ',
8761
+						minimumInputLength: ' . $minimumInputLength.',
8762 8762
 						formatResult: function (result, container, query, escapeMarkup) {
8763 8763
 							return escapeMarkup(result.text);
8764 8764
 						},
@@ -8797,11 +8797,11 @@  discard block
 block discarded – undo
8797 8797
 
8798 8798
 					' . ($callurlonselect ? '
8799 8799
 					/* Code to execute a GET when we select a value */
8800
-					$(".' . $htmlname . '").change(function() {
8801
-						var selected = $(".' . $htmlname . '").val();
8800
+					$(".' . $htmlname.'").change(function() {
8801
+						var selected = $(".' . $htmlname.'").val();
8802 8802
 						console.log("We select "+selected)
8803 8803
 
8804
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
8804
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
8805 8805
 						$.each( saveRemoteData, function( key, value ) {
8806 8806
 							if (key == selected)
8807 8807
 							{
@@ -8809,7 +8809,7 @@  discard block
 block discarded – undo
8809 8809
 								location.assign(value.url);
8810 8810
 							}
8811 8811
 						});
8812
-					});' : '') . '
8812
+					});' : '').'
8813 8813
 
8814 8814
 				});
8815 8815
 				</script>';
@@ -8858,7 +8858,7 @@  discard block
 block discarded – undo
8858 8858
 		$useenhancedmultiselect = 0;
8859 8859
 		if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
8860 8860
 			if ($addjscombo) {
8861
-				$useenhancedmultiselect = 1;	// Use the js multiselect in one line. Possible only if $addjscombo not 0.
8861
+				$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
8862 8862
 			}
8863 8863
 		}
8864 8864
 
@@ -8867,7 +8867,7 @@  discard block
 block discarded – undo
8867 8867
 		// submitted to nothing.
8868 8868
 		$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
8869 8869
 		// Output select component
8870
-		$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', (string) $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
8870
+		$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', (string) $width) ? $width : $width.'px').'"' : '').'>'."\n";
8871 8871
 		if (is_array($array) && !empty($array)) {
8872 8872
 			if ($value_as_key) {
8873 8873
 				$array = array_combine($array, $array);
@@ -8888,33 +8888,33 @@  discard block
 block discarded – undo
8888 8888
 						$tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml'];
8889 8889
 					}
8890 8890
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
8891
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
8891
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
8892 8892
 
8893
-					$out .= '<option value="' . $tmpkey . '"';
8893
+					$out .= '<option value="'.$tmpkey.'"';
8894 8894
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
8895 8895
 						$out .= ' selected';
8896 8896
 					}
8897 8897
 					if (!empty($tmplabelhtml)) {
8898
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8898
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8899 8899
 					} else {
8900
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
8901
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8900
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
8901
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8902 8902
 					}
8903 8903
 					$out .= '>';
8904 8904
 					$out .= dol_htmlentitiesbr($newval);
8905
-					$out .= '</option>' . "\n";
8905
+					$out .= '</option>'."\n";
8906 8906
 				}
8907 8907
 			}
8908 8908
 		}
8909
-		$out .= '</select>' . "\n";
8909
+		$out .= '</select>'."\n";
8910 8910
 
8911 8911
 		// Add code for jquery to use multiselect
8912 8912
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
8913
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
8914
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
8913
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
8914
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
8915 8915
 			if ($addjscombo == 1) {
8916 8916
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
8917
-				$out .= 'function formatResult(record, container) {' . "\n";
8917
+				$out .= 'function formatResult(record, container) {'."\n";
8918 8918
 				// If property data-html set, we decode html entities and use this.
8919 8919
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
8920 8920
 				$out .= '	if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {';
@@ -8922,26 +8922,26 @@  discard block
 block discarded – undo
8922 8922
 				$out .= '		return htmlEntityDecodeJs($(record.element).attr("data-html"));';
8923 8923
 				$out .= '	}'."\n";
8924 8924
 				$out .= '	return record.text;';
8925
-				$out .= '}' . "\n";
8926
-				$out .= 'function formatSelection(record) {' . "\n";
8925
+				$out .= '}'."\n";
8926
+				$out .= 'function formatSelection(record) {'."\n";
8927 8927
 				if ($elemtype == 'category') {
8928
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8928
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8929 8929
 				} else {
8930 8930
 					$out .= 'return record.text;';
8931 8931
 				}
8932
-				$out .= '}' . "\n";
8932
+				$out .= '}'."\n";
8933 8933
 				$out .= '$(document).ready(function () {
8934
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
8934
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
8935 8935
 				if ($placeholder) {
8936 8936
 					$out .= '
8937 8937
 								placeholder: {
8938 8938
 								    id: \'-1\',
8939
-								    text: \'' . dol_escape_js($placeholder) . '\'
8939
+								    text: \'' . dol_escape_js($placeholder).'\'
8940 8940
 								  },';
8941 8941
 				}
8942 8942
 				$out .= '		dir: \'ltr\',
8943 8943
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
8944
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
8944
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
8945 8945
 								// Specify format function for dropdown item
8946 8946
 								formatResult: formatResult,
8947 8947
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -8953,21 +8953,21 @@  discard block
 block discarded – undo
8953 8953
 
8954 8954
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
8955 8955
 								 the size only if component is not hidden by default on load */
8956
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
8956
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
8957 8957
 						});' . "\n";
8958 8958
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
8959 8959
 				// Add other js lib
8960 8960
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
8961 8961
 				// ...
8962
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
8962
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
8963 8963
 				$out .= '$(document).ready(function () {
8964
-							$(\'#' . $htmlname . '\').multiSelect({
8964
+							$(\'#' . $htmlname.'\').multiSelect({
8965 8965
 								containerHTML: \'<div class="multi-select-container">\',
8966 8966
 								menuHTML: \'<div class="multi-select-menu">\',
8967
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
8967
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
8968 8968
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
8969 8969
 								activeClass: \'multi-select-container--open\',
8970
-								noneText: \'' . $placeholder . '\'
8970
+								noneText: \'' . $placeholder.'\'
8971 8971
 							});
8972 8972
 						})';
8973 8973
 			}
@@ -8999,7 +8999,7 @@  discard block
 block discarded – undo
8999 8999
 			return '';
9000 9000
 		}
9001 9001
 
9002
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
9002
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
9003 9003
 
9004 9004
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
9005 9005
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -9042,19 +9042,19 @@  discard block
 block discarded – undo
9042 9042
 				}
9043 9043
 
9044 9044
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list  @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
9045
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
9046
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
9045
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
9046
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
9047 9047
 			}
9048 9048
 		}
9049 9049
 
9050
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
9050
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
9051 9051
 
9052 9052
         <dl class="dropdown">
9053 9053
             <dt>
9054
-            <a href="#' . $htmlname . '">
9055
-              ' . img_picto('', 'list') . '
9054
+            <a href="#' . $htmlname.'">
9055
+              ' . img_picto('', 'list').'
9056 9056
             </a>
9057
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
9057
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
9058 9058
             </dt>
9059 9059
             <dd class="dropdowndd">
9060 9060
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -9066,19 +9066,19 @@  discard block
 block discarded – undo
9066 9066
             </dd>
9067 9067
         </dl>
9068 9068
 
9069
-        <script nonce="' . getNonce() . '" type="text/javascript">
9069
+        <script nonce="' . getNonce().'" type="text/javascript">
9070 9070
           jQuery(document).ready(function () {
9071
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
9071
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
9072 9072
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
9073 9073
 
9074 9074
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
9075 9075
 
9076 9076
                   var title = $(this).val() + ",";
9077 9077
                   if ($(this).is(\':checked\')) {
9078
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
9078
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
9079 9079
                   }
9080 9080
                   else {
9081
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
9081
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
9082 9082
                   }
9083 9083
                   // Now, we submit page
9084 9084
                   //$(this).parents(\'form:first\').submit();
@@ -9109,7 +9109,7 @@  discard block
 block discarded – undo
9109 9109
 	 */
9110 9110
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9111 9111
 	{
9112
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9112
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9113 9113
 
9114 9114
 		$cat = new Categorie($this->db);
9115 9115
 		$categories = $cat->containing($id, $type);
@@ -9119,10 +9119,10 @@  discard block
 block discarded – undo
9119 9119
 			foreach ($categories as $c) {
9120 9120
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
9121 9121
 				foreach ($ways as $way) {
9122
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9122
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9123 9123
 				}
9124 9124
 			}
9125
-			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9125
+			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9126 9126
 		}
9127 9127
 
9128 9128
 		if ($rendermode == 0) {
@@ -9170,15 +9170,15 @@  discard block
 block discarded – undo
9170 9170
 
9171 9171
 
9172 9172
 			print '<div class="div-table-responsive-no-min">';
9173
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9173
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9174 9174
 
9175 9175
 			print '<tr class="liste_titre">';
9176
-			print '<td>' . $langs->trans("Type") . '</td>';
9177
-			print '<td>' . $langs->trans("Ref") . '</td>';
9176
+			print '<td>'.$langs->trans("Type").'</td>';
9177
+			print '<td>'.$langs->trans("Ref").'</td>';
9178 9178
 			print '<td class="center"></td>';
9179
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9180
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9181
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9179
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9180
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9181
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9182 9182
 			print '<td></td>';
9183 9183
 			print '</tr>';
9184 9184
 
@@ -9197,13 +9197,13 @@  discard block
 block discarded – undo
9197 9197
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9198 9198
 					$element = $regs[1];
9199 9199
 					$subelement = $regs[2];
9200
-					$tplpath = $element . '/' . $subelement;
9200
+					$tplpath = $element.'/'.$subelement;
9201 9201
 				}
9202 9202
 				$tplname = 'linkedobjectblock';
9203 9203
 
9204 9204
 				// To work with non standard path
9205 9205
 				if ($objecttype == 'facture') {
9206
-					$tplpath = 'compta/' . $element;
9206
+					$tplpath = 'compta/'.$element;
9207 9207
 					if (!isModEnabled('invoice')) {
9208 9208
 						continue; // Do not show if module disabled
9209 9209
 					}
@@ -9214,7 +9214,7 @@  discard block
 block discarded – undo
9214 9214
 						continue; // Do not show if module disabled
9215 9215
 					}
9216 9216
 				} elseif ($objecttype == 'propal') {
9217
-					$tplpath = 'comm/' . $element;
9217
+					$tplpath = 'comm/'.$element;
9218 9218
 					if (!isModEnabled('propal')) {
9219 9219
 						continue; // Do not show if module disabled
9220 9220
 					}
@@ -9265,7 +9265,7 @@  discard block
 block discarded – undo
9265 9265
 				$linkedObjectBlock = $objects;
9266 9266
 
9267 9267
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9268
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9268
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9269 9269
 				foreach ($dirtpls as $reldir) {
9270 9270
 					$reldir = rtrim($reldir, '/');
9271 9271
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
@@ -9273,7 +9273,7 @@  discard block
 block discarded – undo
9273 9273
 						$noMoreLinkedObjectBlockAfter = 1;
9274 9274
 					}
9275 9275
 
9276
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9276
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9277 9277
 					if ($res) {
9278 9278
 						$nboftypesoutput++;
9279 9279
 						break;
@@ -9282,7 +9282,7 @@  discard block
 block discarded – undo
9282 9282
 			}
9283 9283
 
9284 9284
 			if (!$nboftypesoutput) {
9285
-				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9285
+				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9286 9286
 			}
9287 9287
 
9288 9288
 			print '</table>';
@@ -9322,14 +9322,14 @@  discard block
 block discarded – undo
9322 9322
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9323 9323
 			$listofidcompanytoscan = $object->thirdparty->id;
9324 9324
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9325
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9325
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9326 9326
 			}
9327 9327
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9328
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9328
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9329 9329
 				$tmpproject = new Project($this->db);
9330 9330
 				$tmpproject->fetch($object->fk_project);
9331 9331
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9332
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9332
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9333 9333
 				}
9334 9334
 				unset($tmpproject);
9335 9335
 			}
@@ -9339,63 +9339,63 @@  discard block
 block discarded – undo
9339 9339
 					'enabled' => isModEnabled('propal'),
9340 9340
 					'perms' => 1,
9341 9341
 					'label' => 'LinkToProposal',
9342
-					'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') . ')'),
9342
+					'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').')'),
9343 9343
 				'shipping' => array(
9344 9344
 					'enabled' => isModEnabled('shipping'),
9345 9345
 					'perms' => 1,
9346 9346
 					'label' => 'LinkToExpedition',
9347
-					'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') . ')'),
9347
+					'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').')'),
9348 9348
 				'order' => array(
9349 9349
 					'enabled' => isModEnabled('order'),
9350 9350
 					'perms' => 1,
9351 9351
 					'label' => 'LinkToOrder',
9352
-					'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') . ')'),
9352
+					'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').')'),
9353 9353
 				'invoice' => array(
9354 9354
 					'enabled' => isModEnabled('invoice'),
9355 9355
 					'perms' => 1,
9356 9356
 					'label' => 'LinkToInvoice',
9357
-					'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') . ')'),
9357
+					'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').')'),
9358 9358
 				'invoice_template' => array(
9359 9359
 					'enabled' => isModEnabled('invoice'),
9360 9360
 					'perms' => 1,
9361 9361
 					'label' => 'LinkToTemplateInvoice',
9362
-					'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') . ')'),
9362
+					'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').')'),
9363 9363
 				'contrat' => array(
9364 9364
 					'enabled' => isModEnabled('contract'),
9365 9365
 					'perms' => 1,
9366 9366
 					'label' => 'LinkToContract',
9367 9367
 					'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
9368
-							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'
9368
+							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'
9369 9369
 				),
9370 9370
 				'fichinter' => array(
9371 9371
 					'enabled' => isModEnabled('intervention'),
9372 9372
 					'perms' => 1,
9373 9373
 					'label' => 'LinkToIntervention',
9374
-					'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') . ')'),
9374
+					'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').')'),
9375 9375
 				'supplier_proposal' => array(
9376 9376
 					'enabled' => isModEnabled('supplier_proposal'),
9377 9377
 					'perms' => 1,
9378 9378
 					'label' => 'LinkToSupplierProposal',
9379
-					'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') . ')'),
9379
+					'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').')'),
9380 9380
 				'order_supplier' => array(
9381 9381
 					'enabled' => isModEnabled("supplier_order"),
9382 9382
 					'perms' => 1,
9383 9383
 					'label' => 'LinkToSupplierOrder',
9384
-					'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') . ')'),
9384
+					'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').')'),
9385 9385
 				'invoice_supplier' => array(
9386 9386
 					'enabled' => isModEnabled("supplier_invoice"),
9387 9387
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9388
-					'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') . ')'),
9388
+					'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').')'),
9389 9389
 				'ticket' => array(
9390 9390
 					'enabled' => isModEnabled('ticket'),
9391 9391
 					'perms' => 1,
9392 9392
 					'label' => 'LinkToTicket',
9393
-					'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') . ')'),
9393
+					'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').')'),
9394 9394
 				'mo' => array(
9395 9395
 					'enabled' => isModEnabled('mrp'),
9396 9396
 					'perms' => 1,
9397 9397
 					'label' => 'LinkToMo',
9398
-					'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') . ')')
9398
+					'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').')')
9399 9399
 			);
9400 9400
 		}
9401 9401
 
@@ -9431,22 +9431,22 @@  discard block
 block discarded – undo
9431 9431
 			}
9432 9432
 
9433 9433
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9434
-				print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9434
+				print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9435 9435
 
9436 9436
 				if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9437 9437
 					print '<br>'."\n";
9438 9438
 					print '<!-- form to add a link from anywhere -->'."\n";
9439
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9440
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9439
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9440
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9441 9441
 					print '<input type="hidden" name="action" value="addlinkbyref">';
9442
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9443
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9442
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9443
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9444 9444
 					print '<table class="noborder">';
9445 9445
 					print '<tr>';
9446 9446
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9447
-					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9448
-					print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9449
-					print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9447
+					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9448
+					print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9449
+					print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9450 9450
 					print '</tr>';
9451 9451
 					print '</table>';
9452 9452
 					print '</form>';
@@ -9461,48 +9461,48 @@  discard block
 block discarded – undo
9461 9461
 
9462 9462
 					print '<br>';
9463 9463
 					print '<!-- form to add a link from object to same thirdparty -->'."\n";
9464
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9464
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9465 9465
 					print '<input type="hidden" name="action" value="addlink">';
9466
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9467
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9468
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9466
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9467
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9468
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9469 9469
 					print '<table class="noborder">';
9470 9470
 					print '<tr class="liste_titre">';
9471 9471
 					print '<td class="nowrap"></td>';
9472
-					print '<td class="center">' . $langs->trans("Ref") . '</td>';
9473
-					print '<td class="left">' . $langs->trans("RefCustomer") . '</td>';
9474
-					print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9475
-					print '<td class="left">' . $langs->trans("Company") . '</td>';
9472
+					print '<td class="center">'.$langs->trans("Ref").'</td>';
9473
+					print '<td class="left">'.$langs->trans("RefCustomer").'</td>';
9474
+					print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9475
+					print '<td class="left">'.$langs->trans("Company").'</td>';
9476 9476
 					print '</tr>';
9477 9477
 					while ($i < $num) {
9478 9478
 						$objp = $this->db->fetch_object($resqllist);
9479 9479
 
9480 9480
 						print '<tr class="oddeven">';
9481 9481
 						print '<td class="left">';
9482
-						print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9482
+						print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9483 9483
 						print '</td>';
9484
-						print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9485
-						print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9484
+						print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9485
+						print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9486 9486
 						print '<td class="right">';
9487 9487
 						if ($possiblelink['label'] == 'LinkToContract') {
9488 9488
 							$form = new Form($this->db);
9489
-							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9489
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9490 9490
 						}
9491
-						print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9491
+						print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9492 9492
 						print '</td>';
9493
-						print '<td>' . $objp->name . '</td>';
9493
+						print '<td>'.$objp->name.'</td>';
9494 9494
 						print '</tr>';
9495 9495
 						$i++;
9496 9496
 					}
9497 9497
 					print '</table>';
9498 9498
 					print '<div class="center">';
9499 9499
 					if ($num) {
9500
-						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9500
+						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9501 9501
 					}
9502 9502
 					if (empty($conf->use_javascript_ajax)) {
9503
-						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9503
+						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9504 9504
 					} else {
9505
-						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>';
9505
+						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>';
9506 9506
 					}
9507 9507
 					print '</form>';
9508 9508
 					$this->db->free($resqllist);
@@ -9513,10 +9513,10 @@  discard block
 block discarded – undo
9513 9513
 
9514 9514
 				//$linktoelem.=($linktoelem?' &nbsp; ':'');
9515 9515
 				if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9516
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9516
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9517 9517
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9518 9518
 				} else {
9519
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9519
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9520 9520
 				}
9521 9521
 			}
9522 9522
 		}
@@ -9526,22 +9526,22 @@  discard block
 block discarded – undo
9526 9526
     		<dl class="dropdown" id="linktoobjectname">
9527 9527
     		';
9528 9528
 			if (!empty($conf->use_javascript_ajax)) {
9529
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9529
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9530 9530
 			}
9531 9531
 			$linktoelem .= '<dd>
9532 9532
     		<div class="multiselectlinkto">
9533
-    		<ul class="ulselectedfields">' . $linktoelemlist . '
9533
+    		<ul class="ulselectedfields">' . $linktoelemlist.'
9534 9534
     		</ul>
9535 9535
     		</div>
9536 9536
     		</dd>
9537 9537
     		</dl>';
9538 9538
 		} else {
9539
-			$linktoelem = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
9539
+			$linktoelem = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
9540 9540
 		}
9541 9541
 
9542 9542
 		if (!empty($conf->use_javascript_ajax)) {
9543 9543
 			print '<!-- Add js to show linkto box -->
9544
-				<script nonce="' . getNonce() . '">
9544
+				<script nonce="' . getNonce().'">
9545 9545
 				jQuery(document).ready(function() {
9546 9546
 					jQuery(".linkto").click(function() {
9547 9547
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9582,19 +9582,19 @@  discard block
 block discarded – undo
9582 9582
 
9583 9583
 		$disabled = ($disabled ? ' disabled' : '');
9584 9584
 
9585
-		$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9585
+		$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9586 9586
 		if ($useempty) {
9587
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9587
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9588 9588
 		}
9589 9589
 		if (("$value" == 'yes') || ($value == 1)) {
9590
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9591
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9590
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9591
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9592 9592
 		} else {
9593 9593
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9594
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9595
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9594
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9595
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9596 9596
 		}
9597
-		$resultyesno .= '</select>' . "\n";
9597
+		$resultyesno .= '</select>'."\n";
9598 9598
 
9599 9599
 		if ($addjscombo) {
9600 9600
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9618,12 +9618,12 @@  discard block
 block discarded – undo
9618 9618
 	{
9619 9619
 		// phpcs:enable
9620 9620
 		$sql = "SELECT rowid, label";
9621
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9622
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9621
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9622
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9623 9623
 		$sql .= " ORDER BY rowid";
9624 9624
 		$result = $this->db->query($sql);
9625 9625
 		if ($result) {
9626
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9626
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9627 9627
 			if ($useempty) {
9628 9628
 				print '<option value="-1">&nbsp;</option>';
9629 9629
 			}
@@ -9633,9 +9633,9 @@  discard block
 block discarded – undo
9633 9633
 			while ($i < $num) {
9634 9634
 				$obj = $this->db->fetch_object($result);
9635 9635
 				if ($selected == $obj->rowid) {
9636
-					print '<option value="' . $obj->rowid . '" selected>';
9636
+					print '<option value="'.$obj->rowid.'" selected>';
9637 9637
 				} else {
9638
-					print '<option value="' . $obj->rowid . '">';
9638
+					print '<option value="'.$obj->rowid.'">';
9639 9639
 				}
9640 9640
 				print $obj->label;
9641 9641
 				print '</option>';
@@ -9726,8 +9726,8 @@  discard block
 block discarded – undo
9726 9726
 				$stringforfirstkey .= ' CTL +';
9727 9727
 			}
9728 9728
 
9729
-			$previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
9730
-			$next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
9729
+			$previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
9730
+			$next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
9731 9731
 		}
9732 9732
 
9733 9733
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9735,18 +9735,18 @@  discard block
 block discarded – undo
9735 9735
 
9736 9736
 		// Right part of banner
9737 9737
 		if ($morehtmlright) {
9738
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9738
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9739 9739
 		}
9740 9740
 
9741 9741
 		if ($previous_ref || $next_ref || $morehtml) {
9742 9742
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9743 9743
 		}
9744 9744
 		if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) {
9745
-			$ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9745
+			$ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9746 9746
 		}
9747 9747
 		if ($shownav && ($previous_ref || $next_ref)) {
9748
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
9749
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
9748
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
9749
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
9750 9750
 		}
9751 9751
 		if ($previous_ref || $next_ref || $morehtml) {
9752 9752
 			$ret .= '</ul></div>';
@@ -9761,7 +9761,7 @@  discard block
 block discarded – undo
9761 9761
 			$morehtmlstatus = $hookmanager->resPrint;
9762 9762
 		}
9763 9763
 		if ($morehtmlstatus) {
9764
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
9764
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
9765 9765
 		}
9766 9766
 
9767 9767
 		$parameters = array();
@@ -9775,14 +9775,14 @@  discard block
 block discarded – undo
9775 9775
 		// Left part of banner
9776 9776
 		if ($morehtmlleft) {
9777 9777
 			if ($conf->browser->layout == 'phone') {
9778
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
9778
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
9779 9779
 			} else {
9780
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
9780
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
9781 9781
 			}
9782 9782
 		}
9783 9783
 
9784 9784
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
9785
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
9785
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
9786 9786
 
9787 9787
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
9788 9788
 		if ($object->element == 'societe') {
@@ -9796,7 +9796,7 @@  discard block
 block discarded – undo
9796 9796
 
9797 9797
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
9798 9798
 				if (!is_object($extralanguages)) {
9799
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
9799
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
9800 9800
 					$extralanguages = new ExtraLanguages($this->db);
9801 9801
 				}
9802 9802
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -9811,29 +9811,29 @@  discard block
 block discarded – undo
9811 9811
 						if ($object->array_languages['name'][$extralangcode]) {
9812 9812
 							$htmltext .= $object->array_languages['name'][$extralangcode];
9813 9813
 						} else {
9814
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
9814
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
9815 9815
 						}
9816 9816
 					}
9817
-					$ret .= '<!-- Show translations of name -->' . "\n";
9817
+					$ret .= '<!-- Show translations of name -->'."\n";
9818 9818
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
9819 9819
 				}
9820 9820
 			}
9821 9821
 		} elseif ($object->element == 'member') {
9822 9822
 			'@phan-var-force Adherent $object';
9823
-			$ret .= $object->ref . '<br>';
9823
+			$ret .= $object->ref.'<br>';
9824 9824
 			$fullname = $object->getFullName($langs);
9825 9825
 			if ($object->morphy == 'mor' && $object->societe) {
9826
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
9826
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
9827 9827
 			} else {
9828
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
9828
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
9829 9829
 			}
9830 9830
 		} elseif (in_array($object->element, array('contact', 'user'))) {
9831
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
9831
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
9832 9832
 		} elseif ($object->element == 'usergroup') {
9833 9833
 			$ret .= dol_htmlentities($object->name);
9834 9834
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
9835 9835
 			'@phan-var-force ActionComm $object';
9836
-			$ret .= $object->ref . '<br>' . $object->label;
9836
+			$ret .= $object->ref.'<br>'.$object->label;
9837 9837
 		} elseif (in_array($object->element, array('adherent_type'))) {
9838 9838
 			$ret .= $object->label;
9839 9839
 		} elseif ($object->element == 'ecm_directories') {
@@ -9886,9 +9886,9 @@  discard block
 block discarded – undo
9886 9886
 		}
9887 9887
 
9888 9888
 		// Barcode image  @phan-suppress-next-line PhanUndeclaredProperty
9889
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
9890
-		$out = '<!-- url barcode = ' . $url . ' -->';
9891
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
9889
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
9890
+		$out = '<!-- url barcode = '.$url.' -->';
9891
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
9892 9892
 
9893 9893
 		return $out;
9894 9894
 	}
@@ -9915,7 +9915,7 @@  discard block
 block discarded – undo
9915 9915
 		global $conf, $langs;
9916 9916
 
9917 9917
 		$entity = (empty($object->entity) ? $conf->entity : $object->entity);
9918
-		$id = (empty($object->id) ? $object->rowid : $object->id);  // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
9918
+		$id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
9919 9919
 
9920 9920
 		$dir = '';
9921 9921
 		$file = '';
@@ -9928,28 +9928,28 @@  discard block
 block discarded – undo
9928 9928
 			if (!empty($object->logo)) {
9929 9929
 				if (dolIsAllowedForPreview($object->logo)) {
9930 9930
 					if ((string) $imagesize == 'mini') {
9931
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9931
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9932 9932
 					} elseif ((string) $imagesize == 'small') {
9933
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
9933
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
9934 9934
 					} else {
9935
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9935
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9936 9936
 					}
9937
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9937
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9938 9938
 				}
9939 9939
 			}
9940 9940
 			$email = $object->email;
9941 9941
 		} elseif ($modulepart == 'contact') {
9942
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
9942
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
9943 9943
 			if (!empty($object->photo)) {
9944 9944
 				if (dolIsAllowedForPreview($object->photo)) {
9945 9945
 					if ((string) $imagesize == 'mini') {
9946
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9946
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9947 9947
 					} elseif ((string) $imagesize == 'small') {
9948
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9948
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
9949 9949
 					} else {
9950
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9950
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9951 9951
 					}
9952
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9952
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9953 9953
 				}
9954 9954
 			}
9955 9955
 			$email = $object->email;
@@ -9959,17 +9959,17 @@  discard block
 block discarded – undo
9959 9959
 			if (!empty($object->photo)) {
9960 9960
 				if (dolIsAllowedForPreview($object->photo)) {
9961 9961
 					if ((string) $imagesize == 'mini') {
9962
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9962
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9963 9963
 					} elseif ((string) $imagesize == 'small') {
9964
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9964
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
9965 9965
 					} else {
9966
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9966
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9967 9967
 					}
9968
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9968
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9969 9969
 				}
9970 9970
 			}
9971 9971
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9972
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9972
+				$altfile = $object->id.".jpg"; // For backward compatibility
9973 9973
 			}
9974 9974
 			$email = $object->email;
9975 9975
 			$capture = 'user';
@@ -9978,17 +9978,17 @@  discard block
 block discarded – undo
9978 9978
 			if (!empty($object->photo)) {
9979 9979
 				if (dolIsAllowedForPreview($object->photo)) {
9980 9980
 					if ((string) $imagesize == 'mini') {
9981
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9981
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9982 9982
 					} elseif ((string) $imagesize == 'small') {
9983
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9983
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
9984 9984
 					} else {
9985
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9985
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9986 9986
 					}
9987
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9987
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9988 9988
 				}
9989 9989
 			}
9990 9990
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9991
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9991
+				$altfile = $object->id.".jpg"; // For backward compatibility
9992 9992
 			}
9993 9993
 			$email = $object->email;
9994 9994
 			$capture = 'user';
@@ -10014,35 +10014,35 @@  discard block
 block discarded – undo
10014 10014
 		$ret = '';
10015 10015
 
10016 10016
 		if ($dir) {
10017
-			if ($file && file_exists($dir . "/" . $file)) {
10017
+			if ($file && file_exists($dir."/".$file)) {
10018 10018
 				if ($addlinktofullsize) {
10019
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10019
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10020 10020
 					if ($urladvanced) {
10021
-						$ret .= '<a href="' . $urladvanced . '">';
10021
+						$ret .= '<a href="'.$urladvanced.'">';
10022 10022
 					} else {
10023
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10023
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10024 10024
 					}
10025 10025
 				}
10026
-				$ret .= '<img alt="" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">';
10026
+				$ret .= '<img alt="" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
10027 10027
 				if ($addlinktofullsize) {
10028 10028
 					$ret .= '</a>';
10029 10029
 				}
10030
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
10030
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
10031 10031
 				if ($addlinktofullsize) {
10032
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10032
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10033 10033
 					if ($urladvanced) {
10034
-						$ret .= '<a href="' . $urladvanced . '">';
10034
+						$ret .= '<a href="'.$urladvanced.'">';
10035 10035
 					} else {
10036
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10036
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10037 10037
 					}
10038 10038
 				}
10039
-				$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 . '">';
10039
+				$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.'">';
10040 10040
 				if ($addlinktofullsize) {
10041 10041
 					$ret .= '</a>';
10042 10042
 				}
10043 10043
 			} else {
10044 10044
 				$nophoto = '/public/theme/common/nophoto.png';
10045
-				$defaultimg = 'identicon';        // For gravatar
10045
+				$defaultimg = 'identicon'; // For gravatar
10046 10046
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
10047 10047
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) {
10048 10048
 						$nophoto = 'company';
@@ -10060,13 +10060,13 @@  discard block
 block discarded – undo
10060 10060
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
10061 10061
 					// see https://gravatar.com/site/implement/images/php/
10062 10062
 					$ret .= '<!-- Put link to gravatar -->';
10063
-					$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . dol_hash(strtolower(trim($email)), 'sha256', 1) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash
10063
+					$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)), 'sha256', 1).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash
10064 10064
 				} else {
10065 10065
 					if ($nophoto == 'company') {
10066
-						$ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
10066
+						$ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
10067 10067
 						//$ret .= '<div class="difforspanimgright"></div>';
10068 10068
 					} else {
10069
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
10069
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
10070 10070
 					}
10071 10071
 				}
10072 10072
 			}
@@ -10077,15 +10077,15 @@  discard block
 block discarded – undo
10077 10077
 				}
10078 10078
 				$ret .= '<table class="nobordernopadding centpercent">';
10079 10079
 				if ($object->photo) {
10080
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
10080
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
10081 10081
 				}
10082 10082
 				$ret .= '<tr><td class="tdoverflow">';
10083 10083
 				$maxfilesizearray = getMaxFileSizeArray();
10084 10084
 				$maxmin = $maxfilesizearray['maxmin'];
10085 10085
 				if ($maxmin > 0) {
10086
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
10086
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
10087 10087
 				}
10088
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
10088
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
10089 10089
 				$ret .= '</td></tr>';
10090 10090
 				$ret .= '</table>';
10091 10091
 			}
@@ -10139,38 +10139,38 @@  discard block
 block discarded – undo
10139 10139
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10140 10140
 			$sql .= ", e.label";
10141 10141
 		}
10142
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10142
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10143 10143
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10144
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10144
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10145 10145
 			if ($force_entity) {
10146
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10146
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10147 10147
 			} else {
10148 10148
 				$sql .= " WHERE ug.entity IS NOT NULL";
10149 10149
 			}
10150 10150
 		} else {
10151
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10151
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10152 10152
 		}
10153 10153
 		if (is_array($exclude) && $excludeGroups) {
10154
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10154
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10155 10155
 		}
10156 10156
 		if (is_array($include) && $includeGroups) {
10157
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10157
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10158 10158
 		}
10159 10159
 		$sql .= " ORDER BY ug.nom ASC";
10160 10160
 
10161
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10161
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10162 10162
 		$resql = $this->db->query($sql);
10163 10163
 		if ($resql) {
10164 10164
 			// Enhance with select2
10165
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10165
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10166 10166
 
10167
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10167
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10168 10168
 
10169 10169
 			$num = $this->db->num_rows($resql);
10170 10170
 			$i = 0;
10171 10171
 			if ($num) {
10172 10172
 				if ($show_empty && !$multiple) {
10173
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10173
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10174 10174
 				}
10175 10175
 
10176 10176
 				while ($i < $num) {
@@ -10183,11 +10183,11 @@  discard block
 block discarded – undo
10183 10183
 					$label = $obj->name;
10184 10184
 					$labelhtml = $obj->name;
10185 10185
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10186
-						$label .= " (" . $obj->label . ")";
10187
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10186
+						$label .= " (".$obj->label.")";
10187
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10188 10188
 					}
10189 10189
 
10190
-					$out .= '<option value="' . $obj->rowid . '"';
10190
+					$out .= '<option value="'.$obj->rowid.'"';
10191 10191
 					if ($disableline) {
10192 10192
 						$out .= ' disabled';
10193 10193
 					}
@@ -10203,9 +10203,9 @@  discard block
 block discarded – undo
10203 10203
 				}
10204 10204
 			} else {
10205 10205
 				if ($show_empty) {
10206
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10206
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10207 10207
 				}
10208
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10208
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10209 10209
 			}
10210 10210
 			$out .= '</select>';
10211 10211
 
@@ -10249,25 +10249,25 @@  discard block
 block discarded – undo
10249 10249
 		$out = '';
10250 10250
 
10251 10251
 		if (!empty($conf->use_javascript_ajax)) {
10252
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10252
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10253 10253
 		}
10254
-		$out .= '<script nonce="' . getNonce() . '">
10254
+		$out .= '<script nonce="'.getNonce().'">
10255 10255
             $(document).ready(function() {
10256
-                $("#' . $cssclass . 's").click(function() {
10256
+                $("#' . $cssclass.'s").click(function() {
10257 10257
                     if($(this).is(\':checked\')){
10258
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10259
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10258
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10259
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10260 10260
                     }
10261 10261
                     else
10262 10262
                     {
10263 10263
                         console.log("We uncheck all");
10264
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10264
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10265 10265
                     }' . "\n";
10266 10266
 		if ($calljsfunction) {
10267
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10267
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10268 10268
 		}
10269 10269
 		$out .= '         });
10270
-        	        $(".' . $cssclass . '").change(function() {
10270
+        	        $(".' . $cssclass.'").change(function() {
10271 10271
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10272 10272
 				});
10273 10273
 		 	});
@@ -10312,67 +10312,67 @@  discard block
 block discarded – undo
10312 10312
 		global $langs, $user;
10313 10313
 
10314 10314
 		$out = '';
10315
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10316
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10315
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10316
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10317 10317
 		if (!empty($excludeid)) {
10318
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10318
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10319 10319
 		}
10320 10320
 		$sql .= " ORDER BY label";
10321 10321
 
10322 10322
 		$resql = $this->db->query($sql);
10323 10323
 		if ($resql) {
10324
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10324
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10325 10325
 			if ($useempty) {
10326 10326
 				$out .= '<option value="0">&nbsp;</option>';
10327 10327
 			}
10328 10328
 
10329 10329
 			while ($obj = $this->db->fetch_object($resql)) {
10330
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10330
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10331 10331
 			}
10332 10332
 			$out .= '</select>';
10333
-			$out .= ajax_combobox('select_' . $htmlname);
10333
+			$out .= ajax_combobox('select_'.$htmlname);
10334 10334
 
10335 10335
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10336
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10336
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10337 10337
 			}
10338 10338
 
10339 10339
 			if (!empty($target)) {
10340
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10340
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10341 10341
 				$resql = $this->db->query($sql);
10342 10342
 				if ($resql) {
10343 10343
 					if ($this->db->num_rows($resql) > 0) {
10344 10344
 						$obj = $this->db->fetch_object($resql);
10345
-						$out .= '<script nonce="' . getNonce() . '">
10345
+						$out .= '<script nonce="'.getNonce().'">
10346 10346
 							$(function() {
10347
-								$("select[name=' . $target . ']").on("change", function() {
10347
+								$("select[name=' . $target.']").on("change", function() {
10348 10348
 									var current_val = $(this).val();
10349
-									if (current_val == ' . $obj->id . ') {';
10349
+									if (current_val == ' . $obj->id.') {';
10350 10350
 						if (!empty($default_selected) || !empty($selected)) {
10351
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10351
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10352 10352
 						}
10353 10353
 
10354 10354
 						$out .= '
10355
-										$("select[name=' . $htmlname . ']").change();
10355
+										$("select[name=' . $htmlname.']").change();
10356 10356
 									}
10357 10357
 								});
10358 10358
 
10359
-								$("select[name=' . $htmlname . ']").change(function() {
10359
+								$("select[name=' . $htmlname.']").change(function() {
10360 10360
 
10361
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10361
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10362 10362
 										// get price of kilometer to fill the unit price
10363 10363
 										$.ajax({
10364 10364
 											method: "POST",
10365 10365
 											dataType: "json",
10366
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10367
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '",
10366
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10367
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'",
10368 10368
 										}).done(function( data, textStatus, jqXHR ) {
10369 10369
 											console.log(data);
10370 10370
 											if (typeof data.up != "undefined") {
10371 10371
 												$("input[name=value_unit]").val(data.up);
10372
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10372
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10373 10373
 											} else {
10374 10374
 												$("input[name=value_unit]").val("");
10375
-												$("select[name=' . $htmlname . ']").attr("title", "");
10375
+												$("select[name=' . $htmlname.']").attr("title", "");
10376 10376
 											}
10377 10377
 										});
10378 10378
 									}
@@ -10402,18 +10402,18 @@  discard block
 block discarded – undo
10402 10402
 		global $conf, $langs;
10403 10403
 
10404 10404
 		$out = '';
10405
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10406
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10405
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10406
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10407 10407
 
10408 10408
 		$resql = $this->db->query($sql);
10409 10409
 		if ($resql) {
10410
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10410
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10411 10411
 			if ($useempty) {
10412 10412
 				$out .= '<option value="0"></option>';
10413 10413
 			}
10414 10414
 
10415 10415
 			while ($obj = $this->db->fetch_object($resql)) {
10416
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10416
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10417 10417
 			}
10418 10418
 			$out .= '</select>';
10419 10419
 		} else {
@@ -10444,12 +10444,12 @@  discard block
 block discarded – undo
10444 10444
 
10445 10445
 		$resql = $this->db->query($sql);
10446 10446
 		if ($resql) {
10447
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10447
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10448 10448
 			if ($useempty) {
10449 10449
 				$out .= '<option value="0"></option>';
10450 10450
 			}
10451 10451
 			if ($allchoice) {
10452
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10452
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10453 10453
 			}
10454 10454
 
10455 10455
 			$field = 'code';
@@ -10459,7 +10459,7 @@  discard block
 block discarded – undo
10459 10459
 
10460 10460
 			while ($obj = $this->db->fetch_object($resql)) {
10461 10461
 				$key = $langs->trans($obj->code);
10462
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10462
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10463 10463
 			}
10464 10464
 			$out .= '</select>';
10465 10465
 
@@ -10493,7 +10493,7 @@  discard block
 block discarded – undo
10493 10493
 	{
10494 10494
 		global $user, $conf, $langs;
10495 10495
 
10496
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10496
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10497 10497
 
10498 10498
 		if (is_null($usertofilter)) {
10499 10499
 			$usertofilter = $user;
@@ -10517,10 +10517,10 @@  discard block
 block discarded – undo
10517 10517
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10518 10518
             p.title, p.fk_soc, p.fk_statut, p.public,";
10519 10519
 		$sql .= ' s.nom as name';
10520
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10521
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10522
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10523
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10520
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10521
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10522
+		$sql .= ' '.$this->db->prefix().'facture as f';
10523
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10524 10524
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10525 10525
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10526 10526
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10531,14 +10531,14 @@  discard block
 block discarded – undo
10531 10531
 		if ($resql) {
10532 10532
 			// Use select2 selector
10533 10533
 			if (!empty($conf->use_javascript_ajax)) {
10534
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10534
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10535 10535
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10536 10536
 				$out .= $comboenhancement;
10537 10537
 				$morecss = 'minwidth200imp maxwidth500';
10538 10538
 			}
10539 10539
 
10540 10540
 			if (empty($option_only)) {
10541
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10541
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10542 10542
 			}
10543 10543
 			if (!empty($show_empty)) {
10544 10544
 				$out .= '<option value="0" class="optiongrey">';
@@ -10568,33 +10568,33 @@  discard block
 block discarded – undo
10568 10568
 						if ($showproject == 'all') {
10569 10569
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10570 10570
 							if ($obj->name) {
10571
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10571
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10572 10572
 							}
10573 10573
 
10574 10574
 							$disabled = 0;
10575 10575
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10576 10576
 								$disabled = 1;
10577
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10577
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10578 10578
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10579 10579
 								if ($discard_closed == 2) {
10580 10580
 									$disabled = 1;
10581 10581
 								}
10582
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10582
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10583 10583
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10584 10584
 								$disabled = 1;
10585
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10585
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10586 10586
 							}
10587 10587
 						}
10588 10588
 
10589 10589
 						if (!empty($selected) && $selected == $obj->rowid) {
10590
-							$out .= '<option value="' . $obj->rowid . '" selected';
10590
+							$out .= '<option value="'.$obj->rowid.'" selected';
10591 10591
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10592
-							$out .= '>' . $labeltoshow . '</option>';
10592
+							$out .= '>'.$labeltoshow.'</option>';
10593 10593
 						} else {
10594 10594
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10595 10595
 								$resultat = '';
10596 10596
 							} else {
10597
-								$resultat = '<option value="' . $obj->rowid . '"';
10597
+								$resultat = '<option value="'.$obj->rowid.'"';
10598 10598
 								if ($disabled) {
10599 10599
 									$resultat .= ' disabled';
10600 10600
 								}
@@ -10646,22 +10646,22 @@  discard block
 block discarded – undo
10646 10646
 
10647 10647
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10648 10648
 		//$sql.= ', el.fk_source';
10649
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10650
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10649
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10650
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10651 10651
 		$sql .= " ORDER BY f.titre ASC";
10652 10652
 
10653 10653
 		$resql = $this->db->query($sql);
10654 10654
 		if ($resql) {
10655 10655
 			// Use select2 selector
10656 10656
 			if (!empty($conf->use_javascript_ajax)) {
10657
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10657
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10658 10658
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10659 10659
 				$out .= $comboenhancement;
10660 10660
 				$morecss = 'minwidth200imp maxwidth500';
10661 10661
 			}
10662 10662
 
10663 10663
 			if (empty($option_only)) {
10664
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10664
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10665 10665
 			}
10666 10666
 			if (!empty($show_empty)) {
10667 10667
 				$out .= '<option value="0" class="optiongrey">';
@@ -10680,19 +10680,19 @@  discard block
 block discarded – undo
10680 10680
 					$disabled = 0;
10681 10681
 					if (!empty($obj->suspended)) {
10682 10682
 						$disabled = 1;
10683
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10683
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10684 10684
 					}
10685 10685
 
10686 10686
 
10687 10687
 					if (!empty($selected) && $selected == $obj->rowid) {
10688
-						$out .= '<option value="' . $obj->rowid . '" selected';
10688
+						$out .= '<option value="'.$obj->rowid.'" selected';
10689 10689
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10690
-						$out .= '>' . $labeltoshow . '</option>';
10690
+						$out .= '>'.$labeltoshow.'</option>';
10691 10691
 					} else {
10692 10692
 						if ($disabled && ($selected != $obj->rowid)) {
10693 10693
 							$resultat = '';
10694 10694
 						} else {
10695
-							$resultat = '<option value="' . $obj->rowid . '"';
10695
+							$resultat = '<option value="'.$obj->rowid.'"';
10696 10696
 							if ($disabled) {
10697 10697
 								$resultat .= ' disabled';
10698 10698
 							}
@@ -10732,14 +10732,14 @@  discard block
 block discarded – undo
10732 10732
 		global $langs;
10733 10733
 
10734 10734
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10735
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10735
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10736 10736
 		}
10737 10737
 
10738 10738
 		$ret = '';
10739 10739
 
10740 10740
 		$ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">';
10741 10741
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10742
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth hideonsmartphone" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10742
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth hideonsmartphone" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10743 10743
 		$ret .= '</a>';
10744 10744
 
10745 10745
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -10783,29 +10783,29 @@  discard block
 block discarded – undo
10783 10783
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
10784 10784
 		}
10785 10785
 		$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%')) -->";
10786
-		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
10786
+		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
10787 10787
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
10788 10788
 
10789 10789
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
10790 10790
 		foreach ($arrayofcriterias as $criteria) {
10791 10791
 			foreach ($criteria as $criteriafamilykey => $criteriafamilyval) {
10792
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10792
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10793 10793
 					continue;
10794 10794
 				}
10795 10795
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
10796 10796
 					continue;
10797 10797
 				}
10798 10798
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
10799
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
10800
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
10801
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
10802
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
10803
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
10804
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
10805
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
10806
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
10799
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
10800
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
10801
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
10802
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
10803
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
10804
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
10805
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
10806
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
10807 10807
 				} else {
10808
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
10808
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
10809 10809
 				}
10810 10810
 			}
10811 10811
 		}
@@ -10813,7 +10813,7 @@  discard block
 block discarded – undo
10813 10813
 		$ret .= '</div>';
10814 10814
 
10815 10815
 		$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";
10816
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10816
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10817 10817
 
10818 10818
 		$ret .= '</div>';
10819 10819
 		$ret .= '</div>';
@@ -10887,7 +10887,7 @@  discard block
 block discarded – undo
10887 10887
 
10888 10888
 		$TModels = array();
10889 10889
 
10890
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
10890
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
10891 10891
 		$formmail = new FormMail($this->db);
10892 10892
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
10893 10893
 
@@ -10900,17 +10900,17 @@  discard block
 block discarded – undo
10900 10900
 			}
10901 10901
 		}
10902 10902
 
10903
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
10903
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
10904 10904
 
10905 10905
 		foreach ($TModels as $id_model => $label_model) {
10906
-			$retstring .= '<option value="' . $id_model . '"';
10907
-			$retstring .= ">" . $label_model . "</option>";
10906
+			$retstring .= '<option value="'.$id_model.'"';
10907
+			$retstring .= ">".$label_model."</option>";
10908 10908
 		}
10909 10909
 
10910 10910
 		$retstring .= "</select>";
10911 10911
 
10912 10912
 		if ($addjscombo) {
10913
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
10913
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
10914 10914
 		}
10915 10915
 
10916 10916
 		return $retstring;
@@ -10961,16 +10961,16 @@  discard block
 block discarded – undo
10961 10961
 
10962 10962
 		foreach ($buttons as $button) {
10963 10963
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
10964
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
10964
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
10965 10965
 		}
10966 10966
 		$retstring .= $withoutdiv ? '' : '</div>';
10967 10967
 
10968 10968
 		if ($dol_openinpopup) {
10969
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n";
10970
-			$retstring .= '<script nonce="' . getNonce() . '">';
10969
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n";
10970
+			$retstring .= '<script nonce="'.getNonce().'">';
10971 10971
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
10972
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\');
10973
-				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\');
10972
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\');
10973
+				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\');
10974 10974
 				 });';
10975 10975
 			$retstring .= '</script>';
10976 10976
 		}
@@ -10999,7 +10999,7 @@  discard block
 block discarded – undo
10999 10999
 		dol_syslog(__METHOD__, LOG_DEBUG);
11000 11000
 
11001 11001
 		$sql = "SELECT rowid, code, label as label";
11002
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
11002
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
11003 11003
 		$sql .= " WHERE active = 1";
11004 11004
 
11005 11005
 		$resql = $this->db->query($sql);
@@ -11010,7 +11010,7 @@  discard block
 block discarded – undo
11010 11010
 				$obj = $this->db->fetch_object($resql);
11011 11011
 
11012 11012
 				// If translation exists, we use it, otherwise we take the default wording
11013
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11013
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11014 11014
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
11015 11015
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
11016 11016
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -11042,18 +11042,18 @@  discard block
 block discarded – undo
11042 11042
 		global $langs, $user;
11043 11043
 
11044 11044
 		$out = '';
11045
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
11045
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
11046 11046
 
11047 11047
 		$this->load_cache_invoice_subtype();
11048 11048
 
11049
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
11049
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
11050 11050
 		if ($addempty) {
11051 11051
 			$out .= '<option value="0">&nbsp;</option>';
11052 11052
 		}
11053 11053
 
11054 11054
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
11055 11055
 			$label = $subtype['label'];
11056
-			$out .= '<option value="' . $subtype['rowid'] . '"';
11056
+			$out .= '<option value="'.$subtype['rowid'].'"';
11057 11057
 			if ($selected == $subtype['rowid']) {
11058 11058
 				$out .= ' selected="selected"';
11059 11059
 			}
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -473,11 +473,11 @@  discard block
 block discarded – undo
473 473
 	 *
474 474
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
475 475
 	 */
476
-	private $cond_reglement;  // Private to call DolDeprecationHandler
476
+	private $cond_reglement; // Private to call DolDeprecationHandler
477 477
 	/**
478 478
 	 * @var int|string Internal to detect deprecated access
479 479
 	 */
480
-	protected $depr_cond_reglement;  // Internal value for deprecation
480
+	protected $depr_cond_reglement; // Internal value for deprecation
481 481
 
482 482
 	/**
483 483
 	 * @var int 		Delivery address ID
@@ -534,12 +534,12 @@  discard block
 block discarded – undo
534 534
 	/**
535 535
 	 * @var float Multicurrency total localta1
536 536
 	 */
537
-	public $multicurrency_total_localtax1;	// not in database
537
+	public $multicurrency_total_localtax1; // not in database
538 538
 
539 539
 	/**
540 540
 	 * @var float Multicurrency total localtax2
541 541
 	 */
542
-	public $multicurrency_total_localtax2;	// not in database
542
+	public $multicurrency_total_localtax2; // not in database
543 543
 
544 544
 	/**
545 545
 	 * @var string
@@ -1005,17 +1005,17 @@  discard block
 block discarded – undo
1005 1005
 				}
1006 1006
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1007 1007
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1008
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1008
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1009 1009
 				} else {
1010
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1011
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1010
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1011
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1012 1012
 					$count++;
1013 1013
 				}
1014 1014
 			}
1015 1015
 			$data['closedivextra'] = '</div>';
1016 1016
 		}
1017 1017
 
1018
-		$hookmanager->initHooks(array($this->element . 'dao'));
1018
+		$hookmanager->initHooks(array($this->element.'dao'));
1019 1019
 		$parameters = array(
1020 1020
 			'tooltipcontentarray' => &$data,
1021 1021
 			'params' => $params,
@@ -1506,7 +1506,7 @@  discard block
 block discarded – undo
1506 1506
 		if ($source == 'external' || $source == 'thirdparty') {
1507 1507
 			$sql .= " AND tc.source = 'external'";
1508 1508
 			if ($status >= 0) {
1509
-				$sql .= " AND t.statut = ".((int) $status);	// t is llx_socpeople
1509
+				$sql .= " AND t.statut = ".((int) $status); // t is llx_socpeople
1510 1510
 			}
1511 1511
 		}
1512 1512
 		$sql .= " AND tc.active = 1";
@@ -1888,7 +1888,7 @@  discard block
 block discarded – undo
1888 1888
 		}
1889 1889
 
1890 1890
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1891
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1891
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1892 1892
 		$sql .= " LIMIT 1";
1893 1893
 
1894 1894
 		$query = $this->db->query($sql);
@@ -2178,9 +2178,9 @@  discard block
 block discarded – undo
2178 2178
 		if ($trigkey) {
2179 2179
 			$oldvalue = null;
2180 2180
 
2181
-			$sql = "SELECT " . $field;
2182
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2183
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2181
+			$sql = "SELECT ".$field;
2182
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2183
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2184 2184
 
2185 2185
 			$resql = $this->db->query($sql);
2186 2186
 			if ($resql) {
@@ -2559,7 +2559,7 @@  discard block
 block discarded – undo
2559 2559
 		// Triggers
2560 2560
 		if (!$error && !$notrigger) {
2561 2561
 			// Call triggers
2562
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2562
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2563 2563
 			if ($result < 0) {
2564 2564
 				$error++;
2565 2565
 			} //Do also here what you must do to rollback action if trigger fail
@@ -2925,7 +2925,7 @@  discard block
 block discarded – undo
2925 2925
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
2926 2926
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
2927 2927
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
2928
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2928
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2929 2929
 			}
2930 2930
 			$sql .= ' WHERE rowid='.((int) $this->id);
2931 2931
 
@@ -3273,10 +3273,10 @@  discard block
 block discarded – undo
3273 3273
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3274 3274
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3275 3275
 		if (!$renum) {
3276
-			$sql .= " AND " . $fieldposition . " = 0";
3276
+			$sql .= " AND ".$fieldposition." = 0";
3277 3277
 		}
3278 3278
 		if ($renum) {
3279
-			$sql .= " AND " . $fieldposition . " <> 0";
3279
+			$sql .= " AND ".$fieldposition." <> 0";
3280 3280
 		}
3281 3281
 
3282 3282
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3297,7 +3297,7 @@  discard block
 block discarded – undo
3297 3297
 			if ($fk_parent_line) {
3298 3298
 				$sql .= ' AND fk_parent_line IS NULL';
3299 3299
 			}
3300
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3300
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3301 3301
 
3302 3302
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3303 3303
 			$resql = $this->db->query($sql);
@@ -3348,7 +3348,7 @@  discard block
 block discarded – undo
3348 3348
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3349 3349
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3350 3350
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3351
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3351
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3352 3352
 
3353 3353
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3354 3354
 		$resql = $this->db->query($sql);
@@ -3471,7 +3471,7 @@  discard block
 block discarded – undo
3471 3471
 
3472 3472
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3473 3473
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3474
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3474
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3475 3475
 			if ($this->db->query($sql)) {
3476 3476
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3477 3477
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3502,7 +3502,7 @@  discard block
 block discarded – undo
3502 3502
 
3503 3503
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3504 3504
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3505
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3505
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3506 3506
 			if ($this->db->query($sql)) {
3507 3507
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3508 3508
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3528,7 +3528,7 @@  discard block
 block discarded – undo
3528 3528
 			$fieldposition = 'position';
3529 3529
 		}
3530 3530
 
3531
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3531
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3532 3532
 		$sql .= " WHERE rowid = ".((int) $rowid);
3533 3533
 
3534 3534
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3556,7 +3556,7 @@  discard block
 block discarded – undo
3556 3556
 
3557 3557
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3558 3558
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3559
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3559
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3560 3560
 		$resql = $this->db->query($sql);
3561 3561
 		if ($resql) {
3562 3562
 			$row = $this->db->fetch_row($resql);
@@ -3674,7 +3674,7 @@  discard block
 block discarded – undo
3674 3674
 			$newsuffix = '';
3675 3675
 		}
3676 3676
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3677
-			$fieldusermod =  "fk_user_mod";
3677
+			$fieldusermod = "fk_user_mod";
3678 3678
 		} elseif ($this->table_element == 'ecm_files') {
3679 3679
 			$fieldusermod = "fk_user_m";
3680 3680
 		} else {
@@ -3716,7 +3716,7 @@  discard block
 block discarded – undo
3716 3716
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3717 3717
 						break;
3718 3718
 					default:
3719
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3719
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3720 3720
 				}
3721 3721
 				$ret = $this->call_trigger($trigger_name, $user);
3722 3722
 				if ($ret < 0) {
@@ -4093,19 +4093,19 @@  discard block
 block discarded – undo
4093 4093
 		$this->db->begin();
4094 4094
 		$error = 0;
4095 4095
 
4096
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4096
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4097 4097
 		$sql .= "fk_source";
4098 4098
 		$sql .= ", sourcetype";
4099 4099
 		$sql .= ", fk_target";
4100 4100
 		$sql .= ", targettype";
4101 4101
 		$sql .= ") VALUES (";
4102 4102
 		$sql .= ((int) $origin_id);
4103
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4104
-		$sql .= ", " . ((int) $this->id);
4105
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4103
+		$sql .= ", '".$this->db->escape($origin)."'";
4104
+		$sql .= ", ".((int) $this->id);
4105
+		$sql .= ", '".$this->db->escape($targettype)."'";
4106 4106
 		$sql .= ")";
4107 4107
 
4108
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4108
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4109 4109
 		if ($this->db->query($sql)) {
4110 4110
 			if (!$notrigger) {
4111 4111
 				// Call trigger
@@ -4357,20 +4357,20 @@  discard block
 block discarded – undo
4357 4357
 		$this->db->begin();
4358 4358
 		$error = 0;
4359 4359
 
4360
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4360
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4361 4361
 		if ($updatesource) {
4362
-			$sql .= "fk_source = " . ((int) $sourceid);
4363
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4364
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4365
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4362
+			$sql .= "fk_source = ".((int) $sourceid);
4363
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4364
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4365
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4366 4366
 		} elseif ($updatetarget) {
4367
-			$sql .= "fk_target = " . ((int) $targetid);
4368
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4369
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4370
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4367
+			$sql .= "fk_target = ".((int) $targetid);
4368
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4369
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4370
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4371 4371
 		}
4372 4372
 
4373
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4373
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4374 4374
 		if ($this->db->query($sql)) {
4375 4375
 			if (!$notrigger) {
4376 4376
 				// Call trigger
@@ -4446,25 +4446,25 @@  discard block
 block discarded – undo
4446 4446
 		}
4447 4447
 
4448 4448
 		if (!$error) {
4449
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4449
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4450 4450
 			$sql .= " WHERE";
4451 4451
 			if ($rowid > 0) {
4452
-				$sql .= " rowid = " . ((int) $rowid);
4452
+				$sql .= " rowid = ".((int) $rowid);
4453 4453
 			} else {
4454 4454
 				if ($deletesource) {
4455
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4456
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4455
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4456
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4457 4457
 				} elseif ($deletetarget) {
4458
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4459
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4458
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4459
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4460 4460
 				} else {
4461
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4461
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4462 4462
 					$sql .= " OR";
4463
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4463
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4464 4464
 				}
4465 4465
 			}
4466 4466
 
4467
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4467
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4468 4468
 			if (!$this->db->query($sql)) {
4469 4469
 				$this->error = $this->db->lasterror();
4470 4470
 				$this->errors[] = $this->error;
@@ -4629,14 +4629,14 @@  discard block
 block discarded – undo
4629 4629
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4630 4630
 		}
4631 4631
 		$sql .= " WHERE rowid = ".((int) $elementId);
4632
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4632
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4633 4633
 
4634 4634
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4635 4635
 		$resql = $this->db->query($sql);
4636 4636
 		if ($resql) {
4637 4637
 			$error = 0;
4638 4638
 
4639
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4639
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4640 4640
 
4641 4641
 			if ($nb_rows_affected > 0) {
4642 4642
 				if (empty($trigkey)) {
@@ -4681,7 +4681,7 @@  discard block
 block discarded – undo
4681 4681
 					if ($fieldstatus == 'tosell') {
4682 4682
 						$this->status = $status;
4683 4683
 					} elseif ($fieldstatus == 'tobuy') {
4684
-						$this->status_buy = $status;	// @phpstan-ignore-line
4684
+						$this->status_buy = $status; // @phpstan-ignore-line
4685 4685
 					} else {
4686 4686
 						$this->status = $status;
4687 4687
 					}
@@ -4789,7 +4789,7 @@  discard block
 block discarded – undo
4789 4789
 			return -1;
4790 4790
 		}
4791 4791
 
4792
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4792
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4793 4793
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4794 4794
 		$tmparray = array_keys($this->childtables);
4795 4795
 		if (is_numeric($tmparray[0])) {
@@ -5858,7 +5858,7 @@  discard block
 block discarded – undo
5858 5858
 			$setsharekey = false;
5859 5859
 			if ($this->element == 'propal' || $this->element == 'proposal') {
5860 5860
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
5861
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
5861
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
5862 5862
 				}
5863 5863
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
5864 5864
 					$setsharekey = true;
@@ -5916,7 +5916,7 @@  discard block
 block discarded – undo
5916 5916
 				$ecmfile->gen_or_uploaded = 'generated';
5917 5917
 				$ecmfile->description = ''; // indexed content
5918 5918
 				$ecmfile->keywords = ''; // keyword content
5919
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
5919
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
5920 5920
 				$ecmfile->src_object_id   = $this->id;
5921 5921
 
5922 5922
 				$result = $ecmfile->create($user);
@@ -5968,7 +5968,7 @@  discard block
 block discarded – undo
5968 5968
 			$maxwidthmini = $tmparraysize['maxwidthmini'];
5969 5969
 			$maxheightmini = $tmparraysize['maxheightmini'];
5970 5970
 			//$quality = $tmparraysize['quality'];
5971
-			$quality = 50;	// For thumbs, we force quality to 50
5971
+			$quality = 50; // For thumbs, we force quality to 50
5972 5972
 
5973 5973
 			// Create small thumbs for company (Ratio is near 16/9)
5974 5974
 			// Used on logon for example
@@ -6068,8 +6068,8 @@  discard block
 block discarded – undo
6068 6068
 		// phpcs:enable
6069 6069
 		global $langs, $conf;
6070 6070
 
6071
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6072
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6071
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6072
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6073 6073
 			exit;
6074 6074
 		}
6075 6075
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6261,7 +6261,7 @@  discard block
 block discarded – undo
6261 6261
 		$savDisableCompute = $conf->disable_compute;
6262 6262
 		$conf->disable_compute = 1;
6263 6263
 
6264
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6264
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6265 6265
 
6266 6266
 		$conf->disable_compute = $savDisableCompute;
6267 6267
 
@@ -6323,7 +6323,7 @@  discard block
 block discarded – undo
6323 6323
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6324 6324
 			$sql = "SELECT rowid";
6325 6325
 			foreach ($optionsArray as $name => $label) {
6326
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6326
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6327 6327
 					$sql .= ", ".$name;
6328 6328
 				}
6329 6329
 				// use geo sql fonction to read as text
@@ -6378,9 +6378,9 @@  discard block
 block discarded – undo
6378 6378
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6379 6379
 							//var_dump($conf->disable_compute);
6380 6380
 							if (empty($conf->disable_compute)) {
6381
-								global $objectoffield;        // We set a global variable to $objectoffield so
6382
-								$objectoffield = $this;        // we can use it inside computed formula
6383
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6381
+								global $objectoffield; // We set a global variable to $objectoffield so
6382
+								$objectoffield = $this; // we can use it inside computed formula
6383
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6384 6384
 							}
6385 6385
 						}
6386 6386
 					}
@@ -6561,7 +6561,7 @@  discard block
 block discarded – undo
6561 6561
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6562 6562
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6563 6563
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6564
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6564
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6565 6565
 											} else {
6566 6566
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6567 6567
 											}
@@ -6572,7 +6572,7 @@  discard block
 block discarded – undo
6572 6572
 										// If value has changed
6573 6573
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6574 6574
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6575
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6575
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6576 6576
 											} else {
6577 6577
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6578 6578
 											}
@@ -6584,7 +6584,7 @@  discard block
 block discarded – undo
6584 6584
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6585 6585
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6586 6586
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6587
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6587
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6588 6588
 									} else {
6589 6589
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6590 6590
 									}
@@ -7009,7 +7009,7 @@  discard block
 block discarded – undo
7009 7009
 								if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) {	// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
7010 7010
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7011 7011
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7012
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7012
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7013 7013
 										} else {
7014 7014
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7015 7015
 										}
@@ -7029,7 +7029,7 @@  discard block
 block discarded – undo
7029 7029
 								}
7030 7030
 							} else {
7031 7031
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7032
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7032
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7033 7033
 								} else {
7034 7034
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7035 7035
 								}
@@ -7413,7 +7413,7 @@  discard block
 block discarded – undo
7413 7413
 			}
7414 7414
 			$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> ';
7415 7415
 		} elseif ($type == 'select') {	// combo list
7416
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7416
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7417 7417
 			if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
7418 7418
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7419 7419
 				$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
@@ -7445,7 +7445,7 @@  discard block
 block discarded – undo
7445 7445
 			$out .= $tmpselect;
7446 7446
 			$out .= '</select>';
7447 7447
 		} elseif ($type == 'sellist') {
7448
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7448
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7449 7449
 			if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
7450 7450
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7451 7451
 				$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
@@ -7455,7 +7455,7 @@  discard block
 block discarded – undo
7455 7455
 			if (is_array($param['options'])) {
7456 7456
 				$param_list = array_keys($param['options']);
7457 7457
 				$InfoFieldList = explode(":", $param_list[0], 5);
7458
-				if (! empty($InfoFieldList[4])) {
7458
+				if (!empty($InfoFieldList[4])) {
7459 7459
 					$pos = 0;
7460 7460
 					$parenthesisopen = 0;
7461 7461
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7516,8 +7516,8 @@  discard block
 block discarded – undo
7516 7516
 					}
7517 7517
 
7518 7518
 					$sqlwhere = '';
7519
-					$sql = "SELECT " . $keyList;
7520
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7519
+					$sql = "SELECT ".$keyList;
7520
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7521 7521
 					if (!empty($InfoFieldList[4])) {
7522 7522
 						// can use SELECT request
7523 7523
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7534,18 +7534,18 @@  discard block
 block discarded – undo
7534 7534
 						// We have to join on extrafield table
7535 7535
 						$errstr = '';
7536 7536
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7537
-							$sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra";
7538
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2];
7539
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7537
+							$sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra";
7538
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2];
7539
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7540 7540
 						} else {
7541
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7541
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7542 7542
 						}
7543 7543
 					} else {
7544 7544
 						$sqlwhere .= ' WHERE 1=1';
7545 7545
 					}
7546 7546
 					// Some tables may have field, some other not. For the moment we disable it.
7547 7547
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7548
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7548
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7549 7549
 					}
7550 7550
 					$sql .= $sqlwhere;
7551 7551
 					//print $sql;
@@ -7557,7 +7557,7 @@  discard block
 block discarded – undo
7557 7557
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7558 7558
 					}
7559 7559
 
7560
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7560
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7561 7561
 					$resql = $this->db->query($sql);
7562 7562
 					if ($resql) {
7563 7563
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7573,7 +7573,7 @@  discard block
 block discarded – undo
7573 7573
 							if (count($fields_label) > 1) {
7574 7574
 								$notrans = true;
7575 7575
 								foreach ($fields_label as $field_toshow) {
7576
-									$labeltoshow .= $obj->$field_toshow . ' ';
7576
+									$labeltoshow .= $obj->$field_toshow.' ';
7577 7577
 								}
7578 7578
 							} else {
7579 7579
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7584,12 +7584,12 @@  discard block
 block discarded – undo
7584 7584
 								foreach ($fields_label as $field_toshow) {
7585 7585
 									$translabel = $langs->trans($obj->$field_toshow);
7586 7586
 									if ($translabel != $obj->$field_toshow) {
7587
-										$labeltoshow = dol_trunc($translabel) . ' ';
7587
+										$labeltoshow = dol_trunc($translabel).' ';
7588 7588
 									} else {
7589
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7589
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7590 7590
 									}
7591 7591
 								}
7592
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7592
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7593 7593
 							} else {
7594 7594
 								if (!$notrans) {
7595 7595
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7603,34 +7603,34 @@  discard block
 block discarded – undo
7603 7603
 									$labeltoshow = '(not defined)';
7604 7604
 								}
7605 7605
 								if ($value == $obj->rowid) {
7606
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7606
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7607 7607
 								}
7608 7608
 
7609 7609
 								if (!empty($InfoFieldList[3]) && $parentField) {
7610
-									$parent = $parentName . ':' . $obj->{$parentField};
7610
+									$parent = $parentName.':'.$obj->{$parentField};
7611 7611
 									$isDependList = 1;
7612 7612
 								}
7613 7613
 
7614
-								$out .= '<option value="' . $obj->rowid . '"';
7614
+								$out .= '<option value="'.$obj->rowid.'"';
7615 7615
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7616
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7617
-								$out .= '>' . $labeltoshow . '</option>';
7616
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7617
+								$out .= '>'.$labeltoshow.'</option>';
7618 7618
 							}
7619 7619
 
7620 7620
 							$i++;
7621 7621
 						}
7622 7622
 						$this->db->free($resql);
7623 7623
 					} else {
7624
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7624
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7625 7625
 					}
7626 7626
 				} else {
7627 7627
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7628 7628
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7629 7629
 					$out .= '<option value="0">&nbsp;</option>';
7630 7630
 					foreach ($data as $data_key => $data_value) {
7631
-						$out .= '<option value="' . $data_key . '"';
7631
+						$out .= '<option value="'.$data_key.'"';
7632 7632
 						$out .= ($value == $data_key ? ' selected' : '');
7633
-						$out .= '>' . $data_value . '</option>';
7633
+						$out .= '>'.$data_value.'</option>';
7634 7634
 					}
7635 7635
 				}
7636 7636
 			}
@@ -7639,7 +7639,7 @@  discard block
 block discarded – undo
7639 7639
 			$value_arr = explode(',', $value);
7640 7640
 			$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, '', 0, $morecss, 0, '100%');
7641 7641
 		} elseif ($type == 'radio') {
7642
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7642
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7643 7643
 			foreach ($param['options'] as $keyopt => $valopt) {
7644 7644
 				$out .= '<input class="flat '.$morecss.'" type="radio" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '');
7645 7645
 				$out .= ' value="'.$keyopt.'"';
@@ -7695,8 +7695,8 @@  discard block
 block discarded – undo
7695 7695
 					}
7696 7696
 
7697 7697
 					$sqlwhere = '';
7698
-					$sql = "SELECT " . $keyList;
7699
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
7698
+					$sql = "SELECT ".$keyList;
7699
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
7700 7700
 					if (!empty($InfoFieldList[4])) {
7701 7701
 						// can use SELECT request
7702 7702
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7712,23 +7712,23 @@  discard block
 block discarded – undo
7712 7712
 
7713 7713
 						// We have to join on extrafield table
7714 7714
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7715
-							$sql .= ' as main, ' . $this->db->prefix() . $InfoFieldList[0] . '_extrafields as extra';
7716
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4];
7715
+							$sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra';
7716
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
7717 7717
 						} else {
7718
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
7718
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
7719 7719
 						}
7720 7720
 					} else {
7721 7721
 						$sqlwhere .= ' WHERE 1=1';
7722 7722
 					}
7723 7723
 					// Some tables may have field, some other not. For the moment we disable it.
7724 7724
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7725
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7725
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7726 7726
 					}
7727 7727
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
7728 7728
 					// print $sql;
7729 7729
 
7730 7730
 					$sql .= $sqlwhere;
7731
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
7731
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
7732 7732
 					$resql = $this->db->query($sql);
7733 7733
 					if ($resql) {
7734 7734
 						$num = $this->db->num_rows($resql);
@@ -7746,7 +7746,7 @@  discard block
 block discarded – undo
7746 7746
 							if (count($fields_label) > 1) {
7747 7747
 								$notrans = true;
7748 7748
 								foreach ($fields_label as $field_toshow) {
7749
-									$labeltoshow .= $obj->$field_toshow . ' ';
7749
+									$labeltoshow .= $obj->$field_toshow.' ';
7750 7750
 								}
7751 7751
 							} else {
7752 7752
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7757,9 +7757,9 @@  discard block
 block discarded – undo
7757 7757
 								foreach ($fields_label as $field_toshow) {
7758 7758
 									$translabel = $langs->trans($obj->$field_toshow);
7759 7759
 									if ($translabel != $obj->$field_toshow) {
7760
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
7760
+										$labeltoshow = dol_trunc($translabel, 18).' ';
7761 7761
 									} else {
7762
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
7762
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
7763 7763
 									}
7764 7764
 								}
7765 7765
 
@@ -7782,7 +7782,7 @@  discard block
 block discarded – undo
7782 7782
 								}
7783 7783
 
7784 7784
 								if (!empty($InfoFieldList[3]) && $parentField) {
7785
-									$parent = $parentName . ':' . $obj->{$parentField};
7785
+									$parent = $parentName.':'.$obj->{$parentField};
7786 7786
 									$isDependList = 1;
7787 7787
 								}
7788 7788
 
@@ -7793,14 +7793,14 @@  discard block
 block discarded – undo
7793 7793
 						}
7794 7794
 						$this->db->free($resql);
7795 7795
 
7796
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7796
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7797 7797
 					} else {
7798
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7798
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7799 7799
 					}
7800 7800
 				} else {
7801 7801
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7802 7802
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7803
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7803
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
7804 7804
 				}
7805 7805
 			}
7806 7806
 		} elseif ($type == 'link') {
@@ -7858,7 +7858,7 @@  discard block
 block discarded – undo
7858 7858
 			$newval = $val;
7859 7859
 			$newval['type'] = 'varchar(256)';
7860 7860
 
7861
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
7861
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
7862 7862
 			if (!empty($value)) {
7863 7863
 				foreach ($value as $option) {
7864 7864
 					$out .= '<span><a class="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_del" href="javascript:;"><span class="fa fa-minus-circle valignmiddle"></span></a> ';
@@ -8025,7 +8025,7 @@  discard block
 block discarded – undo
8025 8025
 			$value = $this->getLibStatut(3);
8026 8026
 		} elseif ($type == 'date') {
8027 8027
 			if (!empty($value)) {
8028
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8028
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8029 8029
 			} else {
8030 8030
 				$value = '';
8031 8031
 			}
@@ -8070,7 +8070,7 @@  discard block
 block discarded – undo
8070 8070
 			$value = isset($param['options'][$value]) ? $param['options'][$value] : '';
8071 8071
 			if (strpos($value, "|") !== false) {
8072 8072
 				$value = $langs->trans(explode('|', $value)[0]);
8073
-			} elseif (! is_numeric($value)) {
8073
+			} elseif (!is_numeric($value)) {
8074 8074
 				$value = $langs->trans($value);
8075 8075
 			}
8076 8076
 		} elseif ($type == 'sellist') {
@@ -8132,9 +8132,9 @@  discard block
 block discarded – undo
8132 8132
 									$translabel = $langs->trans($obj->$field_toshow);
8133 8133
 								}
8134 8134
 								if ($translabel != $field_toshow) {
8135
-									$value .= dol_trunc($translabel, 18) . ' ';
8135
+									$value .= dol_trunc($translabel, 18).' ';
8136 8136
 								} else {
8137
-									$value .= $obj->$field_toshow . ' ';
8137
+									$value .= $obj->$field_toshow.' ';
8138 8138
 								}
8139 8139
 							}
8140 8140
 						} else {
@@ -8150,7 +8150,7 @@  discard block
 block discarded – undo
8150 8150
 						}
8151 8151
 					}
8152 8152
 				} else {
8153
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8153
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8154 8154
 
8155 8155
 					$toprint = array();
8156 8156
 					$obj = $this->db->fetch_object($resql);
@@ -8158,7 +8158,7 @@  discard block
 block discarded – undo
8158 8158
 					$c->fetch($obj->rowid);
8159 8159
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8160 8160
 					foreach ($ways as $way) {
8161
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8161
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8162 8162
 					}
8163 8163
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8164 8164
 				}
@@ -8174,11 +8174,11 @@  discard block
 block discarded – undo
8174 8174
 				$toprint = array();
8175 8175
 				foreach ($value_arr as $keyval => $valueval) {
8176 8176
 					if (!empty($valueval)) {
8177
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8177
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8178 8178
 					}
8179 8179
 				}
8180 8180
 				if (!empty($toprint)) {
8181
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8181
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8182 8182
 				}
8183 8183
 			}
8184 8184
 		} elseif ($type == 'chkbxlst') {
@@ -8233,9 +8233,9 @@  discard block
 block discarded – undo
8233 8233
 										$translabel = $langs->trans($obj->$field_toshow);
8234 8234
 									}
8235 8235
 									if ($translabel != $field_toshow) {
8236
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8236
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8237 8237
 									} else {
8238
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8238
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8239 8239
 									}
8240 8240
 								}
8241 8241
 							} else {
@@ -8244,15 +8244,15 @@  discard block
 block discarded – undo
8244 8244
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8245 8245
 								}
8246 8246
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8247
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8247
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8248 8248
 								} else {
8249
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8249
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8250 8250
 								}
8251 8251
 							}
8252 8252
 						}
8253 8253
 					}
8254 8254
 				} else {
8255
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8255
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8256 8256
 
8257 8257
 					$toprint = array();
8258 8258
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8261,7 +8261,7 @@  discard block
 block discarded – undo
8261 8261
 							$c->fetch($obj->rowid);
8262 8262
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8263 8263
 							foreach ($ways as $way) {
8264
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8264
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8265 8265
 							}
8266 8266
 						}
8267 8267
 					}
@@ -8414,7 +8414,7 @@  discard block
 block discarded – undo
8414 8414
 		global $langs;
8415 8415
 
8416 8416
 		if (!class_exists('Validate')) {
8417
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8417
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8418 8418
 		}
8419 8419
 
8420 8420
 		$this->clearFieldError($fieldKey);
@@ -8646,7 +8646,7 @@  discard block
 block discarded – undo
8646 8646
 				$out .= "\n";
8647 8647
 
8648 8648
 				$nbofextrafieldsshown = 0;
8649
-				$e = 0;	// var to manage the modulo (odd/even)
8649
+				$e = 0; // var to manage the modulo (odd/even)
8650 8650
 
8651 8651
 				$lastseparatorkeyfound = '';
8652 8652
 				$extrafields_collapse_num = '';
@@ -9164,13 +9164,13 @@  discard block
 block discarded – undo
9164 9164
 		if (!empty($this->photo)) {
9165 9165
 			if (dolIsAllowedForPreview($this->photo)) {
9166 9166
 				if ((string) $imagesize == 'mini') {
9167
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini'));
9167
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini'));
9168 9168
 				} elseif ((string) $imagesize == 'small') {
9169
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small'));
9169
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small'));
9170 9170
 				} else {
9171
-					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo);
9171
+					$file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo);
9172 9172
 				}
9173
-				$originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo);
9173
+				$originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo);
9174 9174
 			}
9175 9175
 		}
9176 9176
 
@@ -9746,7 +9746,7 @@  discard block
 block discarded – undo
9746 9746
 						continue;
9747 9747
 					}
9748 9748
 				}
9749
-				$keys_with_alias[] = $alias . '.' . $fieldname;
9749
+				$keys_with_alias[] = $alias.'.'.$fieldname;
9750 9750
 			}
9751 9751
 			return implode(',', $keys_with_alias);
9752 9752
 		} else {
@@ -9875,7 +9875,7 @@  discard block
 block discarded – undo
9875 9875
 		if (!$error) {
9876 9876
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
9877 9877
 			$sql .= " (".implode(", ", $keys).')';
9878
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
9878
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
9879 9879
 
9880 9880
 			$res = $this->db->query($sql);
9881 9881
 			if (!$res) {
@@ -10169,7 +10169,7 @@  discard block
 block discarded – undo
10169 10169
 
10170 10170
 		// Update extrafield
10171 10171
 		if (!$error) {
10172
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10172
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10173 10173
 			if ($result < 0) {
10174 10174
 				$error++;
10175 10175
 			}
@@ -10370,12 +10370,12 @@  discard block
 block discarded – undo
10370 10370
 				$error++;
10371 10371
 			} else {
10372 10372
 				while ($obj = $this->db->fetch_object($resql)) {
10373
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10373
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10374 10374
 					if ($result < 0) {
10375 10375
 						$error++;
10376 10376
 						$this->errors[] = $this->error;
10377 10377
 					} else {
10378
-						$result = $this->delete($user);	// @phpstan-ignore-line
10378
+						$result = $this->delete($user); // @phpstan-ignore-line
10379 10379
 						if ($result < 0) {
10380 10380
 							$error++;
10381 10381
 							$this->errors[] = $this->error;
@@ -10590,7 +10590,7 @@  discard block
 block discarded – undo
10590 10590
 		);
10591 10591
 		foreach ($fields as $key => $value) {
10592 10592
 			if (array_key_exists($key, $this->fields)) {
10593
-				$this->{$key} = $value;		// @phpstan-ignore-line
10593
+				$this->{$key} = $value; // @phpstan-ignore-line
10594 10594
 			}
10595 10595
 		}
10596 10596
 
Please login to merge, or discard this patch.