Completed
Branch develop (91e53f)
by
unknown
16:19
created
htdocs/core/lib/security.lib.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
 function dolGetRandomBytes($length)
101 101
 {
102 102
 	if (function_exists('random_bytes')) {	// Available with PHP 7 only.
103
-		return bin2hex(random_bytes((int) floor($length / 2)));	// the bin2hex will double the number of bytes so we take length / 2
103
+		return bin2hex(random_bytes((int) floor($length / 2))); // the bin2hex will double the number of bytes so we take length / 2
104 104
 	}
105 105
 
106
-	return bin2hex(openssl_random_pseudo_bytes((int) floor($length / 2)));		// the bin2hex will double the number of bytes so we take length / 2. May be very slow on Windows.
106
+	return bin2hex(openssl_random_pseudo_bytes((int) floor($length / 2))); // the bin2hex will double the number of bytes so we take length / 2. May be very slow on Windows.
107 107
 }
108 108
 
109 109
 /**
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
 	// Salt value
244 244
 	if (getDolGlobalString('MAIN_SECURITY_SALT') && $type != '4' && $type !== 'openldap' && empty($nosalt)) {
245
-		$chain = getDolGlobalString('MAIN_SECURITY_SALT') . $chain;
245
+		$chain = getDolGlobalString('MAIN_SECURITY_SALT').$chain;
246 246
 	}
247 247
 
248 248
 	if ($type == '1' || $type == 'sha1') {
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 function dol_verifyHash($chain, $hash, $type = '0')
283 283
 {
284 284
 	if ($type == '0' && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'password_hash' && function_exists('password_verify')) {
285
-		if (! empty($hash[0]) && $hash[0] == '$') {
285
+		if (!empty($hash[0]) && $hash[0] == '$') {
286 286
 			return password_verify($chain, $hash);
287 287
 		} elseif (dol_strlen($hash) == 32) {
288 288
 			return dol_verifyHash($chain, $hash, '3'); // md5
@@ -312,31 +312,31 @@  discard block
 block discarded – undo
312 312
 	$salt = substr(sha1(time()), 0, 8);
313 313
 
314 314
 	if ($type === 'md5') {
315
-		return '{MD5}' . base64_encode(hash("md5", $password, true)); //For OpenLdap with md5 (based on an unencrypted password in base)
315
+		return '{MD5}'.base64_encode(hash("md5", $password, true)); //For OpenLdap with md5 (based on an unencrypted password in base)
316 316
 	} elseif ($type === 'md5frommd5') {
317
-		return '{MD5}' . base64_encode(hex2bin($password)); // Create OpenLDAP MD5 password from Dolibarr MD5 password
317
+		return '{MD5}'.base64_encode(hex2bin($password)); // Create OpenLDAP MD5 password from Dolibarr MD5 password
318 318
 	} elseif ($type === 'smd5') {
319
-		return "{SMD5}" . base64_encode(hash("md5", $password . $salt, true) . $salt);
319
+		return "{SMD5}".base64_encode(hash("md5", $password.$salt, true).$salt);
320 320
 	} elseif ($type === 'sha') {
321
-		return '{SHA}' . base64_encode(hash("sha1", $password, true));
321
+		return '{SHA}'.base64_encode(hash("sha1", $password, true));
322 322
 	} elseif ($type === 'ssha') {
323
-		return "{SSHA}" . base64_encode(hash("sha1", $password . $salt, true) . $salt);
323
+		return "{SSHA}".base64_encode(hash("sha1", $password.$salt, true).$salt);
324 324
 	} elseif ($type === 'sha256') {
325
-		return "{SHA256}" . base64_encode(hash("sha256", $password, true));
325
+		return "{SHA256}".base64_encode(hash("sha256", $password, true));
326 326
 	} elseif ($type === 'ssha256') {
327
-		return "{SSHA256}" . base64_encode(hash("sha256", $password . $salt, true) . $salt);
327
+		return "{SSHA256}".base64_encode(hash("sha256", $password.$salt, true).$salt);
328 328
 	} elseif ($type === 'sha384') {
329
-		return "{SHA384}" . base64_encode(hash("sha384", $password, true));
329
+		return "{SHA384}".base64_encode(hash("sha384", $password, true));
330 330
 	} elseif ($type === 'ssha384') {
331
-		return "{SSHA384}" . base64_encode(hash("sha384", $password . $salt, true) . $salt);
331
+		return "{SSHA384}".base64_encode(hash("sha384", $password.$salt, true).$salt);
332 332
 	} elseif ($type === 'sha512') {
333
-		return "{SHA512}" . base64_encode(hash("sha512", $password, true));
333
+		return "{SHA512}".base64_encode(hash("sha512", $password, true));
334 334
 	} elseif ($type === 'ssha512') {
335
-		return "{SSHA512}" . base64_encode(hash("sha512", $password . $salt, true) . $salt);
335
+		return "{SSHA512}".base64_encode(hash("sha512", $password.$salt, true).$salt);
336 336
 	} elseif ($type === 'crypt') {
337
-		return '{CRYPT}' . crypt($password, $salt);
337
+		return '{CRYPT}'.crypt($password, $salt);
338 338
 	} elseif ($type === 'clear') {
339
-		return '{CLEAR}' . $password;  // Just for test, plain text password is not secured !
339
+		return '{CLEAR}'.$password; // Just for test, plain text password is not secured !
340 340
 	}
341 341
 	return "";
342 342
 }
@@ -370,13 +370,13 @@  discard block
 block discarded – undo
370 370
 	if (is_object($object)) {
371 371
 		$objectid = $object->id;
372 372
 	} else {
373
-		$objectid = $object;		// $objectid can be X or 'X,Y,Z'
373
+		$objectid = $object; // $objectid can be X or 'X,Y,Z'
374 374
 	}
375 375
 	if ($objectid == "-1") {
376 376
 		$objectid = 0;
377 377
 	}
378 378
 	if ($objectid) {
379
-		$objectid = preg_replace('/[^0-9\.\,]/', '', $objectid);	// For the case value is coming from a non sanitized user input
379
+		$objectid = preg_replace('/[^0-9\.\,]/', '', $objectid); // For the case value is coming from a non sanitized user input
380 380
 	}
381 381
 
382 382
 	//dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
@@ -853,9 +853,9 @@  discard block
 block discarded – undo
853 853
 	if (is_object($object)) {
854 854
 		$objectid = $object->id;
855 855
 	} else {
856
-		$objectid = $object;		// $objectid can be X or 'X,Y,Z'
856
+		$objectid = $object; // $objectid can be X or 'X,Y,Z'
857 857
 	}
858
-	$objectid = preg_replace('/[^0-9\.\,]/', '', $objectid);	// For the case value is coming from a non sanitized user input
858
+	$objectid = preg_replace('/[^0-9\.\,]/', '', $objectid); // For the case value is coming from a non sanitized user input
859 859
 
860 860
 	//dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
861 861
 	//print "user_id=".$user->id.", features=".join(',', $featuresarray).", objectid=".$objectid;
@@ -902,8 +902,8 @@  discard block
 block discarded – undo
902 902
 		$checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
903 903
 		$checkproject = array('projet', 'project'); // Test for project object
904 904
 		$checktask = array('projet_task'); // Test for task object
905
-		$checkhierarchy = array('expensereport', 'holiday');	// check permission among the hierarchy of user
906
-		$checkuser = array('bookmark');	// check permission among the fk_user (must be myself or null)
905
+		$checkhierarchy = array('expensereport', 'holiday'); // check permission among the hierarchy of user
906
+		$checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null)
907 907
 		$nocheck = array('barcode', 'stock'); // No test
908 908
 
909 909
 		//$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...).
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
 
917 917
 		// To avoid an access forbidden with a numeric ref
918 918
 		if ($dbt_select != 'rowid' && $dbt_select != 'id') {
919
-			$objectid = "'".$objectid."'";	// Note: $objectid was already cast into int at begin of this method.
919
+			$objectid = "'".$objectid."'"; // Note: $objectid was already cast into int at begin of this method.
920 920
 		}
921 921
 		// Check permission for objectid on entity only
922 922
 		if (in_array($feature, $check) && $objectid > 0) {		// For $objectid = 0, no check
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1228 added lines, -1228 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
120 120
 			if (!empty($perm)) {
121 121
 				$tmp = explode(':', $typeofdata);
122
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
122
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
123 123
 				if ($fieldrequired) {
124 124
 					$ret .= '<span class="fieldrequired">';
125 125
 				}
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 				if ($fieldrequired) {
132 132
 					$ret .= '</span>';
133 133
 				}
134
-				$ret .= '</div>' . "\n";
134
+				$ret .= '</div>'."\n";
135 135
 			} else {
136 136
 				if ($fieldrequired) {
137 137
 					$ret .= '<span class="fieldrequired">';
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 			if (empty($notabletag) && $perm) {
170 170
 				$ret .= '<td class="right">';
171 171
 			}
172
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
173
-				$ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>';
172
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
173
+				$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>';
174 174
 			}
175 175
 			if (!empty($notabletag) && $notabletag == 1) {
176 176
 				if ($text) {
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 			} elseif ($reg[1] == 'int') {
238 238
 				$typeofdata = 'numeric';
239 239
 			} else {
240
-				return 'ErrorBadParameter ' . $typeofdata;
240
+				return 'ErrorBadParameter '.$typeofdata;
241 241
 			}
242 242
 		}
243 243
 
@@ -248,13 +248,13 @@  discard block
 block discarded – undo
248 248
 			if ($editaction == '') {
249 249
 				$editaction = GETPOST('action', 'aZ09');
250 250
 			}
251
-			$editmode = ($editaction == 'edit' . $htmlname);
251
+			$editmode = ($editaction == 'edit'.$htmlname);
252 252
 			if ($editmode) {	// edit mode
253 253
 				$ret .= "\n";
254
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
255
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
256
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
257
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
254
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
255
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
256
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
257
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
258 258
 				if (empty($notabletag)) {
259 259
 					$ret .= '<table class="nobordernopadding centpercent">';
260 260
 				}
@@ -263,28 +263,28 @@  discard block
 block discarded – undo
263 263
 				}
264 264
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
265 265
 					$tmp = explode(':', $typeofdata);
266
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
266
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
267 267
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
268 268
 					$tmp = explode(':', $typeofdata);
269 269
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
270
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
270
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
271 271
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
272 272
 					$tmp = explode(':', $typeofdata);
273 273
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
274
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
274
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
275 275
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
276 276
 					$tmp = explode(':', $typeofdata);
277
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
277
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
278 278
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
279 279
 					$tmp = explode(':', $typeofdata);
280 280
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
281 281
 					$morealt = '';
282 282
 					if (preg_match('/%/', $cols)) {
283
-						$morealt = ' style="width: ' . $cols . '"';
283
+						$morealt = ' style="width: '.$cols.'"';
284 284
 						$cols = '';
285 285
 					}
286 286
 					$valuetoshow = ($editvalue ? $editvalue : $value);
287
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
287
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
288 288
 					// textarea convert automatically entities chars into simple chars.
289 289
 					// 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.
290 290
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -294,12 +294,12 @@  discard block
 block discarded – undo
294 294
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
295 295
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
296 296
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
297
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
297
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
298 298
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
299 299
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
300 300
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
301 301
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
302
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
302
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
303 303
 				} elseif (preg_match('/^select;/', $typeofdata)) {
304 304
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
305 305
 					$arraylist = array();
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 					// TODO Not yet implemented. See code for extrafields
314 314
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
315 315
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
316
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
316
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
317 317
 					$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]));
318 318
 					$ret .= $doleditor->Create(1);
319 319
 				} elseif ($typeofdata == 'asis') {
@@ -328,19 +328,19 @@  discard block
 block discarded – undo
328 328
 					$ret .= '<td>';
329 329
 				}
330 330
 				//else $ret.='<div class="clearboth"></div>';
331
-				$ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
331
+				$ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
332 332
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
333
-					$ret .= '<br>' . "\n";
333
+					$ret .= '<br>'."\n";
334 334
 				}
335
-				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
335
+				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
336 336
 				if (empty($notabletag)) {
337 337
 					$ret .= '</td>';
338 338
 				}
339 339
 
340 340
 				if (empty($notabletag)) {
341
-					$ret .= '</tr></table>' . "\n";
341
+					$ret .= '</tr></table>'."\n";
342 342
 				}
343
-				$ret .= '</form>' . "\n";
343
+				$ret .= '</form>'."\n";
344 344
 			} else {		// view mode
345 345
 				if (preg_match('/^email/', $typeofdata)) {
346 346
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -352,15 +352,15 @@  discard block
 block discarded – undo
352 352
 					$ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : '');
353 353
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
354 354
 					$tmp = explode(':', $typeofdata);
355
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
355
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
356 356
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
357 357
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
358 358
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
359 359
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
360 360
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
361
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
361
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
362 362
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
363
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
363
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
364 364
 				} elseif (preg_match('/^select;/', $typeofdata)) {
365 365
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
366 366
 					$arraylist = array();
@@ -371,9 +371,9 @@  discard block
 block discarded – undo
371 371
 					$ret .= $arraylist[$value];
372 372
 					if ($htmlname == 'fk_product_type') {
373 373
 						if ($value == 0) {
374
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
374
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
375 375
 						} else {
376
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
376
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
377 377
 						}
378 378
 					}
379 379
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
382 382
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
383 383
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
384
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
384
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
385 385
 					}
386 386
 					// We dont use dol_escape_htmltag to get the html formating active, but this need we must also
387 387
 					// clean data from some dangerous html
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
391 391
 						$ret .= dol_escape_htmltag($value);
392 392
 					} else {
393
-						$ret .= $value;        // $value must be already html escaped.
393
+						$ret .= $value; // $value must be already html escaped.
394 394
 					}
395 395
 				}
396 396
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 
429 429
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
430 430
 			if (!is_object($extralanguages)) {
431
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
431
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
432 432
 				$extralanguages = new ExtraLanguages($this->db);
433 433
 			}
434 434
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -437,17 +437,17 @@  discard block
 block discarded – undo
437 437
 				return ''; // No extralang field to show
438 438
 			}
439 439
 
440
-			$result .= '<!-- Widget for translation -->' . "\n";
441
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
440
+			$result .= '<!-- Widget for translation -->'."\n";
441
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
442 442
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
443 443
 			$result .= $s;
444 444
 			$result .= '</div>';
445 445
 
446
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
446
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
447 447
 
448 448
 			$resultforextrlang = '';
449 449
 			foreach ($arrayoflangcode as $langcode) {
450
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
450
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
451 451
 				if (empty($valuetoshow)) {
452 452
 					$object->fetchValuesForExtraLanguages();
453 453
 					//var_dump($object->array_languages);
@@ -459,17 +459,17 @@  discard block
 block discarded – undo
459 459
 
460 460
 				// TODO Use the showInputField() method of ExtraLanguages object
461 461
 				if ($typeofdata == 'textarea') {
462
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
462
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
463 463
 					$resultforextrlang .= $valuetoshow;
464 464
 					$resultforextrlang .= '</textarea>';
465 465
 				} else {
466
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
466
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
467 467
 				}
468 468
 			}
469 469
 			$result .= $resultforextrlang;
470 470
 
471 471
 			$result .= '</div>';
472
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
472
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
473 473
 		}
474 474
 
475 475
 		return $result;
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 				if (!empty($tmp[2])) {
535 535
 					$savemethod = $tmp[2];
536 536
 				}
537
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
537
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
538 538
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
539 539
 				$tmp = explode(':', $inputType);
540 540
 				$inputType = $tmp[0];
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 					$savemethod = $tmp[2];
546 546
 				}
547 547
 
548
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
548
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
549 549
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
550 550
 				$tmp = explode(':', $inputType);
551 551
 				$inputType = $tmp[0];
@@ -576,40 +576,40 @@  discard block
 block discarded – undo
576 576
 				}
577 577
 
578 578
 				if (isModEnabled('fckeditor')) {
579
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
579
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
580 580
 				} else {
581 581
 					$inputType = 'textarea';
582 582
 				}
583 583
 			}
584 584
 
585
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
586
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
587
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
588
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
585
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
586
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
587
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
588
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
589 589
 			if (!empty($savemethod)) {
590
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
590
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
591 591
 			}
592 592
 			if (!empty($ext_element)) {
593
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
593
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
594 594
 			}
595 595
 			if (!empty($custommsg)) {
596 596
 				if (is_array($custommsg)) {
597 597
 					if (!empty($custommsg['success'])) {
598
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
598
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
599 599
 					}
600 600
 					if (!empty($custommsg['error'])) {
601
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
601
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
602 602
 					}
603 603
 				} else {
604
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
604
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
605 605
 				}
606 606
 			}
607 607
 			if ($inputType == 'textarea') {
608
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
609
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
608
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
609
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
610 610
 			}
611
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
612
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
611
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
612
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
613 613
 		} else {
614 614
 			$out = $value;
615 615
 		}
@@ -638,12 +638,12 @@  discard block
 block discarded – undo
638 638
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
639 639
 	{
640 640
 		if ($incbefore) {
641
-			$text = $incbefore . $text;
641
+			$text = $incbefore.$text;
642 642
 		}
643 643
 		if (!$htmltext) {
644 644
 			return $text;
645 645
 		}
646
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
646
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
647 647
 
648 648
 		$tag = 'td';
649 649
 		if ($notabs == 2) {
@@ -657,11 +657,11 @@  discard block
 block discarded – undo
657 657
 
658 658
 		$extrastyle = '';
659 659
 		if ($direction < 0) {
660
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
660
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
661 661
 			$extrastyle = 'padding: 0px; padding-left: 3px;';
662 662
 		}
663 663
 		if ($direction > 0) {
664
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
664
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
665 665
 			$extrastyle = 'padding: 0px; padding-right: 3px;';
666 666
 		}
667 667
 
@@ -674,53 +674,53 @@  discard block
 block discarded – undo
674 674
 			$htmltext = str_replace('"', '&quot;', $htmltext);
675 675
 		} else {
676 676
 			$classfortooltip = 'classfortooltiponclick';
677
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
677
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
678 678
 		}
679 679
 		if ($tooltipon == 2 || $tooltipon == 3) {
680
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
680
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
681 681
 			if ($tooltiptrigger == '') {
682
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on img tag to store tooltip
682
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on img tag to store tooltip
683 683
 			} else {
684
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
684
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
685 685
 			}
686 686
 		} else {
687
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag
687
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag
688 688
 		}
689 689
 		if ($tooltipon == 1 || $tooltipon == 3) {
690
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
690
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
691 691
 			if ($tooltiptrigger == '') {
692
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribut to put on td tag to store tooltip
692
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on td tag to store tooltip
693 693
 			} else {
694
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
694
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
695 695
 			}
696 696
 		} else {
697
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribut to put on td text tag
697
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag
698 698
 		}
699 699
 		if (empty($notabs)) {
700 700
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
701 701
 		} elseif ($notabs == 2) {
702
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
702
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
703 703
 		}
704 704
 		// Define value if value is before
705 705
 		if ($direction < 0) {
706
-			$s .= '<' . $tag . $paramfortooltipimg;
706
+			$s .= '<'.$tag.$paramfortooltipimg;
707 707
 			if ($tag == 'td') {
708 708
 				$s .= ' class="valigntop" width="14"';
709 709
 			}
710
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
710
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
711 711
 		}
712 712
 		// Use another method to help avoid having a space in value in order to use this value with jquery
713 713
 		// Define label
714 714
 		if ((string) $text != '') {
715
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
715
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
716 716
 		}
717 717
 		// Define value if value is after
718 718
 		if ($direction > 0) {
719
-			$s .= '<' . $tag . $paramfortooltipimg;
719
+			$s .= '<'.$tag.$paramfortooltipimg;
720 720
 			if ($tag == 'td') {
721 721
 				$s .= ' class="valignmiddle" width="14"';
722 722
 			}
723
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
723
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
724 724
 		}
725 725
 		if (empty($notabs)) {
726 726
 			$s .= '</tr></table>';
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 
826 826
 		$disabled = 0;
827 827
 		$ret = '<div class="centpercent center">';
828
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
828
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
829 829
 
830 830
 		// 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.
831 831
 		$parameters = array();
@@ -835,9 +835,9 @@  discard block
 block discarded – undo
835 835
 			return;
836 836
 		}
837 837
 		if (empty($reshook)) {
838
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
838
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
839 839
 			foreach ($arrayofaction as $code => $label) {
840
-				$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
840
+				$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
841 841
 			}
842 842
 		}
843 843
 		$ret .= $hookmanager->resPrint;
@@ -845,17 +845,17 @@  discard block
 block discarded – undo
845 845
 		$ret .= '</select>';
846 846
 
847 847
 		if (empty($conf->dol_optimize_smallscreen)) {
848
-			$ret .= ajax_combobox('.' . $name . 'select');
848
+			$ret .= ajax_combobox('.'.$name.'select');
849 849
 		}
850 850
 
851 851
 		// 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
852 852
 		$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.
853
-		$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")) . '">';
853
+		$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")).'">';
854 854
 		$ret .= '</div>';
855 855
 
856 856
 		if (!empty($conf->use_javascript_ajax)) {
857 857
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
858
-    		<script nonce="' . getNonce() . '">
858
+    		<script nonce="' . getNonce().'">
859 859
                         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 */
860 860
         		{
861 861
         			atleastoneselected=0;
@@ -866,11 +866,11 @@  discard block
 block discarded – undo
866 866
 
867 867
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
868 868
 
869
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
869
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
870 870
     	  			{
871 871
                                     jQuery("."+name).show();
872
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
873
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
872
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
873
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
874 874
     	  			}
875 875
     	  			else
876 876
     	  			{
@@ -880,11 +880,11 @@  discard block
 block discarded – undo
880 880
         		}
881 881
 
882 882
         	jQuery(document).ready(function () {
883
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
884
-                    jQuery(".' . $cssclass . '").click(function() {
885
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
883
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
884
+                    jQuery(".' . $cssclass.'").click(function() {
885
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
886 886
                     });
887
-                        jQuery(".' . $name . 'select").change(function() {
887
+                        jQuery(".' . $name.'select").change(function() {
888 888
         			var massaction = $( this ).val();
889 889
         			var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
890 890
         			if (massaction == "builddoc")
@@ -892,18 +892,18 @@  discard block
 block discarded – undo
892 892
                         urlform = urlform + "#show_files";
893 893
     	            }
894 894
         			$( this ).closest("form").attr("action", urlform);
895
-                    console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
895
+                    console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
896 896
         	        /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
897 897
         			if ($(this).val() != \'0\')
898 898
     	  			{
899
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
900
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
901
-                                        jQuery(".' . $name . '"+massaction).show();
899
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
900
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
901
+                                        jQuery(".' . $name.'"+massaction).show();
902 902
     	  			}
903 903
     	  			else
904 904
     	  			{
905
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
906
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
905
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
906
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
907 907
     	  			}
908 908
     	        });
909 909
         	});
@@ -946,14 +946,14 @@  discard block
 block discarded – undo
946 946
 		$atleastonefavorite = 0;
947 947
 
948 948
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
949
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
949
+		$sql .= " FROM ".$this->db->prefix()."c_country";
950 950
 		$sql .= " WHERE active > 0";
951 951
 		//$sql.= " ORDER BY code ASC";
952 952
 
953
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
953
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
954 954
 		$resql = $this->db->query($sql);
955 955
 		if ($resql) {
956
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
956
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
957 957
 			$num = $this->db->num_rows($resql);
958 958
 			$i = 0;
959 959
 			if ($num) {
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
 					$countryArray[$i]['rowid'] = $obj->rowid;
964 964
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
965 965
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
966
-					$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 : ''));
966
+					$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 : ''));
967 967
 					$countryArray[$i]['favorite'] = $obj->favorite;
968 968
 					$countryArray[$i]['eec'] = $obj->eec;
969 969
 					$favorite[$i] = $obj->favorite;
@@ -981,20 +981,20 @@  discard block
 block discarded – undo
981 981
 
982 982
 				if ($showempty) {
983 983
 					if (is_numeric($showempty)) {
984
-						$out .= '<option value="">&nbsp;</option>' . "\n";
984
+						$out .= '<option value="">&nbsp;</option>'."\n";
985 985
 					} else {
986
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
986
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
987 987
 					}
988 988
 				}
989 989
 
990 990
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
991 991
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
992
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
993
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
992
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
993
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
994 994
 					if ($mysoc->isInEEC()) {
995
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
995
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
996 996
 					}
997
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
997
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
998 998
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
999 999
 				}
1000 1000
 
@@ -1022,20 +1022,20 @@  discard block
 block discarded – undo
1022 1022
 						$labeltoshow .= '&nbsp;';
1023 1023
 					}
1024 1024
 					if ($row['code_iso']) {
1025
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1025
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1026 1026
 						if (empty($hideflags)) {
1027 1027
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1028
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1028
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1029 1029
 						}
1030 1030
 					}
1031 1031
 
1032 1032
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1033
-						$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']) . '">';
1033
+						$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']).'">';
1034 1034
 					} else {
1035
-						$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']) . '">';
1035
+						$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']).'">';
1036 1036
 					}
1037 1037
 					$out .= $labeltoshow;
1038
-					$out .= '</option>' . "\n";
1038
+					$out .= '</option>'."\n";
1039 1039
 				}
1040 1040
 			}
1041 1041
 			$out .= '</select>';
@@ -1044,8 +1044,8 @@  discard block
 block discarded – undo
1044 1044
 		}
1045 1045
 
1046 1046
 		// Make select dynamic
1047
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1048
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1047
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1048
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1049 1049
 
1050 1050
 		return $out;
1051 1051
 	}
@@ -1077,25 +1077,25 @@  discard block
 block discarded – undo
1077 1077
 		$incotermArray = array();
1078 1078
 
1079 1079
 		$sql = "SELECT rowid, code";
1080
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1080
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1081 1081
 		$sql .= " WHERE active > 0";
1082 1082
 		$sql .= " ORDER BY code ASC";
1083 1083
 
1084
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1084
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1085 1085
 		$resql = $this->db->query($sql);
1086 1086
 		if ($resql) {
1087 1087
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1088
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1088
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1089 1089
 				$out .= ajax_combobox($htmlname, $events);
1090 1090
 			}
1091 1091
 
1092 1092
 			if (!empty($page)) {
1093
-				$out .= '<form method="post" action="' . $page . '">';
1093
+				$out .= '<form method="post" action="'.$page.'">';
1094 1094
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1095
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1095
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1096 1096
 			}
1097 1097
 
1098
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1098
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1099 1099
 			$out .= '<option value="0">&nbsp;</option>';
1100 1100
 			$num = $this->db->num_rows($resql);
1101 1101
 			$i = 0;
@@ -1109,9 +1109,9 @@  discard block
 block discarded – undo
1109 1109
 
1110 1110
 				foreach ($incotermArray as $row) {
1111 1111
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1112
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1112
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1113 1113
 					} else {
1114
-						$out .= '<option value="' . $row['rowid'] . '">';
1114
+						$out .= '<option value="'.$row['rowid'].'">';
1115 1115
 					}
1116 1116
 
1117 1117
 					if ($row['code']) {
@@ -1124,13 +1124,13 @@  discard block
 block discarded – undo
1124 1124
 			$out .= '</select>';
1125 1125
 
1126 1126
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1127
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1127
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1128 1128
 				$moreattrib .= ' autocomplete="off"';
1129 1129
 			}
1130
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1130
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1131 1131
 
1132 1132
 			if (!empty($page)) {
1133
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1133
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1134 1134
 			}
1135 1135
 		} else {
1136 1136
 			dol_print_error($this->db);
@@ -1161,9 +1161,9 @@  discard block
 block discarded – undo
1161 1161
 		if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
1162 1162
 			|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
1163 1163
 			if (empty($hidetext)) {
1164
-				print $langs->trans("Type") . ': ';
1164
+				print $langs->trans("Type").': ';
1165 1165
 			}
1166
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1166
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1167 1167
 			if ($showempty) {
1168 1168
 				print '<option value="-1"';
1169 1169
 				if ($selected == -1) {
@@ -1176,28 +1176,28 @@  discard block
 block discarded – undo
1176 1176
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1177 1177
 				print ' selected';
1178 1178
 			}
1179
-			print '>' . $langs->trans("Product");
1179
+			print '>'.$langs->trans("Product");
1180 1180
 
1181 1181
 			print '<option value="1"';
1182 1182
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1183 1183
 				print ' selected';
1184 1184
 			}
1185
-			print '>' . $langs->trans("Service");
1185
+			print '>'.$langs->trans("Service");
1186 1186
 
1187 1187
 			print '</select>';
1188
-			print ajax_combobox('select_' . $htmlname);
1188
+			print ajax_combobox('select_'.$htmlname);
1189 1189
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1190 1190
 		}
1191 1191
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1192 1192
 			print $langs->trans("Service");
1193
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1193
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1194 1194
 		}
1195 1195
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1196 1196
 			print $langs->trans("Product");
1197
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1197
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1198 1198
 		}
1199 1199
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1200
-			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
1200
+			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
1201 1201
 		}
1202 1202
 	}
1203 1203
 
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 		$langs->load("trips");
1224 1224
 
1225 1225
 		$sql = "SELECT c.code, c.label";
1226
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1226
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1227 1227
 		$sql .= " WHERE active > 0";
1228 1228
 
1229 1229
 		$resql = $this->db->query($sql);
@@ -1264,11 +1264,11 @@  discard block
 block discarded – undo
1264 1264
 		// phpcs:enable
1265 1265
 		global $user, $langs;
1266 1266
 
1267
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1267
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1268 1268
 
1269 1269
 		$this->load_cache_types_fees();
1270 1270
 
1271
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1271
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1272 1272
 		if ($showempty) {
1273 1273
 			print '<option value="-1"';
1274 1274
 			if ($selected == -1) {
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
 		}
1279 1279
 
1280 1280
 		foreach ($this->cache_types_fees as $key => $value) {
1281
-			print '<option value="' . $key . '"';
1281
+			print '<option value="'.$key.'"';
1282 1282
 			if ($key == $selected) {
1283 1283
 				print ' selected';
1284 1284
 			}
@@ -1329,12 +1329,12 @@  discard block
 block discarded – undo
1329 1329
 				$ajaxoptions = array();
1330 1330
 			}
1331 1331
 
1332
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1332
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1333 1333
 
1334 1334
 			// No immediate load of all database
1335 1335
 			$placeholder = '';
1336 1336
 			if ($selected && empty($selected_input_value)) {
1337
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1337
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1338 1338
 				$societetmp = new Societe($this->db);
1339 1339
 				$societetmp->fetch($selected);
1340 1340
 				$selected_input_value = $societetmp->name;
@@ -1342,25 +1342,25 @@  discard block
 block discarded – undo
1342 1342
 			}
1343 1343
 
1344 1344
 			// mode 1
1345
-			$urloption = 'htmlname=' . urlencode(str_replace('.', '_', $htmlname)) . '&outjson=1&filter=' . urlencode($filter) . (empty($excludeids) ? '' : '&excludeids=' . join(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode($showtype) : '') . ($showcode ? '&showcode=' . urlencode($showcode) : '');
1345
+			$urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '').($showcode ? '&showcode='.urlencode($showcode) : '');
1346 1346
 
1347 1347
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1348 1348
 			if (empty($hidelabel)) {
1349
-				print $langs->trans("RefOrLabel") . ' : ';
1349
+				print $langs->trans("RefOrLabel").' : ';
1350 1350
 			} elseif ($hidelabel > 1) {
1351 1351
 				$placeholder = $langs->trans("RefOrLabel");
1352 1352
 				if ($hidelabel == 2) {
1353 1353
 					$out .= img_picto($langs->trans("Search"), 'search');
1354 1354
 				}
1355 1355
 			}
1356
-			$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' : '') . ' />';
1356
+			$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' : '').' />';
1357 1357
 			if ($hidelabel == 3) {
1358 1358
 				$out .= img_picto($langs->trans("Search"), 'search');
1359 1359
 			}
1360 1360
 
1361 1361
 			$out .= ajax_event($htmlname, $events);
1362 1362
 
1363
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1363
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1364 1364
 		} else {
1365 1365
 			// Immediate load of all database
1366 1366
 			$out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode);
@@ -1444,30 +1444,30 @@  discard block
 block discarded – undo
1444 1444
 			$sql .= ", s.address, s.zip, s.town";
1445 1445
 			$sql .= ", dictp.code as country_code";
1446 1446
 		}
1447
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1447
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1448 1448
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1449
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1449
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1450 1450
 		}
1451 1451
 		if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
1452
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1452
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1453 1453
 		}
1454
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1454
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1455 1455
 		if (!empty($user->socid)) {
1456
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1456
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1457 1457
 		}
1458 1458
 		if ($filter) {
1459 1459
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1460 1460
 			// if not, by testSqlAndScriptInject() only.
1461
-			$sql .= " AND (" . $filter . ")";
1461
+			$sql .= " AND (".$filter.")";
1462 1462
 		}
1463 1463
 		if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
1464
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1464
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1465 1465
 		}
1466 1466
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1467 1467
 			$sql .= " AND s.status <> 0";
1468 1468
 		}
1469 1469
 		if (!empty($excludeids)) {
1470
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(join(',', $excludeids)) . ")";
1470
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")";
1471 1471
 		}
1472 1472
 		// Add where from hooks
1473 1473
 		$parameters = array();
@@ -1487,17 +1487,17 @@  discard block
 block discarded – undo
1487 1487
 				if ($i > 0) {
1488 1488
 					$sql .= " AND ";
1489 1489
 				}
1490
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1490
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1491 1491
 				$i++;
1492 1492
 			}
1493 1493
 			if (count($scrit) > 1) {
1494 1494
 				$sql .= ")";
1495 1495
 			}
1496 1496
 			if (isModEnabled('barcode')) {
1497
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1497
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1498 1498
 			}
1499
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1500
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1499
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1500
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1501 1501
 			$sql .= ")";
1502 1502
 		}
1503 1503
 		$sql .= $this->db->order("nom", "ASC");
@@ -1508,12 +1508,12 @@  discard block
 block discarded – undo
1508 1508
 		$resql = $this->db->query($sql);
1509 1509
 		if ($resql) {
1510 1510
 			if (!$forcecombo) {
1511
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1511
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1512 1512
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT"));
1513 1513
 			}
1514 1514
 
1515 1515
 			// Construct $out and $outarray
1516
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1516
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1517 1517
 
1518 1518
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1519 1519
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1526,7 +1526,7 @@  discard block
 block discarded – undo
1526 1526
 				}
1527 1527
 			}
1528 1528
 			if ($showempty) {
1529
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1529
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1530 1530
 			}
1531 1531
 
1532 1532
 			$companytemp = new Societe($this->db);
@@ -1539,18 +1539,18 @@  discard block
 block discarded – undo
1539 1539
 					$label = '';
1540 1540
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1541 1541
 						if (($obj->client) && (!empty($obj->code_client))) {
1542
-							$label = $obj->code_client . ' - ';
1542
+							$label = $obj->code_client.' - ';
1543 1543
 						}
1544 1544
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1545
-							$label .= $obj->code_fournisseur . ' - ';
1545
+							$label .= $obj->code_fournisseur.' - ';
1546 1546
 						}
1547
-						$label .= ' ' . $obj->name;
1547
+						$label .= ' '.$obj->name;
1548 1548
 					} else {
1549 1549
 						$label = $obj->name;
1550 1550
 					}
1551 1551
 
1552 1552
 					if (!empty($obj->name_alias)) {
1553
-						$label .= ' (' . $obj->name_alias . ')';
1553
+						$label .= ' ('.$obj->name_alias.')';
1554 1554
 					}
1555 1555
 
1556 1556
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1565,7 +1565,7 @@  discard block
 block discarded – undo
1565 1565
 						$companytemp->fournisseur = $obj->fournisseur;
1566 1566
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1567 1567
 						if ($tmptype) {
1568
-							$labelhtml .= ' ' . $tmptype;
1568
+							$labelhtml .= ' '.$tmptype;
1569 1569
 						}
1570 1570
 
1571 1571
 						if ($obj->client || $obj->fournisseur) {
@@ -1575,10 +1575,10 @@  discard block
 block discarded – undo
1575 1575
 							$label .= $langs->trans("Customer");
1576 1576
 						}
1577 1577
 						if ($obj->client == 2 || $obj->client == 3) {
1578
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1578
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1579 1579
 						}
1580 1580
 						if ($obj->fournisseur) {
1581
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1581
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1582 1582
 						}
1583 1583
 						if ($obj->client || $obj->fournisseur) {
1584 1584
 							$label .= ')';
@@ -1586,9 +1586,9 @@  discard block
 block discarded – undo
1586 1586
 					}
1587 1587
 
1588 1588
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1589
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1589
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1590 1590
 						if (!empty($obj->country_code)) {
1591
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1591
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1592 1592
 						}
1593 1593
 						$label .= $s;
1594 1594
 						$labelhtml .= $s;
@@ -1596,9 +1596,9 @@  discard block
 block discarded – undo
1596 1596
 
1597 1597
 					if (empty($outputmode)) {
1598 1598
 						if (in_array($obj->rowid, $selected)) {
1599
-							$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>';
1599
+							$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>';
1600 1600
 						} else {
1601
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1601
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1602 1602
 						}
1603 1603
 					} else {
1604 1604
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1610,7 +1610,7 @@  discard block
 block discarded – undo
1610 1610
 					}
1611 1611
 				}
1612 1612
 			}
1613
-			$out .= '</select>' . "\n";
1613
+			$out .= '</select>'."\n";
1614 1614
 		} else {
1615 1615
 			dol_print_error($this->db);
1616 1616
 		}
@@ -1644,18 +1644,18 @@  discard block
 block discarded – undo
1644 1644
 		// On recherche les remises
1645 1645
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
1646 1646
 		$sql .= " re.description, re.fk_facture_source";
1647
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
1648
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
1649
-		$sql .= " AND re.entity = " . $conf->entity;
1647
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
1648
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
1649
+		$sql .= " AND re.entity = ".$conf->entity;
1650 1650
 		if ($filter) {
1651
-			$sql .= " AND " . $filter;
1651
+			$sql .= " AND ".$filter;
1652 1652
 		}
1653 1653
 		$sql .= " ORDER BY re.description ASC";
1654 1654
 
1655
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
1655
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
1656 1656
 		$resql = $this->db->query($sql);
1657 1657
 		if ($resql) {
1658
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
1658
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
1659 1659
 			$num = $this->db->num_rows($resql);
1660 1660
 
1661 1661
 			$qualifiedlines = $num;
@@ -1693,16 +1693,16 @@  discard block
 block discarded – undo
1693 1693
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
1694 1694
 						$tmpfac = new Facture($this->db);
1695 1695
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
1696
-							$desc = $desc . ' - ' . $tmpfac->ref;
1696
+							$desc = $desc.' - '.$tmpfac->ref;
1697 1697
 						}
1698 1698
 					}
1699 1699
 
1700
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
1700
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
1701 1701
 					$i++;
1702 1702
 				}
1703 1703
 			}
1704 1704
 			print '</select>';
1705
-			print ajax_combobox('select_' . $htmlname);
1705
+			print ajax_combobox('select_'.$htmlname);
1706 1706
 
1707 1707
 			return $qualifiedlines;
1708 1708
 		} else {
@@ -1783,7 +1783,7 @@  discard block
 block discarded – undo
1783 1783
 		$out = '';
1784 1784
 
1785 1785
 		if (!is_object($hookmanager)) {
1786
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1786
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1787 1787
 			$hookmanager = new HookManager($this->db);
1788 1788
 		}
1789 1789
 
@@ -1792,13 +1792,13 @@  discard block
 block discarded – undo
1792 1792
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1793 1793
 			$sql .= ", s.nom as company, s.town AS company_town";
1794 1794
 		}
1795
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1795
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1796 1796
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1797
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1797
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1798 1798
 		}
1799
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1799
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1800 1800
 		if ($socid > 0 || $socid == -1) {
1801
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1801
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1802 1802
 		}
1803 1803
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1804 1804
 			$sql .= " AND sp.statut <> 0";
@@ -1809,30 +1809,30 @@  discard block
 block discarded – undo
1809 1809
 		$sql .= $hookmanager->resPrint;
1810 1810
 		$sql .= " ORDER BY sp.lastname ASC";
1811 1811
 
1812
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1812
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1813 1813
 		$resql = $this->db->query($sql);
1814 1814
 		if ($resql) {
1815 1815
 			$num = $this->db->num_rows($resql);
1816 1816
 
1817 1817
 			if ($htmlname != 'none' && !$options_only) {
1818
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1818
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1819 1819
 			}
1820 1820
 
1821 1821
 			if ($showempty && !is_numeric($showempty)) {
1822 1822
 				$textforempty = $showempty;
1823
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1823
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1824 1824
 			} else {
1825 1825
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1826
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1826
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1827 1827
 				}
1828 1828
 				if ($showempty == 2) {
1829
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1829
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1830 1830
 				}
1831 1831
 			}
1832 1832
 
1833 1833
 			$i = 0;
1834 1834
 			if ($num) {
1835
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1835
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1836 1836
 				$contactstatic = new Contact($this->db);
1837 1837
 
1838 1838
 				while ($i < $num) {
@@ -1868,7 +1868,7 @@  discard block
 block discarded – undo
1868 1868
 						}
1869 1869
 						$extendedInfos = implode(' - ', $extendedInfos);
1870 1870
 						if (!empty($extendedInfos)) {
1871
-							$extendedInfos = ' - ' . $extendedInfos;
1871
+							$extendedInfos = ' - '.$extendedInfos;
1872 1872
 						}
1873 1873
 					}
1874 1874
 
@@ -1885,42 +1885,42 @@  discard block
 block discarded – undo
1885 1885
 								$disabled = 1;
1886 1886
 							}
1887 1887
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1888
-								$out .= '<option value="' . $obj->rowid . '"';
1888
+								$out .= '<option value="'.$obj->rowid.'"';
1889 1889
 								if ($disabled) {
1890 1890
 									$out .= ' disabled';
1891 1891
 								}
1892 1892
 								$out .= ' selected>';
1893
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1893
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1894 1894
 								if ($showfunction && $obj->poste) {
1895
-									$out .= ' (' . $obj->poste . ')';
1895
+									$out .= ' ('.$obj->poste.')';
1896 1896
 								}
1897 1897
 								if (($showsoc > 0) && $obj->company) {
1898
-									$out .= ' - (' . $obj->company . ')';
1898
+									$out .= ' - ('.$obj->company.')';
1899 1899
 								}
1900 1900
 								$out .= '</option>';
1901 1901
 							} else {
1902
-								$out .= '<option value="' . $obj->rowid . '"';
1902
+								$out .= '<option value="'.$obj->rowid.'"';
1903 1903
 								if ($disabled) {
1904 1904
 									$out .= ' disabled';
1905 1905
 								}
1906 1906
 								$out .= '>';
1907
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1907
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1908 1908
 								if ($showfunction && $obj->poste) {
1909
-									$out .= ' (' . $obj->poste . ')';
1909
+									$out .= ' ('.$obj->poste.')';
1910 1910
 								}
1911 1911
 								if (($showsoc > 0) && $obj->company) {
1912
-									$out .= ' - (' . $obj->company . ')';
1912
+									$out .= ' - ('.$obj->company.')';
1913 1913
 								}
1914 1914
 								$out .= '</option>';
1915 1915
 							}
1916 1916
 						} else {
1917 1917
 							if (in_array($obj->rowid, $selected)) {
1918
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1918
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1919 1919
 								if ($showfunction && $obj->poste) {
1920
-									$out .= ' (' . $obj->poste . ')';
1920
+									$out .= ' ('.$obj->poste.')';
1921 1921
 								}
1922 1922
 								if (($showsoc > 0) && $obj->company) {
1923
-									$out .= ' - (' . $obj->company . ')';
1923
+									$out .= ' - ('.$obj->company.')';
1924 1924
 								}
1925 1925
 							}
1926 1926
 						}
@@ -1929,7 +1929,7 @@  discard block
 block discarded – undo
1929 1929
 				}
1930 1930
 			} else {
1931 1931
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1932
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1932
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1933 1933
 				$out .= $labeltoshow;
1934 1934
 				$out .= '</option>';
1935 1935
 			}
@@ -1950,7 +1950,7 @@  discard block
 block discarded – undo
1950 1950
 			}
1951 1951
 
1952 1952
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1953
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1953
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1954 1954
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
1955 1955
 			}
1956 1956
 
@@ -2055,11 +2055,11 @@  discard block
 block discarded – undo
2055 2055
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2056 2056
 			$sql .= ", e.label";
2057 2057
 		}
2058
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2058
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2059 2059
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2060
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2060
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2061 2061
 			if (!empty($force_entity)) {
2062
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2062
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2063 2063
 			} else {
2064 2064
 				$sql .= " WHERE u.entity IS NOT NULL";
2065 2065
 			}
@@ -2067,23 +2067,23 @@  discard block
 block discarded – undo
2067 2067
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2068 2068
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2069 2069
 			} else {
2070
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2070
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2071 2071
 			}
2072 2072
 		}
2073 2073
 		if (!empty($user->socid)) {
2074
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2074
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2075 2075
 		}
2076 2076
 		if (is_array($exclude) && $excludeUsers) {
2077
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2077
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2078 2078
 		}
2079 2079
 		if ($includeUsers) {
2080
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2080
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2081 2081
 		}
2082 2082
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2083 2083
 			$sql .= " AND u.statut <> 0";
2084 2084
 		}
2085 2085
 		if (!empty($morefilter)) {
2086
-			$sql .= " " . $morefilter;
2086
+			$sql .= " ".$morefilter;
2087 2087
 		}
2088 2088
 
2089 2089
 		//Add hook to filter on user (for exemple on usergroup define in custom modules)
@@ -2098,7 +2098,7 @@  discard block
 block discarded – undo
2098 2098
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2099 2099
 		}
2100 2100
 
2101
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2101
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2102 2102
 
2103 2103
 		$resql = $this->db->query($sql);
2104 2104
 		if ($resql) {
@@ -2106,7 +2106,7 @@  discard block
 block discarded – undo
2106 2106
 			$i = 0;
2107 2107
 			if ($num) {
2108 2108
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2109
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2109
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2110 2110
 				if ($show_empty && !$multiple) {
2111 2111
 					$textforempty = ' ';
2112 2112
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2115,10 +2115,10 @@  discard block
 block discarded – undo
2115 2115
 					if (!is_numeric($show_empty)) {
2116 2116
 						$textforempty = $show_empty;
2117 2117
 					}
2118
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2118
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2119 2119
 				}
2120 2120
 				if ($show_every) {
2121
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2121
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2122 2122
 				}
2123 2123
 
2124 2124
 				$userstatic = new User($this->db);
@@ -2165,22 +2165,22 @@  discard block
 block discarded – undo
2165 2165
 					}
2166 2166
 					if ($showstatus >= 0) {
2167 2167
 						if ($obj->status == 1 && $showstatus == 1) {
2168
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2169
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2168
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2169
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2170 2170
 						}
2171 2171
 						if ($obj->status == 0 && $showstatus == 1) {
2172
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2173
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2172
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2173
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2174 2174
 						}
2175 2175
 					}
2176 2176
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity)) {
2177 2177
 						if (empty($obj->entity)) {
2178
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2179
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2178
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2179
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2180 2180
 						} else {
2181 2181
 							if ($obj->entity != $conf->entity) {
2182
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2183
-								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2182
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2183
+								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2184 2184
 							}
2185 2185
 						}
2186 2186
 					}
@@ -2188,13 +2188,13 @@  discard block
 block discarded – undo
2188 2188
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2189 2189
 					if (!empty($disableline) && $disableline != '1') {
2190 2190
 						// Add text from $enableonlytext parameter
2191
-						$moreinfo .= ' - ' . $disableline;
2192
-						$moreinfohtml .= ' - ' . $disableline;
2191
+						$moreinfo .= ' - '.$disableline;
2192
+						$moreinfohtml .= ' - '.$disableline;
2193 2193
 					}
2194 2194
 					$labeltoshow .= $moreinfo;
2195 2195
 					$labeltoshowhtml .= $moreinfohtml;
2196 2196
 
2197
-					$out .= '<option value="' . $obj->rowid . '"';
2197
+					$out .= '<option value="'.$obj->rowid.'"';
2198 2198
 					if (!empty($disableline)) {
2199 2199
 						$out .= ' disabled';
2200 2200
 					}
@@ -2202,7 +2202,7 @@  discard block
 block discarded – undo
2202 2202
 						$out .= ' selected';
2203 2203
 					}
2204 2204
 					$out .= ' data-html="';
2205
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2205
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2206 2206
 					if ($showstatus >= 0 && $obj->status == 0) {
2207 2207
 						$outhtml .= '<strike class="opacitymediumxxx">';
2208 2208
 					}
@@ -2215,7 +2215,7 @@  discard block
 block discarded – undo
2215 2215
 					$out .= $labeltoshow;
2216 2216
 					$out .= '</option>';
2217 2217
 
2218
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2218
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2219 2219
 					$outarray2[$userstatic->id] = array(
2220 2220
 						'id'=>$userstatic->id,
2221 2221
 						'label'=>$labeltoshow,
@@ -2227,14 +2227,14 @@  discard block
 block discarded – undo
2227 2227
 					$i++;
2228 2228
 				}
2229 2229
 			} else {
2230
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2231
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2230
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2231
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2232 2232
 			}
2233 2233
 			$out .= '</select>';
2234 2234
 
2235 2235
 			if ($num && !$forcecombo) {
2236 2236
 				// Enhance with select2
2237
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2237
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2238 2238
 				$out .= ajax_combobox($htmlname);
2239 2239
 			}
2240 2240
 		} else {
@@ -2304,16 +2304,16 @@  discard block
 block discarded – undo
2304 2304
 			$out .= $userstatic->getNomUrl(-1);
2305 2305
 			if ($i == 0) {
2306 2306
 				$ownerid = $value['id'];
2307
-				$out .= ' (' . $langs->trans("Owner") . ')';
2307
+				$out .= ' ('.$langs->trans("Owner").')';
2308 2308
 			}
2309 2309
 			if ($nbassignetouser > 1 && $action != 'view') {
2310
-				$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 . '">';
2310
+				$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.'">';
2311 2311
 			}
2312 2312
 			// Show my availability
2313 2313
 			if ($showproperties) {
2314 2314
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2315 2315
 					$out .= '<div class="myavailability inline-block">';
2316
-					$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>';
2316
+					$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>';
2317 2317
 					$out .= '</div>';
2318 2318
 				}
2319 2319
 			}
@@ -2330,15 +2330,15 @@  discard block
 block discarded – undo
2330 2330
 		// Method with no ajax
2331 2331
 		if ($action != 'view') {
2332 2332
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2333
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2333
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2334 2334
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2335 2335
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2336
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2337
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2336
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2337
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2338 2338
 			$out .= '});';
2339 2339
 			$out .= '})</script>';
2340 2340
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2341
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2341
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2342 2342
 			$out .= '<br>';
2343 2343
 		}
2344 2344
 
@@ -2393,13 +2393,13 @@  discard block
 block discarded – undo
2393 2393
 			$resourcestatic->fetch($value['id']);
2394 2394
 			$out .= $resourcestatic->getNomUrl(-1);
2395 2395
 			if ($nbassignetoresource > 1 && $action != 'view') {
2396
-				$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 . '">';
2396
+				$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.'">';
2397 2397
 			}
2398 2398
 			// Show my availability
2399 2399
 			if ($showproperties) {
2400 2400
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2401 2401
 					$out .= '<div class="myavailability inline-block">';
2402
-					$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>';
2402
+					$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>';
2403 2403
 					$out .= '</div>';
2404 2404
 				}
2405 2405
 			}
@@ -2416,11 +2416,11 @@  discard block
 block discarded – undo
2416 2416
 		// Method with no ajax
2417 2417
 		if ($action != 'view') {
2418 2418
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">';
2419
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2419
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2420 2420
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2421 2421
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2422
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2423
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2422
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2423
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2424 2424
 			$out .= '});';
2425 2425
 			$out .= '})</script>';
2426 2426
 
@@ -2428,7 +2428,7 @@  discard block
 block discarded – undo
2428 2428
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2429 2429
 			$out .= $formresources->select_resource_list('', $htmlname, '', 1, 1, 0, $events, '', 2, null);
2430 2430
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2431
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2431
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2432 2432
 			$out .= '<br>';
2433 2433
 		}
2434 2434
 
@@ -2489,7 +2489,7 @@  discard block
 block discarded – undo
2489 2489
 			$placeholder = '';
2490 2490
 
2491 2491
 			if ($selected && empty($selected_input_value)) {
2492
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2492
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2493 2493
 				$producttmpselect = new Product($this->db);
2494 2494
 				$producttmpselect->fetch($selected);
2495 2495
 				$selected_input_value = $producttmpselect->ref;
@@ -2504,17 +2504,17 @@  discard block
 block discarded – undo
2504 2504
 				}
2505 2505
 			}
2506 2506
 			// mode=1 means customers products
2507
-			$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;
2508
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2507
+			$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;
2508
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2509 2509
 
2510 2510
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2511 2511
 				// Code to automatically insert with javascript the select of attributes under the select of product
2512 2512
 				// when a parent of variant has been selected.
2513 2513
 				$out .= '
2514 2514
 				<!-- script to auto show attributes select tags if a variant was selected -->
2515
-				<script nonce="' . getNonce() . '">
2515
+				<script nonce="' . getNonce().'">
2516 2516
 					// auto show attributes fields
2517
-					selected = ' . json_encode($selected_combinations) . ';
2517
+					selected = ' . json_encode($selected_combinations).';
2518 2518
 					combvalues = {};
2519 2519
 
2520 2520
 					jQuery(document).ready(function () {
@@ -2525,7 +2525,7 @@  discard block
 block discarded – undo
2525 2525
 							}
2526 2526
 						});
2527 2527
 
2528
-						jQuery("input#' . $htmlname . '").change(function () {
2528
+						jQuery("input#' . $htmlname.'").change(function () {
2529 2529
 
2530 2530
 							if (!jQuery(this).val()) {
2531 2531
 								jQuery(\'div#attributes_box\').empty();
@@ -2534,7 +2534,7 @@  discard block
 block discarded – undo
2534 2534
 
2535 2535
 							console.log("A change has started. We get variants fields to inject html select");
2536 2536
 
2537
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2537
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2538 2538
 								id: jQuery(this).val()
2539 2539
 							}, function (data) {
2540 2540
 								jQuery(\'div#attributes_box\').empty();
@@ -2577,21 +2577,21 @@  discard block
 block discarded – undo
2577 2577
 							})
2578 2578
 						});
2579 2579
 
2580
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2580
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2581 2581
 					});
2582 2582
 				</script>
2583 2583
                 ';
2584 2584
 			}
2585 2585
 
2586 2586
 			if (empty($hidelabel)) {
2587
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2587
+				$out .= $langs->trans("RefOrLabel").' : ';
2588 2588
 			} elseif ($hidelabel > 1) {
2589
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2589
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2590 2590
 				if ($hidelabel == 2) {
2591 2591
 					$out .= img_picto($langs->trans("Search"), 'search');
2592 2592
 				}
2593 2593
 			}
2594
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2594
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2595 2595
 			if ($hidelabel == 3) {
2596 2596
 				$out .= img_picto($langs->trans("Search"), 'search');
2597 2597
 			}
@@ -2628,33 +2628,33 @@  discard block
 block discarded – undo
2628 2628
 		// phpcs:enable
2629 2629
 		global $conf, $user, $langs, $db;
2630 2630
 
2631
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2631
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2632 2632
 
2633 2633
 		$error = 0;
2634 2634
 		$out = '';
2635 2635
 
2636 2636
 		if (!$forcecombo) {
2637
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2637
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2638 2638
 			$events = array();
2639 2639
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2640 2640
 		}
2641 2641
 
2642
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2642
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2643 2643
 
2644 2644
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2645
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2646
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2645
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2646
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2647 2647
 		if (!empty($status)) {
2648
-			$sql .= ' AND status = ' . (int) $status;
2648
+			$sql .= ' AND status = '.(int) $status;
2649 2649
 		}
2650 2650
 		if (!empty($type)) {
2651
-			$sql .= ' AND bomtype = ' . (int) $type;
2651
+			$sql .= ' AND bomtype = '.(int) $type;
2652 2652
 		}
2653 2653
 		if (!empty($TProducts)) {
2654
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2654
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2655 2655
 		}
2656 2656
 		if (!empty($limit)) {
2657
-			$sql .= ' LIMIT ' . (int) $limit;
2657
+			$sql .= ' LIMIT '.(int) $limit;
2658 2658
 		}
2659 2659
 		$resql = $db->query($sql);
2660 2660
 		if ($resql) {
@@ -2668,11 +2668,11 @@  discard block
 block discarded – undo
2668 2668
 			while ($obj = $db->fetch_object($resql)) {
2669 2669
 				$product = new Product($db);
2670 2670
 				$res = $product->fetch($obj->fk_product);
2671
-				$out .= '<option value="' . $obj->rowid . '"';
2671
+				$out .= '<option value="'.$obj->rowid.'"';
2672 2672
 				if ($obj->rowid == $selected) {
2673 2673
 					$out .= 'selected';
2674 2674
 				}
2675
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2675
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2676 2676
 			}
2677 2677
 		} else {
2678 2678
 			$error++;
@@ -2729,7 +2729,7 @@  discard block
 block discarded – undo
2729 2729
 
2730 2730
 		$warehouseStatusArray = array();
2731 2731
 		if (!empty($warehouseStatus)) {
2732
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2732
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2733 2733
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2734 2734
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2735 2735
 			}
@@ -2743,9 +2743,9 @@  discard block
 block discarded – undo
2743 2743
 
2744 2744
 		$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";
2745 2745
 		if (count($warehouseStatusArray)) {
2746
-			$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
2746
+			$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
2747 2747
 		} else {
2748
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2748
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2749 2749
 		}
2750 2750
 
2751 2751
 		$sql = "SELECT ";
@@ -2761,9 +2761,9 @@  discard block
 block discarded – undo
2761 2761
 
2762 2762
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2763 2763
 			//Product category
2764
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2765
-						FROM " . $this->db->prefix() . "categorie_product
2766
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2764
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2765
+						FROM " . $this->db->prefix()."categorie_product
2766
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2767 2767
 						LIMIT 1
2768 2768
 				) AS categorie_product_id ";
2769 2769
 		}
@@ -2789,15 +2789,15 @@  discard block
 block discarded – undo
2789 2789
 		}
2790 2790
 		// Price by quantity
2791 2791
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2792
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2792
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2793 2793
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2794
-				$sql .= " AND price_level = " . ((int) $price_level);
2794
+				$sql .= " AND price_level = ".((int) $price_level);
2795 2795
 			}
2796 2796
 			$sql .= " ORDER BY date_price";
2797 2797
 			$sql .= " DESC LIMIT 1) as price_rowid";
2798
-			$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
2798
+			$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
2799 2799
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2800
-				$sql .= " AND price_level = " . ((int) $price_level);
2800
+				$sql .= " AND price_level = ".((int) $price_level);
2801 2801
 			}
2802 2802
 			$sql .= " ORDER BY date_price";
2803 2803
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -2811,67 +2811,67 @@  discard block
 block discarded – undo
2811 2811
 		$sql .= $hookmanager->resPrint;
2812 2812
 
2813 2813
 		if (count($warehouseStatusArray)) {
2814
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
2815
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
2816
-			$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.
2814
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
2815
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
2816
+			$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.
2817 2817
 		}
2818 2818
 
2819 2819
 		// include search in supplier ref
2820 2820
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2821
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2821
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2822 2822
 		}
2823 2823
 
2824 2824
 		//Price by customer
2825 2825
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2826
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
2826
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
2827 2827
 		}
2828 2828
 		// Units
2829 2829
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
2830
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
2830
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
2831 2831
 		}
2832 2832
 		// Multilang : we add translation
2833 2833
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
2834
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
2834
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
2835 2835
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
2836
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
2836
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
2837 2837
 				$soc = new Societe($this->db);
2838 2838
 				$result = $soc->fetch($socid);
2839 2839
 				if ($result > 0 && !empty($soc->default_lang)) {
2840
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
2840
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
2841 2841
 				} else {
2842
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2842
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2843 2843
 				}
2844 2844
 			} else {
2845
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2845
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2846 2846
 			}
2847 2847
 		}
2848 2848
 
2849 2849
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2850
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2850
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2851 2851
 		}
2852 2852
 
2853
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
2853
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
2854 2854
 
2855 2855
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2856 2856
 			$sql .= " AND pac.rowid IS NULL";
2857 2857
 		}
2858 2858
 
2859 2859
 		if ($finished == 0) {
2860
-			$sql .= " AND p.finished = " . ((int) $finished);
2860
+			$sql .= " AND p.finished = ".((int) $finished);
2861 2861
 		} elseif ($finished == 1) {
2862
-			$sql .= " AND p.finished = " . ((int) $finished);
2862
+			$sql .= " AND p.finished = ".((int) $finished);
2863 2863
 			if ($status >= 0) {
2864
-				$sql .= " AND p.tosell = " . ((int) $status);
2864
+				$sql .= " AND p.tosell = ".((int) $status);
2865 2865
 			}
2866 2866
 		} elseif ($status >= 0) {
2867
-			$sql .= " AND p.tosell = " . ((int) $status);
2867
+			$sql .= " AND p.tosell = ".((int) $status);
2868 2868
 		}
2869 2869
 		if ($status_purchase >= 0) {
2870
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
2870
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
2871 2871
 		}
2872 2872
 		// Filter by product type
2873 2873
 		if (strval($filtertype) != '') {
2874
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
2874
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
2875 2875
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
2876 2876
 			$sql .= " AND p.fk_product_type = 1";
2877 2877
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
@@ -2895,21 +2895,21 @@  discard block
 block discarded – undo
2895 2895
 				if ($i > 0) {
2896 2896
 					$sql .= " AND ";
2897 2897
 				}
2898
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2898
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2899 2899
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
2900
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2900
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2901 2901
 				}
2902 2902
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2903
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2903
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
2904 2904
 				}
2905 2905
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
2906
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2906
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2907 2907
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
2908
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2908
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2909 2909
 					}
2910 2910
 				}
2911 2911
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2912
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2912
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
2913 2913
 				}
2914 2914
 				$sql .= ")";
2915 2915
 				$i++;
@@ -2918,12 +2918,12 @@  discard block
 block discarded – undo
2918 2918
 				$sql .= ")";
2919 2919
 			}
2920 2920
 			if (isModEnabled('barcode')) {
2921
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
2921
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
2922 2922
 			}
2923 2923
 			$sql .= ')';
2924 2924
 		}
2925 2925
 		if (count($warehouseStatusArray)) {
2926
-			$sql .= " GROUP BY " . $selectFields;
2926
+			$sql .= " GROUP BY ".$selectFields;
2927 2927
 		}
2928 2928
 
2929 2929
 		//Sort by category
@@ -2938,23 +2938,23 @@  discard block
 block discarded – undo
2938 2938
 		$sql .= $this->db->plimit($limit, 0);
2939 2939
 
2940 2940
 		// Build output string
2941
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
2941
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
2942 2942
 		$result = $this->db->query($sql);
2943 2943
 		if ($result) {
2944
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2945
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2946
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
2944
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2945
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2946
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
2947 2947
 
2948 2948
 			$num = $this->db->num_rows($result);
2949 2949
 
2950 2950
 			$events = null;
2951 2951
 
2952 2952
 			if (!$forcecombo) {
2953
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2953
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2954 2954
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2955 2955
 			}
2956 2956
 
2957
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2957
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2958 2958
 
2959 2959
 			$textifempty = '';
2960 2960
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -2971,7 +2971,7 @@  discard block
 block discarded – undo
2971 2971
 				}
2972 2972
 			}
2973 2973
 			if ($showempty) {
2974
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
2974
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
2975 2975
 			}
2976 2976
 
2977 2977
 			$i = 0;
@@ -2982,11 +2982,11 @@  discard block
 block discarded – undo
2982 2982
 
2983 2983
 				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
2984 2984
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
2985
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
2986
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
2985
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
2986
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
2987 2987
 					$sql .= " ORDER BY quantity ASC";
2988 2988
 
2989
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
2989
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
2990 2990
 					$result2 = $this->db->query($sql);
2991 2991
 					if ($result2) {
2992 2992
 						$nb_prices = $this->db->num_rows($result2);
@@ -3024,7 +3024,7 @@  discard block
 block discarded – undo
3024 3024
 						$price_product = new Product($this->db);
3025 3025
 						$price_product->fetch($objp->rowid, '', '', 1);
3026 3026
 
3027
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3027
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3028 3028
 						$priceparser = new PriceParser($this->db);
3029 3029
 						$price_result = $priceparser->parseProduct($price_product);
3030 3030
 						if ($price_result >= 0) {
@@ -3108,7 +3108,7 @@  discard block
 block discarded – undo
3108 3108
 			$label = $objp->label_translated;
3109 3109
 		}
3110 3110
 		if (!empty($filterkey) && $filterkey != '') {
3111
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3111
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3112 3112
 		}
3113 3113
 
3114 3114
 		$outkey = $objp->rowid;
@@ -3129,32 +3129,32 @@  discard block
 block discarded – undo
3129 3129
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3130 3130
 
3131 3131
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3132
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3132
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3133 3133
 		}
3134 3134
 
3135 3135
 		// Units
3136 3136
 		$outvalUnits = '';
3137 3137
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3138 3138
 			if (!empty($objp->unit_short)) {
3139
-				$outvalUnits .= ' - ' . $objp->unit_short;
3139
+				$outvalUnits .= ' - '.$objp->unit_short;
3140 3140
 			}
3141 3141
 		}
3142 3142
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3143 3143
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3144 3144
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3145
-				$outvalUnits .= ' - ' . $unitToShow;
3145
+				$outvalUnits .= ' - '.$unitToShow;
3146 3146
 			}
3147 3147
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3148
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3149
-				$outvalUnits .= ' - ' . $unitToShow;
3148
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3149
+				$outvalUnits .= ' - '.$unitToShow;
3150 3150
 			}
3151 3151
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3152 3152
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3153
-				$outvalUnits .= ' - ' . $unitToShow;
3153
+				$outvalUnits .= ' - '.$unitToShow;
3154 3154
 			}
3155 3155
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3156 3156
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3157
-				$outvalUnits .= ' - ' . $unitToShow;
3157
+				$outvalUnits .= ' - '.$unitToShow;
3158 3158
 			}
3159 3159
 		}
3160 3160
 		if ($outdurationvalue && $outdurationunit) {
@@ -3166,14 +3166,14 @@  discard block
 block discarded – undo
3166 3166
 				'y' => $langs->trans('Year')
3167 3167
 			);
3168 3168
 			if (isset($da[$outdurationunit])) {
3169
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3169
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3170 3170
 			}
3171 3171
 		}
3172 3172
 
3173
-		$opt = '<option value="' . $objp->rowid . '"';
3173
+		$opt = '<option value="'.$objp->rowid.'"';
3174 3174
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3175 3175
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3176
-			$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 . '"';
3176
+			$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.'"';
3177 3177
 		}
3178 3178
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3179 3179
 			if ($user->hasRight('stock', 'lire')) {
@@ -3185,36 +3185,36 @@  discard block
 block discarded – undo
3185 3185
 			}
3186 3186
 		}
3187 3187
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3188
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3189
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3188
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3189
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3190 3190
 		}
3191 3191
 		$opt .= '>';
3192 3192
 		$opt .= $objp->ref;
3193 3193
 		if (!empty($objp->custref)) {
3194
-			$opt .= ' (' . $objp->custref . ')';
3194
+			$opt .= ' ('.$objp->custref.')';
3195 3195
 		}
3196 3196
 		if ($outbarcode) {
3197
-			$opt .= ' (' . $outbarcode . ')';
3197
+			$opt .= ' ('.$outbarcode.')';
3198 3198
 		}
3199
-		$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
3199
+		$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
3200 3200
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3201
-			$opt .= ' (' . getCountry($outorigin, 1) . ')';
3201
+			$opt .= ' ('.getCountry($outorigin, 1).')';
3202 3202
 		}
3203 3203
 
3204 3204
 		$objRef = $objp->ref;
3205 3205
 		if (!empty($objp->custref)) {
3206
-			$objRef .= ' (' . $objp->custref . ')';
3206
+			$objRef .= ' ('.$objp->custref.')';
3207 3207
 		}
3208 3208
 		if (!empty($filterkey) && $filterkey != '') {
3209
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3209
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3210 3210
 		}
3211 3211
 		$outval .= $objRef;
3212 3212
 		if ($outbarcode) {
3213
-			$outval .= ' (' . $outbarcode . ')';
3213
+			$outval .= ' ('.$outbarcode.')';
3214 3214
 		}
3215
-		$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
3215
+		$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
3216 3216
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3217
-			$outval .= ' (' . getCountry($outorigin, 1) . ')';
3217
+			$outval .= ' ('.getCountry($outorigin, 1).')';
3218 3218
 		}
3219 3219
 
3220 3220
 		// Units
@@ -3227,35 +3227,35 @@  discard block
 block discarded – undo
3227 3227
 		// If we need a particular price level (from 1 to n)
3228 3228
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
3229 3229
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3230
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3231
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3232
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3233
-			$sql .= " AND price_level = " . ((int) $price_level);
3230
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3231
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3232
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3233
+			$sql .= " AND price_level = ".((int) $price_level);
3234 3234
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3235 3235
 			$sql .= " LIMIT 1";
3236 3236
 
3237
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3237
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3238 3238
 			$result2 = $this->db->query($sql);
3239 3239
 			if ($result2) {
3240 3240
 				$objp2 = $this->db->fetch_object($result2);
3241 3241
 				if ($objp2) {
3242 3242
 					$found = 1;
3243 3243
 					if ($objp2->price_base_type == 'HT') {
3244
-						$opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3245
-						$outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3244
+						$opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3245
+						$outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3246 3246
 					} else {
3247
-						$opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3248
-						$outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3247
+						$opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3248
+						$outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3249 3249
 					}
3250 3250
 					$outprice_ht = price($objp2->price);
3251 3251
 					$outprice_ttc = price($objp2->price_ttc);
3252 3252
 					$outpricebasetype = $objp2->price_base_type;
3253 3253
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3254
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3255
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3254
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3255
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3256 3256
 					} else {
3257
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3258
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3257
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3258
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3259 3259
 					}
3260 3260
 				}
3261 3261
 			} else {
@@ -3269,13 +3269,13 @@  discard block
 block discarded – undo
3269 3269
 			$outqty = $objp->quantity;
3270 3270
 			$outdiscount = $objp->remise_percent;
3271 3271
 			if ($objp->quantity == 1) {
3272
-				$opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3273
-				$outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3272
+				$opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3273
+				$outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3274 3274
 				$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3275 3275
 				$outval .= $langs->transnoentities("Unit");
3276 3276
 			} else {
3277
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3278
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3277
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3278
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3279 3279
 				$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3280 3280
 				$outval .= $langs->transnoentities("Units");
3281 3281
 			}
@@ -3283,16 +3283,16 @@  discard block
 block discarded – undo
3283 3283
 			$outprice_ht = price($objp->unitprice);
3284 3284
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3285 3285
 			$outpricebasetype = $objp->price_base_type;
3286
-			$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
3287
-			$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
3286
+			$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
3287
+			$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
3288 3288
 		}
3289 3289
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3290
-			$opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3291
-			$outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3290
+			$opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3291
+			$outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3292 3292
 		}
3293 3293
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3294
-			$opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3295
-			$outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3294
+			$opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3295
+			$outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3296 3296
 		}
3297 3297
 
3298 3298
 		// Price by customer
@@ -3301,11 +3301,11 @@  discard block
 block discarded – undo
3301 3301
 				$found = 1;
3302 3302
 
3303 3303
 				if ($objp->custprice_base_type == 'HT') {
3304
-					$opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3305
-					$outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3304
+					$opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3305
+					$outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3306 3306
 				} else {
3307
-					$opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3308
-					$outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3307
+					$opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3308
+					$outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3309 3309
 				}
3310 3310
 
3311 3311
 				$outprice_ht = price($objp->custprice);
@@ -3319,11 +3319,11 @@  discard block
 block discarded – undo
3319 3319
 		// If level no defined or multiprice not found, we used the default price
3320 3320
 		if (empty($hidepriceinlabel) && !$found) {
3321 3321
 			if ($objp->price_base_type == 'HT') {
3322
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3323
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3322
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3323
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3324 3324
 			} else {
3325
-				$opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3326
-				$outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3325
+				$opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3326
+				$outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3327 3327
 			}
3328 3328
 			$outprice_ht = price($objp->price);
3329 3329
 			$outprice_ttc = price($objp->price_ttc);
@@ -3334,14 +3334,14 @@  discard block
 block discarded – undo
3334 3334
 
3335 3335
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3336 3336
 			if ($user->hasRight('stock', 'lire')) {
3337
-				$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3337
+				$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3338 3338
 
3339 3339
 				if ($objp->stock > 0) {
3340 3340
 					$outval .= ' - <span class="product_line_stock_ok">';
3341 3341
 				} elseif ($objp->stock <= 0) {
3342 3342
 					$outval .= ' - <span class="product_line_stock_too_low">';
3343 3343
 				}
3344
-				$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3344
+				$outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3345 3345
 				$outval .= '</span>';
3346 3346
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3347 3347
 					$langs->load("stocks");
@@ -3351,9 +3351,9 @@  discard block
 block discarded – undo
3351 3351
 					$tmpproduct->load_virtual_stock();
3352 3352
 					$virtualstock = $tmpproduct->stock_theorique;
3353 3353
 
3354
-					$opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3354
+					$opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3355 3355
 
3356
-					$outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3356
+					$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
3357 3357
 					if ($virtualstock > 0) {
3358 3358
 						$outval .= '<span class="product_line_stock_ok">';
3359 3359
 					} elseif ($virtualstock <= 0) {
@@ -3431,7 +3431,7 @@  discard block
 block discarded – undo
3431 3431
 		$selected_input_value = '';
3432 3432
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3433 3433
 			if ($selected > 0) {
3434
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3434
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3435 3435
 				$producttmpselect = new Product($this->db);
3436 3436
 				$producttmpselect->fetch($selected);
3437 3437
 				$selected_input_value = $producttmpselect->ref;
@@ -3439,10 +3439,10 @@  discard block
 block discarded – undo
3439 3439
 			}
3440 3440
 
3441 3441
 			// mode=2 means suppliers products
3442
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3443
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3442
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3443
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3444 3444
 
3445
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3445
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3446 3446
 		} else {
3447 3447
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3448 3448
 		}
@@ -3502,25 +3502,25 @@  discard block
 block discarded – undo
3502 3502
 		if (isModEnabled('barcode')) {
3503 3503
 			$sql .= ", pfp.barcode";
3504 3504
 		}
3505
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3506
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3505
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3506
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3507 3507
 		if ($socid > 0) {
3508
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3508
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3509 3509
 		}
3510
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3510
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3511 3511
 		// Units
3512 3512
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3513
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3513
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3514 3514
 		}
3515
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3515
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3516 3516
 		if ($statut != -1) {
3517
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3517
+			$sql .= " AND p.tobuy = ".((int) $statut);
3518 3518
 		}
3519 3519
 		if (strval($filtertype) != '') {
3520
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3520
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3521 3521
 		}
3522 3522
 		if (!empty($filtre)) {
3523
-			$sql .= " " . $filtre;
3523
+			$sql .= " ".$filtre;
3524 3524
 		}
3525 3525
 		// Add where from hooks
3526 3526
 		$parameters = array();
@@ -3540,9 +3540,9 @@  discard block
 block discarded – undo
3540 3540
 				if ($i > 0) {
3541 3541
 					$sql .= " AND ";
3542 3542
 				}
3543
-				$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) . "%'";
3543
+				$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)."%'";
3544 3544
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3545
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3545
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3546 3546
 				}
3547 3547
 				$sql .= ")";
3548 3548
 				$i++;
@@ -3551,8 +3551,8 @@  discard block
 block discarded – undo
3551 3551
 				$sql .= ")";
3552 3552
 			}
3553 3553
 			if (isModEnabled('barcode')) {
3554
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3555
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3554
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3555
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3556 3556
 			}
3557 3557
 			$sql .= ')';
3558 3558
 		}
@@ -3561,20 +3561,20 @@  discard block
 block discarded – undo
3561 3561
 
3562 3562
 		// Build output string
3563 3563
 
3564
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3564
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3565 3565
 		$result = $this->db->query($sql);
3566 3566
 		if ($result) {
3567
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3568
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3567
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3568
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3569 3569
 
3570 3570
 			$num = $this->db->num_rows($result);
3571 3571
 
3572 3572
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3573
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3573
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3574 3574
 			if (!$selected) {
3575
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3575
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3576 3576
 			} else {
3577
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3577
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3578 3578
 			}
3579 3579
 
3580 3580
 			$i = 0;
@@ -3589,7 +3589,7 @@  discard block
 block discarded – undo
3589 3589
 
3590 3590
 				$outkey = $objp->idprodfournprice; // id in table of price
3591 3591
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3592
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3592
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3593 3593
 				}
3594 3594
 
3595 3595
 				$outref = $objp->ref;
@@ -3604,23 +3604,23 @@  discard block
 block discarded – undo
3604 3604
 				$outvalUnits = '';
3605 3605
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3606 3606
 					if (!empty($objp->unit_short)) {
3607
-						$outvalUnits .= ' - ' . $objp->unit_short;
3607
+						$outvalUnits .= ' - '.$objp->unit_short;
3608 3608
 					}
3609 3609
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3610 3610
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3611
-						$outvalUnits .= ' - ' . $unitToShow;
3611
+						$outvalUnits .= ' - '.$unitToShow;
3612 3612
 					}
3613 3613
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3614
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3615
-						$outvalUnits .= ' - ' . $unitToShow;
3614
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3615
+						$outvalUnits .= ' - '.$unitToShow;
3616 3616
 					}
3617 3617
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3618 3618
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3619
-						$outvalUnits .= ' - ' . $unitToShow;
3619
+						$outvalUnits .= ' - '.$unitToShow;
3620 3620
 					}
3621 3621
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3622 3622
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3623
-						$outvalUnits .= ' - ' . $unitToShow;
3623
+						$outvalUnits .= ' - '.$unitToShow;
3624 3624
 					}
3625 3625
 					if ($outdurationvalue && $outdurationunit) {
3626 3626
 						$da = array(
@@ -3631,22 +3631,22 @@  discard block
 block discarded – undo
3631 3631
 							'y' => $langs->trans('Year')
3632 3632
 						);
3633 3633
 						if (isset($da[$outdurationunit])) {
3634
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3634
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3635 3635
 						}
3636 3636
 					}
3637 3637
 				}
3638 3638
 
3639 3639
 				$objRef = $objp->ref;
3640 3640
 				if ($filterkey && $filterkey != '') {
3641
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3641
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3642 3642
 				}
3643 3643
 				$objRefFourn = $objp->ref_fourn;
3644 3644
 				if ($filterkey && $filterkey != '') {
3645
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3645
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3646 3646
 				}
3647 3647
 				$label = $objp->label;
3648 3648
 				if ($filterkey && $filterkey != '') {
3649
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3649
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3650 3650
 				}
3651 3651
 
3652 3652
 				switch ($objp->fk_product_type) {
@@ -3669,21 +3669,21 @@  discard block
 block discarded – undo
3669 3669
 
3670 3670
 				$optlabel .= $objp->ref;
3671 3671
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3672
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3672
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3673 3673
 				}
3674 3674
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3675
-					$optlabel .= ' (' . $outbarcode . ')';
3675
+					$optlabel .= ' ('.$outbarcode.')';
3676 3676
 				}
3677
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3677
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3678 3678
 
3679 3679
 				$outvallabel = $objRef;
3680 3680
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3681
-					$outvallabel .= ' (' . $objRefFourn . ')';
3681
+					$outvallabel .= ' ('.$objRefFourn.')';
3682 3682
 				}
3683 3683
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3684
-					$outvallabel .= ' (' . $outbarcode . ')';
3684
+					$outvallabel .= ' ('.$outbarcode.')';
3685 3685
 				}
3686
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3686
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3687 3687
 
3688 3688
 				// Units
3689 3689
 				$optlabel .= $outvalUnits;
@@ -3700,7 +3700,7 @@  discard block
 block discarded – undo
3700 3700
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3701 3701
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3702 3702
 
3703
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3703
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3704 3704
 						$priceparser = new PriceParser($this->db);
3705 3705
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3706 3706
 						if ($price_result >= 0) {
@@ -3711,47 +3711,47 @@  discard block
 block discarded – undo
3711 3711
 						}
3712 3712
 					}
3713 3713
 					if ($objp->quantity == 1) {
3714
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3715
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3714
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3715
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3716 3716
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3717 3717
 						$outvallabel .= $langs->transnoentities("Unit");
3718 3718
 					} else {
3719
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3720
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3721
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3722
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3719
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3720
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3721
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3722
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3723 3723
 					}
3724 3724
 
3725 3725
 					if ($objp->quantity > 1) {
3726
-						$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
3727
-						$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
3726
+						$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
3727
+						$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
3728 3728
 					}
3729 3729
 					if ($objp->remise_percent >= 1) {
3730
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3731
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3730
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3731
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3732 3732
 					}
3733 3733
 					if ($objp->duration) {
3734
-						$optlabel .= " - " . $objp->duration;
3735
-						$outvallabel .= " - " . $objp->duration;
3734
+						$optlabel .= " - ".$objp->duration;
3735
+						$outvallabel .= " - ".$objp->duration;
3736 3736
 					}
3737 3737
 					if (!$socid) {
3738
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3739
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3738
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3739
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3740 3740
 					}
3741 3741
 					if ($objp->supplier_reputation) {
3742 3742
 						//TODO dictionary
3743 3743
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3744 3744
 
3745
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3746
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3745
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3746
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3747 3747
 					}
3748 3748
 				} else {
3749 3749
 					if (empty($alsoproductwithnosupplierprice)) {     // No supplier price defined for couple product/supplier
3750
-						$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3751
-						$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3750
+						$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3751
+						$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3752 3752
 					} else { // No supplier price defined for product, even on other suppliers
3753
-						$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3754
-						$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3753
+						$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3754
+						$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3755 3755
 					}
3756 3756
 				}
3757 3757
 
@@ -3759,14 +3759,14 @@  discard block
 block discarded – undo
3759 3759
 					$novirtualstock = ($showstockinlist == 2);
3760 3760
 
3761 3761
 					if ($user->hasRight('stock', 'lire')) {
3762
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3762
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3763 3763
 
3764 3764
 						if ($objp->stock > 0) {
3765 3765
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3766 3766
 						} elseif ($objp->stock <= 0) {
3767 3767
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3768 3768
 						}
3769
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3769
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3770 3770
 						$optlabel .= '</span>';
3771 3771
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3772 3772
 							$langs->load("stocks");
@@ -3776,9 +3776,9 @@  discard block
 block discarded – undo
3776 3776
 							$tmpproduct->load_virtual_stock();
3777 3777
 							$virtualstock = $tmpproduct->stock_theorique;
3778 3778
 
3779
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3779
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3780 3780
 
3781
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3781
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
3782 3782
 							if ($virtualstock > 0) {
3783 3783
 								$optlabel .= '<span class="product_line_stock_ok">';
3784 3784
 							} elseif ($virtualstock <= 0) {
@@ -3792,7 +3792,7 @@  discard block
 block discarded – undo
3792 3792
 					}
3793 3793
 				}
3794 3794
 
3795
-				$optstart = '<option value="' . $outkey . '"';
3795
+				$optstart = '<option value="'.$outkey.'"';
3796 3796
 				if ($selected && $selected == $objp->idprodfournprice) {
3797 3797
 					$optstart .= ' selected';
3798 3798
 				}
@@ -3801,27 +3801,27 @@  discard block
 block discarded – undo
3801 3801
 				}
3802 3802
 
3803 3803
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
3804
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
3805
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
3806
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
3807
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
3808
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
3809
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
3810
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
3811
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
3812
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
3813
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
3814
-				}
3815
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
3804
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
3805
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
3806
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
3807
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
3808
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
3809
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
3810
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
3811
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
3812
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
3813
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
3814
+				}
3815
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
3816 3816
 
3817 3817
 				$outarrayentry = array(
3818 3818
 					'key' => $outkey,
3819 3819
 					'value' => $outref,
3820 3820
 					'label' => $outvallabel,
3821 3821
 					'qty' => $outqty,
3822
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
3823
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3824
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3822
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3823
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3824
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3825 3825
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
3826 3826
 					'tva_tx' => price2num($objp->tva_tx),
3827 3827
 					'default_vat_code' => $objp->default_vat_code,
@@ -3846,18 +3846,18 @@  discard block
 block discarded – undo
3846 3846
 				// Add new entry
3847 3847
 				// "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
3848 3848
 				// "label" value of json key array is used by jQuery automatically as text for combo box
3849
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
3849
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
3850 3850
 				array_push(
3851 3851
 					$outarray,
3852 3852
 					array('key' => $outkey,
3853 3853
 						'value' => $outref,
3854 3854
 						'label' => $outvallabel,
3855 3855
 						'qty' => $outqty,
3856
-						'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
3856
+						'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3857 3857
 						'price_qty_ht_locale' => price($objp->fprice),
3858
-						'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3858
+						'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3859 3859
 						'price_unit_ht_locale' => price($objp->unitprice),
3860
-						'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3860
+						'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3861 3861
 						'tva_tx_formated' => price($objp->tva_tx),
3862 3862
 						'tva_tx' => price2num($objp->tva_tx),
3863 3863
 						'default_vat_code' => $objp->default_vat_code,
@@ -3884,7 +3884,7 @@  discard block
 block discarded – undo
3884 3884
 
3885 3885
 			$this->db->free($result);
3886 3886
 
3887
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3887
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3888 3888
 			$out .= ajax_combobox($htmlname);
3889 3889
 		} else {
3890 3890
 			dol_print_error($this->db);
@@ -3916,43 +3916,43 @@  discard block
 block discarded – undo
3916 3916
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
3917 3917
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
3918 3918
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
3919
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3920
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3921
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3922
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
3919
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3920
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3921
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3922
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
3923 3923
 		$sql .= " AND p.tobuy = 1";
3924 3924
 		$sql .= " AND s.fournisseur = 1";
3925
-		$sql .= " AND p.rowid = " . ((int) $productid);
3925
+		$sql .= " AND p.rowid = ".((int) $productid);
3926 3926
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
3927 3927
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
3928 3928
 		} else {
3929 3929
 			$sql .= " ORDER BY pfp.unitprice ASC";
3930 3930
 		}
3931 3931
 
3932
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
3932
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
3933 3933
 		$result = $this->db->query($sql);
3934 3934
 
3935 3935
 		if ($result) {
3936 3936
 			$num = $this->db->num_rows($result);
3937 3937
 
3938
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3938
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3939 3939
 
3940 3940
 			if (!$num) {
3941
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
3941
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
3942 3942
 			} else {
3943
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3943
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3944 3944
 				$form .= '<option value="0">&nbsp;</option>';
3945 3945
 
3946 3946
 				$i = 0;
3947 3947
 				while ($i < $num) {
3948 3948
 					$objp = $this->db->fetch_object($result);
3949 3949
 
3950
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
3950
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
3951 3951
 					//if there is only one supplier, preselect it
3952 3952
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
3953 3953
 						$opt .= ' selected';
3954 3954
 					}
3955
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
3955
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
3956 3956
 
3957 3957
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
3958 3958
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -3962,7 +3962,7 @@  discard block
 block discarded – undo
3962 3962
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3963 3963
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3964 3964
 
3965
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3965
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3966 3966
 						$priceparser = new PriceParser($this->db);
3967 3967
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3968 3968
 						if ($price_result >= 0) {
@@ -3973,10 +3973,10 @@  discard block
 block discarded – undo
3973 3973
 						}
3974 3974
 					}
3975 3975
 					if ($objp->quantity == 1) {
3976
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3976
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3977 3977
 					}
3978 3978
 
3979
-					$opt .= $objp->quantity . ' ';
3979
+					$opt .= $objp->quantity.' ';
3980 3980
 
3981 3981
 					if ($objp->quantity == 1) {
3982 3982
 						$opt .= $langs->trans("Unit");
@@ -3985,10 +3985,10 @@  discard block
 block discarded – undo
3985 3985
 					}
3986 3986
 					if ($objp->quantity > 1) {
3987 3987
 						$opt .= " - ";
3988
-						$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");
3988
+						$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");
3989 3989
 					}
3990 3990
 					if ($objp->duration) {
3991
-						$opt .= " - " . $objp->duration;
3991
+						$opt .= " - ".$objp->duration;
3992 3992
 					}
3993 3993
 					$opt .= "</option>\n";
3994 3994
 
@@ -4026,8 +4026,8 @@  discard block
 block discarded – undo
4026 4026
 		dol_syslog(__METHOD__, LOG_DEBUG);
4027 4027
 
4028 4028
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4029
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4030
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4029
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4030
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4031 4031
 		$sql .= " AND active > 0";
4032 4032
 		$sql .= " ORDER BY sortorder";
4033 4033
 
@@ -4039,7 +4039,7 @@  discard block
 block discarded – undo
4039 4039
 				$obj = $this->db->fetch_object($resql);
4040 4040
 
4041 4041
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4042
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != ("PaymentConditionShort" . $obj->code) ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4042
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != ("PaymentConditionShort".$obj->code) ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4043 4043
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4044 4044
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4045 4045
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4067,7 +4067,7 @@  discard block
 block discarded – undo
4067 4067
 		// phpcs:enable
4068 4068
 		global $langs;
4069 4069
 
4070
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4070
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4071 4071
 		if ($num > 0) {
4072 4072
 			return 0; // Cache already loaded
4073 4073
 		}
@@ -4077,7 +4077,7 @@  discard block
 block discarded – undo
4077 4077
 		$langs->load('propal');
4078 4078
 
4079 4079
 		$sql = "SELECT rowid, code, label, position";
4080
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4080
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4081 4081
 		$sql .= " WHERE active > 0";
4082 4082
 
4083 4083
 		$resql = $this->db->query($sql);
@@ -4088,7 +4088,7 @@  discard block
 block discarded – undo
4088 4088
 				$obj = $this->db->fetch_object($resql);
4089 4089
 
4090 4090
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4091
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != ("AvailabilityType" . $obj->code) ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4091
+				$label = ($langs->trans("AvailabilityType".$obj->code) != ("AvailabilityType".$obj->code) ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4092 4092
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4093 4093
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4094 4094
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4120,17 +4120,17 @@  discard block
 block discarded – undo
4120 4120
 
4121 4121
 		$this->load_cache_availability();
4122 4122
 
4123
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4123
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4124 4124
 
4125
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4125
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4126 4126
 		if ($addempty) {
4127 4127
 			print '<option value="0">&nbsp;</option>';
4128 4128
 		}
4129 4129
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4130 4130
 			if ($selected == $id) {
4131
-				print '<option value="' . $id . '" selected>';
4131
+				print '<option value="'.$id.'" selected>';
4132 4132
 			} else {
4133
-				print '<option value="' . $id . '">';
4133
+				print '<option value="'.$id.'">';
4134 4134
 			}
4135 4135
 			print dol_escape_htmltag($arrayavailability['label']);
4136 4136
 			print '</option>';
@@ -4151,13 +4151,13 @@  discard block
 block discarded – undo
4151 4151
 	{
4152 4152
 		global $langs;
4153 4153
 
4154
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4154
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4155 4155
 		if ($num > 0) {
4156 4156
 			return 0; // Cache already loaded
4157 4157
 		}
4158 4158
 
4159 4159
 		$sql = "SELECT rowid, code, label";
4160
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4160
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4161 4161
 		$sql .= " WHERE active > 0";
4162 4162
 
4163 4163
 		$resql = $this->db->query($sql);
@@ -4170,8 +4170,8 @@  discard block
 block discarded – undo
4170 4170
 
4171 4171
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4172 4172
 				$label = ($obj->label != '-' ? $obj->label : '');
4173
-				if ($langs->trans("DemandReasonType" . $obj->code) != ("DemandReasonType" . $obj->code)) {
4174
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4173
+				if ($langs->trans("DemandReasonType".$obj->code) != ("DemandReasonType".$obj->code)) {
4174
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4175 4175
 				}
4176 4176
 				if ($langs->trans($obj->code) != $obj->code) {
4177 4177
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4211,9 +4211,9 @@  discard block
 block discarded – undo
4211 4211
 
4212 4212
 		$this->loadCacheInputReason();
4213 4213
 
4214
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4214
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4215 4215
 		if ($addempty) {
4216
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4216
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4217 4217
 		}
4218 4218
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4219 4219
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4221,9 +4221,9 @@  discard block
 block discarded – undo
4221 4221
 			}
4222 4222
 
4223 4223
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4224
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4224
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4225 4225
 			} else {
4226
-				print '<option value="' . $arraydemandreason['id'] . '">';
4226
+				print '<option value="'.$arraydemandreason['id'].'">';
4227 4227
 			}
4228 4228
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4229 4229
 			print $langs->trans($label);
@@ -4233,7 +4233,7 @@  discard block
 block discarded – undo
4233 4233
 		if ($user->admin && empty($notooltip)) {
4234 4234
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4235 4235
 		}
4236
-		print ajax_combobox('select_' . $htmlname);
4236
+		print ajax_combobox('select_'.$htmlname);
4237 4237
 	}
4238 4238
 
4239 4239
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4248,7 +4248,7 @@  discard block
 block discarded – undo
4248 4248
 		// phpcs:enable
4249 4249
 		global $langs;
4250 4250
 
4251
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4251
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4252 4252
 		if ($num > 0) {
4253 4253
 			return $num; // Cache already loaded
4254 4254
 		}
@@ -4258,8 +4258,8 @@  discard block
 block discarded – undo
4258 4258
 		$this->cache_types_paiements = array();
4259 4259
 
4260 4260
 		$sql = "SELECT id, code, libelle as label, type, active";
4261
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4262
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4261
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4262
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4263 4263
 
4264 4264
 		$resql = $this->db->query($sql);
4265 4265
 		if ($resql) {
@@ -4269,7 +4269,7 @@  discard block
 block discarded – undo
4269 4269
 				$obj = $this->db->fetch_object($resql);
4270 4270
 
4271 4271
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
4272
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4272
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4273 4273
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4274 4274
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4275 4275
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4335,17 +4335,17 @@  discard block
 block discarded – undo
4335 4335
 		global $langs, $user, $conf;
4336 4336
 
4337 4337
 		$out = '';
4338
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4338
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4339 4339
 
4340 4340
 		$this->load_cache_conditions_paiements();
4341 4341
 
4342 4342
 		// Set default value if not already set by caller
4343 4343
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4344
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4344
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4345 4345
 			$selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID;
4346 4346
 		}
4347 4347
 
4348
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4348
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4349 4349
 		if ($addempty) {
4350 4350
 			$out .= '<option value="0">&nbsp;</option>';
4351 4351
 		}
@@ -4359,9 +4359,9 @@  discard block
 block discarded – undo
4359 4359
 
4360 4360
 			if ($selected == $id) {
4361 4361
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4362
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4362
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4363 4363
 			} else {
4364
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4364
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4365 4365
 			}
4366 4366
 			$label = $arrayconditions['label'];
4367 4367
 
@@ -4379,21 +4379,21 @@  discard block
 block discarded – undo
4379 4379
 		$out .= ajax_combobox($htmlname);
4380 4380
 
4381 4381
 		if ($deposit_percent >= 0) {
4382
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4383
-			$out .= $langs->trans('DepositPercent') . ' : ';
4384
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4382
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4383
+			$out .= $langs->trans('DepositPercent').' : ';
4384
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4385 4385
 			$out .= '</span>';
4386 4386
 			$out .= '
4387
-				<script nonce="' . getNonce() . '">
4387
+				<script nonce="' . getNonce().'">
4388 4388
 					$(document).ready(function () {
4389
-						$("#' . $htmlname . '").change(function () {
4389
+						$("#' . $htmlname.'").change(function () {
4390 4390
 							let $selected = $(this).find("option:selected");
4391 4391
 							let depositPercent = $selected.attr("data-deposit_percent");
4392 4392
 
4393 4393
 							if (depositPercent.length > 0) {
4394
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4394
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4395 4395
 							} else {
4396
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4396
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4397 4397
 							}
4398 4398
 
4399 4399
 							return true;
@@ -4431,7 +4431,7 @@  discard block
 block discarded – undo
4431 4431
 
4432 4432
 		$out = '';
4433 4433
 
4434
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4434
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4435 4435
 
4436 4436
 		$filterarray = array();
4437 4437
 		if ($filtertype == 'CRDT') {
@@ -4446,11 +4446,11 @@  discard block
 block discarded – undo
4446 4446
 
4447 4447
 		// Set default value if not already set by caller
4448 4448
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4449
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4449
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4450 4450
 			$selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID;
4451 4451
 		}
4452 4452
 
4453
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4453
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4454 4454
 		if ($empty) {
4455 4455
 			$out .= '<option value="">&nbsp;</option>';
4456 4456
 		}
@@ -4471,13 +4471,13 @@  discard block
 block discarded – undo
4471 4471
 			}
4472 4472
 
4473 4473
 			if ($format == 0) {
4474
-				$out .= '<option value="' . $id . '"';
4474
+				$out .= '<option value="'.$id.'"';
4475 4475
 			} elseif ($format == 1) {
4476
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4476
+				$out .= '<option value="'.$arraytypes['code'].'"';
4477 4477
 			} elseif ($format == 2) {
4478
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4478
+				$out .= '<option value="'.$arraytypes['code'].'"';
4479 4479
 			} elseif ($format == 3) {
4480
-				$out .= '<option value="' . $id . '"';
4480
+				$out .= '<option value="'.$id.'"';
4481 4481
 			}
4482 4482
 			// Print attribute selected or not
4483 4483
 			if ($format == 1 || $format == 2) {
@@ -4507,7 +4507,7 @@  discard block
 block discarded – undo
4507 4507
 		if ($user->admin && !$noadmininfo) {
4508 4508
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4509 4509
 		}
4510
-		$out .= ajax_combobox('select' . $htmlname);
4510
+		$out .= ajax_combobox('select'.$htmlname);
4511 4511
 
4512 4512
 		if (empty($nooutput)) {
4513 4513
 			print $out;
@@ -4529,22 +4529,22 @@  discard block
 block discarded – undo
4529 4529
 	{
4530 4530
 		global $langs;
4531 4531
 
4532
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4532
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4533 4533
 		$options = array(
4534 4534
 			'HT' => $langs->trans("HT"),
4535 4535
 			'TTC' => $langs->trans("TTC")
4536 4536
 		);
4537 4537
 		foreach ($options as $id => $value) {
4538 4538
 			if ($selected == $id) {
4539
-				$return .= '<option value="' . $id . '" selected>' . $value;
4539
+				$return .= '<option value="'.$id.'" selected>'.$value;
4540 4540
 			} else {
4541
-				$return .= '<option value="' . $id . '">' . $value;
4541
+				$return .= '<option value="'.$id.'">'.$value;
4542 4542
 			}
4543 4543
 			$return .= '</option>';
4544 4544
 		}
4545 4545
 		$return .= '</select>';
4546 4546
 		if ($addjscombo) {
4547
-			$return .= ajax_combobox('select_' . $htmlname);
4547
+			$return .= ajax_combobox('select_'.$htmlname);
4548 4548
 		}
4549 4549
 
4550 4550
 		return $return;
@@ -4562,7 +4562,7 @@  discard block
 block discarded – undo
4562 4562
 		// phpcs:enable
4563 4563
 		global $langs;
4564 4564
 
4565
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4565
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4566 4566
 		if ($num > 0) {
4567 4567
 			return $num; // Cache already loaded
4568 4568
 		}
@@ -4572,8 +4572,8 @@  discard block
 block discarded – undo
4572 4572
 		$this->cache_transport_mode = array();
4573 4573
 
4574 4574
 		$sql = "SELECT rowid, code, label, active";
4575
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4576
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4575
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4576
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4577 4577
 
4578 4578
 		$resql = $this->db->query($sql);
4579 4579
 		if ($resql) {
@@ -4583,7 +4583,7 @@  discard block
 block discarded – undo
4583 4583
 				$obj = $this->db->fetch_object($resql);
4584 4584
 
4585 4585
 				// If traduction exist, we use it else we take the default label
4586
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4586
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != ("PaymentTypeShort".$obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4587 4587
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4588 4588
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4589 4589
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4617,11 +4617,11 @@  discard block
 block discarded – undo
4617 4617
 	{
4618 4618
 		global $langs, $user;
4619 4619
 
4620
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4620
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4621 4621
 
4622 4622
 		$this->load_cache_transport_mode();
4623 4623
 
4624
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4624
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4625 4625
 		if ($empty) {
4626 4626
 			print '<option value="">&nbsp;</option>';
4627 4627
 		}
@@ -4637,13 +4637,13 @@  discard block
 block discarded – undo
4637 4637
 			}
4638 4638
 
4639 4639
 			if ($format == 0) {
4640
-				print '<option value="' . $id . '"';
4640
+				print '<option value="'.$id.'"';
4641 4641
 			} elseif ($format == 1) {
4642
-				print '<option value="' . $arraytypes['code'] . '"';
4642
+				print '<option value="'.$arraytypes['code'].'"';
4643 4643
 			} elseif ($format == 2) {
4644
-				print '<option value="' . $arraytypes['code'] . '"';
4644
+				print '<option value="'.$arraytypes['code'].'"';
4645 4645
 			} elseif ($format == 3) {
4646
-				print '<option value="' . $id . '"';
4646
+				print '<option value="'.$id.'"';
4647 4647
 			}
4648 4648
 			// If text is selected, we compare with code, else with id
4649 4649
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4691,31 +4691,31 @@  discard block
 block discarded – undo
4691 4691
 		$langs->load("deliveries");
4692 4692
 
4693 4693
 		$sql = "SELECT rowid, code, libelle as label";
4694
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4694
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4695 4695
 		$sql .= " WHERE active > 0";
4696 4696
 		if ($filtre) {
4697
-			$sql .= " AND " . $filtre;
4697
+			$sql .= " AND ".$filtre;
4698 4698
 		}
4699 4699
 		$sql .= " ORDER BY libelle ASC";
4700 4700
 
4701
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4701
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4702 4702
 		$result = $this->db->query($sql);
4703 4703
 		if ($result) {
4704 4704
 			$num = $this->db->num_rows($result);
4705 4705
 			$i = 0;
4706 4706
 			if ($num) {
4707
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4707
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4708 4708
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4709 4709
 					print '<option value="-1">&nbsp;</option>';
4710 4710
 				}
4711 4711
 				while ($i < $num) {
4712 4712
 					$obj = $this->db->fetch_object($result);
4713 4713
 					if ($selected == $obj->rowid) {
4714
-						print '<option value="' . $obj->rowid . '" selected>';
4714
+						print '<option value="'.$obj->rowid.'" selected>';
4715 4715
 					} else {
4716
-						print '<option value="' . $obj->rowid . '">';
4716
+						print '<option value="'.$obj->rowid.'">';
4717 4717
 					}
4718
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4718
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4719 4719
 					print '</option>';
4720 4720
 					$i++;
4721 4721
 				}
@@ -4724,7 +4724,7 @@  discard block
 block discarded – undo
4724 4724
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4725 4725
 				}
4726 4726
 
4727
-				print ajax_combobox('select' . $htmlname);
4727
+				print ajax_combobox('select'.$htmlname);
4728 4728
 			} else {
4729 4729
 				print $langs->trans("NoShippingMethodDefined");
4730 4730
 			}
@@ -4749,16 +4749,16 @@  discard block
 block discarded – undo
4749 4749
 		$langs->load("deliveries");
4750 4750
 
4751 4751
 		if ($htmlname != "none") {
4752
-			print '<form method="POST" action="' . $page . '">';
4752
+			print '<form method="POST" action="'.$page.'">';
4753 4753
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4754
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4754
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4755 4755
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4756
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4756
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4757 4757
 			print '</form>';
4758 4758
 		} else {
4759 4759
 			if ($selected) {
4760 4760
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
4761
-				print $langs->trans("SendingMethod" . strtoupper($code));
4761
+				print $langs->trans("SendingMethod".strtoupper($code));
4762 4762
 			} else {
4763 4763
 				print "&nbsp;";
4764 4764
 			}
@@ -4781,10 +4781,10 @@  discard block
 block discarded – undo
4781 4781
 
4782 4782
 		$opt = '<option value="" selected></option>';
4783 4783
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
4784
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
4785
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
4784
+		$sql .= ' FROM '.$this->db->prefix().'facture';
4785
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
4786 4786
 		$sql .= ' AND situation_counter >= 1';
4787
-		$sql .= ' AND fk_soc = ' . (int) $socid;
4787
+		$sql .= ' AND fk_soc = '.(int) $socid;
4788 4788
 		$sql .= ' AND type <> 2';
4789 4789
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
4790 4790
 		$resql = $this->db->query($sql);
@@ -4802,19 +4802,19 @@  discard block
 block discarded – undo
4802 4802
 						//Not prov?
4803 4803
 						if (substr($obj->ref, 1, 4) != 'PROV') {
4804 4804
 							if ($selected == $obj->rowid) {
4805
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
4805
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
4806 4806
 							} else {
4807
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
4807
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
4808 4808
 							}
4809 4809
 						}
4810 4810
 					}
4811 4811
 				}
4812 4812
 			}
4813 4813
 		} else {
4814
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
4814
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
4815 4815
 		}
4816 4816
 		if ($opt == '<option value ="" selected></option>') {
4817
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
4817
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
4818 4818
 		}
4819 4819
 		return $opt;
4820 4820
 	}
@@ -4834,12 +4834,12 @@  discard block
 block discarded – undo
4834 4834
 
4835 4835
 		$langs->load('products');
4836 4836
 
4837
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
4837
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
4838 4838
 
4839
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
4839
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
4840 4840
 		$sql .= ' WHERE active > 0';
4841 4841
 		if (!empty($unit_type)) {
4842
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
4842
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
4843 4843
 		}
4844 4844
 		$sql .= " ORDER BY sortorder";
4845 4845
 
@@ -4851,14 +4851,14 @@  discard block
 block discarded – undo
4851 4851
 
4852 4852
 			while ($res = $this->db->fetch_object($resql)) {
4853 4853
 				$unitLabel = $res->label;
4854
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
4855
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
4854
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
4855
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
4856 4856
 				}
4857 4857
 
4858 4858
 				if ($selected == $res->rowid) {
4859
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
4859
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
4860 4860
 				} else {
4861
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
4861
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
4862 4862
 				}
4863 4863
 			}
4864 4864
 			$return .= '</select>';
@@ -4893,23 +4893,23 @@  discard block
 block discarded – undo
4893 4893
 		$num = 0;
4894 4894
 
4895 4895
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
4896
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
4897
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
4896
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
4897
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
4898 4898
 		if ($status != 2) {
4899
-			$sql .= " AND clos = " . (int) $status;
4899
+			$sql .= " AND clos = ".(int) $status;
4900 4900
 		}
4901 4901
 		if ($filtre) {
4902
-			$sql .= " AND " . $filtre;
4902
+			$sql .= " AND ".$filtre;
4903 4903
 		}
4904 4904
 		$sql .= " ORDER BY label";
4905 4905
 
4906
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
4906
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
4907 4907
 		$result = $this->db->query($sql);
4908 4908
 		if ($result) {
4909 4909
 			$num = $this->db->num_rows($result);
4910 4910
 			$i = 0;
4911 4911
 			if ($num) {
4912
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4912
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4913 4913
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4914 4914
 					$out .= '<option value="-1">&nbsp;</option>';
4915 4915
 				}
@@ -4917,27 +4917,27 @@  discard block
 block discarded – undo
4917 4917
 				while ($i < $num) {
4918 4918
 					$obj = $this->db->fetch_object($result);
4919 4919
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
4920
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
4920
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
4921 4921
 					} else {
4922
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
4922
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
4923 4923
 					}
4924 4924
 					$out .= trim($obj->label);
4925 4925
 					if ($showcurrency) {
4926
-						$out .= ' (' . $obj->currency_code . ')';
4926
+						$out .= ' ('.$obj->currency_code.')';
4927 4927
 					}
4928 4928
 					if ($status == 2 && $obj->status == 1) {
4929
-						$out .= ' (' . $langs->trans("Closed") . ')';
4929
+						$out .= ' ('.$langs->trans("Closed").')';
4930 4930
 					}
4931 4931
 					$out .= '</option>';
4932 4932
 					$i++;
4933 4933
 				}
4934 4934
 				$out .= "</select>";
4935
-				$out .= ajax_combobox('select' . $htmlname);
4935
+				$out .= ajax_combobox('select'.$htmlname);
4936 4936
 			} else {
4937 4937
 				if ($status == 0) {
4938
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
4938
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
4939 4939
 				} else {
4940
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
4940
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
4941 4941
 				}
4942 4942
 			}
4943 4943
 		} else {
@@ -4973,23 +4973,23 @@  discard block
 block discarded – undo
4973 4973
 		$num = 0;
4974 4974
 
4975 4975
 		$sql = "SELECT rowid, name, fk_country, status, entity";
4976
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
4976
+		$sql .= " FROM ".$this->db->prefix()."establishment";
4977 4977
 		$sql .= " WHERE 1=1";
4978 4978
 		if ($status != 2) {
4979
-			$sql .= " AND status = " . (int) $status;
4979
+			$sql .= " AND status = ".(int) $status;
4980 4980
 		}
4981 4981
 		if ($filtre) {
4982
-			$sql .= " AND " . $filtre;
4982
+			$sql .= " AND ".$filtre;
4983 4983
 		}
4984 4984
 		$sql .= " ORDER BY name";
4985 4985
 
4986
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
4986
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
4987 4987
 		$result = $this->db->query($sql);
4988 4988
 		if ($result) {
4989 4989
 			$num = $this->db->num_rows($result);
4990 4990
 			$i = 0;
4991 4991
 			if ($num) {
4992
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4992
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4993 4993
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4994 4994
 					print '<option value="-1">&nbsp;</option>';
4995 4995
 				}
@@ -4997,13 +4997,13 @@  discard block
 block discarded – undo
4997 4997
 				while ($i < $num) {
4998 4998
 					$obj = $this->db->fetch_object($result);
4999 4999
 					if ($selected == $obj->rowid) {
5000
-						print '<option value="' . $obj->rowid . '" selected>';
5000
+						print '<option value="'.$obj->rowid.'" selected>';
5001 5001
 					} else {
5002
-						print '<option value="' . $obj->rowid . '">';
5002
+						print '<option value="'.$obj->rowid.'">';
5003 5003
 					}
5004 5004
 					print trim($obj->name);
5005 5005
 					if ($status == 2 && $obj->status == 1) {
5006
-						print ' (' . $langs->trans("Closed") . ')';
5006
+						print ' ('.$langs->trans("Closed").')';
5007 5007
 					}
5008 5008
 					print '</option>';
5009 5009
 					$i++;
@@ -5011,9 +5011,9 @@  discard block
 block discarded – undo
5011 5011
 				print "</select>";
5012 5012
 			} else {
5013 5013
 				if ($status == 0) {
5014
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5014
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5015 5015
 				} else {
5016
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5016
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5017 5017
 				}
5018 5018
 			}
5019 5019
 
@@ -5037,20 +5037,20 @@  discard block
 block discarded – undo
5037 5037
 	{
5038 5038
 		global $langs;
5039 5039
 		if ($htmlname != "none") {
5040
-			print '<form method="POST" action="' . $page . '">';
5040
+			print '<form method="POST" action="'.$page.'">';
5041 5041
 			print '<input type="hidden" name="action" value="setbankaccount">';
5042
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5042
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5043 5043
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5044 5044
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5045 5045
 			if ($nbaccountfound > 0) {
5046
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5046
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5047 5047
 			}
5048 5048
 			print '</form>';
5049 5049
 		} else {
5050 5050
 			$langs->load('banks');
5051 5051
 
5052 5052
 			if ($selected) {
5053
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5053
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5054 5054
 				$bankstatic = new Account($this->db);
5055 5055
 				$result = $bankstatic->fetch($selected);
5056 5056
 				if ($result) {
@@ -5088,19 +5088,19 @@  discard block
 block discarded – undo
5088 5088
 		global $conf, $langs;
5089 5089
 		$langs->load("categories");
5090 5090
 
5091
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5091
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5092 5092
 
5093 5093
 		// For backward compatibility
5094 5094
 		if (is_numeric($type)) {
5095
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5095
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5096 5096
 		}
5097 5097
 
5098 5098
 		if ($type === Categorie::TYPE_BANK_LINE) {
5099 5099
 			// TODO Move this into common category feature
5100 5100
 			$cate_arbo = array();
5101 5101
 			$sql = "SELECT c.label, c.rowid";
5102
-			$sql .= " FROM " . $this->db->prefix() . "bank_categ as c";
5103
-			$sql .= " WHERE entity = " . $conf->entity;
5102
+			$sql .= " FROM ".$this->db->prefix()."bank_categ as c";
5103
+			$sql .= " WHERE entity = ".$conf->entity;
5104 5104
 			$sql .= " ORDER BY c.label";
5105 5105
 			$result = $this->db->query($sql);
5106 5106
 			if ($result) {
@@ -5125,10 +5125,10 @@  discard block
 block discarded – undo
5125 5125
 		$outarray = array();
5126 5126
 		$outarrayrichhtml = array();
5127 5127
 
5128
-		$output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5128
+		$output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5129 5129
 		if (is_array($cate_arbo)) {
5130 5130
 			if (!count($cate_arbo)) {
5131
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5131
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5132 5132
 			} else {
5133 5133
 				$output .= '<option value="-1">&nbsp;</option>';
5134 5134
 				foreach ($cate_arbo as $key => $value) {
@@ -5138,15 +5138,15 @@  discard block
 block discarded – undo
5138 5138
 						$add = '';
5139 5139
 					}
5140 5140
 
5141
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5141
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5142 5142
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5143 5143
 
5144 5144
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5145 5145
 
5146 5146
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5147 5147
 
5148
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5149
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5148
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5149
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5150 5150
 					$output .= '>';
5151 5151
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5152 5152
 					$output .= '</option>';
@@ -5187,7 +5187,7 @@  discard block
 block discarded – undo
5187 5187
 	public function form_confirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5188 5188
 	{
5189 5189
 		// phpcs:enable
5190
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5190
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5191 5191
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5192 5192
 	}
5193 5193
 
@@ -5222,7 +5222,7 @@  discard block
 block discarded – undo
5222 5222
 	{
5223 5223
 		global $langs, $conf;
5224 5224
 
5225
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5225
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5226 5226
 		$formconfirm = '';
5227 5227
 		$inputok = array();
5228 5228
 		$inputko = array();
@@ -5246,27 +5246,27 @@  discard block
 block discarded – undo
5246 5246
 			foreach ($formquestion as $key => $input) {
5247 5247
 				if (is_array($input) && !empty($input)) {
5248 5248
 					if ($input['type'] == 'hidden') {
5249
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5250
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5249
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5250
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5251 5251
 
5252
-						$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";
5252
+						$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";
5253 5253
 					}
5254 5254
 				}
5255 5255
 			}
5256 5256
 
5257 5257
 			// Now add questions
5258 5258
 			$moreonecolumn = '';
5259
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5259
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5260 5260
 			foreach ($formquestion as $key => $input) {
5261 5261
 				if (is_array($input) && !empty($input)) {
5262
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5263
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5264
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5262
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5263
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5264
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5265 5265
 
5266 5266
 					if ($input['type'] == 'text') {
5267
-						$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";
5267
+						$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";
5268 5268
 					} elseif ($input['type'] == 'password') {
5269
-						$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";
5269
+						$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";
5270 5270
 					} elseif ($input['type'] == 'textarea') {
5271 5271
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5272 5272
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5274,8 +5274,8 @@  discard block
 block discarded – undo
5274 5274
 						$more .= '</textarea>';
5275 5275
 						$more .= '</div></div>'."\n";*/
5276 5276
 						$moreonecolumn .= '<div class="margintoponly">';
5277
-						$moreonecolumn .= $input['label'] . '<br>';
5278
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5277
+						$moreonecolumn .= $input['label'].'<br>';
5278
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5279 5279
 						$moreonecolumn .= $input['value'];
5280 5280
 						$moreonecolumn .= '</textarea>';
5281 5281
 						$moreonecolumn .= '</div>';
@@ -5292,20 +5292,20 @@  discard block
 block discarded – undo
5292 5292
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5293 5293
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5294 5294
 
5295
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5295
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5296 5296
 						if (!empty($input['label'])) {
5297
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5297
+							$more .= $input['label'].'</div><div class="tagtd left">';
5298 5298
 						}
5299 5299
 						if ($input['type'] == 'select') {
5300 5300
 							$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);
5301 5301
 						} else {
5302 5302
 							$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);
5303 5303
 						}
5304
-						$more .= '</div></div>' . "\n";
5304
+						$more .= '</div></div>'."\n";
5305 5305
 					} elseif ($input['type'] == 'checkbox') {
5306 5306
 						$more .= '<div class="tagtr">';
5307
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5308
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5307
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5308
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5309 5309
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5310 5310
 							$more .= ' checked';
5311 5311
 						}
@@ -5316,19 +5316,19 @@  discard block
 block discarded – undo
5316 5316
 							$more .= ' disabled';
5317 5317
 						}
5318 5318
 						$more .= ' /></div>';
5319
-						$more .= '</div>' . "\n";
5319
+						$more .= '</div>'."\n";
5320 5320
 					} elseif ($input['type'] == 'radio') {
5321 5321
 						$i = 0;
5322 5322
 						foreach ($input['values'] as $selkey => $selval) {
5323 5323
 							$more .= '<div class="tagtr">';
5324 5324
 							if (isset($input['label'])) {
5325 5325
 								if ($i == 0) {
5326
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5326
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5327 5327
 								} else {
5328
-									$more .= '<div clas="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5328
+									$more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5329 5329
 								}
5330 5330
 							}
5331
-							$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;
5331
+							$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;
5332 5332
 							if (!empty($input['disabled'])) {
5333 5333
 								$more .= ' disabled';
5334 5334
 							}
@@ -5336,12 +5336,12 @@  discard block
 block discarded – undo
5336 5336
 								$more .= ' checked="checked"';
5337 5337
 							}
5338 5338
 							$more .= ' /> ';
5339
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5340
-							$more .= '</div></div>' . "\n";
5339
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5340
+							$more .= '</div></div>'."\n";
5341 5341
 							$i++;
5342 5342
 						}
5343 5343
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5344
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5344
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5345 5345
 						$more .= '<div class="tagtd">';
5346 5346
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5347 5347
 						$h = $m = 0;
@@ -5359,24 +5359,24 @@  discard block
 block discarded – undo
5359 5359
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5360 5360
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5361 5361
 						if (!empty($input['label'])) {
5362
-							$more .= $input['label'] . '</div><div class="tagtd">';
5362
+							$more .= $input['label'].'</div><div class="tagtd">';
5363 5363
 						}
5364 5364
 						$more .= $input['value'];
5365
-						$more .= '</div></div>' . "\n";
5365
+						$more .= '</div></div>'."\n";
5366 5366
 					} elseif ($input['type'] == 'onecolumn') {
5367 5367
 						$moreonecolumn .= '<div class="margintoponly">';
5368 5368
 						$moreonecolumn .= $input['value'];
5369
-						$moreonecolumn .= '</div>' . "\n";
5369
+						$moreonecolumn .= '</div>'."\n";
5370 5370
 					} elseif ($input['type'] == 'hidden') {
5371 5371
 						// Do nothing more, already added by a previous loop
5372 5372
 					} elseif ($input['type'] == 'separator') {
5373 5373
 						$more .= '<br>';
5374 5374
 					} else {
5375
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5375
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5376 5376
 					}
5377 5377
 				}
5378 5378
 			}
5379
-			$more .= '</div>' . "\n";
5379
+			$more .= '</div>'."\n";
5380 5380
 			$more .= $moreonecolumn;
5381 5381
 		}
5382 5382
 
@@ -5398,10 +5398,10 @@  discard block
 block discarded – undo
5398 5398
 				$button = $useajax;
5399 5399
 				$useajax = 1;
5400 5400
 				$autoOpen = false;
5401
-				$dialogconfirm .= '-' . $button;
5401
+				$dialogconfirm .= '-'.$button;
5402 5402
 			}
5403
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5404
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5403
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5404
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5405 5405
 
5406 5406
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5407 5407
 			if (is_array($formquestion)) {
@@ -5423,24 +5423,24 @@  discard block
 block discarded – undo
5423 5423
 			}
5424 5424
 
5425 5425
 			// Show JQuery confirm box.
5426
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5426
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5427 5427
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5428
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5428
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5429 5429
 			}
5430 5430
 			if (!empty($more)) {
5431
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5431
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5432 5432
 			}
5433
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : '');
5434
-			$formconfirm .= '</div>' . "\n";
5433
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : '');
5434
+			$formconfirm .= '</div>'."\n";
5435 5435
 
5436
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5437
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5436
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5437
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5438 5438
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5439 5439
 			$formconfirm .= 'jQuery(document).ready(function() {
5440 5440
             $(function() {
5441
-            	$( "#' . $dialogconfirm . '" ).dialog(
5441
+            	$( "#' . $dialogconfirm.'" ).dialog(
5442 5442
             	{
5443
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5443
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5444 5444
 			if ($newselectedchoice == 'no') {
5445 5445
 				$formconfirm .= '
5446 5446
 						open: function() {
@@ -5450,24 +5450,24 @@  discard block
 block discarded – undo
5450 5450
 
5451 5451
 			$jsforcursor = '';
5452 5452
 			if ($useajax == 1) {
5453
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5454
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5453
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5454
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5455 5455
 			}
5456 5456
 
5457 5457
 			$postconfirmas = 'GET';
5458 5458
 
5459 5459
 			$formconfirm .= '
5460 5460
                     resizable: false,
5461
-                    height: "' . $height . '",
5462
-                    width: "' . $width . '",
5461
+                    height: "' . $height.'",
5462
+                    width: "' . $width.'",
5463 5463
                     modal: true,
5464 5464
                     closeOnEscape: false,
5465 5465
                     buttons: {
5466
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5467
-							var options = "token=' . urlencode(newToken()) . '";
5468
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5469
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5470
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5466
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5467
+							var options = "token=' . urlencode(newToken()).'";
5468
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5469
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5470
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5471 5471
 
5472 5472
                          	if (inputok.length > 0) {
5473 5473
                          		$.each(inputok, function(i, inputname) {
@@ -5501,11 +5501,11 @@  discard block
 block discarded – undo
5501 5501
 							}
5502 5502
 	                        $(this).dialog("close");
5503 5503
                         },
5504
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5505
-                        	var options = "token=' . urlencode(newToken()) . '";
5506
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5507
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5508
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5504
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5505
+                        	var options = "token=' . urlencode(newToken()).'";
5506
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5507
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5508
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5509 5509
                          	if (inputko.length > 0) {
5510 5510
                          		$.each(inputko, function(i, inputname) {
5511 5511
                          			var more = "";
@@ -5537,10 +5537,10 @@  discard block
 block discarded – undo
5537 5537
                 }
5538 5538
                 );
5539 5539
 
5540
-            	var button = "' . $button . '";
5540
+            	var button = "' . $button.'";
5541 5541
             	if (button.length > 0) {
5542 5542
                 	$( "#" + button ).click(function() {
5543
-                		$("#' . $dialogconfirm . '").dialog("open");
5543
+                		$("#' . $dialogconfirm.'").dialog("open");
5544 5544
         			});
5545 5545
                 }
5546 5546
             });
@@ -5548,44 +5548,44 @@  discard block
 block discarded – undo
5548 5548
             </script>';
5549 5549
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5550 5550
 		} else {
5551
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5551
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5552 5552
 
5553 5553
 			if (empty($disableformtag)) {
5554
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n";
5554
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
5555 5555
 			}
5556 5556
 
5557
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5558
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5557
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5558
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5559 5559
 
5560
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5560
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5561 5561
 
5562 5562
 			// Line title
5563 5563
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5564
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5565
-			$formconfirm .= '</td></tr>' . "\n";
5564
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5565
+			$formconfirm .= '</td></tr>'."\n";
5566 5566
 
5567 5567
 			// Line text
5568 5568
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5569
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5569
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5570 5570
 			}
5571 5571
 
5572 5572
 			// Line form fields
5573 5573
 			if ($more) {
5574
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5574
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5575 5575
 				$formconfirm .= $more;
5576
-				$formconfirm .= '</td></tr>' . "\n";
5576
+				$formconfirm .= '</td></tr>'."\n";
5577 5577
 			}
5578 5578
 
5579 5579
 			// Line with question
5580 5580
 			$formconfirm .= '<tr class="valid">';
5581
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5581
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5582 5582
 			$formconfirm .= '<td class="valid center">';
5583 5583
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5584
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5584
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5585 5585
 			$formconfirm .= '</td>';
5586
-			$formconfirm .= '</tr>' . "\n";
5586
+			$formconfirm .= '</tr>'."\n";
5587 5587
 
5588
-			$formconfirm .= '</table>' . "\n";
5588
+			$formconfirm .= '</table>'."\n";
5589 5589
 
5590 5590
 			if (empty($disableformtag)) {
5591 5591
 				$formconfirm .= "</form>\n";
@@ -5594,7 +5594,7 @@  discard block
 block discarded – undo
5594 5594
 
5595 5595
 			if (!empty($conf->use_javascript_ajax)) {
5596 5596
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5597
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5597
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5598 5598
 				$formconfirm .= '
5599 5599
 				$(document).ready(function () {
5600 5600
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5606,7 +5606,7 @@  discard block
 block discarded – undo
5606 5606
 					});
5607 5607
 				});
5608 5608
 				';
5609
-				$formconfirm .= '</script>' . "\n";
5609
+				$formconfirm .= '</script>'."\n";
5610 5610
 			}
5611 5611
 
5612 5612
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5638,8 +5638,8 @@  discard block
 block discarded – undo
5638 5638
 		// phpcs:enable
5639 5639
 		global $langs;
5640 5640
 
5641
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5642
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5641
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5642
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5643 5643
 
5644 5644
 		$out = '';
5645 5645
 
@@ -5647,11 +5647,11 @@  discard block
 block discarded – undo
5647 5647
 
5648 5648
 		$langs->load("project");
5649 5649
 		if ($htmlname != "none") {
5650
-			$out .= '<form method="post" action="' . $page . '">';
5650
+			$out .= '<form method="post" action="'.$page.'">';
5651 5651
 			$out .= '<input type="hidden" name="action" value="classin">';
5652
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5652
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5653 5653
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5654
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5654
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5655 5655
 			$out .= '</form>';
5656 5656
 		} else {
5657 5657
 			$out .= '<span class="project_head_block">';
@@ -5660,7 +5660,7 @@  discard block
 block discarded – undo
5660 5660
 				$projet->fetch($selected);
5661 5661
 				$out .= $projet->getNomUrl(0, '', 1);
5662 5662
 			} else {
5663
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5663
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5664 5664
 			}
5665 5665
 			$out .= '</span>';
5666 5666
 		}
@@ -5697,14 +5697,14 @@  discard block
 block discarded – undo
5697 5697
 		$out = '';
5698 5698
 
5699 5699
 		if ($htmlname != "none") {
5700
-			$out .= '<form method="POST" action="' . $page . '">';
5700
+			$out .= '<form method="POST" action="'.$page.'">';
5701 5701
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5702
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5702
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5703 5703
 			if ($type) {
5704
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5704
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5705 5705
 			}
5706 5706
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5707
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5707
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5708 5708
 			$out .= '</form>';
5709 5709
 		} else {
5710 5710
 			if ($selected) {
@@ -5749,12 +5749,12 @@  discard block
 block discarded – undo
5749 5749
 		// phpcs:enable
5750 5750
 		global $langs;
5751 5751
 		if ($htmlname != "none") {
5752
-			print '<form method="post" action="' . $page . '">';
5752
+			print '<form method="post" action="'.$page.'">';
5753 5753
 			print '<input type="hidden" name="action" value="setavailability">';
5754
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5754
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5755 5755
 			$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
5756
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5757
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
5756
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5757
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
5758 5758
 			print '</form>';
5759 5759
 		} else {
5760 5760
 			if ($selected) {
@@ -5780,11 +5780,11 @@  discard block
 block discarded – undo
5780 5780
 	{
5781 5781
 		global $langs;
5782 5782
 		if ($htmlname != "none") {
5783
-			print '<form method="post" action="' . $page . '">';
5783
+			print '<form method="post" action="'.$page.'">';
5784 5784
 			print '<input type="hidden" name="action" value="setdemandreason">';
5785
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5785
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5786 5786
 			$this->selectInputReason($selected, $htmlname, -1, $addempty);
5787
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5787
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5788 5788
 			print '</form>';
5789 5789
 		} else {
5790 5790
 			if ($selected) {
@@ -5824,17 +5824,17 @@  discard block
 block discarded – undo
5824 5824
 		$ret = '';
5825 5825
 
5826 5826
 		if ($htmlname != "none") {
5827
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5828
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
5829
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
5827
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5828
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
5829
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
5830 5830
 			if ($type) {
5831
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5831
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5832 5832
 			}
5833 5833
 			$ret .= '<table class="nobordernopadding">';
5834 5834
 			$ret .= '<tr><td>';
5835
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
5835
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
5836 5836
 			$ret .= '</td>';
5837
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
5837
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
5838 5838
 			$ret .= '</tr></table></form>';
5839 5839
 		} else {
5840 5840
 			if ($displayhour) {
@@ -5869,15 +5869,15 @@  discard block
 block discarded – undo
5869 5869
 		global $langs;
5870 5870
 
5871 5871
 		if ($htmlname != "none") {
5872
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5873
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
5874
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5872
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5873
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
5874
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5875 5875
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
5876
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5876
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5877 5877
 			print '</form>';
5878 5878
 		} else {
5879 5879
 			if ($selected) {
5880
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
5880
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
5881 5881
 				$theuser = new User($this->db);
5882 5882
 				$theuser->fetch($selected);
5883 5883
 				print $theuser->getNomUrl(1);
@@ -5910,14 +5910,14 @@  discard block
 block discarded – undo
5910 5910
 
5911 5911
 		$out = '';
5912 5912
 		if ($htmlname != "none") {
5913
-			$out .= '<form method="POST" action="' . $page . '">';
5913
+			$out .= '<form method="POST" action="'.$page.'">';
5914 5914
 			$out .= '<input type="hidden" name="action" value="setmode">';
5915
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5915
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5916 5916
 			if ($type) {
5917
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5917
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5918 5918
 			}
5919 5919
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
5920
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5920
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5921 5921
 			$out .= '</form>';
5922 5922
 		} else {
5923 5923
 			if ($selected) {
@@ -5950,11 +5950,11 @@  discard block
 block discarded – undo
5950 5950
 	{
5951 5951
 		global $langs;
5952 5952
 		if ($htmlname != "none") {
5953
-			print '<form method="POST" action="' . $page . '">';
5953
+			print '<form method="POST" action="'.$page.'">';
5954 5954
 			print '<input type="hidden" name="action" value="settransportmode">';
5955
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5955
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5956 5956
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
5957
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5957
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5958 5958
 			print '</form>';
5959 5959
 		} else {
5960 5960
 			if ($selected) {
@@ -5981,11 +5981,11 @@  discard block
 block discarded – undo
5981 5981
 		// phpcs:enable
5982 5982
 		global $langs;
5983 5983
 		if ($htmlname != "none") {
5984
-			print '<form method="POST" action="' . $page . '">';
5984
+			print '<form method="POST" action="'.$page.'">';
5985 5985
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
5986
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5986
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5987 5987
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
5988
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5988
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5989 5989
 			print '</form>';
5990 5990
 		} else {
5991 5991
 			dol_include_once('/core/lib/company.lib.php');
@@ -6010,21 +6010,21 @@  discard block
 block discarded – undo
6010 6010
 		global $langs, $mysoc, $conf;
6011 6011
 
6012 6012
 		if ($htmlname != "none") {
6013
-			print '<form method="POST" action="' . $page . '">';
6013
+			print '<form method="POST" action="'.$page.'">';
6014 6014
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6015
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6016
-			print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6015
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6016
+			print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6017 6017
 			print '<select name="calculation_mode">';
6018
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6019
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6018
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6019
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6020 6020
 			print '</select> ';
6021
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6021
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6022 6022
 			print '</form>';
6023 6023
 		} else {
6024 6024
 			if (!empty($rate)) {
6025 6025
 				print price($rate, 1, $langs, 1, 0);
6026 6026
 				if ($currency && $rate != 1) {
6027
-					print ' &nbsp; (' . price($rate, 1, $langs, 1, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')';
6027
+					print ' &nbsp; ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')';
6028 6028
 				}
6029 6029
 			} else {
6030 6030
 				print 1;
@@ -6055,9 +6055,9 @@  discard block
 block discarded – undo
6055 6055
 		// phpcs:enable
6056 6056
 		global $conf, $langs;
6057 6057
 		if ($htmlname != "none") {
6058
-			print '<form method="post" action="' . $page . '">';
6058
+			print '<form method="post" action="'.$page.'">';
6059 6059
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6060
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6060
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6061 6061
 			print '<div class="inline-block">';
6062 6062
 			if (!empty($discount_type)) {
6063 6063
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6095,24 +6095,24 @@  discard block
 block discarded – undo
6095 6095
 			print '</div>';
6096 6096
 			if (empty($hidelist)) {
6097 6097
 				print '<div class="inline-block" style="padding-right: 10px">';
6098
-				$newfilter = 'discount_type=' . intval($discount_type);
6098
+				$newfilter = 'discount_type='.intval($discount_type);
6099 6099
 				if (!empty($discount_type)) {
6100 6100
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6101 6101
 				} else {
6102 6102
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6103 6103
 				}
6104 6104
 				if ($filter) {
6105
-					$newfilter .= ' AND (' . $filter . ')';
6105
+					$newfilter .= ' AND ('.$filter.')';
6106 6106
 				}
6107 6107
 				// output the combo of discounts
6108 6108
 				$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
6109 6109
 				if ($nbqualifiedlines > 0) {
6110
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6110
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6111 6111
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6112
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6112
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6113 6113
 					}
6114 6114
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6115
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6115
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6116 6116
 					}
6117 6117
 
6118 6118
 					print '>';
@@ -6152,23 +6152,23 @@  discard block
 block discarded – undo
6152 6152
 		global $langs, $conf;
6153 6153
 
6154 6154
 		if ($htmlname != "none") {
6155
-			print '<form method="post" action="' . $page . '">';
6155
+			print '<form method="post" action="'.$page.'">';
6156 6156
 			print '<input type="hidden" name="action" value="set_contact">';
6157
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6157
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6158 6158
 			print '<table class="nobordernopadding">';
6159 6159
 			print '<tr><td>';
6160 6160
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6161 6161
 			$num = $this->num;
6162 6162
 			if ($num == 0) {
6163 6163
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6164
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6164
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6165 6165
 			}
6166 6166
 			print '</td>';
6167
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6167
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6168 6168
 			print '</tr></table></form>';
6169 6169
 		} else {
6170 6170
 			if ($selected) {
6171
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6171
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6172 6172
 				$contact = new Contact($this->db);
6173 6173
 				$contact->fetch($selected);
6174 6174
 				print $contact->getFullName($langs);
@@ -6203,20 +6203,20 @@  discard block
 block discarded – undo
6203 6203
 
6204 6204
 		$out = '';
6205 6205
 		if ($htmlname != "none") {
6206
-			$out .= '<form method="post" action="' . $page . '">';
6206
+			$out .= '<form method="post" action="'.$page.'">';
6207 6207
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6208
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6208
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6209 6209
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6210
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6210
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6211 6211
 			$out .= '</form>';
6212 6212
 		} else {
6213 6213
 			if ($selected) {
6214
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6214
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6215 6215
 				$soc = new Societe($this->db);
6216 6216
 				$soc->fetch($selected);
6217 6217
 				$out .= $soc->getNomUrl(0, '');
6218 6218
 			} else {
6219
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6219
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6220 6220
 			}
6221 6221
 		}
6222 6222
 
@@ -6266,22 +6266,22 @@  discard block
 block discarded – undo
6266 6266
 			$selected = 'EUR'; // Pour compatibilite
6267 6267
 		}
6268 6268
 
6269
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6269
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6270 6270
 		if ($useempty) {
6271 6271
 			$out .= '<option value="-1" selected></option>';
6272 6272
 		}
6273 6273
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6274 6274
 			$labeltoshow = $currency['label'];
6275 6275
 			if ($mode == 1) {
6276
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6276
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6277 6277
 			} else {
6278
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6278
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6279 6279
 			}
6280 6280
 
6281 6281
 			if ($selected && $selected == $code_iso) {
6282
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6282
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6283 6283
 			} else {
6284
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6284
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6285 6285
 			}
6286 6286
 			$out .= $labeltoshow;
6287 6287
 			$out .= '</option>';
@@ -6292,7 +6292,7 @@  discard block
 block discarded – undo
6292 6292
 		}
6293 6293
 
6294 6294
 		// Make select dynamic
6295
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6295
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6296 6296
 		$out .= ajax_combobox($htmlname);
6297 6297
 
6298 6298
 		return $out;
@@ -6318,10 +6318,10 @@  discard block
 block discarded – undo
6318 6318
 
6319 6319
 		$TCurrency = array();
6320 6320
 
6321
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6322
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6321
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6322
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6323 6323
 		if ($filter) {
6324
-			$sql .= " AND " . $filter;
6324
+			$sql .= " AND ".$filter;
6325 6325
 		}
6326 6326
 		$resql = $this->db->query($sql);
6327 6327
 		if ($resql) {
@@ -6331,7 +6331,7 @@  discard block
 block discarded – undo
6331 6331
 		}
6332 6332
 
6333 6333
 		$out = '';
6334
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6334
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6335 6335
 		if ($useempty) {
6336 6336
 			$out .= '<option value="">&nbsp;</option>';
6337 6337
 		}
@@ -6343,13 +6343,13 @@  discard block
 block discarded – undo
6343 6343
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6344 6344
 				if (isset($TCurrency[$code_iso])) {
6345 6345
 					if (!empty($selected) && $selected == $code_iso) {
6346
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6346
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6347 6347
 					} else {
6348
-						$out .= '<option value="' . $code_iso . '">';
6348
+						$out .= '<option value="'.$code_iso.'">';
6349 6349
 					}
6350 6350
 
6351 6351
 					$out .= $currency['label'];
6352
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6352
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6353 6353
 					$out .= '</option>';
6354 6354
 				}
6355 6355
 			}
@@ -6358,7 +6358,7 @@  discard block
 block discarded – undo
6358 6358
 		$out .= '</select>';
6359 6359
 
6360 6360
 		// Make select dynamic
6361
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6361
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6362 6362
 		$out .= ajax_combobox($htmlname);
6363 6363
 
6364 6364
 		return $out;
@@ -6385,11 +6385,11 @@  discard block
 block discarded – undo
6385 6385
 		dol_syslog(__METHOD__, LOG_DEBUG);
6386 6386
 
6387 6387
 		$sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly";
6388
-		$sql .= " FROM " . $this->db->prefix() . "c_tva as t, " . $this->db->prefix() . "c_country as c";
6388
+		$sql .= " FROM ".$this->db->prefix()."c_tva as t, ".$this->db->prefix()."c_country as c";
6389 6389
 		$sql .= " WHERE t.fk_pays = c.rowid";
6390 6390
 		$sql .= " AND t.active > 0";
6391 6391
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6392
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6392
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6393 6393
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6394 6394
 
6395 6395
 		$resql = $this->db->query($sql);
@@ -6407,22 +6407,22 @@  discard block
 block discarded – undo
6407 6407
 					$this->cache_vatrates[$i]['localtax2'] = $obj->localtax2;
6408 6408
 					$this->cache_vatrates[$i]['localtax2_type'] = $obj->localtax1_type;
6409 6409
 
6410
-					$this->cache_vatrates[$i]['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6411
-					$this->cache_vatrates[$i]['labelallrates'] = $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6410
+					$this->cache_vatrates[$i]['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6411
+					$this->cache_vatrates[$i]['labelallrates'] = $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6412 6412
 					$positiverates = '';
6413 6413
 					if ($obj->taux) {
6414
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6414
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6415 6415
 					}
6416 6416
 					if ($obj->localtax1) {
6417
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6417
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6418 6418
 					}
6419 6419
 					if ($obj->localtax2) {
6420
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6420
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6421 6421
 					}
6422 6422
 					if (empty($positiverates)) {
6423 6423
 						$positiverates = '0';
6424 6424
 					}
6425
-					$this->cache_vatrates[$i]['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6425
+					$this->cache_vatrates[$i]['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6426 6426
 				}
6427 6427
 
6428 6428
 				return $num;
@@ -6440,7 +6440,7 @@  discard block
 block discarded – undo
6440 6440
 				return -1;
6441 6441
 			}
6442 6442
 		} else {
6443
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6443
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6444 6444
 			return -2;
6445 6445
 		}
6446 6446
 	}
@@ -6492,9 +6492,9 @@  discard block
 block discarded – undo
6492 6492
 		// Check parameters
6493 6493
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6494 6494
 			if ($societe_vendeuse->id == $mysoc->id) {
6495
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6495
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6496 6496
 			} else {
6497
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6497
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6498 6498
 			}
6499 6499
 			return $return;
6500 6500
 		}
@@ -6506,25 +6506,25 @@  discard block
 block discarded – undo
6506 6506
 		// Define list of countries to use to search VAT rates to show
6507 6507
 		// First we defined code_country to use to find list
6508 6508
 		if (is_object($societe_vendeuse)) {
6509
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6509
+			$code_country = "'".$societe_vendeuse->country_code."'";
6510 6510
 		} else {
6511
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6511
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6512 6512
 		}
6513 6513
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6514
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6514
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6515 6515
 			if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) {
6516 6516
 				// We also add the buyer country code
6517 6517
 				if (is_numeric($type)) {
6518 6518
 					if ($type == 1) { // We know product is a service
6519
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6519
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6520 6520
 					}
6521 6521
 				} elseif (!$idprod) {  // We don't know type of product
6522
-					$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6522
+					$code_country .= ",'".$societe_acheteuse->country_code."'";
6523 6523
 				} else {
6524 6524
 					$prodstatic = new Product($this->db);
6525 6525
 					$prodstatic->fetch($idprod);
6526 6526
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6527
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6527
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6528 6528
 					}
6529 6529
 				}
6530 6530
 			}
@@ -6576,13 +6576,13 @@  discard block
 block discarded – undo
6576 6576
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6577 6577
 				// of using supplier invoices (this is a very bad idea !)
6578 6578
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
6579
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6579
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6580 6580
 					$disabled = true;
6581 6581
 				}
6582 6582
 			}
6583 6583
 
6584 6584
 			if (!$options_only) {
6585
-				$return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6585
+				$return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6586 6586
 			}
6587 6587
 
6588 6588
 			$selectedfound = false;
@@ -6596,13 +6596,13 @@  discard block
 block discarded – undo
6596 6596
 				$key = $rate['txtva'];
6597 6597
 				$key .= $rate['nprtva'] ? '*' : '';
6598 6598
 				if ($mode > 0 && $rate['code']) {
6599
-					$key .= ' (' . $rate['code'] . ')';
6599
+					$key .= ' ('.$rate['code'].')';
6600 6600
 				}
6601 6601
 				if ($mode < 0) {
6602 6602
 					$key = $rate['rowid'];
6603 6603
 				}
6604 6604
 
6605
-				$return .= '<option value="' . $key . '"';
6605
+				$return .= '<option value="'.$key.'"';
6606 6606
 				if (!$selectedfound) {
6607 6607
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6608 6608
 						if ($defaultcode == $rate['code']) {
@@ -6673,7 +6673,7 @@  discard block
 block discarded – undo
6673 6673
 	public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '')
6674 6674
 	{
6675 6675
 		// phpcs:enable
6676
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6676
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6677 6677
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
6678 6678
 		if (!empty($nooutput)) {
6679 6679
 			return $retstring;
@@ -6702,11 +6702,11 @@  discard block
 block discarded – undo
6702 6702
 	{
6703 6703
 		global $langs;
6704 6704
 
6705
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6705
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6706 6706
 		if ($forcenewline) {
6707 6707
 			$ret .= '<br>';
6708 6708
 		}
6709
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6709
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6710 6710
 		return $ret;
6711 6711
 	}
6712 6712
 
@@ -6772,7 +6772,7 @@  discard block
 block discarded – undo
6772 6772
 		$orig_set_time = $set_time;
6773 6773
 
6774 6774
 		if ($set_time === '' && $emptydate == 0) {
6775
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
6775
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
6776 6776
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
6777 6777
 				$set_time = dol_now($gm);
6778 6778
 			} else {
@@ -6840,38 +6840,38 @@  discard block
 block discarded – undo
6840 6840
 				// Calendrier popup version eldy
6841 6841
 				if ($usecalendar == "eldy") {
6842 6842
 					// Input area to enter date manually
6843
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
6843
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6844 6844
 					$retstring .= ($disabled ? ' disabled' : '');
6845
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6845
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6846 6846
 					$retstring .= '>';
6847 6847
 
6848 6848
 					// Icon calendar
6849 6849
 					$retstringbuttom = '';
6850 6850
 					if (!$disabled) {
6851
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
6852
-						$base = DOL_URL_ROOT . '/core/';
6853
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
6854
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
6851
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
6852
+						$base = DOL_URL_ROOT.'/core/';
6853
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
6854
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
6855 6855
 					} else {
6856
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6856
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6857 6857
 					}
6858
-					$retstring = $retstringbuttom . $retstring;
6858
+					$retstring = $retstringbuttom.$retstring;
6859 6859
 
6860
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6861
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6862
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6860
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6861
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6862
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6863 6863
 				} elseif ($usecalendar == 'jquery') {
6864 6864
 					if (!$disabled) {
6865 6865
 						// Output javascript for datepicker
6866 6866
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100));
6867 6867
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100));
6868 6868
 
6869
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
6870
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
6871
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
6869
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
6870
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
6871
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
6872 6872
 							autoclose: true,
6873 6873
 							todayHighlight: true,
6874
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
6874
+							yearRange: '" . $minYear.":".$maxYear."',";
6875 6875
 						if (!empty($conf->dol_use_jmobile)) {
6876 6876
 							$retstring .= "
6877 6877
 								beforeShow: function (input, datePicker) {
@@ -6886,7 +6886,7 @@  discard block
 block discarded – undo
6886 6886
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
6887 6887
 							$retstring .= "
6888 6888
 								showOn: 'button',	/* both has problem with autocompletion */
6889
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
6889
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
6890 6890
 								buttonImageOnly: true";
6891 6891
 						}
6892 6892
 						$retstring .= "
@@ -6898,8 +6898,8 @@  discard block
 block discarded – undo
6898 6898
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
6899 6899
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6900 6900
 					$retstring .= ($disabled ? ' disabled' : '');
6901
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
6902
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6901
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
6902
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6903 6903
 					$retstring .= '>';
6904 6904
 
6905 6905
 					// Icone calendrier
@@ -6914,40 +6914,40 @@  discard block
 block discarded – undo
6914 6914
 						$retstring.='});';
6915 6915
 						$retstring.="</script>";*/
6916 6916
 					} else {
6917
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6918
-						$retsring = $retstringbutton . $retstring;
6917
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6918
+						$retsring = $retstringbutton.$retstring;
6919 6919
 					}
6920 6920
 
6921 6921
 					$retstring .= '</div>';
6922
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6923
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6924
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6922
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6923
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6924
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6925 6925
 				} else {
6926 6926
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
6927 6927
 				}
6928 6928
 			} else {
6929 6929
 				// Show date with combo selects
6930 6930
 				// Day
6931
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
6931
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
6932 6932
 
6933 6933
 				if ($emptydate || $set_time == -1) {
6934 6934
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6935 6935
 				}
6936 6936
 
6937 6937
 				for ($day = 1; $day <= 31; $day++) {
6938
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
6938
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
6939 6939
 				}
6940 6940
 
6941 6941
 				$retstring .= "</select>";
6942 6942
 
6943
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
6943
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
6944 6944
 				if ($emptydate || $set_time == -1) {
6945 6945
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6946 6946
 				}
6947 6947
 
6948 6948
 				// Month
6949 6949
 				for ($month = 1; $month <= 12; $month++) {
6950
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
6950
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
6951 6951
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
6952 6952
 					$retstring .= "</option>";
6953 6953
 				}
@@ -6955,12 +6955,12 @@  discard block
 block discarded – undo
6955 6955
 
6956 6956
 				// Year
6957 6957
 				if ($emptydate || $set_time == -1) {
6958
-					$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 . '">';
6958
+					$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.'">';
6959 6959
 				} else {
6960
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
6960
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
6961 6961
 
6962 6962
 					for ($year = $syear - 10; $year < $syear + 10; $year++) {
6963
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
6963
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
6964 6964
 					}
6965 6965
 					$retstring .= "</select>\n";
6966 6966
 				}
@@ -6984,15 +6984,15 @@  discard block
 block discarded – undo
6984 6984
 				}
6985 6985
 			}
6986 6986
 			// Show hour
6987
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
6987
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
6988 6988
 			if ($emptyhours) {
6989 6989
 				$retstring .= '<option value="-1">&nbsp;</option>';
6990 6990
 			}
6991 6991
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
6992 6992
 				if (strlen($hour) < 2) {
6993
-					$hour = "0" . $hour;
6993
+					$hour = "0".$hour;
6994 6994
 				}
6995
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
6995
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
6996 6996
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
6997 6997
 				$retstring .= '</option>';
6998 6998
 			}
@@ -7005,19 +7005,19 @@  discard block
 block discarded – undo
7005 7005
 
7006 7006
 		if ($m) {
7007 7007
 			// Show minutes
7008
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7008
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7009 7009
 			if ($emptyhours) {
7010 7010
 				$retstring .= '<option value="-1">&nbsp;</option>';
7011 7011
 			}
7012 7012
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7013 7013
 				if (strlen($min) < 2) {
7014
-					$min = "0" . $min;
7014
+					$min = "0".$min;
7015 7015
 				}
7016
-				$retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>';
7016
+				$retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>';
7017 7017
 			}
7018 7018
 			$retstring .= '</select>';
7019 7019
 
7020
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7020
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7021 7021
 		}
7022 7022
 
7023 7023
 		if ($d && $h) {
@@ -7040,10 +7040,10 @@  discard block
 block discarded – undo
7040 7040
 
7041 7041
 			// Generate the date part, depending on the use or not of the javascript calendar
7042 7042
 			if ($addnowlink == 1) { // server time expressed in user time setup
7043
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7044
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7045
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7046
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7043
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7044
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7045
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7046
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7047 7047
 			} elseif ($addnowlink == 2) {
7048 7048
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7049 7049
 				 * This break application for foreign languages.
@@ -7052,10 +7052,10 @@  discard block
 block discarded – undo
7052 7052
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7053 7053
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7054 7054
 				*/
7055
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7056
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7057
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7058
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7055
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7056
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7057
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7058
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7059 7059
 			}
7060 7060
 			/*if ($usecalendar == "eldy")
7061 7061
 			{
@@ -7075,11 +7075,11 @@  discard block
 block discarded – undo
7075 7075
 				}
7076 7076
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7077 7077
 				if ($addnowlink == 1) {
7078
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7079
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7078
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7079
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7080 7080
 				} elseif ($addnowlink == 2) {
7081
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7082
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7081
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7082
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7083 7083
 				}
7084 7084
 
7085 7085
 				if ($fullday) {
@@ -7093,11 +7093,11 @@  discard block
 block discarded – undo
7093 7093
 				}
7094 7094
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7095 7095
 				if ($addnowlink == 1) {
7096
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7097
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7096
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7097
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7098 7098
 				} elseif ($addnowlink == 2) {
7099
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7100
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7099
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7100
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7101 7101
 				}
7102 7102
 				if ($fullday) {
7103 7103
 					$reset_scripts .= ' } ';
@@ -7105,7 +7105,7 @@  discard block
 block discarded – undo
7105 7105
 			}
7106 7106
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7107 7107
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7108
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7108
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7109 7109
 				$retstring .= $langs->trans("Now");
7110 7110
 				$retstring .= '</button> ';
7111 7111
 			}
@@ -7117,16 +7117,16 @@  discard block
 block discarded – undo
7117 7117
 			$reset_scripts = "";
7118 7118
 
7119 7119
 			// Generate the date part, depending on the use or not of the javascript calendar
7120
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7121
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7122
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7123
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7120
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7121
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7122
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7123
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7124 7124
 			// Update the hour part
7125 7125
 			if ($h) {
7126 7126
 				if ($fullday) {
7127 7127
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7128 7128
 				}
7129
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7129
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7130 7130
 				if ($fullday) {
7131 7131
 					$reset_scripts .= ' } ';
7132 7132
 				}
@@ -7136,14 +7136,14 @@  discard block
 block discarded – undo
7136 7136
 				if ($fullday) {
7137 7137
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7138 7138
 				}
7139
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7139
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7140 7140
 				if ($fullday) {
7141 7141
 					$reset_scripts .= ' } ';
7142 7142
 				}
7143 7143
 			}
7144 7144
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7145 7145
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7146
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7146
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7147 7147
 				$retstring .= $langs->trans("DateStartPlusOne");
7148 7148
 				$retstring .= '</button> ';
7149 7149
 			}
@@ -7201,17 +7201,17 @@  discard block
 block discarded – undo
7201 7201
 			unset($TDurationTypes[$value]);
7202 7202
 		}
7203 7203
 
7204
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7204
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7205 7205
 		foreach ($TDurationTypes as $key => $typeduration) {
7206
-			$retstring .= '<option value="' . $key . '"';
7206
+			$retstring .= '<option value="'.$key.'"';
7207 7207
 			if ($key == $selected) {
7208 7208
 				$retstring .= " selected";
7209 7209
 			}
7210
-			$retstring .= ">" . $typeduration . "</option>";
7210
+			$retstring .= ">".$typeduration."</option>";
7211 7211
 		}
7212 7212
 		$retstring .= "</select>";
7213 7213
 
7214
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7214
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7215 7215
 
7216 7216
 		return $retstring;
7217 7217
 	}
@@ -7243,30 +7243,30 @@  discard block
 block discarded – undo
7243 7243
 
7244 7244
 		// Hours
7245 7245
 		if ($iSecond != '') {
7246
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7246
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7247 7247
 
7248 7248
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7249 7249
 			$minSelected = convertSecondToTime($iSecond, 'min');
7250 7250
 		}
7251 7251
 
7252 7252
 		if ($typehour == 'select') {
7253
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7253
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7254 7254
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7255
-				$retstring .= '<option value="' . $hour . '"';
7255
+				$retstring .= '<option value="'.$hour.'"';
7256 7256
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7257 7257
 					$retstring .= " selected";
7258 7258
 				}
7259
-				$retstring .= ">" . $hour . "</option>";
7259
+				$retstring .= ">".$hour."</option>";
7260 7260
 			}
7261 7261
 			$retstring .= "</select>";
7262 7262
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7263
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7263
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7264 7264
 		} else {
7265 7265
 			return 'BadValueForParameterTypeHour';
7266 7266
 		}
7267 7267
 
7268 7268
 		if ($typehour != 'text') {
7269
-			$retstring .= ' ' . $langs->trans('HourShort');
7269
+			$retstring .= ' '.$langs->trans('HourShort');
7270 7270
 		} else {
7271 7271
 			$retstring .= '<span class="">:</span>';
7272 7272
 		}
@@ -7281,21 +7281,21 @@  discard block
 block discarded – undo
7281 7281
 		}
7282 7282
 
7283 7283
 		if ($typehour == 'select' || $typehour == 'textselect') {
7284
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7284
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7285 7285
 			for ($min = 0; $min <= 55; $min = $min + 5) {
7286
-				$retstring .= '<option value="' . $min . '"';
7286
+				$retstring .= '<option value="'.$min.'"';
7287 7287
 				if (is_numeric($minSelected) && $minSelected == $min) {
7288 7288
 					$retstring .= ' selected';
7289 7289
 				}
7290
-				$retstring .= '>' . $min . '</option>';
7290
+				$retstring .= '>'.$min.'</option>';
7291 7291
 			}
7292 7292
 			$retstring .= "</select>";
7293 7293
 		} elseif ($typehour == 'text') {
7294
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7294
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7295 7295
 		}
7296 7296
 
7297 7297
 		if ($typehour != 'text') {
7298
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7298
+			$retstring .= ' '.$langs->trans('MinuteShort');
7299 7299
 		}
7300 7300
 
7301 7301
 		$retstring .= "</span>";
@@ -7343,7 +7343,7 @@  discard block
 block discarded – undo
7343 7343
 			$placeholder = '';
7344 7344
 
7345 7345
 			if ($selected && empty($selected_input_value)) {
7346
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7346
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7347 7347
 				$tickettmpselect = new Ticket($this->db);
7348 7348
 				$tickettmpselect->fetch($selected);
7349 7349
 				$selected_input_value = $tickettmpselect->ref;
@@ -7351,17 +7351,17 @@  discard block
 block discarded – undo
7351 7351
 			}
7352 7352
 
7353 7353
 			$urloption = '';
7354
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7354
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7355 7355
 
7356 7356
 			if (empty($hidelabel)) {
7357
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7357
+				$out .= $langs->trans("RefOrLabel").' : ';
7358 7358
 			} elseif ($hidelabel > 1) {
7359
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7359
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7360 7360
 				if ($hidelabel == 2) {
7361 7361
 					$out .= img_picto($langs->trans("Search"), 'search');
7362 7362
 				}
7363 7363
 			}
7364
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7364
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7365 7365
 			if ($hidelabel == 3) {
7366 7366
 				$out .= img_picto($langs->trans("Search"), 'search');
7367 7367
 			}
@@ -7405,8 +7405,8 @@  discard block
 block discarded – undo
7405 7405
 
7406 7406
 		$sql = "SELECT ";
7407 7407
 		$sql .= $selectFields;
7408
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7409
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7408
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7409
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7410 7410
 
7411 7411
 		// Add criteria on ref/label
7412 7412
 		if ($filterkey != '') {
@@ -7422,7 +7422,7 @@  discard block
 block discarded – undo
7422 7422
 				if ($i > 0) {
7423 7423
 					$sql .= " AND ";
7424 7424
 				}
7425
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7425
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7426 7426
 				$sql .= ")";
7427 7427
 				$i++;
7428 7428
 			}
@@ -7435,22 +7435,22 @@  discard block
 block discarded – undo
7435 7435
 		$sql .= $this->db->plimit($limit, 0);
7436 7436
 
7437 7437
 		// Build output string
7438
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7438
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7439 7439
 		$result = $this->db->query($sql);
7440 7440
 		if ($result) {
7441
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7442
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7441
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7442
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7443 7443
 
7444 7444
 			$num = $this->db->num_rows($result);
7445 7445
 
7446 7446
 			$events = null;
7447 7447
 
7448 7448
 			if (!$forcecombo) {
7449
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7449
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7450 7450
 				$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT);
7451 7451
 			}
7452 7452
 
7453
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7453
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7454 7454
 
7455 7455
 			$textifempty = '';
7456 7456
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7467,7 +7467,7 @@  discard block
 block discarded – undo
7467 7467
 				}
7468 7468
 			}
7469 7469
 			if ($showempty) {
7470
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7470
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7471 7471
 			}
7472 7472
 
7473 7473
 			$i = 0;
@@ -7522,13 +7522,13 @@  discard block
 block discarded – undo
7522 7522
 		$outref = $objp->ref;
7523 7523
 		$outtype = $objp->fk_product_type;
7524 7524
 
7525
-		$opt = '<option value="' . $objp->rowid . '"';
7525
+		$opt = '<option value="'.$objp->rowid.'"';
7526 7526
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7527 7527
 		$opt .= '>';
7528 7528
 		$opt .= $objp->ref;
7529 7529
 		$objRef = $objp->ref;
7530 7530
 		if (!empty($filterkey) && $filterkey != '') {
7531
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7531
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7532 7532
 		}
7533 7533
 
7534 7534
 		$opt .= "</option>\n";
@@ -7569,7 +7569,7 @@  discard block
 block discarded – undo
7569 7569
 			$placeholder = '';
7570 7570
 
7571 7571
 			if ($selected && empty($selected_input_value)) {
7572
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7572
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7573 7573
 				$projecttmpselect = new Project($this->db);
7574 7574
 				$projecttmpselect->fetch($selected);
7575 7575
 				$selected_input_value = $projecttmpselect->ref;
@@ -7577,17 +7577,17 @@  discard block
 block discarded – undo
7577 7577
 			}
7578 7578
 
7579 7579
 			$urloption = '';
7580
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7580
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7581 7581
 
7582 7582
 			if (empty($hidelabel)) {
7583
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7583
+				$out .= $langs->trans("RefOrLabel").' : ';
7584 7584
 			} elseif ($hidelabel > 1) {
7585
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7585
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7586 7586
 				if ($hidelabel == 2) {
7587 7587
 					$out .= img_picto($langs->trans("Search"), 'search');
7588 7588
 				}
7589 7589
 			}
7590
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7590
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7591 7591
 			if ($hidelabel == 3) {
7592 7592
 				$out .= img_picto($langs->trans("Search"), 'search');
7593 7593
 			}
@@ -7630,8 +7630,8 @@  discard block
 block discarded – undo
7630 7630
 
7631 7631
 		$sql = "SELECT ";
7632 7632
 		$sql .= $selectFields;
7633
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7634
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7633
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7634
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7635 7635
 
7636 7636
 		// Add criteria on ref/label
7637 7637
 		if ($filterkey != '') {
@@ -7647,7 +7647,7 @@  discard block
 block discarded – undo
7647 7647
 				if ($i > 0) {
7648 7648
 					$sql .= " AND ";
7649 7649
 				}
7650
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7650
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7651 7651
 				$sql .= "";
7652 7652
 				$i++;
7653 7653
 			}
@@ -7660,22 +7660,22 @@  discard block
 block discarded – undo
7660 7660
 		$sql .= $this->db->plimit($limit, 0);
7661 7661
 
7662 7662
 		// Build output string
7663
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7663
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7664 7664
 		$result = $this->db->query($sql);
7665 7665
 		if ($result) {
7666
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7667
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7666
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7667
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7668 7668
 
7669 7669
 			$num = $this->db->num_rows($result);
7670 7670
 
7671 7671
 			$events = null;
7672 7672
 
7673 7673
 			if (!$forcecombo) {
7674
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7674
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7675 7675
 				$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
7676 7676
 			}
7677 7677
 
7678
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7678
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7679 7679
 
7680 7680
 			$textifempty = '';
7681 7681
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7692,7 +7692,7 @@  discard block
 block discarded – undo
7692 7692
 				}
7693 7693
 			}
7694 7694
 			if ($showempty) {
7695
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7695
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7696 7696
 			}
7697 7697
 
7698 7698
 			$i = 0;
@@ -7750,13 +7750,13 @@  discard block
 block discarded – undo
7750 7750
 		$outlabel = $objp->label;
7751 7751
 		$outtype = $objp->fk_product_type;
7752 7752
 
7753
-		$opt = '<option value="' . $objp->rowid . '"';
7753
+		$opt = '<option value="'.$objp->rowid.'"';
7754 7754
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7755 7755
 		$opt .= '>';
7756 7756
 		$opt .= $objp->ref;
7757 7757
 		$objRef = $objp->ref;
7758 7758
 		if (!empty($filterkey) && $filterkey != '') {
7759
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7759
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7760 7760
 		}
7761 7761
 
7762 7762
 		$opt .= "</option>\n";
@@ -7799,7 +7799,7 @@  discard block
 block discarded – undo
7799 7799
 			$urloption = '';
7800 7800
 
7801 7801
 			if ($selected && empty($selected_input_value)) {
7802
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7802
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7803 7803
 				$adherenttmpselect = new Adherent($this->db);
7804 7804
 				$adherenttmpselect->fetch($selected);
7805 7805
 				$selected_input_value = $adherenttmpselect->ref;
@@ -7808,17 +7808,17 @@  discard block
 block discarded – undo
7808 7808
 
7809 7809
 			$urloption = '';
7810 7810
 
7811
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7811
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7812 7812
 
7813 7813
 			if (empty($hidelabel)) {
7814
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7814
+				$out .= $langs->trans("RefOrLabel").' : ';
7815 7815
 			} elseif ($hidelabel > 1) {
7816
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7816
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7817 7817
 				if ($hidelabel == 2) {
7818 7818
 					$out .= img_picto($langs->trans("Search"), 'search');
7819 7819
 				}
7820 7820
 			}
7821
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7821
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7822 7822
 			if ($hidelabel == 3) {
7823 7823
 				$out .= img_picto($langs->trans("Search"), 'search');
7824 7824
 			}
@@ -7863,8 +7863,8 @@  discard block
 block discarded – undo
7863 7863
 
7864 7864
 		$sql = "SELECT ";
7865 7865
 		$sql .= $selectFields;
7866
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
7867
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
7866
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
7867
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
7868 7868
 
7869 7869
 		// Add criteria on ref/label
7870 7870
 		if ($filterkey != '') {
@@ -7880,8 +7880,8 @@  discard block
 block discarded – undo
7880 7880
 				if ($i > 0) {
7881 7881
 					$sql .= " AND ";
7882 7882
 				}
7883
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7884
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
7883
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
7884
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
7885 7885
 				$i++;
7886 7886
 			}
7887 7887
 			if (count($scrit) > 1) {
@@ -7890,27 +7890,27 @@  discard block
 block discarded – undo
7890 7890
 			$sql .= ')';
7891 7891
 		}
7892 7892
 		if ($status != -1) {
7893
-			$sql .= ' AND statut = ' . ((int) $status);
7893
+			$sql .= ' AND statut = '.((int) $status);
7894 7894
 		}
7895 7895
 		$sql .= $this->db->plimit($limit, 0);
7896 7896
 
7897 7897
 		// Build output string
7898
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
7898
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
7899 7899
 		$result = $this->db->query($sql);
7900 7900
 		if ($result) {
7901
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7902
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
7901
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7902
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
7903 7903
 
7904 7904
 			$num = $this->db->num_rows($result);
7905 7905
 
7906 7906
 			$events = null;
7907 7907
 
7908 7908
 			if (!$forcecombo) {
7909
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7909
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7910 7910
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
7911 7911
 			}
7912 7912
 
7913
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7913
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7914 7914
 
7915 7915
 			$textifempty = '';
7916 7916
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7927,7 +7927,7 @@  discard block
 block discarded – undo
7927 7927
 				}
7928 7928
 			}
7929 7929
 			if ($showempty) {
7930
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
7930
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
7931 7931
 			}
7932 7932
 
7933 7933
 			$i = 0;
@@ -7983,11 +7983,11 @@  discard block
 block discarded – undo
7983 7983
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
7984 7984
 		$outtype = $objp->fk_adherent_type;
7985 7985
 
7986
-		$opt = '<option value="' . $objp->rowid . '"';
7986
+		$opt = '<option value="'.$objp->rowid.'"';
7987 7987
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7988 7988
 		$opt .= '>';
7989 7989
 		if (!empty($filterkey) && $filterkey != '') {
7990
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
7990
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
7991 7991
 		}
7992 7992
 		$opt .= $outlabel;
7993 7993
 		$opt .= "</option>\n";
@@ -8028,9 +8028,9 @@  discard block
 block discarded – undo
8028 8028
 		$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8029 8029
 		$reg = array();
8030 8030
 		if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8031
-			$InfoFieldList[4] = $reg[1];    // take the sort field
8031
+			$InfoFieldList[4] = $reg[1]; // take the sort field
8032 8032
 		}
8033
-		$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8033
+		$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8034 8034
 
8035 8035
 		$classname = $InfoFieldList[0];
8036 8036
 		$classpath = $InfoFieldList[1];
@@ -8054,8 +8054,8 @@  discard block
 block discarded – undo
8054 8054
 			}
8055 8055
 		}
8056 8056
 		if (!is_object($objecttmp)) {
8057
-			dol_syslog('Error bad setup of type for field ' . join(',', $InfoFieldList), LOG_WARNING);
8058
-			return 'Error bad setup of type for field ' . join(',', $InfoFieldList);
8057
+			dol_syslog('Error bad setup of type for field '.join(',', $InfoFieldList), LOG_WARNING);
8058
+			return 'Error bad setup of type for field '.join(',', $InfoFieldList);
8059 8059
 		}
8060 8060
 
8061 8061
 		//var_dump($filter);
@@ -8066,9 +8066,9 @@  discard block
 block discarded – undo
8066 8066
 		if ($prefixforautocompletemode == 'product') {
8067 8067
 			$prefixforautocompletemode = 'produit';
8068 8068
 		}
8069
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8069
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8070 8070
 
8071
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8071
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8072 8072
 		$out = '';
8073 8073
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString($confkeyforautocompletemode) && !$forcecombo) {
8074 8074
 			// No immediate load of all database
@@ -8079,15 +8079,15 @@  discard block
 block discarded – undo
8079 8079
 				//unset($objecttmp);
8080 8080
 			}
8081 8081
 
8082
-			$objectdesc = $classname . ':' . $classpath . ':' . $addcreatebuttonornot . ':' . $filter;
8083
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8082
+			$objectdesc = $classname.':'.$classpath.':'.$addcreatebuttonornot.':'.$filter;
8083
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8084 8084
 
8085 8085
 			// No immediate load of all database
8086
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdesc) . '&filter=' . urlencode($filter) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8086
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdesc).'&filter='.urlencode($filter).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8087 8087
 			// Activate the auto complete using ajax call.
8088 8088
 			$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
8089 8089
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8090
-			$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) . '"' : '') . ' />';
8090
+			$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).'"' : '').' />';
8091 8091
 		} else {
8092 8092
 			// Immediate load of table record.
8093 8093
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8127,7 +8127,7 @@  discard block
 block discarded – undo
8127 8127
 		if ($prefixforautocompletemode == 'societe') {
8128 8128
 			$prefixforautocompletemode = 'company';
8129 8129
 		}
8130
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8130
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8131 8131
 
8132 8132
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8133 8133
 			$tmpfieldstoshow = '';
@@ -8136,7 +8136,7 @@  discard block
 block discarded – undo
8136 8136
 					continue;
8137 8137
 				}
8138 8138
 				if (!empty($val['showoncombobox'])) {
8139
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8139
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8140 8140
 				}
8141 8141
 			}
8142 8142
 			if ($tmpfieldstoshow) {
@@ -8164,18 +8164,18 @@  discard block
 block discarded – undo
8164 8164
 		$num = 0;
8165 8165
 
8166 8166
 		// Search data
8167
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8167
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8168 8168
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8169
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object";
8169
+			$sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object";
8170 8170
 		}
8171 8171
 		if (isset($objecttmp->ismultientitymanaged)) {
8172 8172
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8173 8173
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8174
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8174
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8175 8175
 			}
8176 8176
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8177 8177
 				if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
8178
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8178
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8179 8179
 				}
8180 8180
 			}
8181 8181
 		}
@@ -8195,21 +8195,21 @@  discard block
 block discarded – undo
8195 8195
 			$sql .= " WHERE 1=1";
8196 8196
 			if (isset($objecttmp->ismultientitymanaged)) {
8197 8197
 				if ($objecttmp->ismultientitymanaged == 1) {
8198
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8198
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8199 8199
 				}
8200 8200
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8201
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8201
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8202 8202
 				}
8203 8203
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8204 8204
 					if ($objecttmp->element == 'societe') {
8205
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8205
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8206 8206
 					} else {
8207
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8207
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8208 8208
 					}
8209 8209
 				}
8210 8210
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8211 8211
 					if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
8212
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8212
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8213 8213
 					}
8214 8214
 				}
8215 8215
 			}
@@ -8221,7 +8221,7 @@  discard block
 block discarded – undo
8221 8221
 				$errormessage = '';
8222 8222
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8223 8223
 				if ($errormessage) {
8224
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8224
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8225 8225
 				}
8226 8226
 			}
8227 8227
 		}
@@ -8233,7 +8233,7 @@  discard block
 block discarded – undo
8233 8233
 		$resql = $this->db->query($sql);
8234 8234
 		if ($resql) {
8235 8235
 			// Construct $out and $outarray
8236
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8236
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8237 8237
 
8238 8238
 			// 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
8239 8239
 			$textifempty = '&nbsp;';
@@ -8247,7 +8247,7 @@  discard block
 block discarded – undo
8247 8247
 				}
8248 8248
 			}
8249 8249
 			if ($showempty) {
8250
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8250
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8251 8251
 			}
8252 8252
 
8253 8253
 			$num = $this->db->num_rows($resql);
@@ -8270,9 +8270,9 @@  discard block
 block discarded – undo
8270 8270
 					}
8271 8271
 					if (empty($outputmode)) {
8272 8272
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8273
-							$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>';
8273
+							$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>';
8274 8274
 						} else {
8275
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8275
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8276 8276
 						}
8277 8277
 					} else {
8278 8278
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8285,10 +8285,10 @@  discard block
 block discarded – undo
8285 8285
 				}
8286 8286
 			}
8287 8287
 
8288
-			$out .= '</select>' . "\n";
8288
+			$out .= '</select>'."\n";
8289 8289
 
8290 8290
 			if (!$forcecombo) {
8291
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8291
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8292 8292
 				$out .= ajax_combobox($htmlname, null, (!empty($conf->global->$confkeyforautocompletemode) ? $conf->global->$confkeyforautocompletemode : 0));
8293 8293
 			}
8294 8294
 		} else {
@@ -8350,8 +8350,8 @@  discard block
 block discarded – undo
8350 8350
 			}
8351 8351
 		}
8352 8352
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8353
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8354
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8353
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8354
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8355 8355
 		$out .= '>'."\n";
8356 8356
 
8357 8357
 		if ($show_empty) {
@@ -8362,7 +8362,7 @@  discard block
 block discarded – undo
8362 8362
 			if (!is_numeric($show_empty)) {
8363 8363
 				$textforempty = $show_empty;
8364 8364
 			}
8365
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8365
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8366 8366
 		}
8367 8367
 		if (is_array($array)) {
8368 8368
 			// Translate
@@ -8385,7 +8385,7 @@  discard block
 block discarded – undo
8385 8385
 				if (is_array($tmpvalue)) {
8386 8386
 					$value = $tmpvalue['label'];
8387 8387
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8388
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8388
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8389 8389
 				} else {
8390 8390
 					$value = $tmpvalue;
8391 8391
 					$disabled = '';
@@ -8400,9 +8400,9 @@  discard block
 block discarded – undo
8400 8400
 				}
8401 8401
 				if ($key_in_label) {
8402 8402
 					if (empty($nohtmlescape)) {
8403
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8403
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8404 8404
 					} else {
8405
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8405
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8406 8406
 					}
8407 8407
 				} else {
8408 8408
 					if (empty($nohtmlescape)) {
@@ -8414,8 +8414,8 @@  discard block
 block discarded – undo
8414 8414
 						$selectOptionValue = '&nbsp;';
8415 8415
 					}
8416 8416
 				}
8417
-				$out .= '<option value="' . $key . '"';
8418
-				$out .= $style . $disabled;
8417
+				$out .= '<option value="'.$key.'"';
8418
+				$out .= $style.$disabled;
8419 8419
 				if (is_array($id)) {
8420 8420
 					if (in_array($key, $id) && !$disabled) {
8421 8421
 						$out .= ' selected'; // To preselect a value
@@ -8427,7 +8427,7 @@  discard block
 block discarded – undo
8427 8427
 					}
8428 8428
 				}
8429 8429
 				if ($nohtmlescape) {
8430
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8430
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8431 8431
 				}
8432 8432
 				if (is_array($tmpvalue)) {
8433 8433
 					foreach ($tmpvalue as $keyforvalue => $valueforvalue) {
@@ -8445,7 +8445,7 @@  discard block
 block discarded – undo
8445 8445
 		// Add code for jquery to use multiselect
8446 8446
 		if ($addjscombo && $jsbeautify) {
8447 8447
 			// Enhance with select2
8448
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8448
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8449 8449
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
8450 8450
 		}
8451 8451
 
@@ -8477,28 +8477,28 @@  discard block
 block discarded – undo
8477 8477
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8478 8478
 	{
8479 8479
 		global $conf, $langs;
8480
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8480
+		global $delayedhtmlcontent; // Will be used later outside of this function
8481 8481
 
8482 8482
 		// TODO Use an internal dolibarr component instead of select2
8483 8483
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8484 8484
 			return '';
8485 8485
 		}
8486 8486
 
8487
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8487
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8488 8488
 
8489 8489
 		$outdelayed = '';
8490 8490
 		if (!empty($conf->use_javascript_ajax)) {
8491 8491
 			$tmpplugin = 'select2';
8492
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8493
-		    	<script nonce="' . getNonce() . '">
8492
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8493
+		    	<script nonce="' . getNonce().'">
8494 8494
 		    	$(document).ready(function () {
8495 8495
 
8496
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8496
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8497 8497
 
8498
-	                $(".' . $htmlname . '").select2({
8498
+	                $(".' . $htmlname.'").select2({
8499 8499
 				    	ajax: {
8500 8500
 					    	dir: "ltr",
8501
-					    	url: "' . $url . '",
8501
+					    	url: "' . $url.'",
8502 8502
 					    	dataType: \'json\',
8503 8503
 					    	delay: 250,
8504 8504
 					    	data: function (params) {
@@ -8525,9 +8525,9 @@  discard block
 block discarded – undo
8525 8525
 				    	},
8526 8526
 		 				language: select2arrayoflanguage,
8527 8527
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8528
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8528
+					    placeholder: "' . dol_escape_js($placeholder).'",
8529 8529
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8530
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8530
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8531 8531
 				        formatResult: function (result, container, query, escapeMarkup) {
8532 8532
 	                        return escapeMarkup(result.text);
8533 8533
 	                    },
@@ -8535,10 +8535,10 @@  discard block
 block discarded – undo
8535 8535
 
8536 8536
 	                ' . ($callurlonselect ? '
8537 8537
 	                /* Code to execute a GET when we select a value */
8538
-	                $(".' . $htmlname . '").change(function() {
8539
-				    	var selected = $(".' . $htmlname . '").val();
8538
+	                $(".' . $htmlname.'").change(function() {
8539
+				    	var selected = $(".' . $htmlname.'").val();
8540 8540
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8541
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8541
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8542 8542
 	    			    $.each( saveRemoteData, function( key, value ) {
8543 8543
 	    				        if (key == selected)
8544 8544
 	    			            {
@@ -8546,7 +8546,7 @@  discard block
 block discarded – undo
8546 8546
 	    			                 location.assign(value.url);
8547 8547
 	    			            }
8548 8548
 	                    });
8549
-	    			});' : '') . '
8549
+	    			});' : '').'
8550 8550
 
8551 8551
 	    	   });
8552 8552
 		       </script>';
@@ -8582,14 +8582,14 @@  discard block
 block discarded – undo
8582 8582
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8583 8583
 	{
8584 8584
 		global $conf, $langs;
8585
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8585
+		global $delayedhtmlcontent; // Will be used later outside of this function
8586 8586
 
8587 8587
 		// TODO Use an internal dolibarr component instead of select2
8588 8588
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8589 8589
 			return '';
8590 8590
 		}
8591 8591
 
8592
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8592
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8593 8593
 
8594 8594
 		$formattedarrayresult = array();
8595 8595
 
@@ -8604,20 +8604,20 @@  discard block
 block discarded – undo
8604 8604
 		$outdelayed = '';
8605 8605
 		if (!empty($conf->use_javascript_ajax)) {
8606 8606
 			$tmpplugin = 'select2';
8607
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8608
-				<script nonce="' . getNonce() . '">
8607
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8608
+				<script nonce="' . getNonce().'">
8609 8609
 				$(document).ready(function () {
8610
-					var data = ' . json_encode($formattedarrayresult) . ';
8610
+					var data = ' . json_encode($formattedarrayresult).';
8611 8611
 
8612
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8612
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8613 8613
 
8614
-					$(".' . $htmlname . '").select2({
8614
+					$(".' . $htmlname.'").select2({
8615 8615
 						data: data,
8616 8616
 						language: select2arrayoflanguage,
8617 8617
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8618
-						placeholder: "' . dol_escape_js($placeholder) . '",
8618
+						placeholder: "' . dol_escape_js($placeholder).'",
8619 8619
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8620
-						minimumInputLength: ' . $minimumInputLength . ',
8620
+						minimumInputLength: ' . $minimumInputLength.',
8621 8621
 						formatResult: function (result, container, query, escapeMarkup) {
8622 8622
 							return escapeMarkup(result.text);
8623 8623
 						},
@@ -8656,11 +8656,11 @@  discard block
 block discarded – undo
8656 8656
 
8657 8657
 					' . ($callurlonselect ? '
8658 8658
 					/* Code to execute a GET when we select a value */
8659
-					$(".' . $htmlname . '").change(function() {
8660
-						var selected = $(".' . $htmlname . '").val();
8659
+					$(".' . $htmlname.'").change(function() {
8660
+						var selected = $(".' . $htmlname.'").val();
8661 8661
 						console.log("We select "+selected)
8662 8662
 
8663
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
8663
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
8664 8664
 						$.each( saveRemoteData, function( key, value ) {
8665 8665
 							if (key == selected)
8666 8666
 							{
@@ -8668,7 +8668,7 @@  discard block
 block discarded – undo
8668 8668
 								location.assign(value.url);
8669 8669
 							}
8670 8670
 						});
8671
-					});' : '') . '
8671
+					});' : '').'
8672 8672
 
8673 8673
 				});
8674 8674
 				</script>';
@@ -8720,7 +8720,7 @@  discard block
 block discarded – undo
8720 8720
 		}
8721 8721
 
8722 8722
 		// Output select component
8723
-		$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
8723
+		$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n";
8724 8724
 		if (is_array($array) && !empty($array)) {
8725 8725
 			if ($value_as_key) {
8726 8726
 				$array = array_combine($array, $array);
@@ -8741,57 +8741,57 @@  discard block
 block discarded – undo
8741 8741
 						$tmplabelhtml = !empty($value['labelhtml']) ? $value['labelhtml'] : '';
8742 8742
 					}
8743 8743
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
8744
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
8744
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
8745 8745
 
8746
-					$out .= '<option value="' . $tmpkey . '"';
8746
+					$out .= '<option value="'.$tmpkey.'"';
8747 8747
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
8748 8748
 						$out .= ' selected';
8749 8749
 					}
8750 8750
 					if (!empty($tmplabelhtml)) {
8751
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8751
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8752 8752
 					} else {
8753
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
8754
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8753
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
8754
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8755 8755
 					}
8756 8756
 					$out .= '>';
8757 8757
 					$out .= dol_htmlentitiesbr($newval);
8758
-					$out .= '</option>' . "\n";
8758
+					$out .= '</option>'."\n";
8759 8759
 				}
8760 8760
 			}
8761 8761
 		}
8762
-		$out .= '</select>' . "\n";
8762
+		$out .= '</select>'."\n";
8763 8763
 
8764 8764
 		// Add code for jquery to use multiselect
8765 8765
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
8766
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
8767
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
8766
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
8767
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
8768 8768
 			if ($addjscombo == 1) {
8769 8769
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
8770
-				$out .= 'function formatResult(record, container) {' . "\n";
8770
+				$out .= 'function formatResult(record, container) {'."\n";
8771 8771
 				// If property html set, we decode html entities and use this.
8772 8772
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
8773 8773
 				$out .= '	if ($(record.element).attr("data-html") != undefined) { return htmlEntityDecodeJs($(record.element).attr("data-html")); }'."\n";
8774 8774
 				$out .= '	return record.text;';
8775
-				$out .= '}' . "\n";
8776
-				$out .= 'function formatSelection(record) {' . "\n";
8775
+				$out .= '}'."\n";
8776
+				$out .= 'function formatSelection(record) {'."\n";
8777 8777
 				if ($elemtype == 'category') {
8778
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8778
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8779 8779
 				} else {
8780 8780
 					$out .= 'return record.text;';
8781 8781
 				}
8782
-				$out .= '}' . "\n";
8782
+				$out .= '}'."\n";
8783 8783
 				$out .= '$(document).ready(function () {
8784
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
8784
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
8785 8785
 				if ($placeholder) {
8786 8786
 					$out .= '
8787 8787
 								placeholder: {
8788 8788
 								    id: \'-1\',
8789
-								    text: \'' . dol_escape_js($placeholder) . '\'
8789
+								    text: \'' . dol_escape_js($placeholder).'\'
8790 8790
 								  },';
8791 8791
 				}
8792 8792
 				$out .= '		dir: \'ltr\',
8793 8793
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
8794
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */
8794
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */
8795 8795
 								// Specify format function for dropdown item
8796 8796
 								formatResult: formatResult,
8797 8797
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -8803,21 +8803,21 @@  discard block
 block discarded – undo
8803 8803
 
8804 8804
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
8805 8805
 								 the size only if component is not hidden by default on load */
8806
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
8806
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
8807 8807
 						});' . "\n";
8808 8808
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
8809 8809
 				// Add other js lib
8810 8810
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
8811 8811
 				// ...
8812
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
8812
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
8813 8813
 				$out .= '$(document).ready(function () {
8814
-							$(\'#' . $htmlname . '\').multiSelect({
8814
+							$(\'#' . $htmlname.'\').multiSelect({
8815 8815
 								containerHTML: \'<div class="multi-select-container">\',
8816 8816
 								menuHTML: \'<div class="multi-select-menu">\',
8817
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
8817
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
8818 8818
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
8819 8819
 								activeClass: \'multi-select-container--open\',
8820
-								noneText: \'' . $placeholder . '\'
8820
+								noneText: \'' . $placeholder.'\'
8821 8821
 							});
8822 8822
 						})';
8823 8823
 			}
@@ -8849,7 +8849,7 @@  discard block
 block discarded – undo
8849 8849
 			return '';
8850 8850
 		}
8851 8851
 
8852
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
8852
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
8853 8853
 
8854 8854
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
8855 8855
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -8892,19 +8892,19 @@  discard block
 block discarded – undo
8892 8892
 				}
8893 8893
 
8894 8894
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list
8895
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
8896
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
8895
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
8896
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
8897 8897
 			}
8898 8898
 		}
8899 8899
 
8900
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
8900
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
8901 8901
 
8902 8902
         <dl class="dropdown">
8903 8903
             <dt>
8904
-            <a href="#' . $htmlname . '">
8905
-              ' . img_picto('', 'list') . '
8904
+            <a href="#' . $htmlname.'">
8905
+              ' . img_picto('', 'list').'
8906 8906
             </a>
8907
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
8907
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
8908 8908
             </dt>
8909 8909
             <dd class="dropdowndd">
8910 8910
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -8916,19 +8916,19 @@  discard block
 block discarded – undo
8916 8916
             </dd>
8917 8917
         </dl>
8918 8918
 
8919
-        <script nonce="' . getNonce() . '" type="text/javascript">
8919
+        <script nonce="' . getNonce().'" type="text/javascript">
8920 8920
           jQuery(document).ready(function () {
8921
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
8921
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
8922 8922
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
8923 8923
 
8924 8924
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
8925 8925
 
8926 8926
                   var title = $(this).val() + ",";
8927 8927
                   if ($(this).is(\':checked\')) {
8928
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
8928
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
8929 8929
                   }
8930 8930
                   else {
8931
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
8931
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
8932 8932
                   }
8933 8933
                   // Now, we submit page
8934 8934
                   //$(this).parents(\'form:first\').submit();
@@ -8959,7 +8959,7 @@  discard block
 block discarded – undo
8959 8959
 	 */
8960 8960
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
8961 8961
 	{
8962
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8962
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8963 8963
 
8964 8964
 		$cat = new Categorie($this->db);
8965 8965
 		$categories = $cat->containing($id, $type);
@@ -8969,10 +8969,10 @@  discard block
 block discarded – undo
8969 8969
 			foreach ($categories as $c) {
8970 8970
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
8971 8971
 				foreach ($ways as $way) {
8972
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
8972
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
8973 8973
 				}
8974 8974
 			}
8975
-			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8975
+			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8976 8976
 		}
8977 8977
 
8978 8978
 		if ($rendermode == 0) {
@@ -9020,15 +9020,15 @@  discard block
 block discarded – undo
9020 9020
 
9021 9021
 
9022 9022
 			print '<div class="div-table-responsive-no-min">';
9023
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9023
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9024 9024
 
9025 9025
 			print '<tr class="liste_titre">';
9026
-			print '<td>' . $langs->trans("Type") . '</td>';
9027
-			print '<td>' . $langs->trans("Ref") . '</td>';
9026
+			print '<td>'.$langs->trans("Type").'</td>';
9027
+			print '<td>'.$langs->trans("Ref").'</td>';
9028 9028
 			print '<td class="center"></td>';
9029
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9030
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9031
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9029
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9030
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9031
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9032 9032
 			print '<td></td>';
9033 9033
 			print '</tr>';
9034 9034
 
@@ -9047,13 +9047,13 @@  discard block
 block discarded – undo
9047 9047
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9048 9048
 					$element = $regs[1];
9049 9049
 					$subelement = $regs[2];
9050
-					$tplpath = $element . '/' . $subelement;
9050
+					$tplpath = $element.'/'.$subelement;
9051 9051
 				}
9052 9052
 				$tplname = 'linkedobjectblock';
9053 9053
 
9054 9054
 				// To work with non standard path
9055 9055
 				if ($objecttype == 'facture') {
9056
-					$tplpath = 'compta/' . $element;
9056
+					$tplpath = 'compta/'.$element;
9057 9057
 					if (!isModEnabled('facture')) {
9058 9058
 						continue; // Do not show if module disabled
9059 9059
 					}
@@ -9064,7 +9064,7 @@  discard block
 block discarded – undo
9064 9064
 						continue; // Do not show if module disabled
9065 9065
 					}
9066 9066
 				} elseif ($objecttype == 'propal') {
9067
-					$tplpath = 'comm/' . $element;
9067
+					$tplpath = 'comm/'.$element;
9068 9068
 					if (!isModEnabled('propal')) {
9069 9069
 						continue; // Do not show if module disabled
9070 9070
 					}
@@ -9115,14 +9115,14 @@  discard block
 block discarded – undo
9115 9115
 				$linkedObjectBlock = $objects;
9116 9116
 
9117 9117
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9118
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9118
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9119 9119
 				foreach ($dirtpls as $reldir) {
9120 9120
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
9121 9121
 						global $noMoreLinkedObjectBlockAfter;
9122 9122
 						$noMoreLinkedObjectBlockAfter = 1;
9123 9123
 					}
9124 9124
 
9125
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9125
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9126 9126
 					if ($res) {
9127 9127
 						$nboftypesoutput++;
9128 9128
 						break;
@@ -9131,7 +9131,7 @@  discard block
 block discarded – undo
9131 9131
 			}
9132 9132
 
9133 9133
 			if (!$nboftypesoutput) {
9134
-				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9134
+				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9135 9135
 			}
9136 9136
 
9137 9137
 			print '</table>';
@@ -9171,14 +9171,14 @@  discard block
 block discarded – undo
9171 9171
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9172 9172
 			$listofidcompanytoscan = $object->thirdparty->id;
9173 9173
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9174
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9174
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9175 9175
 			}
9176 9176
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9177
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9177
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9178 9178
 				$tmpproject = new Project($this->db);
9179 9179
 				$tmpproject->fetch($object->fk_project);
9180 9180
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9181
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9181
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9182 9182
 				}
9183 9183
 				unset($tmpproject);
9184 9184
 			}
@@ -9188,63 +9188,63 @@  discard block
 block discarded – undo
9188 9188
 					'enabled' => isModEnabled('propal'),
9189 9189
 					'perms' => 1,
9190 9190
 					'label' => 'LinkToProposal',
9191
-					'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') . ')'),
9191
+					'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').')'),
9192 9192
 				'shipping' => array(
9193 9193
 					'enabled' => isModEnabled('expedition'),
9194 9194
 					'perms' => 1,
9195 9195
 					'label' => 'LinkToExpedition',
9196
-					'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') . ')'),
9196
+					'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').')'),
9197 9197
 				'order' => array(
9198 9198
 					'enabled' => isModEnabled('commande'),
9199 9199
 					'perms' => 1,
9200 9200
 					'label' => 'LinkToOrder',
9201
-					'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') . ')'),
9201
+					'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').')'),
9202 9202
 				'invoice' => array(
9203 9203
 					'enabled' => isModEnabled('facture'),
9204 9204
 					'perms' => 1,
9205 9205
 					'label' => 'LinkToInvoice',
9206
-					'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') . ')'),
9206
+					'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').')'),
9207 9207
 				'invoice_template' => array(
9208 9208
 					'enabled' => isModEnabled('facture'),
9209 9209
 					'perms' => 1,
9210 9210
 					'label' => 'LinkToTemplateInvoice',
9211
-					'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') . ')'),
9211
+					'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').')'),
9212 9212
 				'contrat' => array(
9213 9213
 					'enabled' => isModEnabled('contrat'),
9214 9214
 					'perms' => 1,
9215 9215
 					'label' => 'LinkToContract',
9216 9216
 					'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
9217
-							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'
9217
+							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'
9218 9218
 				),
9219 9219
 				'fichinter' => array(
9220 9220
 					'enabled' => isModEnabled('ficheinter'),
9221 9221
 					'perms' => 1,
9222 9222
 					'label' => 'LinkToIntervention',
9223
-					'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') . ')'),
9223
+					'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').')'),
9224 9224
 				'supplier_proposal' => array(
9225 9225
 					'enabled' => isModEnabled('supplier_proposal'),
9226 9226
 					'perms' => 1,
9227 9227
 					'label' => 'LinkToSupplierProposal',
9228
-					'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') . ')'),
9228
+					'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').')'),
9229 9229
 				'order_supplier' => array(
9230 9230
 					'enabled' => isModEnabled("supplier_order"),
9231 9231
 					'perms' => 1,
9232 9232
 					'label' => 'LinkToSupplierOrder',
9233
-					'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') . ')'),
9233
+					'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').')'),
9234 9234
 				'invoice_supplier' => array(
9235 9235
 					'enabled' => isModEnabled("supplier_invoice"),
9236 9236
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9237
-					'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') . ')'),
9237
+					'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').')'),
9238 9238
 				'ticket' => array(
9239 9239
 					'enabled' => isModEnabled('ticket'),
9240 9240
 					'perms' => 1,
9241 9241
 					'label' => 'LinkToTicket',
9242
-					'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') . ')'),
9242
+					'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').')'),
9243 9243
 				'mo' => array(
9244 9244
 					'enabled' => isModEnabled('mrp'),
9245 9245
 					'perms' => 1,
9246 9246
 					'label' => 'LinkToMo',
9247
-					'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') . ')')
9247
+					'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').')')
9248 9248
 			);
9249 9249
 		}
9250 9250
 
@@ -9279,22 +9279,22 @@  discard block
 block discarded – undo
9279 9279
 			}
9280 9280
 
9281 9281
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9282
-				print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9282
+				print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9283 9283
 
9284 9284
 				if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9285 9285
 					print '<br>'."\n";
9286 9286
 					print '<!-- form to add a link from anywhere -->'."\n";
9287
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9288
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9287
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9288
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9289 9289
 					print '<input type="hidden" name="action" value="addlinkbyref">';
9290
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9291
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9290
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9291
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9292 9292
 					print '<table class="noborder">';
9293 9293
 					print '<tr>';
9294 9294
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9295
-					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9296
-					print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9297
-					print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9295
+					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9296
+					print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9297
+					print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9298 9298
 					print '</tr>';
9299 9299
 					print '</table>';
9300 9300
 					print '</form>';
@@ -9309,48 +9309,48 @@  discard block
 block discarded – undo
9309 9309
 
9310 9310
 					print '<br>';
9311 9311
 					print '<!-- form to add a link from object to same thirdparty -->'."\n";
9312
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9312
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9313 9313
 					print '<input type="hidden" name="action" value="addlink">';
9314
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9315
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9316
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9314
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9315
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9316
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9317 9317
 					print '<table class="noborder">';
9318 9318
 					print '<tr class="liste_titre">';
9319 9319
 					print '<td class="nowrap"></td>';
9320
-					print '<td class="center">' . $langs->trans("Ref") . '</td>';
9321
-					print '<td class="left">' . $langs->trans("RefCustomer") . '</td>';
9322
-					print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9323
-					print '<td class="left">' . $langs->trans("Company") . '</td>';
9320
+					print '<td class="center">'.$langs->trans("Ref").'</td>';
9321
+					print '<td class="left">'.$langs->trans("RefCustomer").'</td>';
9322
+					print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9323
+					print '<td class="left">'.$langs->trans("Company").'</td>';
9324 9324
 					print '</tr>';
9325 9325
 					while ($i < $num) {
9326 9326
 						$objp = $this->db->fetch_object($resqllist);
9327 9327
 
9328 9328
 						print '<tr class="oddeven">';
9329 9329
 						print '<td class="left">';
9330
-						print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9330
+						print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9331 9331
 						print '</td>';
9332
-						print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9333
-						print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9332
+						print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9333
+						print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9334 9334
 						print '<td class="right">';
9335 9335
 						if ($possiblelink['label'] == 'LinkToContract') {
9336 9336
 							$form = new Form($this->db);
9337
-							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9337
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9338 9338
 						}
9339
-						print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9339
+						print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9340 9340
 						print '</td>';
9341
-						print '<td>' . $objp->name . '</td>';
9341
+						print '<td>'.$objp->name.'</td>';
9342 9342
 						print '</tr>';
9343 9343
 						$i++;
9344 9344
 					}
9345 9345
 					print '</table>';
9346 9346
 					print '<div class="center">';
9347 9347
 					if ($num) {
9348
-						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9348
+						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9349 9349
 					}
9350 9350
 					if (empty($conf->use_javascript_ajax)) {
9351
-						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9351
+						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9352 9352
 					} else {
9353
-						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>';
9353
+						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>';
9354 9354
 					}
9355 9355
 					print '</form>';
9356 9356
 					$this->db->free($resqllist);
@@ -9361,10 +9361,10 @@  discard block
 block discarded – undo
9361 9361
 
9362 9362
 				//$linktoelem.=($linktoelem?' &nbsp; ':'');
9363 9363
 				if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9364
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9364
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9365 9365
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9366 9366
 				} else {
9367
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9367
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9368 9368
 				}
9369 9369
 			}
9370 9370
 		}
@@ -9374,11 +9374,11 @@  discard block
 block discarded – undo
9374 9374
     		<dl class="dropdown" id="linktoobjectname">
9375 9375
     		';
9376 9376
 			if (!empty($conf->use_javascript_ajax)) {
9377
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9377
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9378 9378
 			}
9379 9379
 			$linktoelem .= '<dd>
9380 9380
     		<div class="multiselectlinkto">
9381
-    		<ul class="ulselectedfields">' . $linktoelemlist . '
9381
+    		<ul class="ulselectedfields">' . $linktoelemlist.'
9382 9382
     		</ul>
9383 9383
     		</div>
9384 9384
     		</dd>
@@ -9389,7 +9389,7 @@  discard block
 block discarded – undo
9389 9389
 
9390 9390
 		if (!empty($conf->use_javascript_ajax)) {
9391 9391
 			print '<!-- Add js to show linkto box -->
9392
-				<script nonce="' . getNonce() . '">
9392
+				<script nonce="' . getNonce().'">
9393 9393
 				jQuery(document).ready(function() {
9394 9394
 					jQuery(".linkto").click(function() {
9395 9395
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9430,19 +9430,19 @@  discard block
 block discarded – undo
9430 9430
 
9431 9431
 		$disabled = ($disabled ? ' disabled' : '');
9432 9432
 
9433
-		$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9433
+		$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9434 9434
 		if ($useempty) {
9435
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9435
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9436 9436
 		}
9437 9437
 		if (("$value" == 'yes') || ($value == 1)) {
9438
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9439
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9438
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9439
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9440 9440
 		} else {
9441 9441
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9442
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9443
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9442
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9443
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9444 9444
 		}
9445
-		$resultyesno .= '</select>' . "\n";
9445
+		$resultyesno .= '</select>'."\n";
9446 9446
 
9447 9447
 		if ($addjscombo) {
9448 9448
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9466,12 +9466,12 @@  discard block
 block discarded – undo
9466 9466
 	{
9467 9467
 		// phpcs:enable
9468 9468
 		$sql = "SELECT rowid, label";
9469
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9470
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9469
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9470
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9471 9471
 		$sql .= " ORDER BY rowid";
9472 9472
 		$result = $this->db->query($sql);
9473 9473
 		if ($result) {
9474
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9474
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9475 9475
 			if ($useempty) {
9476 9476
 				print '<option value="-1">&nbsp;</option>';
9477 9477
 			}
@@ -9481,9 +9481,9 @@  discard block
 block discarded – undo
9481 9481
 			while ($i < $num) {
9482 9482
 				$obj = $this->db->fetch_object($result);
9483 9483
 				if ($selected == $obj->rowid) {
9484
-					print '<option value="' . $obj->rowid . '" selected>';
9484
+					print '<option value="'.$obj->rowid.'" selected>';
9485 9485
 				} else {
9486
-					print '<option value="' . $obj->rowid . '">';
9486
+					print '<option value="'.$obj->rowid.'">';
9487 9487
 				}
9488 9488
 				print $obj->label;
9489 9489
 				print '</option>';
@@ -9573,8 +9573,8 @@  discard block
 block discarded – undo
9573 9573
 				$stringforfirstkey .= ' CTL +';
9574 9574
 			}
9575 9575
 
9576
-			$previous_ref = $object->ref_previous ? '<a accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
9577
-			$next_ref = $object->ref_next ? '<a accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
9576
+			$previous_ref = $object->ref_previous ? '<a accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
9577
+			$next_ref = $object->ref_next ? '<a accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
9578 9578
 		}
9579 9579
 
9580 9580
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9582,18 +9582,18 @@  discard block
 block discarded – undo
9582 9582
 
9583 9583
 		// Right part of banner
9584 9584
 		if ($morehtmlright) {
9585
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9585
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9586 9586
 		}
9587 9587
 
9588 9588
 		if ($previous_ref || $next_ref || $morehtml) {
9589 9589
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9590 9590
 		}
9591 9591
 		if ($morehtml) {
9592
-			$ret .= '<li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9592
+			$ret .= '<li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9593 9593
 		}
9594 9594
 		if ($shownav && ($previous_ref || $next_ref)) {
9595
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
9596
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
9595
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
9596
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
9597 9597
 		}
9598 9598
 		if ($previous_ref || $next_ref || $morehtml) {
9599 9599
 			$ret .= '</ul></div>';
@@ -9608,7 +9608,7 @@  discard block
 block discarded – undo
9608 9608
 			$morehtmlstatus = $hookmanager->resPrint;
9609 9609
 		}
9610 9610
 		if ($morehtmlstatus) {
9611
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
9611
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
9612 9612
 		}
9613 9613
 
9614 9614
 		$parameters = array();
@@ -9622,14 +9622,14 @@  discard block
 block discarded – undo
9622 9622
 		// Left part of banner
9623 9623
 		if ($morehtmlleft) {
9624 9624
 			if ($conf->browser->layout == 'phone') {
9625
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
9625
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
9626 9626
 			} else {
9627
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
9627
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
9628 9628
 			}
9629 9629
 		}
9630 9630
 
9631 9631
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
9632
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
9632
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
9633 9633
 
9634 9634
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
9635 9635
 		if ($object->element == 'societe') {
@@ -9643,7 +9643,7 @@  discard block
 block discarded – undo
9643 9643
 
9644 9644
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
9645 9645
 				if (!is_object($extralanguages)) {
9646
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
9646
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
9647 9647
 					$extralanguages = new ExtraLanguages($this->db);
9648 9648
 				}
9649 9649
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -9658,27 +9658,27 @@  discard block
 block discarded – undo
9658 9658
 						if ($object->array_languages['name'][$extralangcode]) {
9659 9659
 							$htmltext .= $object->array_languages['name'][$extralangcode];
9660 9660
 						} else {
9661
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
9661
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
9662 9662
 						}
9663 9663
 					}
9664
-					$ret .= '<!-- Show translations of name -->' . "\n";
9664
+					$ret .= '<!-- Show translations of name -->'."\n";
9665 9665
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
9666 9666
 				}
9667 9667
 			}
9668 9668
 		} elseif ($object->element == 'member') {
9669
-			$ret .= $object->ref . '<br>';
9669
+			$ret .= $object->ref.'<br>';
9670 9670
 			$fullname = $object->getFullName($langs);
9671 9671
 			if ($object->morphy == 'mor' && $object->societe) {
9672
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
9672
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
9673 9673
 			} else {
9674
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
9674
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
9675 9675
 			}
9676 9676
 		} elseif (in_array($object->element, array('contact', 'user'))) {
9677
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
9677
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
9678 9678
 		} elseif ($object->element == 'usergroup') {
9679 9679
 			$ret .= dol_htmlentities($object->name);
9680 9680
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
9681
-			$ret .= $object->ref . '<br>' . $object->label;
9681
+			$ret .= $object->ref.'<br>'.$object->label;
9682 9682
 		} elseif (in_array($object->element, array('adherent_type'))) {
9683 9683
 			$ret .= $object->label;
9684 9684
 		} elseif ($object->element == 'ecm_directories') {
@@ -9730,9 +9730,9 @@  discard block
 block discarded – undo
9730 9730
 		}
9731 9731
 
9732 9732
 		// Barcode image
9733
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
9734
-		$out = '<!-- url barcode = ' . $url . ' -->';
9735
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
9733
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
9734
+		$out = '<!-- url barcode = '.$url.' -->';
9735
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
9736 9736
 
9737 9737
 		return $out;
9738 9738
 	}
@@ -9772,28 +9772,28 @@  discard block
 block discarded – undo
9772 9772
 			if (!empty($object->logo)) {
9773 9773
 				if (dolIsAllowedForPreview($object->logo)) {
9774 9774
 					if ((string) $imagesize == 'mini') {
9775
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9775
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9776 9776
 					} elseif ((string) $imagesize == 'small') {
9777
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
9777
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
9778 9778
 					} else {
9779
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9779
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9780 9780
 					}
9781
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9781
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9782 9782
 				}
9783 9783
 			}
9784 9784
 			$email = $object->email;
9785 9785
 		} elseif ($modulepart == 'contact') {
9786
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
9786
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
9787 9787
 			if (!empty($object->photo)) {
9788 9788
 				if (dolIsAllowedForPreview($object->photo)) {
9789 9789
 					if ((string) $imagesize == 'mini') {
9790
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9790
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9791 9791
 					} elseif ((string) $imagesize == 'small') {
9792
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9792
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
9793 9793
 					} else {
9794
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9794
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9795 9795
 					}
9796
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9796
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9797 9797
 				}
9798 9798
 			}
9799 9799
 			$email = $object->email;
@@ -9803,17 +9803,17 @@  discard block
 block discarded – undo
9803 9803
 			if (!empty($object->photo)) {
9804 9804
 				if (dolIsAllowedForPreview($object->photo)) {
9805 9805
 					if ((string) $imagesize == 'mini') {
9806
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9806
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9807 9807
 					} elseif ((string) $imagesize == 'small') {
9808
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9808
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
9809 9809
 					} else {
9810
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9810
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9811 9811
 					}
9812
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9812
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9813 9813
 				}
9814 9814
 			}
9815 9815
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9816
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9816
+				$altfile = $object->id.".jpg"; // For backward compatibility
9817 9817
 			}
9818 9818
 			$email = $object->email;
9819 9819
 			$capture = 'user';
@@ -9822,17 +9822,17 @@  discard block
 block discarded – undo
9822 9822
 			if (!empty($object->photo)) {
9823 9823
 				if (dolIsAllowedForPreview($object->photo)) {
9824 9824
 					if ((string) $imagesize == 'mini') {
9825
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9825
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9826 9826
 					} elseif ((string) $imagesize == 'small') {
9827
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9827
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
9828 9828
 					} else {
9829
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9829
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9830 9830
 					}
9831
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9831
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9832 9832
 				}
9833 9833
 			}
9834 9834
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9835
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9835
+				$altfile = $object->id.".jpg"; // For backward compatibility
9836 9836
 			}
9837 9837
 			$email = $object->email;
9838 9838
 			$capture = 'user';
@@ -9842,17 +9842,17 @@  discard block
 block discarded – undo
9842 9842
 			if (!empty($object->photo)) {
9843 9843
 				if (dolIsAllowedForPreview($object->photo)) {
9844 9844
 					if ((string) $imagesize == 'mini') {
9845
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9845
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
9846 9846
 					} elseif ((string) $imagesize == 'small') {
9847
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9847
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
9848 9848
 					} else {
9849
-						$file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo;
9849
+						$file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
9850 9850
 					}
9851
-					$originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo;
9851
+					$originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
9852 9852
 				}
9853 9853
 			}
9854 9854
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9855
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9855
+				$altfile = $object->id.".jpg"; // For backward compatibility
9856 9856
 			}
9857 9857
 			$email = $object->email;
9858 9858
 		}
@@ -9862,35 +9862,35 @@  discard block
 block discarded – undo
9862 9862
 		}
9863 9863
 
9864 9864
 		if ($dir) {
9865
-			if ($file && file_exists($dir . "/" . $file)) {
9865
+			if ($file && file_exists($dir."/".$file)) {
9866 9866
 				if ($addlinktofullsize) {
9867
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9867
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9868 9868
 					if ($urladvanced) {
9869
-						$ret .= '<a href="' . $urladvanced . '">';
9869
+						$ret .= '<a href="'.$urladvanced.'">';
9870 9870
 					} else {
9871
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9871
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9872 9872
 					}
9873 9873
 				}
9874
-				$ret .= '<img alt="Photo" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">';
9874
+				$ret .= '<img alt="Photo" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
9875 9875
 				if ($addlinktofullsize) {
9876 9876
 					$ret .= '</a>';
9877 9877
 				}
9878
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
9878
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
9879 9879
 				if ($addlinktofullsize) {
9880
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9880
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9881 9881
 					if ($urladvanced) {
9882
-						$ret .= '<a href="' . $urladvanced . '">';
9882
+						$ret .= '<a href="'.$urladvanced.'">';
9883 9883
 					} else {
9884
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9884
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9885 9885
 					}
9886 9886
 				}
9887
-				$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 . '">';
9887
+				$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.'">';
9888 9888
 				if ($addlinktofullsize) {
9889 9889
 					$ret .= '</a>';
9890 9890
 				}
9891 9891
 			} else {
9892 9892
 				$nophoto = '/public/theme/common/nophoto.png';
9893
-				$defaultimg = 'identicon';        // For gravatar
9893
+				$defaultimg = 'identicon'; // For gravatar
9894 9894
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
9895 9895
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) {
9896 9896
 						$nophoto = 'company';
@@ -9908,13 +9908,13 @@  discard block
 block discarded – undo
9908 9908
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
9909 9909
 					// see https://gravatar.com/site/implement/images/php/
9910 9910
 					$ret .= '<!-- Put link to gravatar -->';
9911
-					$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
9911
+					$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
9912 9912
 				} else {
9913 9913
 					if ($nophoto == 'company') {
9914
-						$ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
9914
+						$ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
9915 9915
 						$ret .= '<div class="difforspanimgright"></div>';
9916 9916
 					} else {
9917
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
9917
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
9918 9918
 					}
9919 9919
 				}
9920 9920
 			}
@@ -9925,15 +9925,15 @@  discard block
 block discarded – undo
9925 9925
 				}
9926 9926
 				$ret .= '<table class="nobordernopadding centpercent">';
9927 9927
 				if ($object->photo) {
9928
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
9928
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
9929 9929
 				}
9930 9930
 				$ret .= '<tr><td class="tdoverflow">';
9931 9931
 				$maxfilesizearray = getMaxFileSizeArray();
9932 9932
 				$maxmin = $maxfilesizearray['maxmin'];
9933 9933
 				if ($maxmin > 0) {
9934
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
9934
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
9935 9935
 				}
9936
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
9936
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
9937 9937
 				$ret .= '</td></tr>';
9938 9938
 				$ret .= '</table>';
9939 9939
 			}
@@ -9987,38 +9987,38 @@  discard block
 block discarded – undo
9987 9987
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
9988 9988
 			$sql .= ", e.label";
9989 9989
 		}
9990
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
9990
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
9991 9991
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
9992
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
9992
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
9993 9993
 			if ($force_entity) {
9994
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
9994
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
9995 9995
 			} else {
9996 9996
 				$sql .= " WHERE ug.entity IS NOT NULL";
9997 9997
 			}
9998 9998
 		} else {
9999
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
9999
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10000 10000
 		}
10001 10001
 		if (is_array($exclude) && $excludeGroups) {
10002
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10002
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10003 10003
 		}
10004 10004
 		if (is_array($include) && $includeGroups) {
10005
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10005
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10006 10006
 		}
10007 10007
 		$sql .= " ORDER BY ug.nom ASC";
10008 10008
 
10009
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10009
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10010 10010
 		$resql = $this->db->query($sql);
10011 10011
 		if ($resql) {
10012 10012
 			// Enhance with select2
10013
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10013
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10014 10014
 
10015
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10015
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10016 10016
 
10017 10017
 			$num = $this->db->num_rows($resql);
10018 10018
 			$i = 0;
10019 10019
 			if ($num) {
10020 10020
 				if ($show_empty && !$multiple) {
10021
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10021
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10022 10022
 				}
10023 10023
 
10024 10024
 				while ($i < $num) {
@@ -10031,11 +10031,11 @@  discard block
 block discarded – undo
10031 10031
 					$label = $obj->name;
10032 10032
 					$labelhtml = $obj->name;
10033 10033
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10034
-						$label .= " (" . $obj->label . ")";
10035
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10034
+						$label .= " (".$obj->label.")";
10035
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10036 10036
 					}
10037 10037
 
10038
-					$out .= '<option value="' . $obj->rowid . '"';
10038
+					$out .= '<option value="'.$obj->rowid.'"';
10039 10039
 					if ($disableline) {
10040 10040
 						$out .= ' disabled';
10041 10041
 					}
@@ -10050,9 +10050,9 @@  discard block
 block discarded – undo
10050 10050
 				}
10051 10051
 			} else {
10052 10052
 				if ($show_empty) {
10053
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10053
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10054 10054
 				}
10055
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10055
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10056 10056
 			}
10057 10057
 			$out .= '</select>';
10058 10058
 
@@ -10101,25 +10101,25 @@  discard block
 block discarded – undo
10101 10101
 		$out = '';
10102 10102
 
10103 10103
 		if (!empty($conf->use_javascript_ajax)) {
10104
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10104
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10105 10105
 		}
10106
-		$out .= '<script nonce="' . getNonce() . '">
10106
+		$out .= '<script nonce="'.getNonce().'">
10107 10107
             $(document).ready(function() {
10108
-                $("#' . $cssclass . 's").click(function() {
10108
+                $("#' . $cssclass.'s").click(function() {
10109 10109
                     if($(this).is(\':checked\')){
10110
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10111
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10110
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10111
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10112 10112
                     }
10113 10113
                     else
10114 10114
                     {
10115 10115
                         console.log("We uncheck all");
10116
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10116
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10117 10117
                     }' . "\n";
10118 10118
 		if ($calljsfunction) {
10119
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10119
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10120 10120
 		}
10121 10121
 		$out .= '         });
10122
-        	        $(".' . $cssclass . '").change(function() {
10122
+        	        $(".' . $cssclass.'").change(function() {
10123 10123
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10124 10124
 				});
10125 10125
 		 	});
@@ -10164,67 +10164,67 @@  discard block
 block discarded – undo
10164 10164
 		global $langs, $user;
10165 10165
 
10166 10166
 		$out = '';
10167
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10168
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10167
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10168
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10169 10169
 		if (!empty($excludeid)) {
10170
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10170
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10171 10171
 		}
10172 10172
 		$sql .= " ORDER BY label";
10173 10173
 
10174 10174
 		$resql = $this->db->query($sql);
10175 10175
 		if ($resql) {
10176
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10176
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10177 10177
 			if ($useempty) {
10178 10178
 				$out .= '<option value="0">&nbsp;</option>';
10179 10179
 			}
10180 10180
 
10181 10181
 			while ($obj = $this->db->fetch_object($resql)) {
10182
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10182
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10183 10183
 			}
10184 10184
 			$out .= '</select>';
10185
-			$out .= ajax_combobox('select_' . $htmlname);
10185
+			$out .= ajax_combobox('select_'.$htmlname);
10186 10186
 
10187 10187
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10188
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10188
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10189 10189
 			}
10190 10190
 
10191 10191
 			if (!empty($target)) {
10192
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10192
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10193 10193
 				$resql = $this->db->query($sql);
10194 10194
 				if ($resql) {
10195 10195
 					if ($this->db->num_rows($resql) > 0) {
10196 10196
 						$obj = $this->db->fetch_object($resql);
10197
-						$out .= '<script nonce="' . getNonce() . '">
10197
+						$out .= '<script nonce="'.getNonce().'">
10198 10198
 							$(function() {
10199
-								$("select[name=' . $target . ']").on("change", function() {
10199
+								$("select[name=' . $target.']").on("change", function() {
10200 10200
 									var current_val = $(this).val();
10201
-									if (current_val == ' . $obj->id . ') {';
10201
+									if (current_val == ' . $obj->id.') {';
10202 10202
 						if (!empty($default_selected) || !empty($selected)) {
10203
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10203
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10204 10204
 						}
10205 10205
 
10206 10206
 						$out .= '
10207
-										$("select[name=' . $htmlname . ']").change();
10207
+										$("select[name=' . $htmlname.']").change();
10208 10208
 									}
10209 10209
 								});
10210 10210
 
10211
-								$("select[name=' . $htmlname . ']").change(function() {
10211
+								$("select[name=' . $htmlname.']").change(function() {
10212 10212
 
10213
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10213
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10214 10214
 										// get price of kilometer to fill the unit price
10215 10215
 										$.ajax({
10216 10216
 											method: "POST",
10217 10217
 											dataType: "json",
10218
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10219
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . join('&', $params)) . '",
10218
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10219
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.join('&', $params)).'",
10220 10220
 										}).done(function( data, textStatus, jqXHR ) {
10221 10221
 											console.log(data);
10222 10222
 											if (typeof data.up != "undefined") {
10223 10223
 												$("input[name=value_unit]").val(data.up);
10224
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10224
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10225 10225
 											} else {
10226 10226
 												$("input[name=value_unit]").val("");
10227
-												$("select[name=' . $htmlname . ']").attr("title", "");
10227
+												$("select[name=' . $htmlname.']").attr("title", "");
10228 10228
 											}
10229 10229
 										});
10230 10230
 									}
@@ -10254,18 +10254,18 @@  discard block
 block discarded – undo
10254 10254
 		global $conf, $langs;
10255 10255
 
10256 10256
 		$out = '';
10257
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10258
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10257
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10258
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10259 10259
 
10260 10260
 		$resql = $this->db->query($sql);
10261 10261
 		if ($resql) {
10262
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10262
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10263 10263
 			if ($useempty) {
10264 10264
 				$out .= '<option value="0"></option>';
10265 10265
 			}
10266 10266
 
10267 10267
 			while ($obj = $this->db->fetch_object($resql)) {
10268
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10268
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10269 10269
 			}
10270 10270
 			$out .= '</select>';
10271 10271
 		} else {
@@ -10290,17 +10290,17 @@  discard block
 block discarded – undo
10290 10290
 		global $langs;
10291 10291
 
10292 10292
 		$out = '';
10293
-		$sql = "SELECT id, code, label FROM " . $this->db->prefix() . "c_type_fees";
10293
+		$sql = "SELECT id, code, label FROM ".$this->db->prefix()."c_type_fees";
10294 10294
 		$sql .= " WHERE active = 1";
10295 10295
 
10296 10296
 		$resql = $this->db->query($sql);
10297 10297
 		if ($resql) {
10298
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10298
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10299 10299
 			if ($useempty) {
10300 10300
 				$out .= '<option value="0"></option>';
10301 10301
 			}
10302 10302
 			if ($allchoice) {
10303
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10303
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10304 10304
 			}
10305 10305
 
10306 10306
 			$field = 'code';
@@ -10310,7 +10310,7 @@  discard block
 block discarded – undo
10310 10310
 
10311 10311
 			while ($obj = $this->db->fetch_object($resql)) {
10312 10312
 				$key = $langs->trans($obj->code);
10313
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10313
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10314 10314
 			}
10315 10315
 			$out .= '</select>';
10316 10316
 		} else {
@@ -10342,7 +10342,7 @@  discard block
 block discarded – undo
10342 10342
 	{
10343 10343
 		global $user, $conf, $langs;
10344 10344
 
10345
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10345
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10346 10346
 
10347 10347
 		if (is_null($usertofilter)) {
10348 10348
 			$usertofilter = $user;
@@ -10366,10 +10366,10 @@  discard block
 block discarded – undo
10366 10366
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10367 10367
             p.title, p.fk_soc, p.fk_statut, p.public,";
10368 10368
 		$sql .= ' s.nom as name';
10369
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10370
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10371
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10372
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10369
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10370
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10371
+		$sql .= ' '.$this->db->prefix().'facture as f';
10372
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10373 10373
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10374 10374
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10375 10375
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10380,14 +10380,14 @@  discard block
 block discarded – undo
10380 10380
 		if ($resql) {
10381 10381
 			// Use select2 selector
10382 10382
 			if (!empty($conf->use_javascript_ajax)) {
10383
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10383
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10384 10384
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10385 10385
 				$out .= $comboenhancement;
10386 10386
 				$morecss = 'minwidth200imp maxwidth500';
10387 10387
 			}
10388 10388
 
10389 10389
 			if (empty($option_only)) {
10390
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10390
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10391 10391
 			}
10392 10392
 			if (!empty($show_empty)) {
10393 10393
 				$out .= '<option value="0" class="optiongrey">';
@@ -10417,33 +10417,33 @@  discard block
 block discarded – undo
10417 10417
 						if ($showproject == 'all') {
10418 10418
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10419 10419
 							if ($obj->name) {
10420
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10420
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10421 10421
 							}
10422 10422
 
10423 10423
 							$disabled = 0;
10424 10424
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10425 10425
 								$disabled = 1;
10426
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10426
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10427 10427
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10428 10428
 								if ($discard_closed == 2) {
10429 10429
 									$disabled = 1;
10430 10430
 								}
10431
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10431
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10432 10432
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10433 10433
 								$disabled = 1;
10434
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10434
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10435 10435
 							}
10436 10436
 						}
10437 10437
 
10438 10438
 						if (!empty($selected) && $selected == $obj->rowid) {
10439
-							$out .= '<option value="' . $obj->rowid . '" selected';
10439
+							$out .= '<option value="'.$obj->rowid.'" selected';
10440 10440
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10441
-							$out .= '>' . $labeltoshow . '</option>';
10441
+							$out .= '>'.$labeltoshow.'</option>';
10442 10442
 						} else {
10443 10443
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10444 10444
 								$resultat = '';
10445 10445
 							} else {
10446
-								$resultat = '<option value="' . $obj->rowid . '"';
10446
+								$resultat = '<option value="'.$obj->rowid.'"';
10447 10447
 								if ($disabled) {
10448 10448
 									$resultat .= ' disabled';
10449 10449
 								}
@@ -10495,22 +10495,22 @@  discard block
 block discarded – undo
10495 10495
 
10496 10496
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10497 10497
 		//$sql.= ', el.fk_source';
10498
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10499
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10498
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10499
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10500 10500
 		$sql .= " ORDER BY f.titre ASC";
10501 10501
 
10502 10502
 		$resql = $this->db->query($sql);
10503 10503
 		if ($resql) {
10504 10504
 			// Use select2 selector
10505 10505
 			if (!empty($conf->use_javascript_ajax)) {
10506
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10506
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10507 10507
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10508 10508
 				$out .= $comboenhancement;
10509 10509
 				$morecss = 'minwidth200imp maxwidth500';
10510 10510
 			}
10511 10511
 
10512 10512
 			if (empty($option_only)) {
10513
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10513
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10514 10514
 			}
10515 10515
 			if (!empty($show_empty)) {
10516 10516
 				$out .= '<option value="0" class="optiongrey">';
@@ -10529,19 +10529,19 @@  discard block
 block discarded – undo
10529 10529
 					$disabled = 0;
10530 10530
 					if (!empty($obj->suspended)) {
10531 10531
 						$disabled = 1;
10532
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10532
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10533 10533
 					}
10534 10534
 
10535 10535
 
10536 10536
 					if (!empty($selected) && $selected == $obj->rowid) {
10537
-						$out .= '<option value="' . $obj->rowid . '" selected';
10537
+						$out .= '<option value="'.$obj->rowid.'" selected';
10538 10538
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10539
-						$out .= '>' . $labeltoshow . '</option>';
10539
+						$out .= '>'.$labeltoshow.'</option>';
10540 10540
 					} else {
10541 10541
 						if ($disabled && ($selected != $obj->rowid)) {
10542 10542
 							$resultat = '';
10543 10543
 						} else {
10544
-							$resultat = '<option value="' . $obj->rowid . '"';
10544
+							$resultat = '<option value="'.$obj->rowid.'"';
10545 10545
 							if ($disabled) {
10546 10546
 								$resultat .= ' disabled';
10547 10547
 							}
@@ -10581,14 +10581,14 @@  discard block
 block discarded – undo
10581 10581
 		global $langs;
10582 10582
 
10583 10583
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10584
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10584
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10585 10585
 		}
10586 10586
 
10587 10587
 		$ret = '';
10588 10588
 
10589 10589
 		$ret .= '<div class="divadvancedsearchfieldcomp inline-block">';
10590 10590
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10591
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10591
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10592 10592
 		$ret .= '</a>';
10593 10593
 
10594 10594
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -10615,13 +10615,13 @@  discard block
 block discarded – undo
10615 10615
 				}
10616 10616
 
10617 10617
 				if ($countparenthesis == 0) {
10618
-					$char2 = dol_substr($search_component_params_hidden, $i+1, 1);
10619
-					$char3 = dol_substr($search_component_params_hidden, $i+2, 1);
10618
+					$char2 = dol_substr($search_component_params_hidden, $i + 1, 1);
10619
+					$char3 = dol_substr($search_component_params_hidden, $i + 2, 1);
10620 10620
 					if ($char == 'A' && $char2 == 'N' && $char3 == 'D') {
10621 10621
 						// We found a AND
10622 10622
 						$arrayofandtags[] = trim($s);
10623 10623
 						$s = '';
10624
-						$i+=2;
10624
+						$i += 2;
10625 10625
 					} else {
10626 10626
 						$s .= $char;
10627 10627
 					}
@@ -10645,8 +10645,8 @@  discard block
 block discarded – undo
10645 10645
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
10646 10646
 				$searchtags = removeGlobalParenthesis($searchtags);
10647 10647
 
10648
-				$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
10649
-				$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> ';
10648
+				$ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">';
10649
+				$ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> ';
10650 10650
 				$ret .= dol_escape_htmltag($searchtags);
10651 10651
 				$ret .= '</span>';
10652 10652
 			}
@@ -10663,29 +10663,29 @@  discard block
 block discarded – undo
10663 10663
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
10664 10664
 		}
10665 10665
 		$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%')) -->";
10666
-		$ret .= '<input type="hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
10666
+		$ret .= '<input type="hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
10667 10667
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
10668 10668
 
10669 10669
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
10670 10670
 		foreach ($arrayofcriterias as $criterias) {
10671 10671
 			foreach ($criterias as $criteriafamilykey => $criteriafamilyval) {
10672
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10672
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10673 10673
 					continue;
10674 10674
 				}
10675 10675
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
10676 10676
 					continue;
10677 10677
 				}
10678 10678
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
10679
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
10680
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
10681
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
10682
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
10683
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
10684
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
10685
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
10686
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
10679
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
10680
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
10681
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
10682
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
10683
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
10684
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
10685
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
10686
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
10687 10687
 				} else {
10688
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
10688
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
10689 10689
 				}
10690 10690
 			}
10691 10691
 		}
@@ -10693,7 +10693,7 @@  discard block
 block discarded – undo
10693 10693
 		$ret .= '</div>';
10694 10694
 
10695 10695
 		$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";
10696
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Search") . '" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10696
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Search").'" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10697 10697
 
10698 10698
 		$ret .= '</div>';
10699 10699
 		$ret .= '</div>';
@@ -10729,7 +10729,7 @@  discard block
 block discarded – undo
10729 10729
 
10730 10730
 		$TModels = array();
10731 10731
 
10732
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
10732
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
10733 10733
 		$formmail = new FormMail($this->db);
10734 10734
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
10735 10735
 
@@ -10742,17 +10742,17 @@  discard block
 block discarded – undo
10742 10742
 			}
10743 10743
 		}
10744 10744
 
10745
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
10745
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
10746 10746
 
10747 10747
 		foreach ($TModels as $id_model => $label_model) {
10748
-			$retstring .= '<option value="' . $id_model . '"';
10749
-			$retstring .= ">" . $label_model . "</option>";
10748
+			$retstring .= '<option value="'.$id_model.'"';
10749
+			$retstring .= ">".$label_model."</option>";
10750 10750
 		}
10751 10751
 
10752 10752
 		$retstring .= "</select>";
10753 10753
 
10754 10754
 		if ($addjscombo) {
10755
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
10755
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
10756 10756
 		}
10757 10757
 
10758 10758
 		return $retstring;
@@ -10803,16 +10803,16 @@  discard block
 block discarded – undo
10803 10803
 
10804 10804
 		foreach ($buttons as $button) {
10805 10805
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
10806
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
10806
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
10807 10807
 		}
10808 10808
 		$retstring .= $withoutdiv ? '' : '</div>';
10809 10809
 
10810 10810
 		if ($dol_openinpopup) {
10811
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n";
10812
-			$retstring .= '<script nonce="' . getNonce() . '">';
10811
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n";
10812
+			$retstring .= '<script nonce="'.getNonce().'">';
10813 10813
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
10814
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\');
10815
-				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\');
10814
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\');
10815
+				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\');
10816 10816
 				 });';
10817 10817
 			$retstring .= '</script>';
10818 10818
 		}
@@ -10841,7 +10841,7 @@  discard block
 block discarded – undo
10841 10841
 		dol_syslog(__METHOD__, LOG_DEBUG);
10842 10842
 
10843 10843
 		$sql = "SELECT rowid, code, label as label";
10844
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
10844
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
10845 10845
 		$sql .= " WHERE active = 1";
10846 10846
 
10847 10847
 		$resql = $this->db->query($sql);
@@ -10852,7 +10852,7 @@  discard block
 block discarded – undo
10852 10852
 				$obj = $this->db->fetch_object($resql);
10853 10853
 
10854 10854
 				// If translation exists, we use it, otherwise we take the default wording
10855
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != ("InvoiceSubtype" . $obj->rowid)) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
10855
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != ("InvoiceSubtype".$obj->rowid)) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
10856 10856
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
10857 10857
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
10858 10858
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -10884,18 +10884,18 @@  discard block
 block discarded – undo
10884 10884
 		global $langs, $user;
10885 10885
 
10886 10886
 		$out = '';
10887
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
10887
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
10888 10888
 
10889 10889
 		$this->load_cache_invoice_subtype();
10890 10890
 
10891
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
10891
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
10892 10892
 		if ($addempty) {
10893 10893
 			$out .= '<option value="0">&nbsp;</option>';
10894 10894
 		}
10895 10895
 
10896 10896
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
10897 10897
 			$label = $subtype['label'];
10898
-			$out .= '<option value="' . $subtype['rowid'] . '"';
10898
+			$out .= '<option value="'.$subtype['rowid'].'"';
10899 10899
 			if ($selected == $subtype['rowid']) {
10900 10900
 				$out .= ' selected="selected"';
10901 10901
 			}
Please login to merge, or discard this patch.
htdocs/accountancy/admin/index.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -288,19 +288,19 @@  discard block
 block discarded – undo
288 288
 // Show message if accountancy hidden options are activated to help to resolve some problems
289 289
 if (!$user->admin) {
290 290
 	if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
291
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
291
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS").'</div>';
292 292
 	}
293 293
 	if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
294
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
294
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS").'</div>';
295 295
 	}
296 296
 	if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) {
297
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>';
297
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY").'</div>';
298 298
 	}
299 299
 	if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
300
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '</div>';
300
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED").'</div>';
301 301
 	}
302 302
 	if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
303
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '</div>';
303
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED").'</div>';
304 304
 	}
305 305
 }
306 306
 
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 print '<div class="div-table-responsive-no-min">';
479 479
 print '<table class="noborder centpercent">';
480 480
 print '<tr class="liste_titre">';
481
-print '<td colspan="2">' . $langs->trans('OptionsAdvanced') . '</td>';
481
+print '<td colspan="2">'.$langs->trans('OptionsAdvanced').'</td>';
482 482
 print "</tr>\n";
483 483
 
484 484
 print '<tr class="oddeven">';
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 	// Number of letters for lettering (3 by default (AAA), min 2 (AA))
500 500
 	print '<tr class="oddeven">';
501 501
 	print '<td>';
502
-	print $form->textwithpicto($langs->trans("ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans("ACCOUNTING_LETTERING_NBLETTERS_DESC")) . '</td>';
502
+	print $form->textwithpicto($langs->trans("ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans("ACCOUNTING_LETTERING_NBLETTERS_DESC")).'</td>';
503 503
 	print '<td class="right">';
504 504
 
505 505
 	if (empty($letter)) {
@@ -510,19 +510,19 @@  discard block
 block discarded – undo
510 510
 		}
511 511
 	}
512 512
 
513
-	print '<input class="flat right" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="' . $nbletter . '" type="number" step="1" min="2" max="3" >' . "\n";
513
+	print '<input class="flat right" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="'.$nbletter.'" type="number" step="1" min="2" max="3" >'."\n";
514 514
 	print '</tr>';
515 515
 
516 516
 	// Auto Lettering when transfer in accountancy is realized
517 517
 	print '<tr class="oddeven">';
518 518
 	print '<td>';
519
-	print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) . '</td>';
519
+	print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING_DESC")).'</td>';
520 520
 	if (getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) {
521
-		print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=0">';
521
+		print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenableautolettering&value=0">';
522 522
 		print img_picto($langs->trans("Activated"), 'switch_on');
523 523
 		print '</a></td>';
524 524
 	} else {
525
-		print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=1">';
525
+		print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenableautolettering&value=1">';
526 526
 		print img_picto($langs->trans("Disabled"), 'switch_off');
527 527
 		print '</a></td>';
528 528
 	}
@@ -533,11 +533,11 @@  discard block
 block discarded – undo
533 533
 print '<td>';
534 534
 print $form->textwithpicto($langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities("MenuDefaultAccounts"))).'</td>';
535 535
 if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
536
-	print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=0">';
536
+	print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablevatreversecharge&value=0">';
537 537
 	print img_picto($langs->trans("Activated"), 'switch_on');
538 538
 	print '</a></td>';
539 539
 } else {
540
-	print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=1">';
540
+	print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablevatreversecharge&value=1">';
541 541
 	print img_picto($langs->trans("Disabled"), 'switch_off');
542 542
 	print '</a></td>';
543 543
 }
Please login to merge, or discard this patch.
htdocs/accountancy/bookkeeping/listbyaccount.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -52,29 +52,29 @@  discard block
 block discarded – undo
52 52
 	$context_default = 'bookkeepingbyaccountlist';
53 53
 }
54 54
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : $context_default;
55
-$search_date_startyear =  GETPOST('search_date_startyear', 'int');
56
-$search_date_startmonth =  GETPOST('search_date_startmonth', 'int');
57
-$search_date_startday =  GETPOST('search_date_startday', 'int');
58
-$search_date_endyear =  GETPOST('search_date_endyear', 'int');
59
-$search_date_endmonth =  GETPOST('search_date_endmonth', 'int');
60
-$search_date_endday =  GETPOST('search_date_endday', 'int');
55
+$search_date_startyear = GETPOST('search_date_startyear', 'int');
56
+$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
57
+$search_date_startday = GETPOST('search_date_startday', 'int');
58
+$search_date_endyear = GETPOST('search_date_endyear', 'int');
59
+$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
60
+$search_date_endday = GETPOST('search_date_endday', 'int');
61 61
 $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
62 62
 $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
63 63
 $search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
64
-$search_date_export_startyear =  GETPOST('search_date_export_startyear', 'int');
65
-$search_date_export_startmonth =  GETPOST('search_date_export_startmonth', 'int');
66
-$search_date_export_startday =  GETPOST('search_date_export_startday', 'int');
67
-$search_date_export_endyear =  GETPOST('search_date_export_endyear', 'int');
68
-$search_date_export_endmonth =  GETPOST('search_date_export_endmonth', 'int');
69
-$search_date_export_endday =  GETPOST('search_date_export_endday', 'int');
64
+$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int');
65
+$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int');
66
+$search_date_export_startday = GETPOST('search_date_export_startday', 'int');
67
+$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
68
+$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
69
+$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
70 70
 $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
71 71
 $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
72
-$search_date_validation_startyear =  GETPOST('search_date_validation_startyear', 'int');
73
-$search_date_validation_startmonth =  GETPOST('search_date_validation_startmonth', 'int');
74
-$search_date_validation_startday =  GETPOST('search_date_validation_startday', 'int');
75
-$search_date_validation_endyear =  GETPOST('search_date_validation_endyear', 'int');
76
-$search_date_validation_endmonth =  GETPOST('search_date_validation_endmonth', 'int');
77
-$search_date_validation_endday =  GETPOST('search_date_validation_endday', 'int');
72
+$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int');
73
+$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int');
74
+$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int');
75
+$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int');
76
+$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int');
77
+$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int');
78 78
 $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
79 79
 $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
80 80
 $search_import_key = GETPOST("search_import_key", 'alpha');
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 		} else {
305 305
 			$filter['t.numero_compte>='] = $search_accountancy_code_start;
306 306
 		}
307
-		$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
307
+		$param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start);
308 308
 	}
309 309
 	if (!empty($search_accountancy_code_end)) {
310 310
 		if ($type == 'sub') {
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 		} else {
313 313
 			$filter['t.numero_compte<='] = $search_accountancy_code_end;
314 314
 		}
315
-		$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
315
+		$param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end);
316 316
 	}
317 317
 	if (!empty($search_label_account)) {
318 318
 		$filter['t.label_compte'] = $search_label_account;
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 			}
495 495
 
496 496
 			if (!$error) {
497
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
497
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
498 498
 				exit();
499 499
 			}
500 500
 		} elseif ($massaction == 'letteringmanual') {
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 				setEventMessages('', $lettering->errors, 'errors');
505 505
 			} else {
506 506
 				setEventMessages($langs->trans('AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs');
507
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
507
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
508 508
 				exit();
509 509
 			}
510 510
 		} elseif ($action == 'unletteringauto' && $confirm == "yes") {
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 			}
526 526
 
527 527
 			if (!$error) {
528
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
528
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
529 529
 				exit();
530 530
 			}
531 531
 		} elseif ($action == 'unletteringmanual' && $confirm == "yes") {
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 				setEventMessages('', $lettering->errors, 'errors');
536 536
 			} else {
537 537
 				setEventMessages($langs->trans('AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs');
538
-				header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
538
+				header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param);
539 539
 				exit();
540 540
 			}
541 541
 		}
@@ -642,10 +642,10 @@  discard block
 block discarded – undo
642 642
 // List of mass actions available
643 643
 $arrayofmassactions = array();
644 644
 if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) {
645
-	$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto');
646
-	$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto');
647
-	$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual');
648
-	$arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual');
645
+	$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto');
646
+	$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto');
647
+	$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual');
648
+	$arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual');
649 649
 }
650 650
 if ($user->hasRight('accounting', 'mouvements', 'supprimer')) {
651 651
 	$arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
@@ -678,11 +678,11 @@  discard block
 block discarded – undo
678 678
 if (empty($reshook)) {
679 679
 	$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
680 680
 	if ($type == 'sub') {
681
-		$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
682
-		$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
681
+		$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly'));
682
+		$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
683 683
 	} else {
684
-		$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
685
-		$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
684
+		$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
685
+		$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly'));
686 686
 	}
687 687
 	$newcardbutton .= dolGetButtonTitleSeparator();
688 688
 	$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
@@ -760,8 +760,8 @@  discard block
 block discarded – undo
760 760
 } else {
761 761
 	$stringforfirstkey .= ' CTL +';
762 762
 }
763
-$moreforfilter .= '&nbsp;&nbsp;&nbsp;<a id="previous_account" accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>';
764
-$moreforfilter .= '&nbsp;&nbsp;&nbsp;<a id="next_account" accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>';
763
+$moreforfilter .= '&nbsp;&nbsp;&nbsp;<a id="previous_account" accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>';
764
+$moreforfilter .= '&nbsp;&nbsp;&nbsp;<a id="next_account" accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>';
765 765
 $moreforfilter .= <<<SCRIPT
766 766
 <script type="text/javascript">
767 767
 	jQuery(document).ready(function() {
@@ -988,8 +988,8 @@  discard block
 block discarded – undo
988 988
 	}
989 989
 	//if (empty($accountg)) $accountg = '-';
990 990
 
991
-	$colspan = 0;			// colspan before field 'label of operation'
992
-	$colspanend = 0;		// colspan after debit/credit
991
+	$colspan = 0; // colspan before field 'label of operation'
992
+	$colspanend = 0; // colspan after debit/credit
993 993
 	if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
994 994
 		$colspan++;
995 995
 	}
@@ -1038,9 +1038,9 @@  discard block
 block discarded – undo
1038 1038
 		if (isset($displayed_account_number)) {
1039 1039
 			print '<tr class="liste_total">';
1040 1040
 			if ($type == 'sub') {
1041
-				print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accounta($displayed_account_number) . ':</td>';
1041
+				print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accounta($displayed_account_number).':</td>';
1042 1042
 			} else {
1043
-				print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accountg($displayed_account_number) . ':</td>';
1043
+				print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accountg($displayed_account_number).':</td>';
1044 1044
 			}
1045 1045
 			print '<td class="nowrap right">'.price(price2num($sous_total_debit, 'MT')).'</td>';
1046 1046
 			print '<td class="nowrap right">'.price(price2num($sous_total_credit, 'MT')).'</td>';
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
 
1072 1072
 		// Show the break account
1073 1073
 		print '<tr class="trforbreak">';
1074
-		print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : count($arrayfields)+1).'" class="tdforbreak">';
1074
+		print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : count($arrayfields) + 1).'" class="tdforbreak">';
1075 1075
 		if ($type == 'sub') {
1076 1076
 			if ($line->subledger_account != "" && $line->subledger_account != '-1') {
1077 1077
 				print empty($line->subledger_label) ? '<span class="error">'.$langs->trans("Unknown").'</span>' : $line->subledger_label;
@@ -1079,9 +1079,9 @@  discard block
 block discarded – undo
1079 1079
 				print length_accounta($line->subledger_account);
1080 1080
 			} else {
1081 1081
 				// Should not happen: subledger account must be null or a non empty value
1082
-				print '<span class="error">' . $langs->trans("Unknown");
1082
+				print '<span class="error">'.$langs->trans("Unknown");
1083 1083
 				if ($line->subledger_label) {
1084
-					print ' (' . $line->subledger_label . ')';
1084
+					print ' ('.$line->subledger_label.')';
1085 1085
 					$htmltext = 'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
1086 1086
 				} else {
1087 1087
 					$htmltext = 'EmptyStringForSubledgerAccountAndSubledgerLabel';
@@ -1091,9 +1091,9 @@  discard block
 block discarded – undo
1091 1091
 			}
1092 1092
 		} else {
1093 1093
 			if ($line->numero_compte != "" && $line->numero_compte != '-1') {
1094
-				print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte);
1094
+				print length_accountg($line->numero_compte).' : '.$object->get_compte_desc($line->numero_compte);
1095 1095
 			} else {
1096
-				print '<span class="error">' . $langs->trans("Unknown") . '</span>';
1096
+				print '<span class="error">'.$langs->trans("Unknown").'</span>';
1097 1097
 			}
1098 1098
 		}
1099 1099
 		print '</td>';
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
 			if (in_array($line->id, $arrayofselected)) {
1117 1117
 				$selected = 1;
1118 1118
 			}
1119
-			print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />';
1119
+			print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />';
1120 1120
 		}
1121 1121
 		print '</td>';
1122 1122
 		if (!$i) {
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
 		} elseif ($line->doc_type == 'bank') {
1210 1210
 			print $objectstatic->getNomUrl(1);
1211 1211
 			$bank_ref = strstr($line->doc_ref, '-');
1212
-			print " " . $bank_ref;
1212
+			print " ".$bank_ref;
1213 1213
 		} else {
1214 1214
 			print $line->doc_ref;
1215 1215
 		}
@@ -1227,7 +1227,7 @@  discard block
 block discarded – undo
1227 1227
 		if (strlen(length_accounta($line->subledger_account)) == 0) {
1228 1228
 			print '<td class="small tdoverflowmax350 classfortooltip" title="'.dol_escape_htmltag($line->label_operation).'">'.dol_escape_htmltag($line->label_operation).'</td>';
1229 1229
 		} else {
1230
-			print '<td class="small tdoverflowmax350 classfortooltip" title="'.dol_escape_htmltag($line->label_operation.($line->label_operation?'<br>':'').'<span style="font-size:0.8em">('.length_accounta($line->subledger_account).')').'">'.dol_escape_htmltag($line->label_operation).($line->label_operation?'<br>':'').'<span style="font-size:0.8em">('.dol_escape_htmltag(length_accounta($line->subledger_account)).')</span></td>';
1230
+			print '<td class="small tdoverflowmax350 classfortooltip" title="'.dol_escape_htmltag($line->label_operation.($line->label_operation ? '<br>' : '').'<span style="font-size:0.8em">('.length_accounta($line->subledger_account).')').'">'.dol_escape_htmltag($line->label_operation).($line->label_operation ? '<br>' : '').'<span style="font-size:0.8em">('.dol_escape_htmltag(length_accounta($line->subledger_account)).')</span></td>';
1231 1231
 		}
1232 1232
 		if (!$i) {
1233 1233
 			$totalarray['nbfield']++;
@@ -1314,7 +1314,7 @@  discard block
 block discarded – undo
1314 1314
 			if (in_array($line->id, $arrayofselected)) {
1315 1315
 				$selected = 1;
1316 1316
 			}
1317
-			print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />';
1317
+			print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />';
1318 1318
 		}
1319 1319
 		print '</td>';
1320 1320
 		if (!$i) {
Please login to merge, or discard this patch.