Completed
Branch develop (e30377)
by
unknown
16:42
created
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1223 added lines, -1223 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
123 123
 			if (!empty($perm)) {
124 124
 				$tmp = explode(':', $typeofdata);
125
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
125
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
126 126
 				if ($fieldrequired) {
127 127
 					$ret .= '<span class="fieldrequired">';
128 128
 				}
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 				if ($fieldrequired) {
135 135
 					$ret .= '</span>';
136 136
 				}
137
-				$ret .= '</div>' . "\n";
137
+				$ret .= '</div>'."\n";
138 138
 			} else {
139 139
 				if ($fieldrequired) {
140 140
 					$ret .= '<span class="fieldrequired">';
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 			if (empty($notabletag) && $perm) {
173 173
 				$ret .= '<td class="right">';
174 174
 			}
175
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
176
-				$ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>';
175
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
176
+				$ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>';
177 177
 			}
178 178
 			if (!empty($notabletag) && $notabletag == 1) {
179 179
 				if ($text) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 			} elseif ($reg[1] == 'int') {
241 241
 				$typeofdata = 'numeric';
242 242
 			} else {
243
-				return 'ErrorBadParameter ' . $typeofdata;
243
+				return 'ErrorBadParameter '.$typeofdata;
244 244
 			}
245 245
 		}
246 246
 
@@ -251,13 +251,13 @@  discard block
 block discarded – undo
251 251
 			if ($editaction == '') {
252 252
 				$editaction = GETPOST('action', 'aZ09');
253 253
 			}
254
-			$editmode = ($editaction == 'edit' . $htmlname);
254
+			$editmode = ($editaction == 'edit'.$htmlname);
255 255
 			if ($editmode) {	// edit mode
256 256
 				$ret .= "\n";
257
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
258
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
259
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
260
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
257
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
258
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
259
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
260
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
261 261
 				if (empty($notabletag)) {
262 262
 					$ret .= '<table class="nobordernopadding centpercent">';
263 263
 				}
@@ -266,28 +266,28 @@  discard block
 block discarded – undo
266 266
 				}
267 267
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
268 268
 					$tmp = explode(':', $typeofdata);
269
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
269
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
270 270
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
271 271
 					$tmp = explode(':', $typeofdata);
272 272
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
273
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
273
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
274 274
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
275 275
 					$tmp = explode(':', $typeofdata);
276 276
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
277
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
277
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
278 278
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
279 279
 					$tmp = explode(':', $typeofdata);
280
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
280
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
281 281
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
282 282
 					$tmp = explode(':', $typeofdata);
283 283
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
284 284
 					$morealt = '';
285 285
 					if (preg_match('/%/', $cols)) {
286
-						$morealt = ' style="width: ' . $cols . '"';
286
+						$morealt = ' style="width: '.$cols.'"';
287 287
 						$cols = '';
288 288
 					}
289 289
 					$valuetoshow = ($editvalue ? $editvalue : $value);
290
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
290
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
291 291
 					// textarea convert automatically entities chars into simple chars.
292 292
 					// So we convert & into &amp; so a string like 'a &lt; <b>b</b><br>é<br>&lt;script&gt;alert('X');&lt;script&gt;' stay a correct html and is not converted by textarea component when wysiwig is off.
293 293
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -297,12 +297,12 @@  discard block
 block discarded – undo
297 297
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
298 298
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
299 299
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
300
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
300
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
301 301
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
302 302
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
303 303
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
304 304
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
305
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
305
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
306 306
 				} elseif (preg_match('/^select;/', $typeofdata)) {
307 307
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
308 308
 					$arraylist = array();
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 					// TODO Not yet implemented. See code for extrafields
317 317
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
318 318
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
319
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
319
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
320 320
 					$doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7]));
321 321
 					$ret .= $doleditor->Create(1);
322 322
 				} elseif ($typeofdata == 'asis') {
@@ -331,19 +331,19 @@  discard block
 block discarded – undo
331 331
 					$ret .= '<td>';
332 332
 				}
333 333
 				//else $ret.='<div class="clearboth"></div>';
334
-				$ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
334
+				$ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
335 335
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
336
-					$ret .= '<br>' . "\n";
336
+					$ret .= '<br>'."\n";
337 337
 				}
338
-				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
338
+				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
339 339
 				if (empty($notabletag)) {
340 340
 					$ret .= '</td>';
341 341
 				}
342 342
 
343 343
 				if (empty($notabletag)) {
344
-					$ret .= '</tr></table>' . "\n";
344
+					$ret .= '</tr></table>'."\n";
345 345
 				}
346
-				$ret .= '</form>' . "\n";
346
+				$ret .= '</form>'."\n";
347 347
 			} else {		// view mode
348 348
 				if (preg_match('/^email/', $typeofdata)) {
349 349
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -355,15 +355,15 @@  discard block
 block discarded – undo
355 355
 					$ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : '');
356 356
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
357 357
 					$tmp = explode(':', $typeofdata);
358
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
358
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
359 359
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
360 360
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
361 361
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
362 362
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
363 363
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
364
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
364
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
365 365
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
366
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
366
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
367 367
 				} elseif (preg_match('/^select;/', $typeofdata)) {
368 368
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
369 369
 					$arraylist = array();
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
 					$ret .= $arraylist[$value];
375 375
 					if ($htmlname == 'fk_product_type') {
376 376
 						if ($value == 0) {
377
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
377
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
378 378
 						} else {
379
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
379
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
380 380
 						}
381 381
 					}
382 382
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
385 385
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
386 386
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
387
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
387
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
388 388
 					}
389 389
 					// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also
390 390
 					// clean data from some dangerous html
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
394 394
 						$ret .= dol_escape_htmltag($value);
395 395
 					} else {
396
-						$ret .= $value;        // $value must be already html escaped.
396
+						$ret .= $value; // $value must be already html escaped.
397 397
 					}
398 398
 				}
399 399
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 
432 432
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
433 433
 			if (!is_object($extralanguages)) {
434
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
434
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
435 435
 				$extralanguages = new ExtraLanguages($this->db);
436 436
 			}
437 437
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -440,17 +440,17 @@  discard block
 block discarded – undo
440 440
 				return ''; // No extralang field to show
441 441
 			}
442 442
 
443
-			$result .= '<!-- Widget for translation -->' . "\n";
444
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
443
+			$result .= '<!-- Widget for translation -->'."\n";
444
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
445 445
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
446 446
 			$result .= $s;
447 447
 			$result .= '</div>';
448 448
 
449
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
449
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
450 450
 
451 451
 			$resultforextrlang = '';
452 452
 			foreach ($arrayoflangcode as $langcode) {
453
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
453
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
454 454
 				if (empty($valuetoshow)) {
455 455
 					$object->fetchValuesForExtraLanguages();
456 456
 					//var_dump($object->array_languages);
@@ -462,17 +462,17 @@  discard block
 block discarded – undo
462 462
 
463 463
 				// TODO Use the showInputField() method of ExtraLanguages object
464 464
 				if ($typeofdata == 'textarea') {
465
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
465
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
466 466
 					$resultforextrlang .= $valuetoshow;
467 467
 					$resultforextrlang .= '</textarea>';
468 468
 				} else {
469
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
469
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
470 470
 				}
471 471
 			}
472 472
 			$result .= $resultforextrlang;
473 473
 
474 474
 			$result .= '</div>';
475
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
475
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
476 476
 		}
477 477
 
478 478
 		return $result;
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 				if (!empty($tmp[2])) {
536 536
 					$savemethod = $tmp[2];
537 537
 				}
538
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
538
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
539 539
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
540 540
 				$tmp = explode(':', $inputType);
541 541
 				$inputType = $tmp[0];
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 					$savemethod = $tmp[2];
547 547
 				}
548 548
 
549
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
549
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
550 550
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
551 551
 				$tmp = explode(':', $inputType);
552 552
 				$inputType = $tmp[0];
@@ -577,40 +577,40 @@  discard block
 block discarded – undo
577 577
 				}
578 578
 
579 579
 				if (isModEnabled('fckeditor')) {
580
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
580
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
581 581
 				} else {
582 582
 					$inputType = 'textarea';
583 583
 				}
584 584
 			}
585 585
 
586
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
587
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
588
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
589
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
586
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
587
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
588
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
589
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
590 590
 			if (!empty($savemethod)) {
591
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
591
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
592 592
 			}
593 593
 			if (!empty($ext_element)) {
594
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
594
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
595 595
 			}
596 596
 			if (!empty($custommsg)) {
597 597
 				if (is_array($custommsg)) {
598 598
 					if (!empty($custommsg['success'])) {
599
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
599
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
600 600
 					}
601 601
 					if (!empty($custommsg['error'])) {
602
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
602
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
603 603
 					}
604 604
 				} else {
605
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
605
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
606 606
 				}
607 607
 			}
608 608
 			if ($inputType == 'textarea') {
609
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
610
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
609
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
610
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
611 611
 			}
612
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
613
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
612
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
613
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
614 614
 		} else {
615 615
 			$out = $value;
616 616
 		}
@@ -639,12 +639,12 @@  discard block
 block discarded – undo
639 639
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
640 640
 	{
641 641
 		if ($incbefore) {
642
-			$text = $incbefore . $text;
642
+			$text = $incbefore.$text;
643 643
 		}
644 644
 		if (!$htmltext) {
645 645
 			return $text;
646 646
 		}
647
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
647
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
648 648
 
649 649
 		$tag = 'td';
650 650
 		if ($notabs == 2) {
@@ -658,11 +658,11 @@  discard block
 block discarded – undo
658 658
 
659 659
 		$extrastyle = '';
660 660
 		if ($direction < 0) {
661
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
661
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
662 662
 			$extrastyle = 'padding: 0px; padding-left: 3px;';
663 663
 		}
664 664
 		if ($direction > 0) {
665
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
665
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
666 666
 			$extrastyle = 'padding: 0px; padding-right: 3px;';
667 667
 		}
668 668
 
@@ -675,53 +675,53 @@  discard block
 block discarded – undo
675 675
 			$htmltext = str_replace('"', '&quot;', $htmltext);
676 676
 		} else {
677 677
 			$classfortooltip = 'classfortooltiponclick';
678
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
678
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
679 679
 		}
680 680
 		if ($tooltipon == 2 || $tooltipon == 3) {
681
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
681
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
682 682
 			if ($tooltiptrigger == '') {
683
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip
683
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip
684 684
 			} else {
685
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
685
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
686 686
 			}
687 687
 		} else {
688
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
688
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
689 689
 		}
690 690
 		if ($tooltipon == 1 || $tooltipon == 3) {
691
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
691
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
692 692
 			if ($tooltiptrigger == '') {
693
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip
693
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip
694 694
 			} else {
695
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
695
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
696 696
 			}
697 697
 		} else {
698
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
698
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
699 699
 		}
700 700
 		if (empty($notabs)) {
701 701
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
702 702
 		} elseif ($notabs == 2) {
703
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
703
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
704 704
 		}
705 705
 		// Define value if value is before
706 706
 		if ($direction < 0) {
707
-			$s .= '<' . $tag . $paramfortooltipimg;
707
+			$s .= '<'.$tag.$paramfortooltipimg;
708 708
 			if ($tag == 'td') {
709 709
 				$s .= ' class="valigntop" width="14"';
710 710
 			}
711
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
711
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
712 712
 		}
713 713
 		// Use another method to help avoid having a space in value in order to use this value with jquery
714 714
 		// Define label
715 715
 		if ((string) $text != '') {
716
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
716
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
717 717
 		}
718 718
 		// Define value if value is after
719 719
 		if ($direction > 0) {
720
-			$s .= '<' . $tag . $paramfortooltipimg;
720
+			$s .= '<'.$tag.$paramfortooltipimg;
721 721
 			if ($tag == 'td') {
722 722
 				$s .= ' class="valignmiddle" width="14"';
723 723
 			}
724
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
724
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
725 725
 		}
726 726
 		if (empty($notabs)) {
727 727
 			$s .= '</tr></table>';
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 
829 829
 		$disabled = 0;
830 830
 		$ret = '<div class="centpercent center">';
831
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
831
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
832 832
 
833 833
 		// Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks.
834 834
 		$parameters = array();
@@ -838,9 +838,9 @@  discard block
 block discarded – undo
838 838
 			return;
839 839
 		}
840 840
 		if (empty($reshook)) {
841
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
841
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
842 842
 			foreach ($arrayofaction as $code => $label) {
843
-				$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
843
+				$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
844 844
 			}
845 845
 		}
846 846
 		$ret .= $hookmanager->resPrint;
@@ -848,17 +848,17 @@  discard block
 block discarded – undo
848 848
 		$ret .= '</select>';
849 849
 
850 850
 		if (empty($conf->dol_optimize_smallscreen)) {
851
-			$ret .= ajax_combobox('.' . $name . 'select');
851
+			$ret .= ajax_combobox('.'.$name.'select');
852 852
 		}
853 853
 
854 854
 		// 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
855 855
 		$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.
856
-		$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")) . '">';
856
+		$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")).'">';
857 857
 		$ret .= '</div>';
858 858
 
859 859
 		if (!empty($conf->use_javascript_ajax)) {
860 860
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
861
-    		<script nonce="' . getNonce() . '">
861
+    		<script nonce="' . getNonce().'">
862 862
                         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 */
863 863
         		{
864 864
         			atleastoneselected=0;
@@ -869,11 +869,11 @@  discard block
 block discarded – undo
869 869
 
870 870
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
871 871
 
872
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
872
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
873 873
     	  			{
874 874
                                     jQuery("."+name).show();
875
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
876
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
875
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
876
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
877 877
     	  			}
878 878
     	  			else
879 879
     	  			{
@@ -883,11 +883,11 @@  discard block
 block discarded – undo
883 883
         		}
884 884
 
885 885
         	jQuery(document).ready(function () {
886
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
887
-                    jQuery(".' . $cssclass . '").click(function() {
888
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
886
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
887
+                    jQuery(".' . $cssclass.'").click(function() {
888
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
889 889
                     });
890
-                        jQuery(".' . $name . 'select").change(function() {
890
+                        jQuery(".' . $name.'select").change(function() {
891 891
         			var massaction = $( this ).val();
892 892
         			var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
893 893
         			if (massaction == "builddoc")
@@ -895,18 +895,18 @@  discard block
 block discarded – undo
895 895
                         urlform = urlform + "#show_files";
896 896
     	            }
897 897
         			$( this ).closest("form").attr("action", urlform);
898
-                    console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
898
+                    console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
899 899
         	        /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
900 900
         			if ($(this).val() != \'0\')
901 901
     	  			{
902
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
903
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
904
-                                        jQuery(".' . $name . '"+massaction).show();
902
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
903
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
904
+                                        jQuery(".' . $name.'"+massaction).show();
905 905
     	  			}
906 906
     	  			else
907 907
     	  			{
908
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
909
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
908
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
909
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
910 910
     	  			}
911 911
     	        });
912 912
         	});
@@ -949,14 +949,14 @@  discard block
 block discarded – undo
949 949
 		$atleastonefavorite = 0;
950 950
 
951 951
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
952
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
952
+		$sql .= " FROM ".$this->db->prefix()."c_country";
953 953
 		$sql .= " WHERE active > 0";
954 954
 		//$sql.= " ORDER BY code ASC";
955 955
 
956
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
956
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
957 957
 		$resql = $this->db->query($sql);
958 958
 		if ($resql) {
959
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
959
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
960 960
 			$num = $this->db->num_rows($resql);
961 961
 			$i = 0;
962 962
 			if ($num) {
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 					$countryArray[$i]['rowid'] = $obj->rowid;
967 967
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
968 968
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
969
-					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
969
+					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
970 970
 					$countryArray[$i]['favorite'] = $obj->favorite;
971 971
 					$countryArray[$i]['eec'] = $obj->eec;
972 972
 					$favorite[$i] = $obj->favorite;
@@ -984,20 +984,20 @@  discard block
 block discarded – undo
984 984
 
985 985
 				if ($showempty) {
986 986
 					if (is_numeric($showempty)) {
987
-						$out .= '<option value="">&nbsp;</option>' . "\n";
987
+						$out .= '<option value="">&nbsp;</option>'."\n";
988 988
 					} else {
989
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
989
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
990 990
 					}
991 991
 				}
992 992
 
993 993
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
994 994
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
995
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
996
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
995
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
996
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
997 997
 					if ($mysoc->isInEEC()) {
998
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
998
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
999 999
 					}
1000
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
1000
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
1001 1001
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
1002 1002
 				}
1003 1003
 
@@ -1025,20 +1025,20 @@  discard block
 block discarded – undo
1025 1025
 						$labeltoshow .= '&nbsp;';
1026 1026
 					}
1027 1027
 					if ($row['code_iso']) {
1028
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1028
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1029 1029
 						if (empty($hideflags)) {
1030 1030
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1031
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1031
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1032 1032
 						}
1033 1033
 					}
1034 1034
 
1035 1035
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1036
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1036
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1037 1037
 					} else {
1038
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1038
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1039 1039
 					}
1040 1040
 					$out .= $labeltoshow;
1041
-					$out .= '</option>' . "\n";
1041
+					$out .= '</option>'."\n";
1042 1042
 				}
1043 1043
 			}
1044 1044
 			$out .= '</select>';
@@ -1047,8 +1047,8 @@  discard block
 block discarded – undo
1047 1047
 		}
1048 1048
 
1049 1049
 		// Make select dynamic
1050
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1051
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1050
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1051
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1052 1052
 
1053 1053
 		return $out;
1054 1054
 	}
@@ -1080,25 +1080,25 @@  discard block
 block discarded – undo
1080 1080
 		$incotermArray = array();
1081 1081
 
1082 1082
 		$sql = "SELECT rowid, code";
1083
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1083
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1084 1084
 		$sql .= " WHERE active > 0";
1085 1085
 		$sql .= " ORDER BY code ASC";
1086 1086
 
1087
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1087
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1088 1088
 		$resql = $this->db->query($sql);
1089 1089
 		if ($resql) {
1090 1090
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1091
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1091
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1092 1092
 				$out .= ajax_combobox($htmlname, $events);
1093 1093
 			}
1094 1094
 
1095 1095
 			if (!empty($page)) {
1096
-				$out .= '<form method="post" action="' . $page . '">';
1096
+				$out .= '<form method="post" action="'.$page.'">';
1097 1097
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1098
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1098
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1099 1099
 			}
1100 1100
 
1101
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1101
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1102 1102
 			$out .= '<option value="0">&nbsp;</option>';
1103 1103
 			$num = $this->db->num_rows($resql);
1104 1104
 			$i = 0;
@@ -1112,9 +1112,9 @@  discard block
 block discarded – undo
1112 1112
 
1113 1113
 				foreach ($incotermArray as $row) {
1114 1114
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1115
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1115
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1116 1116
 					} else {
1117
-						$out .= '<option value="' . $row['rowid'] . '">';
1117
+						$out .= '<option value="'.$row['rowid'].'">';
1118 1118
 					}
1119 1119
 
1120 1120
 					if ($row['code']) {
@@ -1127,13 +1127,13 @@  discard block
 block discarded – undo
1127 1127
 			$out .= '</select>';
1128 1128
 
1129 1129
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1130
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1130
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1131 1131
 				$moreattrib .= ' autocomplete="off"';
1132 1132
 			}
1133
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1133
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1134 1134
 
1135 1135
 			if (!empty($page)) {
1136
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1136
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1137 1137
 			}
1138 1138
 		} else {
1139 1139
 			dol_print_error($this->db);
@@ -1164,9 +1164,9 @@  discard block
 block discarded – undo
1164 1164
 		if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
1165 1165
 			|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
1166 1166
 			if (empty($hidetext)) {
1167
-				print $langs->trans("Type") . ': ';
1167
+				print $langs->trans("Type").': ';
1168 1168
 			}
1169
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1169
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1170 1170
 			if ($showempty) {
1171 1171
 				print '<option value="-1"';
1172 1172
 				if ($selected == -1) {
@@ -1179,28 +1179,28 @@  discard block
 block discarded – undo
1179 1179
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1180 1180
 				print ' selected';
1181 1181
 			}
1182
-			print '>' . $langs->trans("Product");
1182
+			print '>'.$langs->trans("Product");
1183 1183
 
1184 1184
 			print '<option value="1"';
1185 1185
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1186 1186
 				print ' selected';
1187 1187
 			}
1188
-			print '>' . $langs->trans("Service");
1188
+			print '>'.$langs->trans("Service");
1189 1189
 
1190 1190
 			print '</select>';
1191
-			print ajax_combobox('select_' . $htmlname);
1191
+			print ajax_combobox('select_'.$htmlname);
1192 1192
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1193 1193
 		}
1194 1194
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1195 1195
 			print $langs->trans("Service");
1196
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1196
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1197 1197
 		}
1198 1198
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1199 1199
 			print $langs->trans("Product");
1200
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1200
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1201 1201
 		}
1202 1202
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1203
-			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
1203
+			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
1204 1204
 		}
1205 1205
 	}
1206 1206
 
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 		$langs->load("trips");
1227 1227
 
1228 1228
 		$sql = "SELECT c.code, c.label";
1229
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1229
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1230 1230
 		$sql .= " WHERE active > 0";
1231 1231
 
1232 1232
 		$resql = $this->db->query($sql);
@@ -1267,11 +1267,11 @@  discard block
 block discarded – undo
1267 1267
 		// phpcs:enable
1268 1268
 		global $user, $langs;
1269 1269
 
1270
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1270
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1271 1271
 
1272 1272
 		$this->load_cache_types_fees();
1273 1273
 
1274
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1274
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1275 1275
 		if ($showempty) {
1276 1276
 			print '<option value="-1"';
1277 1277
 			if ($selected == -1) {
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
 		}
1282 1282
 
1283 1283
 		foreach ($this->cache_types_fees as $key => $value) {
1284
-			print '<option value="' . $key . '"';
1284
+			print '<option value="'.$key.'"';
1285 1285
 			if ($key == $selected) {
1286 1286
 				print ' selected';
1287 1287
 			}
@@ -1332,12 +1332,12 @@  discard block
 block discarded – undo
1332 1332
 				$ajaxoptions = array();
1333 1333
 			}
1334 1334
 
1335
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1335
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1336 1336
 
1337 1337
 			// No immediate load of all database
1338 1338
 			$placeholder = '';
1339 1339
 			if ($selected && empty($selected_input_value)) {
1340
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1340
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1341 1341
 				$societetmp = new Societe($this->db);
1342 1342
 				$societetmp->fetch($selected);
1343 1343
 				$selected_input_value = $societetmp->name;
@@ -1345,25 +1345,25 @@  discard block
 block discarded – undo
1345 1345
 			}
1346 1346
 
1347 1347
 			// mode 1
1348
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : '');
1348
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode((string) ($showtype)) : '').($showcode ? '&showcode='.urlencode((string) ($showcode)) : '');
1349 1349
 
1350 1350
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1351 1351
 			if (empty($hidelabel)) {
1352
-				print $langs->trans("RefOrLabel") . ' : ';
1352
+				print $langs->trans("RefOrLabel").' : ';
1353 1353
 			} elseif ($hidelabel > 1) {
1354 1354
 				$placeholder = $langs->trans("RefOrLabel");
1355 1355
 				if ($hidelabel == 2) {
1356 1356
 					$out .= img_picto($langs->trans("Search"), 'search');
1357 1357
 				}
1358 1358
 			}
1359
-			$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' : '') . ' />';
1359
+			$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' : '').' />';
1360 1360
 			if ($hidelabel == 3) {
1361 1361
 				$out .= img_picto($langs->trans("Search"), 'search');
1362 1362
 			}
1363 1363
 
1364 1364
 			$out .= ajax_event($htmlname, $events);
1365 1365
 
1366
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1366
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1367 1367
 		} else {
1368 1368
 			// Immediate load of all database
1369 1369
 			$out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode);
@@ -1447,30 +1447,30 @@  discard block
 block discarded – undo
1447 1447
 			$sql .= ", s.address, s.zip, s.town";
1448 1448
 			$sql .= ", dictp.code as country_code";
1449 1449
 		}
1450
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1450
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1451 1451
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1452
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1452
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1453 1453
 		}
1454 1454
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1455
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1455
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1456 1456
 		}
1457
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1457
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1458 1458
 		if (!empty($user->socid)) {
1459
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1459
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1460 1460
 		}
1461 1461
 		if ($filter) {
1462 1462
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1463 1463
 			// if not, by testSqlAndScriptInject() only.
1464
-			$sql .= " AND (" . $filter . ")";
1464
+			$sql .= " AND (".$filter.")";
1465 1465
 		}
1466 1466
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1467
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1467
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1468 1468
 		}
1469 1469
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1470 1470
 			$sql .= " AND s.status <> 0";
1471 1471
 		}
1472 1472
 		if (!empty($excludeids)) {
1473
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")";
1473
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")";
1474 1474
 		}
1475 1475
 		// Add where from hooks
1476 1476
 		$parameters = array();
@@ -1490,17 +1490,17 @@  discard block
 block discarded – undo
1490 1490
 				if ($i > 0) {
1491 1491
 					$sql .= " AND ";
1492 1492
 				}
1493
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1493
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1494 1494
 				$i++;
1495 1495
 			}
1496 1496
 			if (count($search_crit) > 1) {
1497 1497
 				$sql .= ")";
1498 1498
 			}
1499 1499
 			if (isModEnabled('barcode')) {
1500
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1500
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1501 1501
 			}
1502
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1503
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1502
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1503
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1504 1504
 			$sql .= ")";
1505 1505
 		}
1506 1506
 		$sql .= $this->db->order("nom", "ASC");
@@ -1511,12 +1511,12 @@  discard block
 block discarded – undo
1511 1511
 		$resql = $this->db->query($sql);
1512 1512
 		if ($resql) {
1513 1513
 			if (!$forcecombo) {
1514
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1514
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1515 1515
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT"));
1516 1516
 			}
1517 1517
 
1518 1518
 			// Construct $out and $outarray
1519
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1519
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1520 1520
 
1521 1521
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1522 1522
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
 				}
1530 1530
 			}
1531 1531
 			if ($showempty) {
1532
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1532
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1533 1533
 			}
1534 1534
 
1535 1535
 			$companytemp = new Societe($this->db);
@@ -1542,18 +1542,18 @@  discard block
 block discarded – undo
1542 1542
 					$label = '';
1543 1543
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1544 1544
 						if (($obj->client) && (!empty($obj->code_client))) {
1545
-							$label = $obj->code_client . ' - ';
1545
+							$label = $obj->code_client.' - ';
1546 1546
 						}
1547 1547
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1548
-							$label .= $obj->code_fournisseur . ' - ';
1548
+							$label .= $obj->code_fournisseur.' - ';
1549 1549
 						}
1550
-						$label .= ' ' . $obj->name;
1550
+						$label .= ' '.$obj->name;
1551 1551
 					} else {
1552 1552
 						$label = $obj->name;
1553 1553
 					}
1554 1554
 
1555 1555
 					if (!empty($obj->name_alias)) {
1556
-						$label .= ' (' . $obj->name_alias . ')';
1556
+						$label .= ' ('.$obj->name_alias.')';
1557 1557
 					}
1558 1558
 
1559 1559
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 						$companytemp->fournisseur = $obj->fournisseur;
1569 1569
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1570 1570
 						if ($tmptype) {
1571
-							$labelhtml .= ' ' . $tmptype;
1571
+							$labelhtml .= ' '.$tmptype;
1572 1572
 						}
1573 1573
 
1574 1574
 						if ($obj->client || $obj->fournisseur) {
@@ -1578,10 +1578,10 @@  discard block
 block discarded – undo
1578 1578
 							$label .= $langs->trans("Customer");
1579 1579
 						}
1580 1580
 						if ($obj->client == 2 || $obj->client == 3) {
1581
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1581
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1582 1582
 						}
1583 1583
 						if ($obj->fournisseur) {
1584
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1584
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1585 1585
 						}
1586 1586
 						if ($obj->client || $obj->fournisseur) {
1587 1587
 							$label .= ')';
@@ -1589,9 +1589,9 @@  discard block
 block discarded – undo
1589 1589
 					}
1590 1590
 
1591 1591
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1592
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1592
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1593 1593
 						if (!empty($obj->country_code)) {
1594
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1594
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1595 1595
 						}
1596 1596
 						$label .= $s;
1597 1597
 						$labelhtml .= $s;
@@ -1599,9 +1599,9 @@  discard block
 block discarded – undo
1599 1599
 
1600 1600
 					if (empty($outputmode)) {
1601 1601
 						if (in_array($obj->rowid, $selected)) {
1602
-							$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>';
1602
+							$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>';
1603 1603
 						} else {
1604
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1604
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1605 1605
 						}
1606 1606
 					} else {
1607 1607
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1613,7 +1613,7 @@  discard block
 block discarded – undo
1613 1613
 					}
1614 1614
 				}
1615 1615
 			}
1616
-			$out .= '</select>' . "\n";
1616
+			$out .= '</select>'."\n";
1617 1617
 		} else {
1618 1618
 			dol_print_error($this->db);
1619 1619
 		}
@@ -1647,18 +1647,18 @@  discard block
 block discarded – undo
1647 1647
 		// On recherche les remises
1648 1648
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
1649 1649
 		$sql .= " re.description, re.fk_facture_source";
1650
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
1651
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
1652
-		$sql .= " AND re.entity = " . $conf->entity;
1650
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
1651
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
1652
+		$sql .= " AND re.entity = ".$conf->entity;
1653 1653
 		if ($filter) {
1654
-			$sql .= " AND " . $filter;
1654
+			$sql .= " AND ".$filter;
1655 1655
 		}
1656 1656
 		$sql .= " ORDER BY re.description ASC";
1657 1657
 
1658
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
1658
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
1659 1659
 		$resql = $this->db->query($sql);
1660 1660
 		if ($resql) {
1661
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
1661
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
1662 1662
 			$num = $this->db->num_rows($resql);
1663 1663
 
1664 1664
 			$qualifiedlines = $num;
@@ -1696,16 +1696,16 @@  discard block
 block discarded – undo
1696 1696
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
1697 1697
 						$tmpfac = new Facture($this->db);
1698 1698
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
1699
-							$desc = $desc . ' - ' . $tmpfac->ref;
1699
+							$desc = $desc.' - '.$tmpfac->ref;
1700 1700
 						}
1701 1701
 					}
1702 1702
 
1703
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
1703
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
1704 1704
 					$i++;
1705 1705
 				}
1706 1706
 			}
1707 1707
 			print '</select>';
1708
-			print ajax_combobox('select_' . $htmlname);
1708
+			print ajax_combobox('select_'.$htmlname);
1709 1709
 
1710 1710
 			return $qualifiedlines;
1711 1711
 		} else {
@@ -1786,7 +1786,7 @@  discard block
 block discarded – undo
1786 1786
 		$out = '';
1787 1787
 
1788 1788
 		if (!is_object($hookmanager)) {
1789
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1789
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1790 1790
 			$hookmanager = new HookManager($this->db);
1791 1791
 		}
1792 1792
 
@@ -1795,13 +1795,13 @@  discard block
 block discarded – undo
1795 1795
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1796 1796
 			$sql .= ", s.nom as company, s.town AS company_town";
1797 1797
 		}
1798
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1798
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1799 1799
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1800
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1800
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1801 1801
 		}
1802
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1802
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1803 1803
 		if ($socid > 0 || $socid == -1) {
1804
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1804
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1805 1805
 		}
1806 1806
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1807 1807
 			$sql .= " AND sp.statut <> 0";
@@ -1812,30 +1812,30 @@  discard block
 block discarded – undo
1812 1812
 		$sql .= $hookmanager->resPrint;
1813 1813
 		$sql .= " ORDER BY sp.lastname ASC";
1814 1814
 
1815
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1815
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1816 1816
 		$resql = $this->db->query($sql);
1817 1817
 		if ($resql) {
1818 1818
 			$num = $this->db->num_rows($resql);
1819 1819
 
1820 1820
 			if ($htmlname != 'none' && !$options_only) {
1821
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1821
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1822 1822
 			}
1823 1823
 
1824 1824
 			if ($showempty && !is_numeric($showempty)) {
1825 1825
 				$textforempty = $showempty;
1826
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1826
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1827 1827
 			} else {
1828 1828
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1829
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1829
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1830 1830
 				}
1831 1831
 				if ($showempty == 2) {
1832
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1832
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1833 1833
 				}
1834 1834
 			}
1835 1835
 
1836 1836
 			$i = 0;
1837 1837
 			if ($num) {
1838
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1838
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1839 1839
 				$contactstatic = new Contact($this->db);
1840 1840
 
1841 1841
 				while ($i < $num) {
@@ -1871,7 +1871,7 @@  discard block
 block discarded – undo
1871 1871
 						}
1872 1872
 						$extendedInfos = implode(' - ', $extendedInfos);
1873 1873
 						if (!empty($extendedInfos)) {
1874
-							$extendedInfos = ' - ' . $extendedInfos;
1874
+							$extendedInfos = ' - '.$extendedInfos;
1875 1875
 						}
1876 1876
 					}
1877 1877
 
@@ -1888,42 +1888,42 @@  discard block
 block discarded – undo
1888 1888
 								$disabled = 1;
1889 1889
 							}
1890 1890
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1891
-								$out .= '<option value="' . $obj->rowid . '"';
1891
+								$out .= '<option value="'.$obj->rowid.'"';
1892 1892
 								if ($disabled) {
1893 1893
 									$out .= ' disabled';
1894 1894
 								}
1895 1895
 								$out .= ' selected>';
1896
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1896
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1897 1897
 								if ($showfunction && $obj->poste) {
1898
-									$out .= ' (' . $obj->poste . ')';
1898
+									$out .= ' ('.$obj->poste.')';
1899 1899
 								}
1900 1900
 								if (($showsoc > 0) && $obj->company) {
1901
-									$out .= ' - (' . $obj->company . ')';
1901
+									$out .= ' - ('.$obj->company.')';
1902 1902
 								}
1903 1903
 								$out .= '</option>';
1904 1904
 							} else {
1905
-								$out .= '<option value="' . $obj->rowid . '"';
1905
+								$out .= '<option value="'.$obj->rowid.'"';
1906 1906
 								if ($disabled) {
1907 1907
 									$out .= ' disabled';
1908 1908
 								}
1909 1909
 								$out .= '>';
1910
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1910
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1911 1911
 								if ($showfunction && $obj->poste) {
1912
-									$out .= ' (' . $obj->poste . ')';
1912
+									$out .= ' ('.$obj->poste.')';
1913 1913
 								}
1914 1914
 								if (($showsoc > 0) && $obj->company) {
1915
-									$out .= ' - (' . $obj->company . ')';
1915
+									$out .= ' - ('.$obj->company.')';
1916 1916
 								}
1917 1917
 								$out .= '</option>';
1918 1918
 							}
1919 1919
 						} else {
1920 1920
 							if (in_array($obj->rowid, $selected)) {
1921
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1921
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1922 1922
 								if ($showfunction && $obj->poste) {
1923
-									$out .= ' (' . $obj->poste . ')';
1923
+									$out .= ' ('.$obj->poste.')';
1924 1924
 								}
1925 1925
 								if (($showsoc > 0) && $obj->company) {
1926
-									$out .= ' - (' . $obj->company . ')';
1926
+									$out .= ' - ('.$obj->company.')';
1927 1927
 								}
1928 1928
 							}
1929 1929
 						}
@@ -1932,7 +1932,7 @@  discard block
 block discarded – undo
1932 1932
 				}
1933 1933
 			} else {
1934 1934
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1935
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1935
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1936 1936
 				$out .= $labeltoshow;
1937 1937
 				$out .= '</option>';
1938 1938
 			}
@@ -1953,7 +1953,7 @@  discard block
 block discarded – undo
1953 1953
 			}
1954 1954
 
1955 1955
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1956
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1956
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1957 1957
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
1958 1958
 			}
1959 1959
 
@@ -2058,11 +2058,11 @@  discard block
 block discarded – undo
2058 2058
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2059 2059
 			$sql .= ", e.label";
2060 2060
 		}
2061
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2061
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2062 2062
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2063
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2063
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2064 2064
 			if (!empty($force_entity)) {
2065
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2065
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2066 2066
 			} else {
2067 2067
 				$sql .= " WHERE u.entity IS NOT NULL";
2068 2068
 			}
@@ -2070,17 +2070,17 @@  discard block
 block discarded – undo
2070 2070
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2071 2071
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2072 2072
 			} else {
2073
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2073
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2074 2074
 			}
2075 2075
 		}
2076 2076
 		if (!empty($user->socid)) {
2077
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2077
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2078 2078
 		}
2079 2079
 		if (is_array($exclude) && $excludeUsers) {
2080
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2080
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2081 2081
 		}
2082 2082
 		if ($includeUsers) {
2083
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2083
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2084 2084
 		}
2085 2085
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2086 2086
 			$sql .= " AND u.statut <> 0";
@@ -2092,7 +2092,7 @@  discard block
 block discarded – undo
2092 2092
 			$sql .= " AND u.fk_soc IS NULL";
2093 2093
 		}
2094 2094
 		if (!empty($morefilter)) {
2095
-			$sql .= " " . $morefilter;
2095
+			$sql .= " ".$morefilter;
2096 2096
 		}
2097 2097
 
2098 2098
 		//Add hook to filter on user (for example on usergroup define in custom modules)
@@ -2107,7 +2107,7 @@  discard block
 block discarded – undo
2107 2107
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2108 2108
 		}
2109 2109
 
2110
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2110
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2111 2111
 
2112 2112
 		$resql = $this->db->query($sql);
2113 2113
 		if ($resql) {
@@ -2115,7 +2115,7 @@  discard block
 block discarded – undo
2115 2115
 			$i = 0;
2116 2116
 			if ($num) {
2117 2117
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2118
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2118
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2119 2119
 				if ($show_empty && !$multiple) {
2120 2120
 					$textforempty = ' ';
2121 2121
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2124,10 +2124,10 @@  discard block
 block discarded – undo
2124 2124
 					if (!is_numeric($show_empty)) {
2125 2125
 						$textforempty = $show_empty;
2126 2126
 					}
2127
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2127
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2128 2128
 				}
2129 2129
 				if ($show_every) {
2130
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2130
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2131 2131
 				}
2132 2132
 
2133 2133
 				$userstatic = new User($this->db);
@@ -2174,22 +2174,22 @@  discard block
 block discarded – undo
2174 2174
 					}
2175 2175
 					if ($showstatus >= 0) {
2176 2176
 						if ($obj->status == 1 && $showstatus == 1) {
2177
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2178
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2177
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2178
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2179 2179
 						}
2180 2180
 						if ($obj->status == 0 && $showstatus == 1) {
2181
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2182
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2181
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2182
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2183 2183
 						}
2184 2184
 					}
2185 2185
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity)) {
2186 2186
 						if (empty($obj->entity)) {
2187
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2188
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2187
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2188
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2189 2189
 						} else {
2190 2190
 							if ($obj->entity != $conf->entity) {
2191
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2192
-								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2191
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2192
+								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2193 2193
 							}
2194 2194
 						}
2195 2195
 					}
@@ -2197,13 +2197,13 @@  discard block
 block discarded – undo
2197 2197
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2198 2198
 					if (!empty($disableline) && $disableline != '1') {
2199 2199
 						// Add text from $enableonlytext parameter
2200
-						$moreinfo .= ' - ' . $disableline;
2201
-						$moreinfohtml .= ' - ' . $disableline;
2200
+						$moreinfo .= ' - '.$disableline;
2201
+						$moreinfohtml .= ' - '.$disableline;
2202 2202
 					}
2203 2203
 					$labeltoshow .= $moreinfo;
2204 2204
 					$labeltoshowhtml .= $moreinfohtml;
2205 2205
 
2206
-					$out .= '<option value="' . $obj->rowid . '"';
2206
+					$out .= '<option value="'.$obj->rowid.'"';
2207 2207
 					if (!empty($disableline)) {
2208 2208
 						$out .= ' disabled';
2209 2209
 					}
@@ -2211,7 +2211,7 @@  discard block
 block discarded – undo
2211 2211
 						$out .= ' selected';
2212 2212
 					}
2213 2213
 					$out .= ' data-html="';
2214
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2214
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2215 2215
 					if ($showstatus >= 0 && $obj->status == 0) {
2216 2216
 						$outhtml .= '<strike class="opacitymediumxxx">';
2217 2217
 					}
@@ -2224,7 +2224,7 @@  discard block
 block discarded – undo
2224 2224
 					$out .= $labeltoshow;
2225 2225
 					$out .= '</option>';
2226 2226
 
2227
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2227
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2228 2228
 					$outarray2[$userstatic->id] = array(
2229 2229
 						'id' => $userstatic->id,
2230 2230
 						'label' => $labeltoshow,
@@ -2236,14 +2236,14 @@  discard block
 block discarded – undo
2236 2236
 					$i++;
2237 2237
 				}
2238 2238
 			} else {
2239
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2240
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2239
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2240
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2241 2241
 			}
2242 2242
 			$out .= '</select>';
2243 2243
 
2244 2244
 			if ($num && !$forcecombo) {
2245 2245
 				// Enhance with select2
2246
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2246
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2247 2247
 				$out .= ajax_combobox($htmlname);
2248 2248
 			}
2249 2249
 		} else {
@@ -2317,16 +2317,16 @@  discard block
 block discarded – undo
2317 2317
 			$out .= $userstatic->getNomUrl(-1);
2318 2318
 			if ($i == 0) {
2319 2319
 				$ownerid = $value['id'];
2320
-				$out .= ' (' . $langs->trans("Owner") . ')';
2320
+				$out .= ' ('.$langs->trans("Owner").')';
2321 2321
 			}
2322 2322
 			if ($nbassignetouser > 1 && $action != 'view') {
2323
-				$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 . '">';
2323
+				$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.'">';
2324 2324
 			}
2325 2325
 			// Show my availability
2326 2326
 			if ($showproperties) {
2327 2327
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2328 2328
 					$out .= '<div class="myavailability inline-block">';
2329
-					$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>';
2329
+					$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>';
2330 2330
 					$out .= '</div>';
2331 2331
 				}
2332 2332
 			}
@@ -2343,15 +2343,15 @@  discard block
 block discarded – undo
2343 2343
 		// Method with no ajax
2344 2344
 		if ($action != 'view') {
2345 2345
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2346
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2346
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2347 2347
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2348 2348
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2349
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2350
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2349
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2350
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2351 2351
 			$out .= '});';
2352 2352
 			$out .= '})</script>';
2353 2353
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2354
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2354
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2355 2355
 			$out .= '<br>';
2356 2356
 		}
2357 2357
 
@@ -2410,13 +2410,13 @@  discard block
 block discarded – undo
2410 2410
 			$resourcestatic->fetch($value['id']);
2411 2411
 			$out .= $resourcestatic->getNomUrl(-1);
2412 2412
 			if ($nbassignetoresource > 1 && $action != 'view') {
2413
-				$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 . '">';
2413
+				$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.'">';
2414 2414
 			}
2415 2415
 			// Show my availability
2416 2416
 			if ($showproperties) {
2417 2417
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2418 2418
 					$out .= '<div class="myavailability inline-block">';
2419
-					$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>';
2419
+					$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>';
2420 2420
 					$out .= '</div>';
2421 2421
 				}
2422 2422
 			}
@@ -2433,11 +2433,11 @@  discard block
 block discarded – undo
2433 2433
 		// Method with no ajax
2434 2434
 		if ($action != 'view') {
2435 2435
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">';
2436
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2436
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2437 2437
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2438 2438
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2439
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2440
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2439
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2440
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2441 2441
 			$out .= '});';
2442 2442
 			$out .= '})</script>';
2443 2443
 
@@ -2445,7 +2445,7 @@  discard block
 block discarded – undo
2445 2445
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2446 2446
 			$out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0);
2447 2447
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2448
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2448
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2449 2449
 			$out .= '<br>';
2450 2450
 		}
2451 2451
 
@@ -2506,7 +2506,7 @@  discard block
 block discarded – undo
2506 2506
 			$placeholder = '';
2507 2507
 
2508 2508
 			if ($selected && empty($selected_input_value)) {
2509
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2509
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2510 2510
 				$producttmpselect = new Product($this->db);
2511 2511
 				$producttmpselect->fetch($selected);
2512 2512
 				$selected_input_value = $producttmpselect->ref;
@@ -2521,17 +2521,17 @@  discard block
 block discarded – undo
2521 2521
 				}
2522 2522
 			}
2523 2523
 			// mode=1 means customers products
2524
-			$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;
2525
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2524
+			$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;
2525
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2526 2526
 
2527 2527
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2528 2528
 				// Code to automatically insert with javascript the select of attributes under the select of product
2529 2529
 				// when a parent of variant has been selected.
2530 2530
 				$out .= '
2531 2531
 				<!-- script to auto show attributes select tags if a variant was selected -->
2532
-				<script nonce="' . getNonce() . '">
2532
+				<script nonce="' . getNonce().'">
2533 2533
 					// auto show attributes fields
2534
-					selected = ' . json_encode($selected_combinations) . ';
2534
+					selected = ' . json_encode($selected_combinations).';
2535 2535
 					combvalues = {};
2536 2536
 
2537 2537
 					jQuery(document).ready(function () {
@@ -2542,7 +2542,7 @@  discard block
 block discarded – undo
2542 2542
 							}
2543 2543
 						});
2544 2544
 
2545
-						jQuery("input#' . $htmlname . '").change(function () {
2545
+						jQuery("input#' . $htmlname.'").change(function () {
2546 2546
 
2547 2547
 							if (!jQuery(this).val()) {
2548 2548
 								jQuery(\'div#attributes_box\').empty();
@@ -2551,7 +2551,7 @@  discard block
 block discarded – undo
2551 2551
 
2552 2552
 							console.log("A change has started. We get variants fields to inject html select");
2553 2553
 
2554
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2554
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2555 2555
 								id: jQuery(this).val()
2556 2556
 							}, function (data) {
2557 2557
 								jQuery(\'div#attributes_box\').empty();
@@ -2594,21 +2594,21 @@  discard block
 block discarded – undo
2594 2594
 							})
2595 2595
 						});
2596 2596
 
2597
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2597
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2598 2598
 					});
2599 2599
 				</script>
2600 2600
                 ';
2601 2601
 			}
2602 2602
 
2603 2603
 			if (empty($hidelabel)) {
2604
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2604
+				$out .= $langs->trans("RefOrLabel").' : ';
2605 2605
 			} elseif ($hidelabel > 1) {
2606
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2606
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2607 2607
 				if ($hidelabel == 2) {
2608 2608
 					$out .= img_picto($langs->trans("Search"), 'search');
2609 2609
 				}
2610 2610
 			}
2611
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2611
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2612 2612
 			if ($hidelabel == 3) {
2613 2613
 				$out .= img_picto($langs->trans("Search"), 'search');
2614 2614
 			}
@@ -2645,33 +2645,33 @@  discard block
 block discarded – undo
2645 2645
 		// phpcs:enable
2646 2646
 		global $conf, $user, $langs, $db;
2647 2647
 
2648
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2648
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2649 2649
 
2650 2650
 		$error = 0;
2651 2651
 		$out = '';
2652 2652
 
2653 2653
 		if (!$forcecombo) {
2654
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2654
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2655 2655
 			$events = array();
2656 2656
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2657 2657
 		}
2658 2658
 
2659
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2659
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2660 2660
 
2661 2661
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2662
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2663
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2662
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2663
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2664 2664
 		if (!empty($status)) {
2665
-			$sql .= ' AND status = ' . (int) $status;
2665
+			$sql .= ' AND status = '.(int) $status;
2666 2666
 		}
2667 2667
 		if (!empty($type)) {
2668
-			$sql .= ' AND bomtype = ' . (int) $type;
2668
+			$sql .= ' AND bomtype = '.(int) $type;
2669 2669
 		}
2670 2670
 		if (!empty($TProducts)) {
2671
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2671
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2672 2672
 		}
2673 2673
 		if (!empty($limit)) {
2674
-			$sql .= ' LIMIT ' . (int) $limit;
2674
+			$sql .= ' LIMIT '.(int) $limit;
2675 2675
 		}
2676 2676
 		$resql = $db->query($sql);
2677 2677
 		if ($resql) {
@@ -2685,11 +2685,11 @@  discard block
 block discarded – undo
2685 2685
 			while ($obj = $db->fetch_object($resql)) {
2686 2686
 				$product = new Product($db);
2687 2687
 				$res = $product->fetch($obj->fk_product);
2688
-				$out .= '<option value="' . $obj->rowid . '"';
2688
+				$out .= '<option value="'.$obj->rowid.'"';
2689 2689
 				if ($obj->rowid == $selected) {
2690 2690
 					$out .= 'selected';
2691 2691
 				}
2692
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2692
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2693 2693
 			}
2694 2694
 		} else {
2695 2695
 			$error++;
@@ -2746,7 +2746,7 @@  discard block
 block discarded – undo
2746 2746
 
2747 2747
 		$warehouseStatusArray = array();
2748 2748
 		if (!empty($warehouseStatus)) {
2749
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2749
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2750 2750
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2751 2751
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2752 2752
 			}
@@ -2760,9 +2760,9 @@  discard block
 block discarded – undo
2760 2760
 
2761 2761
 		$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";
2762 2762
 		if (count($warehouseStatusArray)) {
2763
-			$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
2763
+			$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
2764 2764
 		} else {
2765
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2765
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2766 2766
 		}
2767 2767
 
2768 2768
 		$sql = "SELECT ";
@@ -2778,9 +2778,9 @@  discard block
 block discarded – undo
2778 2778
 
2779 2779
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2780 2780
 			//Product category
2781
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2782
-						FROM " . $this->db->prefix() . "categorie_product
2783
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2781
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2782
+						FROM " . $this->db->prefix()."categorie_product
2783
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2784 2784
 						LIMIT 1
2785 2785
 				) AS categorie_product_id ";
2786 2786
 		}
@@ -2806,15 +2806,15 @@  discard block
 block discarded – undo
2806 2806
 		}
2807 2807
 		// Price by quantity
2808 2808
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2809
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2809
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2810 2810
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2811
-				$sql .= " AND price_level = " . ((int) $price_level);
2811
+				$sql .= " AND price_level = ".((int) $price_level);
2812 2812
 			}
2813 2813
 			$sql .= " ORDER BY date_price";
2814 2814
 			$sql .= " DESC LIMIT 1) as price_rowid";
2815
-			$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
2815
+			$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
2816 2816
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2817
-				$sql .= " AND price_level = " . ((int) $price_level);
2817
+				$sql .= " AND price_level = ".((int) $price_level);
2818 2818
 			}
2819 2819
 			$sql .= " ORDER BY date_price";
2820 2820
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -2823,58 +2823,58 @@  discard block
 block discarded – undo
2823 2823
 
2824 2824
 		$sql .= " FROM ".$this->db->prefix()."product as p";
2825 2825
 		// Add from (left join) from hooks
2826
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
2826
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
2827 2827
 		$reshook = $hookmanager->executeHooks('selectProductsListFrom', $parameters); // Note that $action and $object may have been modified by hook
2828 2828
 		$sql .= $hookmanager->resPrint;
2829 2829
 
2830 2830
 		if (count($warehouseStatusArray)) {
2831
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
2832
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
2833
-			$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.
2831
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
2832
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
2833
+			$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.
2834 2834
 		}
2835 2835
 
2836 2836
 		// include search in supplier ref
2837 2837
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2838
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2838
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2839 2839
 		}
2840 2840
 
2841 2841
 		//Price by customer
2842 2842
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2843
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
2843
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
2844 2844
 		}
2845 2845
 		// Units
2846 2846
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
2847
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
2847
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
2848 2848
 		}
2849 2849
 		// Multilang : we add translation
2850 2850
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
2851
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
2851
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
2852 2852
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
2853
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
2853
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
2854 2854
 				$soc = new Societe($this->db);
2855 2855
 				$result = $soc->fetch($socid);
2856 2856
 				if ($result > 0 && !empty($soc->default_lang)) {
2857
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
2857
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
2858 2858
 				} else {
2859
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2859
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2860 2860
 				}
2861 2861
 			} else {
2862
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2862
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2863 2863
 			}
2864 2864
 		}
2865 2865
 
2866 2866
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2867
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2867
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2868 2868
 		}
2869 2869
 
2870
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
2870
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
2871 2871
 
2872 2872
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2873 2873
 			$sql .= " AND pac.rowid IS NULL";
2874 2874
 		}
2875 2875
 
2876 2876
 		if ($finished == 0) {
2877
-			$sql .= " AND p.finished = " . ((int) $finished);
2877
+			$sql .= " AND p.finished = ".((int) $finished);
2878 2878
 		} elseif ($finished == 1) {
2879 2879
 			$sql .= " AND p.finished = ".((int) $finished);
2880 2880
 		}
@@ -2882,18 +2882,18 @@  discard block
 block discarded – undo
2882 2882
 			$sql .= " AND p.tosell = ".((int) $status);
2883 2883
 		}
2884 2884
 		if ($status_purchase >= 0) {
2885
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
2885
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
2886 2886
 		}
2887 2887
 		// Filter by product type
2888 2888
 		if (strval($filtertype) != '') {
2889
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
2889
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
2890 2890
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
2891 2891
 			$sql .= " AND p.fk_product_type = 1";
2892 2892
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
2893 2893
 			$sql .= " AND p.fk_product_type = 0";
2894 2894
 		}
2895 2895
 		// Add where from hooks
2896
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
2896
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
2897 2897
 		$reshook = $hookmanager->executeHooks('selectProductsListWhere', $parameters); // Note that $action and $object may have been modified by hook
2898 2898
 		$sql .= $hookmanager->resPrint;
2899 2899
 		// Add criteria on ref/label
@@ -2910,21 +2910,21 @@  discard block
 block discarded – undo
2910 2910
 				if ($i > 0) {
2911 2911
 					$sql .= " AND ";
2912 2912
 				}
2913
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2913
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2914 2914
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
2915
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2915
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2916 2916
 				}
2917 2917
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2918
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2918
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
2919 2919
 				}
2920 2920
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
2921
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2921
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2922 2922
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
2923
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2923
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2924 2924
 					}
2925 2925
 				}
2926 2926
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2927
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2927
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
2928 2928
 				}
2929 2929
 				$sql .= ")";
2930 2930
 				$i++;
@@ -2933,12 +2933,12 @@  discard block
 block discarded – undo
2933 2933
 				$sql .= ")";
2934 2934
 			}
2935 2935
 			if (isModEnabled('barcode')) {
2936
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
2936
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
2937 2937
 			}
2938 2938
 			$sql .= ')';
2939 2939
 		}
2940 2940
 		if (count($warehouseStatusArray)) {
2941
-			$sql .= " GROUP BY " . $selectFields;
2941
+			$sql .= " GROUP BY ".$selectFields;
2942 2942
 		}
2943 2943
 
2944 2944
 		//Sort by category
@@ -2953,23 +2953,23 @@  discard block
 block discarded – undo
2953 2953
 		$sql .= $this->db->plimit($limit, 0);
2954 2954
 
2955 2955
 		// Build output string
2956
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
2956
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
2957 2957
 		$result = $this->db->query($sql);
2958 2958
 		if ($result) {
2959
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2960
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2961
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
2959
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2960
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2961
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
2962 2962
 
2963 2963
 			$num = $this->db->num_rows($result);
2964 2964
 
2965 2965
 			$events = array();
2966 2966
 
2967 2967
 			if (!$forcecombo) {
2968
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2968
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2969 2969
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2970 2970
 			}
2971 2971
 
2972
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2972
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2973 2973
 
2974 2974
 			$textifempty = '';
2975 2975
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -2986,7 +2986,7 @@  discard block
 block discarded – undo
2986 2986
 				}
2987 2987
 			}
2988 2988
 			if ($showempty) {
2989
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
2989
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
2990 2990
 			}
2991 2991
 
2992 2992
 			$i = 0;
@@ -2997,11 +2997,11 @@  discard block
 block discarded – undo
2997 2997
 
2998 2998
 				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
2999 2999
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
3000
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
3001
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
3000
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
3001
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
3002 3002
 					$sql .= " ORDER BY quantity ASC";
3003 3003
 
3004
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
3004
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
3005 3005
 					$result2 = $this->db->query($sql);
3006 3006
 					if ($result2) {
3007 3007
 						$nb_prices = $this->db->num_rows($result2);
@@ -3039,7 +3039,7 @@  discard block
 block discarded – undo
3039 3039
 						$price_product = new Product($this->db);
3040 3040
 						$price_product->fetch($objp->rowid, '', '', 1);
3041 3041
 
3042
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3042
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3043 3043
 						$priceparser = new PriceParser($this->db);
3044 3044
 						$price_result = $priceparser->parseProduct($price_product);
3045 3045
 						if ($price_result >= 0) {
@@ -3123,7 +3123,7 @@  discard block
 block discarded – undo
3123 3123
 			$label = $objp->label_translated;
3124 3124
 		}
3125 3125
 		if (!empty($filterkey) && $filterkey != '') {
3126
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3126
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3127 3127
 		}
3128 3128
 
3129 3129
 		$outkey = $objp->rowid;
@@ -3144,32 +3144,32 @@  discard block
 block discarded – undo
3144 3144
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3145 3145
 
3146 3146
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3147
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3147
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3148 3148
 		}
3149 3149
 
3150 3150
 		// Units
3151 3151
 		$outvalUnits = '';
3152 3152
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3153 3153
 			if (!empty($objp->unit_short)) {
3154
-				$outvalUnits .= ' - ' . $objp->unit_short;
3154
+				$outvalUnits .= ' - '.$objp->unit_short;
3155 3155
 			}
3156 3156
 		}
3157 3157
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3158 3158
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3159 3159
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3160
-				$outvalUnits .= ' - ' . $unitToShow;
3160
+				$outvalUnits .= ' - '.$unitToShow;
3161 3161
 			}
3162 3162
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3163
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3164
-				$outvalUnits .= ' - ' . $unitToShow;
3163
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3164
+				$outvalUnits .= ' - '.$unitToShow;
3165 3165
 			}
3166 3166
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3167 3167
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3168
-				$outvalUnits .= ' - ' . $unitToShow;
3168
+				$outvalUnits .= ' - '.$unitToShow;
3169 3169
 			}
3170 3170
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3171 3171
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3172
-				$outvalUnits .= ' - ' . $unitToShow;
3172
+				$outvalUnits .= ' - '.$unitToShow;
3173 3173
 			}
3174 3174
 		}
3175 3175
 		if ($outdurationvalue && $outdurationunit) {
@@ -3181,14 +3181,14 @@  discard block
 block discarded – undo
3181 3181
 				'y' => $langs->trans('Year')
3182 3182
 			);
3183 3183
 			if (isset($da[$outdurationunit])) {
3184
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3184
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3185 3185
 			}
3186 3186
 		}
3187 3187
 
3188
-		$opt = '<option value="' . $objp->rowid . '"';
3188
+		$opt = '<option value="'.$objp->rowid.'"';
3189 3189
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3190 3190
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3191
-			$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 . '"';
3191
+			$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.'"';
3192 3192
 		}
3193 3193
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3194 3194
 			if ($user->hasRight('stock', 'lire')) {
@@ -3200,36 +3200,36 @@  discard block
 block discarded – undo
3200 3200
 			}
3201 3201
 		}
3202 3202
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3203
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3204
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3203
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3204
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3205 3205
 		}
3206 3206
 		$opt .= '>';
3207 3207
 		$opt .= $objp->ref;
3208 3208
 		if (!empty($objp->custref)) {
3209
-			$opt .= ' (' . $objp->custref . ')';
3209
+			$opt .= ' ('.$objp->custref.')';
3210 3210
 		}
3211 3211
 		if ($outbarcode) {
3212
-			$opt .= ' (' . $outbarcode . ')';
3212
+			$opt .= ' ('.$outbarcode.')';
3213 3213
 		}
3214
-		$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
3214
+		$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
3215 3215
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3216
-			$opt .= ' (' . getCountry($outorigin, 1) . ')';
3216
+			$opt .= ' ('.getCountry($outorigin, 1).')';
3217 3217
 		}
3218 3218
 
3219 3219
 		$objRef = $objp->ref;
3220 3220
 		if (!empty($objp->custref)) {
3221
-			$objRef .= ' (' . $objp->custref . ')';
3221
+			$objRef .= ' ('.$objp->custref.')';
3222 3222
 		}
3223 3223
 		if (!empty($filterkey) && $filterkey != '') {
3224
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3224
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3225 3225
 		}
3226 3226
 		$outval .= $objRef;
3227 3227
 		if ($outbarcode) {
3228
-			$outval .= ' (' . $outbarcode . ')';
3228
+			$outval .= ' ('.$outbarcode.')';
3229 3229
 		}
3230
-		$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
3230
+		$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
3231 3231
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3232
-			$outval .= ' (' . getCountry($outorigin, 1) . ')';
3232
+			$outval .= ' ('.getCountry($outorigin, 1).')';
3233 3233
 		}
3234 3234
 
3235 3235
 		// Units
@@ -3242,35 +3242,35 @@  discard block
 block discarded – undo
3242 3242
 		// If we need a particular price level (from 1 to n)
3243 3243
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
3244 3244
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3245
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3246
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3247
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3248
-			$sql .= " AND price_level = " . ((int) $price_level);
3245
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3246
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3247
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3248
+			$sql .= " AND price_level = ".((int) $price_level);
3249 3249
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3250 3250
 			$sql .= " LIMIT 1";
3251 3251
 
3252
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3252
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3253 3253
 			$result2 = $this->db->query($sql);
3254 3254
 			if ($result2) {
3255 3255
 				$objp2 = $this->db->fetch_object($result2);
3256 3256
 				if ($objp2) {
3257 3257
 					$found = 1;
3258 3258
 					if ($objp2->price_base_type == 'HT') {
3259
-						$opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3260
-						$outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3259
+						$opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3260
+						$outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3261 3261
 					} else {
3262
-						$opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3263
-						$outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3262
+						$opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3263
+						$outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3264 3264
 					}
3265 3265
 					$outprice_ht = price($objp2->price);
3266 3266
 					$outprice_ttc = price($objp2->price_ttc);
3267 3267
 					$outpricebasetype = $objp2->price_base_type;
3268 3268
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3269
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3270
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3269
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3270
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3271 3271
 					} else {
3272
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3273
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3272
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3273
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3274 3274
 					}
3275 3275
 				}
3276 3276
 			} else {
@@ -3284,13 +3284,13 @@  discard block
 block discarded – undo
3284 3284
 			$outqty = $objp->quantity;
3285 3285
 			$outdiscount = $objp->remise_percent;
3286 3286
 			if ($objp->quantity == 1) {
3287
-				$opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3288
-				$outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3287
+				$opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3288
+				$outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3289 3289
 				$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3290 3290
 				$outval .= $langs->transnoentities("Unit");
3291 3291
 			} else {
3292
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3293
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3292
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3293
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3294 3294
 				$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3295 3295
 				$outval .= $langs->transnoentities("Units");
3296 3296
 			}
@@ -3298,16 +3298,16 @@  discard block
 block discarded – undo
3298 3298
 			$outprice_ht = price($objp->unitprice);
3299 3299
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3300 3300
 			$outpricebasetype = $objp->price_base_type;
3301
-			$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
3302
-			$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
3301
+			$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
3302
+			$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
3303 3303
 		}
3304 3304
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3305
-			$opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3306
-			$outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3305
+			$opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3306
+			$outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3307 3307
 		}
3308 3308
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3309
-			$opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3310
-			$outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3309
+			$opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3310
+			$outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3311 3311
 		}
3312 3312
 
3313 3313
 		// Price by customer
@@ -3316,11 +3316,11 @@  discard block
 block discarded – undo
3316 3316
 				$found = 1;
3317 3317
 
3318 3318
 				if ($objp->custprice_base_type == 'HT') {
3319
-					$opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3320
-					$outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3319
+					$opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3320
+					$outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3321 3321
 				} else {
3322
-					$opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3323
-					$outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3322
+					$opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3323
+					$outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3324 3324
 				}
3325 3325
 
3326 3326
 				$outprice_ht = price($objp->custprice);
@@ -3334,11 +3334,11 @@  discard block
 block discarded – undo
3334 3334
 		// If level no defined or multiprice not found, we used the default price
3335 3335
 		if (empty($hidepriceinlabel) && !$found) {
3336 3336
 			if ($objp->price_base_type == 'HT') {
3337
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3338
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3337
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3338
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3339 3339
 			} else {
3340
-				$opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3341
-				$outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3340
+				$opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3341
+				$outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3342 3342
 			}
3343 3343
 			$outprice_ht = price($objp->price);
3344 3344
 			$outprice_ttc = price($objp->price_ttc);
@@ -3349,14 +3349,14 @@  discard block
 block discarded – undo
3349 3349
 
3350 3350
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3351 3351
 			if ($user->hasRight('stock', 'lire')) {
3352
-				$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3352
+				$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3353 3353
 
3354 3354
 				if ($objp->stock > 0) {
3355 3355
 					$outval .= ' - <span class="product_line_stock_ok">';
3356 3356
 				} elseif ($objp->stock <= 0) {
3357 3357
 					$outval .= ' - <span class="product_line_stock_too_low">';
3358 3358
 				}
3359
-				$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3359
+				$outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3360 3360
 				$outval .= '</span>';
3361 3361
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3362 3362
 					$langs->load("stocks");
@@ -3366,9 +3366,9 @@  discard block
 block discarded – undo
3366 3366
 					$tmpproduct->load_virtual_stock();
3367 3367
 					$virtualstock = $tmpproduct->stock_theorique;
3368 3368
 
3369
-					$opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3369
+					$opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3370 3370
 
3371
-					$outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3371
+					$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
3372 3372
 					if ($virtualstock > 0) {
3373 3373
 						$outval .= '<span class="product_line_stock_ok">';
3374 3374
 					} elseif ($virtualstock <= 0) {
@@ -3446,7 +3446,7 @@  discard block
 block discarded – undo
3446 3446
 		$selected_input_value = '';
3447 3447
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3448 3448
 			if ($selected > 0) {
3449
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3449
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3450 3450
 				$producttmpselect = new Product($this->db);
3451 3451
 				$producttmpselect->fetch($selected);
3452 3452
 				$selected_input_value = $producttmpselect->ref;
@@ -3454,10 +3454,10 @@  discard block
 block discarded – undo
3454 3454
 			}
3455 3455
 
3456 3456
 			// mode=2 means suppliers products
3457
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3458
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3457
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3458
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3459 3459
 
3460
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3460
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3461 3461
 		} else {
3462 3462
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3463 3463
 		}
@@ -3517,25 +3517,25 @@  discard block
 block discarded – undo
3517 3517
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3518 3518
 			$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
3519 3519
 		}
3520
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3521
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3520
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3521
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3522 3522
 		if ($socid > 0) {
3523
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3523
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3524 3524
 		}
3525
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3525
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3526 3526
 		// Units
3527 3527
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3528
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3528
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3529 3529
 		}
3530
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3530
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3531 3531
 		if ($statut != -1) {
3532
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3532
+			$sql .= " AND p.tobuy = ".((int) $statut);
3533 3533
 		}
3534 3534
 		if (strval($filtertype) != '') {
3535
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3535
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3536 3536
 		}
3537 3537
 		if (!empty($filtre)) {
3538
-			$sql .= " " . $filtre;
3538
+			$sql .= " ".$filtre;
3539 3539
 		}
3540 3540
 		// Add where from hooks
3541 3541
 		$parameters = array();
@@ -3555,9 +3555,9 @@  discard block
 block discarded – undo
3555 3555
 				if ($i > 0) {
3556 3556
 					$sql .= " AND ";
3557 3557
 				}
3558
-				$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) . "%'";
3558
+				$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)."%'";
3559 3559
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3560
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3560
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3561 3561
 				}
3562 3562
 				$sql .= ")";
3563 3563
 				$i++;
@@ -3566,8 +3566,8 @@  discard block
 block discarded – undo
3566 3566
 				$sql .= ")";
3567 3567
 			}
3568 3568
 			if (isModEnabled('barcode')) {
3569
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3570
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3569
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3570
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3571 3571
 			}
3572 3572
 			$sql .= ')';
3573 3573
 		}
@@ -3576,20 +3576,20 @@  discard block
 block discarded – undo
3576 3576
 
3577 3577
 		// Build output string
3578 3578
 
3579
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3579
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3580 3580
 		$result = $this->db->query($sql);
3581 3581
 		if ($result) {
3582
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3583
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3582
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3583
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3584 3584
 
3585 3585
 			$num = $this->db->num_rows($result);
3586 3586
 
3587 3587
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3588
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3588
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3589 3589
 			if (!$selected) {
3590
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3590
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3591 3591
 			} else {
3592
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3592
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3593 3593
 			}
3594 3594
 
3595 3595
 			$i = 0;
@@ -3604,7 +3604,7 @@  discard block
 block discarded – undo
3604 3604
 
3605 3605
 				$outkey = $objp->idprodfournprice; // id in table of price
3606 3606
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3607
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3607
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3608 3608
 				}
3609 3609
 
3610 3610
 				$outref = $objp->ref;
@@ -3619,23 +3619,23 @@  discard block
 block discarded – undo
3619 3619
 				$outvalUnits = '';
3620 3620
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3621 3621
 					if (!empty($objp->unit_short)) {
3622
-						$outvalUnits .= ' - ' . $objp->unit_short;
3622
+						$outvalUnits .= ' - '.$objp->unit_short;
3623 3623
 					}
3624 3624
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3625 3625
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3626
-						$outvalUnits .= ' - ' . $unitToShow;
3626
+						$outvalUnits .= ' - '.$unitToShow;
3627 3627
 					}
3628 3628
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3629
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3630
-						$outvalUnits .= ' - ' . $unitToShow;
3629
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3630
+						$outvalUnits .= ' - '.$unitToShow;
3631 3631
 					}
3632 3632
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3633 3633
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3634
-						$outvalUnits .= ' - ' . $unitToShow;
3634
+						$outvalUnits .= ' - '.$unitToShow;
3635 3635
 					}
3636 3636
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3637 3637
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3638
-						$outvalUnits .= ' - ' . $unitToShow;
3638
+						$outvalUnits .= ' - '.$unitToShow;
3639 3639
 					}
3640 3640
 					if ($outdurationvalue && $outdurationunit) {
3641 3641
 						$da = array(
@@ -3646,22 +3646,22 @@  discard block
 block discarded – undo
3646 3646
 							'y' => $langs->trans('Year')
3647 3647
 						);
3648 3648
 						if (isset($da[$outdurationunit])) {
3649
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3649
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3650 3650
 						}
3651 3651
 					}
3652 3652
 				}
3653 3653
 
3654 3654
 				$objRef = $objp->ref;
3655 3655
 				if ($filterkey && $filterkey != '') {
3656
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3656
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3657 3657
 				}
3658 3658
 				$objRefFourn = $objp->ref_fourn;
3659 3659
 				if ($filterkey && $filterkey != '') {
3660
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3660
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3661 3661
 				}
3662 3662
 				$label = $objp->label;
3663 3663
 				if ($filterkey && $filterkey != '') {
3664
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3664
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3665 3665
 				}
3666 3666
 
3667 3667
 				switch ($objp->fk_product_type) {
@@ -3684,21 +3684,21 @@  discard block
 block discarded – undo
3684 3684
 
3685 3685
 				$optlabel .= $objp->ref;
3686 3686
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3687
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3687
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3688 3688
 				}
3689 3689
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3690
-					$optlabel .= ' (' . $outbarcode . ')';
3690
+					$optlabel .= ' ('.$outbarcode.')';
3691 3691
 				}
3692
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3692
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3693 3693
 
3694 3694
 				$outvallabel = $objRef;
3695 3695
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3696
-					$outvallabel .= ' (' . $objRefFourn . ')';
3696
+					$outvallabel .= ' ('.$objRefFourn.')';
3697 3697
 				}
3698 3698
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3699
-					$outvallabel .= ' (' . $outbarcode . ')';
3699
+					$outvallabel .= ' ('.$outbarcode.')';
3700 3700
 				}
3701
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3701
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3702 3702
 
3703 3703
 				// Units
3704 3704
 				$optlabel .= $outvalUnits;
@@ -3715,7 +3715,7 @@  discard block
 block discarded – undo
3715 3715
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3716 3716
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3717 3717
 
3718
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3718
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3719 3719
 						$priceparser = new PriceParser($this->db);
3720 3720
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3721 3721
 						if ($price_result >= 0) {
@@ -3726,57 +3726,57 @@  discard block
 block discarded – undo
3726 3726
 						}
3727 3727
 					}
3728 3728
 					if ($objp->quantity == 1) {
3729
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3730
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3729
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3730
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3731 3731
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3732 3732
 						$outvallabel .= $langs->transnoentities("Unit");
3733 3733
 					} else {
3734
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3735
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3736
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3737
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3734
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3735
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3736
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3737
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3738 3738
 					}
3739 3739
 
3740 3740
 					if ($objp->quantity > 1) {
3741
-						$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
3742
-						$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
3741
+						$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
3742
+						$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
3743 3743
 					}
3744 3744
 					if ($objp->remise_percent >= 1) {
3745
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3746
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3745
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3746
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3747 3747
 					}
3748 3748
 					if ($objp->duration) {
3749
-						$optlabel .= " - " . $objp->duration;
3750
-						$outvallabel .= " - " . $objp->duration;
3749
+						$optlabel .= " - ".$objp->duration;
3750
+						$outvallabel .= " - ".$objp->duration;
3751 3751
 					}
3752 3752
 					if (!$socid) {
3753
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3754
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3753
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3754
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3755 3755
 					}
3756 3756
 					if ($objp->supplier_reputation) {
3757 3757
 						//TODO dictionary
3758 3758
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3759 3759
 
3760
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3761
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3760
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3761
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3762 3762
 					}
3763 3763
 				} else {
3764
-					$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3765
-					$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3764
+					$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3765
+					$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3766 3766
 				}
3767 3767
 
3768 3768
 				if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3769 3769
 					$novirtualstock = ($showstockinlist == 2);
3770 3770
 
3771 3771
 					if ($user->hasRight('stock', 'lire')) {
3772
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3772
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3773 3773
 
3774 3774
 						if ($objp->stock > 0) {
3775 3775
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3776 3776
 						} elseif ($objp->stock <= 0) {
3777 3777
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3778 3778
 						}
3779
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3779
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3780 3780
 						$optlabel .= '</span>';
3781 3781
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3782 3782
 							$langs->load("stocks");
@@ -3786,9 +3786,9 @@  discard block
 block discarded – undo
3786 3786
 							$tmpproduct->load_virtual_stock();
3787 3787
 							$virtualstock = $tmpproduct->stock_theorique;
3788 3788
 
3789
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3789
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3790 3790
 
3791
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3791
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
3792 3792
 							if ($virtualstock > 0) {
3793 3793
 								$optlabel .= '<span class="product_line_stock_ok">';
3794 3794
 							} elseif ($virtualstock <= 0) {
@@ -3802,7 +3802,7 @@  discard block
 block discarded – undo
3802 3802
 					}
3803 3803
 				}
3804 3804
 
3805
-				$optstart = '<option value="' . $outkey . '"';
3805
+				$optstart = '<option value="'.$outkey.'"';
3806 3806
 				if ($selected && $selected == $objp->idprodfournprice) {
3807 3807
 					$optstart .= ' selected';
3808 3808
 				}
@@ -3811,31 +3811,31 @@  discard block
 block discarded – undo
3811 3811
 				}
3812 3812
 
3813 3813
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
3814
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
3815
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
3816
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
3817
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
3818
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
3819
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
3820
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
3821
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
3822
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
3823
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
3814
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
3815
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
3816
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
3817
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
3818
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
3819
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
3820
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
3821
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
3822
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
3823
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
3824 3824
 					if (isModEnabled('multicurrency')) {
3825
-						$optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"';
3826
-						$optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"';
3825
+						$optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"';
3826
+						$optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"';
3827 3827
 					}
3828 3828
 				}
3829
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
3829
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
3830 3830
 
3831 3831
 				$outarrayentry = array(
3832 3832
 					'key' => $outkey,
3833 3833
 					'value' => $outref,
3834 3834
 					'label' => $outvallabel,
3835 3835
 					'qty' => $outqty,
3836
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
3837
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3838
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3836
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3837
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3838
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3839 3839
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
3840 3840
 					'tva_tx' => price2num($objp->tva_tx),
3841 3841
 					'default_vat_code' => $objp->default_vat_code,
@@ -3864,17 +3864,17 @@  discard block
 block discarded – undo
3864 3864
 				// Add new entry
3865 3865
 				// "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
3866 3866
 				// "label" value of json key array is used by jQuery automatically as text for combo box
3867
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
3867
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
3868 3868
 				$outarraypush = array(
3869 3869
 					'key' => $outkey,
3870 3870
 					'value' => $outref,
3871 3871
 					'label' => $outvallabel,
3872 3872
 					'qty' => $outqty,
3873
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
3873
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3874 3874
 					'price_qty_ht_locale' => price($objp->fprice),
3875
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3875
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3876 3876
 					'price_unit_ht_locale' => price($objp->unitprice),
3877
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3877
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3878 3878
 					'tva_tx_formated' => price($objp->tva_tx),
3879 3879
 					'tva_tx' => price2num($objp->tva_tx),
3880 3880
 					'default_vat_code' => $objp->default_vat_code,
@@ -3906,7 +3906,7 @@  discard block
 block discarded – undo
3906 3906
 
3907 3907
 			$this->db->free($result);
3908 3908
 
3909
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3909
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3910 3910
 			$out .= ajax_combobox($htmlname);
3911 3911
 		} else {
3912 3912
 			dol_print_error($this->db);
@@ -3938,43 +3938,43 @@  discard block
 block discarded – undo
3938 3938
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
3939 3939
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
3940 3940
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
3941
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3942
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3943
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3944
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
3941
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3942
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3943
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3944
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
3945 3945
 		$sql .= " AND p.tobuy = 1";
3946 3946
 		$sql .= " AND s.fournisseur = 1";
3947
-		$sql .= " AND p.rowid = " . ((int) $productid);
3947
+		$sql .= " AND p.rowid = ".((int) $productid);
3948 3948
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
3949 3949
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
3950 3950
 		} else {
3951 3951
 			$sql .= " ORDER BY pfp.unitprice ASC";
3952 3952
 		}
3953 3953
 
3954
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
3954
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
3955 3955
 		$result = $this->db->query($sql);
3956 3956
 
3957 3957
 		if ($result) {
3958 3958
 			$num = $this->db->num_rows($result);
3959 3959
 
3960
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3960
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3961 3961
 
3962 3962
 			if (!$num) {
3963
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
3963
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
3964 3964
 			} else {
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
 				$form .= '<option value="0">&nbsp;</option>';
3967 3967
 
3968 3968
 				$i = 0;
3969 3969
 				while ($i < $num) {
3970 3970
 					$objp = $this->db->fetch_object($result);
3971 3971
 
3972
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
3972
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
3973 3973
 					//if there is only one supplier, preselect it
3974 3974
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
3975 3975
 						$opt .= ' selected';
3976 3976
 					}
3977
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
3977
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
3978 3978
 
3979 3979
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
3980 3980
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -3984,7 +3984,7 @@  discard block
 block discarded – undo
3984 3984
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3985 3985
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3986 3986
 
3987
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3987
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3988 3988
 						$priceparser = new PriceParser($this->db);
3989 3989
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3990 3990
 						if ($price_result >= 0) {
@@ -3995,10 +3995,10 @@  discard block
 block discarded – undo
3995 3995
 						}
3996 3996
 					}
3997 3997
 					if ($objp->quantity == 1) {
3998
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3998
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3999 3999
 					}
4000 4000
 
4001
-					$opt .= $objp->quantity . ' ';
4001
+					$opt .= $objp->quantity.' ';
4002 4002
 
4003 4003
 					if ($objp->quantity == 1) {
4004 4004
 						$opt .= $langs->trans("Unit");
@@ -4007,10 +4007,10 @@  discard block
 block discarded – undo
4007 4007
 					}
4008 4008
 					if ($objp->quantity > 1) {
4009 4009
 						$opt .= " - ";
4010
-						$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");
4010
+						$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");
4011 4011
 					}
4012 4012
 					if ($objp->duration) {
4013
-						$opt .= " - " . $objp->duration;
4013
+						$opt .= " - ".$objp->duration;
4014 4014
 					}
4015 4015
 					$opt .= "</option>\n";
4016 4016
 
@@ -4048,8 +4048,8 @@  discard block
 block discarded – undo
4048 4048
 		dol_syslog(__METHOD__, LOG_DEBUG);
4049 4049
 
4050 4050
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4051
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4052
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4051
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4052
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4053 4053
 		$sql .= " AND active > 0";
4054 4054
 		$sql .= " ORDER BY sortorder";
4055 4055
 
@@ -4061,7 +4061,7 @@  discard block
 block discarded – undo
4061 4061
 				$obj = $this->db->fetch_object($resql);
4062 4062
 
4063 4063
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4064
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4064
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4065 4065
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4066 4066
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4067 4067
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4089,7 +4089,7 @@  discard block
 block discarded – undo
4089 4089
 		// phpcs:enable
4090 4090
 		global $langs;
4091 4091
 
4092
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4092
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4093 4093
 		if ($num > 0) {
4094 4094
 			return 0; // Cache already loaded
4095 4095
 		}
@@ -4099,7 +4099,7 @@  discard block
 block discarded – undo
4099 4099
 		$langs->load('propal');
4100 4100
 
4101 4101
 		$sql = "SELECT rowid, code, label, position";
4102
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4102
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4103 4103
 		$sql .= " WHERE active > 0";
4104 4104
 
4105 4105
 		$resql = $this->db->query($sql);
@@ -4110,7 +4110,7 @@  discard block
 block discarded – undo
4110 4110
 				$obj = $this->db->fetch_object($resql);
4111 4111
 
4112 4112
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4113
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4113
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4114 4114
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4115 4115
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4116 4116
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4142,17 +4142,17 @@  discard block
 block discarded – undo
4142 4142
 
4143 4143
 		$this->load_cache_availability();
4144 4144
 
4145
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4145
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4146 4146
 
4147
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4147
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4148 4148
 		if ($addempty) {
4149 4149
 			print '<option value="0">&nbsp;</option>';
4150 4150
 		}
4151 4151
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4152 4152
 			if ($selected == $id) {
4153
-				print '<option value="' . $id . '" selected>';
4153
+				print '<option value="'.$id.'" selected>';
4154 4154
 			} else {
4155
-				print '<option value="' . $id . '">';
4155
+				print '<option value="'.$id.'">';
4156 4156
 			}
4157 4157
 			print dol_escape_htmltag($arrayavailability['label']);
4158 4158
 			print '</option>';
@@ -4173,13 +4173,13 @@  discard block
 block discarded – undo
4173 4173
 	{
4174 4174
 		global $langs;
4175 4175
 
4176
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4176
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4177 4177
 		if ($num > 0) {
4178 4178
 			return 0; // Cache already loaded
4179 4179
 		}
4180 4180
 
4181 4181
 		$sql = "SELECT rowid, code, label";
4182
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4182
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4183 4183
 		$sql .= " WHERE active > 0";
4184 4184
 
4185 4185
 		$resql = $this->db->query($sql);
@@ -4192,8 +4192,8 @@  discard block
 block discarded – undo
4192 4192
 
4193 4193
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4194 4194
 				$label = ($obj->label != '-' ? $obj->label : '');
4195
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4196
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4195
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4196
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4197 4197
 				}
4198 4198
 				if ($langs->trans($obj->code) != $obj->code) {
4199 4199
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4233,9 +4233,9 @@  discard block
 block discarded – undo
4233 4233
 
4234 4234
 		$this->loadCacheInputReason();
4235 4235
 
4236
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4236
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4237 4237
 		if ($addempty) {
4238
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4238
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4239 4239
 		}
4240 4240
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4241 4241
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4243,9 +4243,9 @@  discard block
 block discarded – undo
4243 4243
 			}
4244 4244
 
4245 4245
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4246
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4246
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4247 4247
 			} else {
4248
-				print '<option value="' . $arraydemandreason['id'] . '">';
4248
+				print '<option value="'.$arraydemandreason['id'].'">';
4249 4249
 			}
4250 4250
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4251 4251
 			print $langs->trans($label);
@@ -4255,7 +4255,7 @@  discard block
 block discarded – undo
4255 4255
 		if ($user->admin && empty($notooltip)) {
4256 4256
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4257 4257
 		}
4258
-		print ajax_combobox('select_' . $htmlname);
4258
+		print ajax_combobox('select_'.$htmlname);
4259 4259
 	}
4260 4260
 
4261 4261
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4270,7 +4270,7 @@  discard block
 block discarded – undo
4270 4270
 		// phpcs:enable
4271 4271
 		global $langs;
4272 4272
 
4273
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4273
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4274 4274
 		if ($num > 0) {
4275 4275
 			return $num; // Cache already loaded
4276 4276
 		}
@@ -4280,8 +4280,8 @@  discard block
 block discarded – undo
4280 4280
 		$this->cache_types_paiements = array();
4281 4281
 
4282 4282
 		$sql = "SELECT id, code, libelle as label, type, active";
4283
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4284
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4283
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4284
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4285 4285
 
4286 4286
 		$resql = $this->db->query($sql);
4287 4287
 		if ($resql) {
@@ -4291,7 +4291,7 @@  discard block
 block discarded – undo
4291 4291
 				$obj = $this->db->fetch_object($resql);
4292 4292
 
4293 4293
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4294
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4294
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4295 4295
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4296 4296
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4297 4297
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4363,17 +4363,17 @@  discard block
 block discarded – undo
4363 4363
 		global $langs, $user, $conf;
4364 4364
 
4365 4365
 		$out = '';
4366
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4366
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4367 4367
 
4368 4368
 		$this->load_cache_conditions_paiements();
4369 4369
 
4370 4370
 		// Set default value if not already set by caller
4371 4371
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4372
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4372
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4373 4373
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4374 4374
 		}
4375 4375
 
4376
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4376
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4377 4377
 		if ($addempty) {
4378 4378
 			$out .= '<option value="0">&nbsp;</option>';
4379 4379
 		}
@@ -4387,9 +4387,9 @@  discard block
 block discarded – undo
4387 4387
 
4388 4388
 			if ($selected == $id) {
4389 4389
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4390
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4390
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4391 4391
 			} else {
4392
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4392
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4393 4393
 			}
4394 4394
 			$label = $arrayconditions['label'];
4395 4395
 
@@ -4407,21 +4407,21 @@  discard block
 block discarded – undo
4407 4407
 		$out .= ajax_combobox($htmlname);
4408 4408
 
4409 4409
 		if ($deposit_percent >= 0) {
4410
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4411
-			$out .= $langs->trans('DepositPercent') . ' : ';
4412
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4410
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4411
+			$out .= $langs->trans('DepositPercent').' : ';
4412
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4413 4413
 			$out .= '</span>';
4414 4414
 			$out .= '
4415
-				<script nonce="' . getNonce() . '">
4415
+				<script nonce="' . getNonce().'">
4416 4416
 					$(document).ready(function () {
4417
-						$("#' . $htmlname . '").change(function () {
4417
+						$("#' . $htmlname.'").change(function () {
4418 4418
 							let $selected = $(this).find("option:selected");
4419 4419
 							let depositPercent = $selected.attr("data-deposit_percent");
4420 4420
 
4421 4421
 							if (depositPercent.length > 0) {
4422
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4422
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4423 4423
 							} else {
4424
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4424
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4425 4425
 							}
4426 4426
 
4427 4427
 							return true;
@@ -4459,7 +4459,7 @@  discard block
 block discarded – undo
4459 4459
 
4460 4460
 		$out = '';
4461 4461
 
4462
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4462
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4463 4463
 
4464 4464
 		$filterarray = array();
4465 4465
 		if ($filtertype == 'CRDT') {
@@ -4474,11 +4474,11 @@  discard block
 block discarded – undo
4474 4474
 
4475 4475
 		// Set default value if not already set by caller
4476 4476
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4477
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4477
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4478 4478
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4479 4479
 		}
4480 4480
 
4481
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4481
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4482 4482
 		if ($empty) {
4483 4483
 			$out .= '<option value="">&nbsp;</option>';
4484 4484
 		}
@@ -4499,13 +4499,13 @@  discard block
 block discarded – undo
4499 4499
 			}
4500 4500
 
4501 4501
 			if ($format == 0) {
4502
-				$out .= '<option value="' . $id . '"';
4502
+				$out .= '<option value="'.$id.'"';
4503 4503
 			} elseif ($format == 1) {
4504
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4504
+				$out .= '<option value="'.$arraytypes['code'].'"';
4505 4505
 			} elseif ($format == 2) {
4506
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4506
+				$out .= '<option value="'.$arraytypes['code'].'"';
4507 4507
 			} elseif ($format == 3) {
4508
-				$out .= '<option value="' . $id . '"';
4508
+				$out .= '<option value="'.$id.'"';
4509 4509
 			}
4510 4510
 			// Print attribute selected or not
4511 4511
 			if ($format == 1 || $format == 2) {
@@ -4535,7 +4535,7 @@  discard block
 block discarded – undo
4535 4535
 		if ($user->admin && !$noadmininfo) {
4536 4536
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4537 4537
 		}
4538
-		$out .= ajax_combobox('select' . $htmlname);
4538
+		$out .= ajax_combobox('select'.$htmlname);
4539 4539
 
4540 4540
 		if (empty($nooutput)) {
4541 4541
 			print $out;
@@ -4557,22 +4557,22 @@  discard block
 block discarded – undo
4557 4557
 	{
4558 4558
 		global $langs;
4559 4559
 
4560
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4560
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4561 4561
 		$options = array(
4562 4562
 			'HT' => $langs->trans("HT"),
4563 4563
 			'TTC' => $langs->trans("TTC")
4564 4564
 		);
4565 4565
 		foreach ($options as $id => $value) {
4566 4566
 			if ($selected == $id) {
4567
-				$return .= '<option value="' . $id . '" selected>' . $value;
4567
+				$return .= '<option value="'.$id.'" selected>'.$value;
4568 4568
 			} else {
4569
-				$return .= '<option value="' . $id . '">' . $value;
4569
+				$return .= '<option value="'.$id.'">'.$value;
4570 4570
 			}
4571 4571
 			$return .= '</option>';
4572 4572
 		}
4573 4573
 		$return .= '</select>';
4574 4574
 		if ($addjscombo) {
4575
-			$return .= ajax_combobox('select_' . $htmlname);
4575
+			$return .= ajax_combobox('select_'.$htmlname);
4576 4576
 		}
4577 4577
 
4578 4578
 		return $return;
@@ -4590,7 +4590,7 @@  discard block
 block discarded – undo
4590 4590
 		// phpcs:enable
4591 4591
 		global $langs;
4592 4592
 
4593
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4593
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4594 4594
 		if ($num > 0) {
4595 4595
 			return $num; // Cache already loaded
4596 4596
 		}
@@ -4600,8 +4600,8 @@  discard block
 block discarded – undo
4600 4600
 		$this->cache_transport_mode = array();
4601 4601
 
4602 4602
 		$sql = "SELECT rowid, code, label, active";
4603
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4604
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4603
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4604
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4605 4605
 
4606 4606
 		$resql = $this->db->query($sql);
4607 4607
 		if ($resql) {
@@ -4611,7 +4611,7 @@  discard block
 block discarded – undo
4611 4611
 				$obj = $this->db->fetch_object($resql);
4612 4612
 
4613 4613
 				// If traduction exist, we use it else we take the default label
4614
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4614
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4615 4615
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4616 4616
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4617 4617
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4645,11 +4645,11 @@  discard block
 block discarded – undo
4645 4645
 	{
4646 4646
 		global $langs, $user;
4647 4647
 
4648
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4648
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4649 4649
 
4650 4650
 		$this->load_cache_transport_mode();
4651 4651
 
4652
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4652
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4653 4653
 		if ($empty) {
4654 4654
 			print '<option value="">&nbsp;</option>';
4655 4655
 		}
@@ -4665,13 +4665,13 @@  discard block
 block discarded – undo
4665 4665
 			}
4666 4666
 
4667 4667
 			if ($format == 0) {
4668
-				print '<option value="' . $id . '"';
4668
+				print '<option value="'.$id.'"';
4669 4669
 			} elseif ($format == 1) {
4670
-				print '<option value="' . $arraytypes['code'] . '"';
4670
+				print '<option value="'.$arraytypes['code'].'"';
4671 4671
 			} elseif ($format == 2) {
4672
-				print '<option value="' . $arraytypes['code'] . '"';
4672
+				print '<option value="'.$arraytypes['code'].'"';
4673 4673
 			} elseif ($format == 3) {
4674
-				print '<option value="' . $id . '"';
4674
+				print '<option value="'.$id.'"';
4675 4675
 			}
4676 4676
 			// If text is selected, we compare with code, else with id
4677 4677
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4719,31 +4719,31 @@  discard block
 block discarded – undo
4719 4719
 		$langs->load("deliveries");
4720 4720
 
4721 4721
 		$sql = "SELECT rowid, code, libelle as label";
4722
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4722
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4723 4723
 		$sql .= " WHERE active > 0";
4724 4724
 		if ($filtre) {
4725
-			$sql .= " AND " . $filtre;
4725
+			$sql .= " AND ".$filtre;
4726 4726
 		}
4727 4727
 		$sql .= " ORDER BY libelle ASC";
4728 4728
 
4729
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4729
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4730 4730
 		$result = $this->db->query($sql);
4731 4731
 		if ($result) {
4732 4732
 			$num = $this->db->num_rows($result);
4733 4733
 			$i = 0;
4734 4734
 			if ($num) {
4735
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4735
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4736 4736
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4737 4737
 					print '<option value="-1">&nbsp;</option>';
4738 4738
 				}
4739 4739
 				while ($i < $num) {
4740 4740
 					$obj = $this->db->fetch_object($result);
4741 4741
 					if ($selected == $obj->rowid) {
4742
-						print '<option value="' . $obj->rowid . '" selected>';
4742
+						print '<option value="'.$obj->rowid.'" selected>';
4743 4743
 					} else {
4744
-						print '<option value="' . $obj->rowid . '">';
4744
+						print '<option value="'.$obj->rowid.'">';
4745 4745
 					}
4746
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4746
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4747 4747
 					print '</option>';
4748 4748
 					$i++;
4749 4749
 				}
@@ -4752,7 +4752,7 @@  discard block
 block discarded – undo
4752 4752
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4753 4753
 				}
4754 4754
 
4755
-				print ajax_combobox('select' . $htmlname);
4755
+				print ajax_combobox('select'.$htmlname);
4756 4756
 			} else {
4757 4757
 				print $langs->trans("NoShippingMethodDefined");
4758 4758
 			}
@@ -4777,16 +4777,16 @@  discard block
 block discarded – undo
4777 4777
 		$langs->load("deliveries");
4778 4778
 
4779 4779
 		if ($htmlname != "none") {
4780
-			print '<form method="POST" action="' . $page . '">';
4780
+			print '<form method="POST" action="'.$page.'">';
4781 4781
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4782
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4782
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4783 4783
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4784
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4784
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4785 4785
 			print '</form>';
4786 4786
 		} else {
4787 4787
 			if ($selected) {
4788 4788
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
4789
-				print $langs->trans("SendingMethod" . strtoupper($code));
4789
+				print $langs->trans("SendingMethod".strtoupper($code));
4790 4790
 			} else {
4791 4791
 				print "&nbsp;";
4792 4792
 			}
@@ -4809,10 +4809,10 @@  discard block
 block discarded – undo
4809 4809
 
4810 4810
 		$opt = '<option value="" selected></option>';
4811 4811
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
4812
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
4813
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
4812
+		$sql .= ' FROM '.$this->db->prefix().'facture';
4813
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
4814 4814
 		$sql .= ' AND situation_counter >= 1';
4815
-		$sql .= ' AND fk_soc = ' . (int) $socid;
4815
+		$sql .= ' AND fk_soc = '.(int) $socid;
4816 4816
 		$sql .= ' AND type <> 2';
4817 4817
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
4818 4818
 		$resql = $this->db->query($sql);
@@ -4830,19 +4830,19 @@  discard block
 block discarded – undo
4830 4830
 						//Not prov?
4831 4831
 						if (substr($obj->ref, 1, 4) != 'PROV') {
4832 4832
 							if ($selected == $obj->rowid) {
4833
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
4833
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
4834 4834
 							} else {
4835
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
4835
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
4836 4836
 							}
4837 4837
 						}
4838 4838
 					}
4839 4839
 				}
4840 4840
 			}
4841 4841
 		} else {
4842
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
4842
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
4843 4843
 		}
4844 4844
 		if ($opt == '<option value ="" selected></option>') {
4845
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
4845
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
4846 4846
 		}
4847 4847
 		return $opt;
4848 4848
 	}
@@ -4862,12 +4862,12 @@  discard block
 block discarded – undo
4862 4862
 
4863 4863
 		$langs->load('products');
4864 4864
 
4865
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
4865
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
4866 4866
 
4867
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
4867
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
4868 4868
 		$sql .= ' WHERE active > 0';
4869 4869
 		if (!empty($unit_type)) {
4870
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
4870
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
4871 4871
 		}
4872 4872
 		$sql .= " ORDER BY sortorder";
4873 4873
 
@@ -4879,14 +4879,14 @@  discard block
 block discarded – undo
4879 4879
 
4880 4880
 			while ($res = $this->db->fetch_object($resql)) {
4881 4881
 				$unitLabel = $res->label;
4882
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
4883
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
4882
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
4883
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
4884 4884
 				}
4885 4885
 
4886 4886
 				if ($selected == $res->rowid) {
4887
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
4887
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
4888 4888
 				} else {
4889
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
4889
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
4890 4890
 				}
4891 4891
 			}
4892 4892
 			$return .= '</select>';
@@ -4921,23 +4921,23 @@  discard block
 block discarded – undo
4921 4921
 		$num = 0;
4922 4922
 
4923 4923
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
4924
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
4925
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
4924
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
4925
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
4926 4926
 		if ($status != 2) {
4927
-			$sql .= " AND clos = " . (int) $status;
4927
+			$sql .= " AND clos = ".(int) $status;
4928 4928
 		}
4929 4929
 		if ($filtre) {
4930
-			$sql .= " AND " . $filtre;
4930
+			$sql .= " AND ".$filtre;
4931 4931
 		}
4932 4932
 		$sql .= " ORDER BY label";
4933 4933
 
4934
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
4934
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
4935 4935
 		$result = $this->db->query($sql);
4936 4936
 		if ($result) {
4937 4937
 			$num = $this->db->num_rows($result);
4938 4938
 			$i = 0;
4939 4939
 			if ($num) {
4940
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4940
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4941 4941
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4942 4942
 					$out .= '<option value="-1">&nbsp;</option>';
4943 4943
 				}
@@ -4945,27 +4945,27 @@  discard block
 block discarded – undo
4945 4945
 				while ($i < $num) {
4946 4946
 					$obj = $this->db->fetch_object($result);
4947 4947
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
4948
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
4948
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
4949 4949
 					} else {
4950
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
4950
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
4951 4951
 					}
4952 4952
 					$out .= trim($obj->label);
4953 4953
 					if ($showcurrency) {
4954
-						$out .= ' (' . $obj->currency_code . ')';
4954
+						$out .= ' ('.$obj->currency_code.')';
4955 4955
 					}
4956 4956
 					if ($status == 2 && $obj->status == 1) {
4957
-						$out .= ' (' . $langs->trans("Closed") . ')';
4957
+						$out .= ' ('.$langs->trans("Closed").')';
4958 4958
 					}
4959 4959
 					$out .= '</option>';
4960 4960
 					$i++;
4961 4961
 				}
4962 4962
 				$out .= "</select>";
4963
-				$out .= ajax_combobox('select' . $htmlname);
4963
+				$out .= ajax_combobox('select'.$htmlname);
4964 4964
 			} else {
4965 4965
 				if ($status == 0) {
4966
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
4966
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
4967 4967
 				} else {
4968
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
4968
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
4969 4969
 				}
4970 4970
 			}
4971 4971
 		} else {
@@ -5001,23 +5001,23 @@  discard block
 block discarded – undo
5001 5001
 		$num = 0;
5002 5002
 
5003 5003
 		$sql = "SELECT rowid, name, fk_country, status, entity";
5004
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
5004
+		$sql .= " FROM ".$this->db->prefix()."establishment";
5005 5005
 		$sql .= " WHERE 1=1";
5006 5006
 		if ($status != 2) {
5007
-			$sql .= " AND status = " . (int) $status;
5007
+			$sql .= " AND status = ".(int) $status;
5008 5008
 		}
5009 5009
 		if ($filtre) {
5010
-			$sql .= " AND " . $filtre;
5010
+			$sql .= " AND ".$filtre;
5011 5011
 		}
5012 5012
 		$sql .= " ORDER BY name";
5013 5013
 
5014
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
5014
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
5015 5015
 		$result = $this->db->query($sql);
5016 5016
 		if ($result) {
5017 5017
 			$num = $this->db->num_rows($result);
5018 5018
 			$i = 0;
5019 5019
 			if ($num) {
5020
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5020
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5021 5021
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5022 5022
 					print '<option value="-1">&nbsp;</option>';
5023 5023
 				}
@@ -5025,13 +5025,13 @@  discard block
 block discarded – undo
5025 5025
 				while ($i < $num) {
5026 5026
 					$obj = $this->db->fetch_object($result);
5027 5027
 					if ($selected == $obj->rowid) {
5028
-						print '<option value="' . $obj->rowid . '" selected>';
5028
+						print '<option value="'.$obj->rowid.'" selected>';
5029 5029
 					} else {
5030
-						print '<option value="' . $obj->rowid . '">';
5030
+						print '<option value="'.$obj->rowid.'">';
5031 5031
 					}
5032 5032
 					print trim($obj->name);
5033 5033
 					if ($status == 2 && $obj->status == 1) {
5034
-						print ' (' . $langs->trans("Closed") . ')';
5034
+						print ' ('.$langs->trans("Closed").')';
5035 5035
 					}
5036 5036
 					print '</option>';
5037 5037
 					$i++;
@@ -5039,9 +5039,9 @@  discard block
 block discarded – undo
5039 5039
 				print "</select>";
5040 5040
 			} else {
5041 5041
 				if ($status == 0) {
5042
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5042
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5043 5043
 				} else {
5044
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5044
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5045 5045
 				}
5046 5046
 			}
5047 5047
 
@@ -5065,20 +5065,20 @@  discard block
 block discarded – undo
5065 5065
 	{
5066 5066
 		global $langs;
5067 5067
 		if ($htmlname != "none") {
5068
-			print '<form method="POST" action="' . $page . '">';
5068
+			print '<form method="POST" action="'.$page.'">';
5069 5069
 			print '<input type="hidden" name="action" value="setbankaccount">';
5070
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5070
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5071 5071
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5072 5072
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5073 5073
 			if ($nbaccountfound > 0) {
5074
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5074
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5075 5075
 			}
5076 5076
 			print '</form>';
5077 5077
 		} else {
5078 5078
 			$langs->load('banks');
5079 5079
 
5080 5080
 			if ($selected) {
5081
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5081
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5082 5082
 				$bankstatic = new Account($this->db);
5083 5083
 				$result = $bankstatic->fetch($selected);
5084 5084
 				if ($result) {
@@ -5116,19 +5116,19 @@  discard block
 block discarded – undo
5116 5116
 		global $conf, $langs;
5117 5117
 		$langs->load("categories");
5118 5118
 
5119
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5119
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5120 5120
 
5121 5121
 		// For backward compatibility
5122 5122
 		if (is_numeric($type)) {
5123
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5123
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5124 5124
 		}
5125 5125
 
5126 5126
 		if ($type === Categorie::TYPE_BANK_LINE) {
5127 5127
 			// TODO Move this into common category feature
5128 5128
 			$cate_arbo = array();
5129 5129
 			$sql = "SELECT c.label, c.rowid";
5130
-			$sql .= " FROM " . $this->db->prefix() . "bank_categ as c";
5131
-			$sql .= " WHERE entity = " . $conf->entity;
5130
+			$sql .= " FROM ".$this->db->prefix()."bank_categ as c";
5131
+			$sql .= " WHERE entity = ".$conf->entity;
5132 5132
 			$sql .= " ORDER BY c.label";
5133 5133
 			$result = $this->db->query($sql);
5134 5134
 			if ($result) {
@@ -5153,10 +5153,10 @@  discard block
 block discarded – undo
5153 5153
 		$outarray = array();
5154 5154
 		$outarrayrichhtml = array();
5155 5155
 
5156
-		$output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5156
+		$output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5157 5157
 		if (is_array($cate_arbo)) {
5158 5158
 			if (!count($cate_arbo)) {
5159
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5159
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5160 5160
 			} else {
5161 5161
 				$output .= '<option value="-1">&nbsp;</option>';
5162 5162
 				foreach ($cate_arbo as $key => $value) {
@@ -5166,15 +5166,15 @@  discard block
 block discarded – undo
5166 5166
 						$add = '';
5167 5167
 					}
5168 5168
 
5169
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5169
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5170 5170
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5171 5171
 
5172 5172
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5173 5173
 
5174 5174
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5175 5175
 
5176
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5177
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5176
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5177
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5178 5178
 					$output .= '>';
5179 5179
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5180 5180
 					$output .= '</option>';
@@ -5216,7 +5216,7 @@  discard block
 block discarded – undo
5216 5216
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5217 5217
 	{
5218 5218
 		// phpcs:enable
5219
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5219
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5220 5220
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5221 5221
 	}
5222 5222
 
@@ -5251,7 +5251,7 @@  discard block
 block discarded – undo
5251 5251
 	{
5252 5252
 		global $langs, $conf;
5253 5253
 
5254
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5254
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5255 5255
 		$formconfirm = '';
5256 5256
 		$inputok = array();
5257 5257
 		$inputko = array();
@@ -5275,27 +5275,27 @@  discard block
 block discarded – undo
5275 5275
 			foreach ($formquestion as $key => $input) {
5276 5276
 				if (is_array($input) && !empty($input)) {
5277 5277
 					if ($input['type'] == 'hidden') {
5278
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5279
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5278
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5279
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5280 5280
 
5281
-						$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";
5281
+						$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";
5282 5282
 					}
5283 5283
 				}
5284 5284
 			}
5285 5285
 
5286 5286
 			// Now add questions
5287 5287
 			$moreonecolumn = '';
5288
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5288
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5289 5289
 			foreach ($formquestion as $key => $input) {
5290 5290
 				if (is_array($input) && !empty($input)) {
5291
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5292
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5293
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5291
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5292
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5293
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5294 5294
 
5295 5295
 					if ($input['type'] == 'text') {
5296
-						$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";
5296
+						$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";
5297 5297
 					} elseif ($input['type'] == 'password') {
5298
-						$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";
5298
+						$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";
5299 5299
 					} elseif ($input['type'] == 'textarea') {
5300 5300
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5301 5301
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5303,8 +5303,8 @@  discard block
 block discarded – undo
5303 5303
 						$more .= '</textarea>';
5304 5304
 						$more .= '</div></div>'."\n";*/
5305 5305
 						$moreonecolumn .= '<div class="margintoponly">';
5306
-						$moreonecolumn .= $input['label'] . '<br>';
5307
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5306
+						$moreonecolumn .= $input['label'].'<br>';
5307
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5308 5308
 						$moreonecolumn .= $input['value'];
5309 5309
 						$moreonecolumn .= '</textarea>';
5310 5310
 						$moreonecolumn .= '</div>';
@@ -5321,20 +5321,20 @@  discard block
 block discarded – undo
5321 5321
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5322 5322
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5323 5323
 
5324
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5324
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5325 5325
 						if (!empty($input['label'])) {
5326
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5326
+							$more .= $input['label'].'</div><div class="tagtd left">';
5327 5327
 						}
5328 5328
 						if ($input['type'] == 'select') {
5329 5329
 							$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);
5330 5330
 						} else {
5331 5331
 							$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);
5332 5332
 						}
5333
-						$more .= '</div></div>' . "\n";
5333
+						$more .= '</div></div>'."\n";
5334 5334
 					} elseif ($input['type'] == 'checkbox') {
5335 5335
 						$more .= '<div class="tagtr">';
5336
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5337
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5336
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5337
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5338 5338
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5339 5339
 							$more .= ' checked';
5340 5340
 						}
@@ -5345,19 +5345,19 @@  discard block
 block discarded – undo
5345 5345
 							$more .= ' disabled';
5346 5346
 						}
5347 5347
 						$more .= ' /></div>';
5348
-						$more .= '</div>' . "\n";
5348
+						$more .= '</div>'."\n";
5349 5349
 					} elseif ($input['type'] == 'radio') {
5350 5350
 						$i = 0;
5351 5351
 						foreach ($input['values'] as $selkey => $selval) {
5352 5352
 							$more .= '<div class="tagtr">';
5353 5353
 							if (isset($input['label'])) {
5354 5354
 								if ($i == 0) {
5355
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5355
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5356 5356
 								} else {
5357
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5357
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5358 5358
 								}
5359 5359
 							}
5360
-							$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;
5360
+							$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;
5361 5361
 							if (!empty($input['disabled'])) {
5362 5362
 								$more .= ' disabled';
5363 5363
 							}
@@ -5365,12 +5365,12 @@  discard block
 block discarded – undo
5365 5365
 								$more .= ' checked="checked"';
5366 5366
 							}
5367 5367
 							$more .= ' /> ';
5368
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5369
-							$more .= '</div></div>' . "\n";
5368
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5369
+							$more .= '</div></div>'."\n";
5370 5370
 							$i++;
5371 5371
 						}
5372 5372
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5373
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5373
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5374 5374
 						$more .= '<div class="tagtd">';
5375 5375
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5376 5376
 						$h = $m = 0;
@@ -5388,24 +5388,24 @@  discard block
 block discarded – undo
5388 5388
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5389 5389
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5390 5390
 						if (!empty($input['label'])) {
5391
-							$more .= $input['label'] . '</div><div class="tagtd">';
5391
+							$more .= $input['label'].'</div><div class="tagtd">';
5392 5392
 						}
5393 5393
 						$more .= $input['value'];
5394
-						$more .= '</div></div>' . "\n";
5394
+						$more .= '</div></div>'."\n";
5395 5395
 					} elseif ($input['type'] == 'onecolumn') {
5396 5396
 						$moreonecolumn .= '<div class="margintoponly">';
5397 5397
 						$moreonecolumn .= $input['value'];
5398
-						$moreonecolumn .= '</div>' . "\n";
5398
+						$moreonecolumn .= '</div>'."\n";
5399 5399
 					} elseif ($input['type'] == 'hidden') {
5400 5400
 						// Do nothing more, already added by a previous loop
5401 5401
 					} elseif ($input['type'] == 'separator') {
5402 5402
 						$more .= '<br>';
5403 5403
 					} else {
5404
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5404
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5405 5405
 					}
5406 5406
 				}
5407 5407
 			}
5408
-			$more .= '</div>' . "\n";
5408
+			$more .= '</div>'."\n";
5409 5409
 			$more .= $moreonecolumn;
5410 5410
 		}
5411 5411
 
@@ -5427,10 +5427,10 @@  discard block
 block discarded – undo
5427 5427
 				$button = $useajax;
5428 5428
 				$useajax = 1;
5429 5429
 				$autoOpen = false;
5430
-				$dialogconfirm .= '-' . $button;
5430
+				$dialogconfirm .= '-'.$button;
5431 5431
 			}
5432
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5433
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5432
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5433
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5434 5434
 
5435 5435
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5436 5436
 			if (is_array($formquestion)) {
@@ -5452,24 +5452,24 @@  discard block
 block discarded – undo
5452 5452
 			}
5453 5453
 
5454 5454
 			// Show JQuery confirm box.
5455
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5455
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5456 5456
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5457
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5457
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5458 5458
 			}
5459 5459
 			if (!empty($more)) {
5460
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5460
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5461 5461
 			}
5462
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : '');
5463
-			$formconfirm .= '</div>' . "\n";
5462
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : '');
5463
+			$formconfirm .= '</div>'."\n";
5464 5464
 
5465
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5466
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5465
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5466
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5467 5467
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5468 5468
 			$formconfirm .= 'jQuery(document).ready(function() {
5469 5469
             $(function() {
5470
-            	$( "#' . $dialogconfirm . '" ).dialog(
5470
+            	$( "#' . $dialogconfirm.'" ).dialog(
5471 5471
             	{
5472
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5472
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5473 5473
 			if ($newselectedchoice == 'no') {
5474 5474
 				$formconfirm .= '
5475 5475
 						open: function() {
@@ -5479,24 +5479,24 @@  discard block
 block discarded – undo
5479 5479
 
5480 5480
 			$jsforcursor = '';
5481 5481
 			if ($useajax == 1) {
5482
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5483
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5482
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5483
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5484 5484
 			}
5485 5485
 
5486 5486
 			$postconfirmas = 'GET';
5487 5487
 
5488 5488
 			$formconfirm .= '
5489 5489
                     resizable: false,
5490
-                    height: "' . $height . '",
5491
-                    width: "' . $width . '",
5490
+                    height: "' . $height.'",
5491
+                    width: "' . $width.'",
5492 5492
                     modal: true,
5493 5493
                     closeOnEscape: false,
5494 5494
                     buttons: {
5495
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5496
-							var options = "token=' . urlencode(newToken()) . '";
5497
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5498
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5499
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5495
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5496
+							var options = "token=' . urlencode(newToken()).'";
5497
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5498
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5499
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5500 5500
 
5501 5501
                          	if (inputok.length > 0) {
5502 5502
                          		$.each(inputok, function(i, inputname) {
@@ -5530,11 +5530,11 @@  discard block
 block discarded – undo
5530 5530
 							}
5531 5531
 	                        $(this).dialog("close");
5532 5532
                         },
5533
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5534
-                        	var options = "token=' . urlencode(newToken()) . '";
5535
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5536
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5537
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5533
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5534
+                        	var options = "token=' . urlencode(newToken()).'";
5535
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5536
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5537
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5538 5538
                          	if (inputko.length > 0) {
5539 5539
                          		$.each(inputko, function(i, inputname) {
5540 5540
                          			var more = "";
@@ -5566,10 +5566,10 @@  discard block
 block discarded – undo
5566 5566
                 }
5567 5567
                 );
5568 5568
 
5569
-            	var button = "' . $button . '";
5569
+            	var button = "' . $button.'";
5570 5570
             	if (button.length > 0) {
5571 5571
                 	$( "#" + button ).click(function() {
5572
-                		$("#' . $dialogconfirm . '").dialog("open");
5572
+                		$("#' . $dialogconfirm.'").dialog("open");
5573 5573
         			});
5574 5574
                 }
5575 5575
             });
@@ -5577,44 +5577,44 @@  discard block
 block discarded – undo
5577 5577
             </script>';
5578 5578
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5579 5579
 		} else {
5580
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5580
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5581 5581
 
5582 5582
 			if (empty($disableformtag)) {
5583
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n";
5583
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
5584 5584
 			}
5585 5585
 
5586
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5587
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5586
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5587
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5588 5588
 
5589
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5589
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5590 5590
 
5591 5591
 			// Line title
5592 5592
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5593
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5594
-			$formconfirm .= '</td></tr>' . "\n";
5593
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5594
+			$formconfirm .= '</td></tr>'."\n";
5595 5595
 
5596 5596
 			// Line text
5597 5597
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5598
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5598
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5599 5599
 			}
5600 5600
 
5601 5601
 			// Line form fields
5602 5602
 			if ($more) {
5603
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5603
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5604 5604
 				$formconfirm .= $more;
5605
-				$formconfirm .= '</td></tr>' . "\n";
5605
+				$formconfirm .= '</td></tr>'."\n";
5606 5606
 			}
5607 5607
 
5608 5608
 			// Line with question
5609 5609
 			$formconfirm .= '<tr class="valid">';
5610
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5610
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5611 5611
 			$formconfirm .= '<td class="valid center">';
5612 5612
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5613
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5613
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5614 5614
 			$formconfirm .= '</td>';
5615
-			$formconfirm .= '</tr>' . "\n";
5615
+			$formconfirm .= '</tr>'."\n";
5616 5616
 
5617
-			$formconfirm .= '</table>' . "\n";
5617
+			$formconfirm .= '</table>'."\n";
5618 5618
 
5619 5619
 			if (empty($disableformtag)) {
5620 5620
 				$formconfirm .= "</form>\n";
@@ -5623,7 +5623,7 @@  discard block
 block discarded – undo
5623 5623
 
5624 5624
 			if (!empty($conf->use_javascript_ajax)) {
5625 5625
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5626
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5626
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5627 5627
 				$formconfirm .= '
5628 5628
 				$(document).ready(function () {
5629 5629
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5635,7 +5635,7 @@  discard block
 block discarded – undo
5635 5635
 					});
5636 5636
 				});
5637 5637
 				';
5638
-				$formconfirm .= '</script>' . "\n";
5638
+				$formconfirm .= '</script>'."\n";
5639 5639
 			}
5640 5640
 
5641 5641
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5667,8 +5667,8 @@  discard block
 block discarded – undo
5667 5667
 		// phpcs:enable
5668 5668
 		global $langs;
5669 5669
 
5670
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5671
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5670
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5671
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5672 5672
 
5673 5673
 		$out = '';
5674 5674
 
@@ -5676,11 +5676,11 @@  discard block
 block discarded – undo
5676 5676
 
5677 5677
 		$langs->load("project");
5678 5678
 		if ($htmlname != "none") {
5679
-			$out .= '<form method="post" action="' . $page . '">';
5679
+			$out .= '<form method="post" action="'.$page.'">';
5680 5680
 			$out .= '<input type="hidden" name="action" value="classin">';
5681
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5681
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5682 5682
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5683
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5683
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5684 5684
 			$out .= '</form>';
5685 5685
 		} else {
5686 5686
 			$out .= '<span class="project_head_block">';
@@ -5689,7 +5689,7 @@  discard block
 block discarded – undo
5689 5689
 				$projet->fetch($selected);
5690 5690
 				$out .= $projet->getNomUrl(0, '', 1);
5691 5691
 			} else {
5692
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5692
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5693 5693
 			}
5694 5694
 			$out .= '</span>';
5695 5695
 		}
@@ -5726,14 +5726,14 @@  discard block
 block discarded – undo
5726 5726
 		$out = '';
5727 5727
 
5728 5728
 		if ($htmlname != "none") {
5729
-			$out .= '<form method="POST" action="' . $page . '">';
5729
+			$out .= '<form method="POST" action="'.$page.'">';
5730 5730
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5731
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5731
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5732 5732
 			if ($type) {
5733
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5733
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5734 5734
 			}
5735 5735
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5736
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5736
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5737 5737
 			$out .= '</form>';
5738 5738
 		} else {
5739 5739
 			if ($selected) {
@@ -5778,12 +5778,12 @@  discard block
 block discarded – undo
5778 5778
 		// phpcs:enable
5779 5779
 		global $langs;
5780 5780
 		if ($htmlname != "none") {
5781
-			print '<form method="post" action="' . $page . '">';
5781
+			print '<form method="post" action="'.$page.'">';
5782 5782
 			print '<input type="hidden" name="action" value="setavailability">';
5783
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5783
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5784 5784
 			$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
5785
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5786
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
5785
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5786
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
5787 5787
 			print '</form>';
5788 5788
 		} else {
5789 5789
 			if ($selected) {
@@ -5809,11 +5809,11 @@  discard block
 block discarded – undo
5809 5809
 	{
5810 5810
 		global $langs;
5811 5811
 		if ($htmlname != "none") {
5812
-			print '<form method="post" action="' . $page . '">';
5812
+			print '<form method="post" action="'.$page.'">';
5813 5813
 			print '<input type="hidden" name="action" value="setdemandreason">';
5814
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5814
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5815 5815
 			$this->selectInputReason($selected, $htmlname, -1, $addempty);
5816
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5816
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5817 5817
 			print '</form>';
5818 5818
 		} else {
5819 5819
 			if ($selected) {
@@ -5853,17 +5853,17 @@  discard block
 block discarded – undo
5853 5853
 		$ret = '';
5854 5854
 
5855 5855
 		if ($htmlname != "none") {
5856
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5857
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
5858
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
5856
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5857
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
5858
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
5859 5859
 			if ($type) {
5860
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5860
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5861 5861
 			}
5862 5862
 			$ret .= '<table class="nobordernopadding">';
5863 5863
 			$ret .= '<tr><td>';
5864
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
5864
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
5865 5865
 			$ret .= '</td>';
5866
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
5866
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
5867 5867
 			$ret .= '</tr></table></form>';
5868 5868
 		} else {
5869 5869
 			if ($displayhour) {
@@ -5898,15 +5898,15 @@  discard block
 block discarded – undo
5898 5898
 		global $langs;
5899 5899
 
5900 5900
 		if ($htmlname != "none") {
5901
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5902
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
5903
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5901
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5902
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
5903
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5904 5904
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
5905
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5905
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5906 5906
 			print '</form>';
5907 5907
 		} else {
5908 5908
 			if ($selected) {
5909
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
5909
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
5910 5910
 				$theuser = new User($this->db);
5911 5911
 				$theuser->fetch($selected);
5912 5912
 				print $theuser->getNomUrl(1);
@@ -5939,14 +5939,14 @@  discard block
 block discarded – undo
5939 5939
 
5940 5940
 		$out = '';
5941 5941
 		if ($htmlname != "none") {
5942
-			$out .= '<form method="POST" action="' . $page . '">';
5942
+			$out .= '<form method="POST" action="'.$page.'">';
5943 5943
 			$out .= '<input type="hidden" name="action" value="setmode">';
5944
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5944
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5945 5945
 			if ($type) {
5946
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5946
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5947 5947
 			}
5948 5948
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
5949
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5949
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5950 5950
 			$out .= '</form>';
5951 5951
 		} else {
5952 5952
 			if ($selected) {
@@ -5979,11 +5979,11 @@  discard block
 block discarded – undo
5979 5979
 	{
5980 5980
 		global $langs;
5981 5981
 		if ($htmlname != "none") {
5982
-			print '<form method="POST" action="' . $page . '">';
5982
+			print '<form method="POST" action="'.$page.'">';
5983 5983
 			print '<input type="hidden" name="action" value="settransportmode">';
5984
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5984
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5985 5985
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
5986
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5986
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5987 5987
 			print '</form>';
5988 5988
 		} else {
5989 5989
 			if ($selected) {
@@ -6010,14 +6010,14 @@  discard block
 block discarded – undo
6010 6010
 		// phpcs:enable
6011 6011
 		global $langs;
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="setmulticurrencycode">';
6015
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6015
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6016 6016
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
6017
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6017
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6018 6018
 			print '</form>';
6019 6019
 		} else {
6020
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6020
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6021 6021
 			print !empty($selected) ? currency_name($selected, 1) : '&nbsp;';
6022 6022
 		}
6023 6023
 	}
@@ -6039,21 +6039,21 @@  discard block
 block discarded – undo
6039 6039
 		global $langs, $mysoc, $conf;
6040 6040
 
6041 6041
 		if ($htmlname != "none") {
6042
-			print '<form method="POST" action="' . $page . '">';
6042
+			print '<form method="POST" action="'.$page.'">';
6043 6043
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6044
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6045
-			print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6044
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6045
+			print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6046 6046
 			print '<select name="calculation_mode">';
6047
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6048
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6047
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6048
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6049 6049
 			print '</select> ';
6050
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6050
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6051 6051
 			print '</form>';
6052 6052
 		} else {
6053 6053
 			if (!empty($rate)) {
6054 6054
 				print price($rate, 1, $langs, 0, 0);
6055 6055
 				if ($currency && $rate != 1) {
6056
-					print ' &nbsp; (' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')';
6056
+					print ' &nbsp; ('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')';
6057 6057
 				}
6058 6058
 			} else {
6059 6059
 				print 1;
@@ -6084,9 +6084,9 @@  discard block
 block discarded – undo
6084 6084
 		// phpcs:enable
6085 6085
 		global $conf, $langs;
6086 6086
 		if ($htmlname != "none") {
6087
-			print '<form method="post" action="' . $page . '">';
6087
+			print '<form method="post" action="'.$page.'">';
6088 6088
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6089
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6089
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6090 6090
 			print '<div class="inline-block">';
6091 6091
 			if (!empty($discount_type)) {
6092 6092
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6124,24 +6124,24 @@  discard block
 block discarded – undo
6124 6124
 			print '</div>';
6125 6125
 			if (empty($hidelist)) {
6126 6126
 				print '<div class="inline-block" style="padding-right: 10px">';
6127
-				$newfilter = 'discount_type=' . intval($discount_type);
6127
+				$newfilter = 'discount_type='.intval($discount_type);
6128 6128
 				if (!empty($discount_type)) {
6129 6129
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6130 6130
 				} else {
6131 6131
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6132 6132
 				}
6133 6133
 				if ($filter) {
6134
-					$newfilter .= ' AND (' . $filter . ')';
6134
+					$newfilter .= ' AND ('.$filter.')';
6135 6135
 				}
6136 6136
 				// output the combo of discounts
6137 6137
 				$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
6138 6138
 				if ($nbqualifiedlines > 0) {
6139
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6139
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6140 6140
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6141
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6141
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6142 6142
 					}
6143 6143
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6144
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6144
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6145 6145
 					}
6146 6146
 
6147 6147
 					print '>';
@@ -6181,23 +6181,23 @@  discard block
 block discarded – undo
6181 6181
 		global $langs, $conf;
6182 6182
 
6183 6183
 		if ($htmlname != "none") {
6184
-			print '<form method="post" action="' . $page . '">';
6184
+			print '<form method="post" action="'.$page.'">';
6185 6185
 			print '<input type="hidden" name="action" value="set_contact">';
6186
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6186
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6187 6187
 			print '<table class="nobordernopadding">';
6188 6188
 			print '<tr><td>';
6189 6189
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6190 6190
 			$num = $this->num;
6191 6191
 			if ($num == 0) {
6192 6192
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6193
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6193
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6194 6194
 			}
6195 6195
 			print '</td>';
6196
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6196
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6197 6197
 			print '</tr></table></form>';
6198 6198
 		} else {
6199 6199
 			if ($selected) {
6200
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6200
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6201 6201
 				$contact = new Contact($this->db);
6202 6202
 				$contact->fetch($selected);
6203 6203
 				print $contact->getFullName($langs);
@@ -6232,20 +6232,20 @@  discard block
 block discarded – undo
6232 6232
 
6233 6233
 		$out = '';
6234 6234
 		if ($htmlname != "none") {
6235
-			$out .= '<form method="post" action="' . $page . '">';
6235
+			$out .= '<form method="post" action="'.$page.'">';
6236 6236
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6237
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6237
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6238 6238
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6239
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6239
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6240 6240
 			$out .= '</form>';
6241 6241
 		} else {
6242 6242
 			if ($selected) {
6243
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6243
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6244 6244
 				$soc = new Societe($this->db);
6245 6245
 				$soc->fetch($selected);
6246 6246
 				$out .= $soc->getNomUrl(0, '');
6247 6247
 			} else {
6248
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6248
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6249 6249
 			}
6250 6250
 		}
6251 6251
 
@@ -6295,22 +6295,22 @@  discard block
 block discarded – undo
6295 6295
 			$selected = 'EUR'; // Pour compatibilite
6296 6296
 		}
6297 6297
 
6298
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6298
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6299 6299
 		if ($useempty) {
6300 6300
 			$out .= '<option value="-1" selected></option>';
6301 6301
 		}
6302 6302
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6303 6303
 			$labeltoshow = $currency['label'];
6304 6304
 			if ($mode == 1) {
6305
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6305
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6306 6306
 			} else {
6307
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6307
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6308 6308
 			}
6309 6309
 
6310 6310
 			if ($selected && $selected == $code_iso) {
6311
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6311
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6312 6312
 			} else {
6313
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6313
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6314 6314
 			}
6315 6315
 			$out .= $labeltoshow;
6316 6316
 			$out .= '</option>';
@@ -6321,7 +6321,7 @@  discard block
 block discarded – undo
6321 6321
 		}
6322 6322
 
6323 6323
 		// Make select dynamic
6324
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6324
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6325 6325
 		$out .= ajax_combobox($htmlname);
6326 6326
 
6327 6327
 		return $out;
@@ -6347,10 +6347,10 @@  discard block
 block discarded – undo
6347 6347
 
6348 6348
 		$TCurrency = array();
6349 6349
 
6350
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6351
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6350
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6351
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6352 6352
 		if ($filter) {
6353
-			$sql .= " AND " . $filter;
6353
+			$sql .= " AND ".$filter;
6354 6354
 		}
6355 6355
 		$resql = $this->db->query($sql);
6356 6356
 		if ($resql) {
@@ -6360,7 +6360,7 @@  discard block
 block discarded – undo
6360 6360
 		}
6361 6361
 
6362 6362
 		$out = '';
6363
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6363
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6364 6364
 		if ($useempty) {
6365 6365
 			$out .= '<option value="">&nbsp;</option>';
6366 6366
 		}
@@ -6372,13 +6372,13 @@  discard block
 block discarded – undo
6372 6372
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6373 6373
 				if (isset($TCurrency[$code_iso])) {
6374 6374
 					if (!empty($selected) && $selected == $code_iso) {
6375
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6375
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6376 6376
 					} else {
6377
-						$out .= '<option value="' . $code_iso . '">';
6377
+						$out .= '<option value="'.$code_iso.'">';
6378 6378
 					}
6379 6379
 
6380 6380
 					$out .= $currency['label'];
6381
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6381
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6382 6382
 					$out .= '</option>';
6383 6383
 				}
6384 6384
 			}
@@ -6387,7 +6387,7 @@  discard block
 block discarded – undo
6387 6387
 		$out .= '</select>';
6388 6388
 
6389 6389
 		// Make select dynamic
6390
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6390
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6391 6391
 		$out .= ajax_combobox($htmlname);
6392 6392
 
6393 6393
 		return $out;
@@ -6418,7 +6418,7 @@  discard block
 block discarded – undo
6418 6418
 		$sql .= " WHERE t.fk_pays = c.rowid";
6419 6419
 		$sql .= " AND t.active > 0";
6420 6420
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6421
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6421
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6422 6422
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6423 6423
 
6424 6424
 		$resql = $this->db->query($sql);
@@ -6430,30 +6430,30 @@  discard block
 block discarded – undo
6430 6430
 
6431 6431
 					$tmparray = array();
6432 6432
 					$tmparray['rowid']			= $obj->rowid;
6433
-					$tmparray['type_vat']		= $obj->type_vat;
6434
-					$tmparray['code']			= $obj->code;
6433
+					$tmparray['type_vat'] = $obj->type_vat;
6434
+					$tmparray['code'] = $obj->code;
6435 6435
 					$tmparray['txtva']			= $obj->taux;
6436
-					$tmparray['nprtva']			= $obj->recuperableonly;
6436
+					$tmparray['nprtva'] = $obj->recuperableonly;
6437 6437
 					$tmparray['localtax1']	    = $obj->localtax1;
6438 6438
 					$tmparray['localtax1_type']	= $obj->localtax1_type;
6439 6439
 					$tmparray['localtax2']	    = $obj->localtax2;
6440 6440
 					$tmparray['localtax2_type']	= $obj->localtax1_type;
6441
-					$tmparray['label']			= $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6442
-					$tmparray['labelallrates']	= $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6441
+					$tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6442
+					$tmparray['labelallrates']	= $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6443 6443
 					$positiverates = '';
6444 6444
 					if ($obj->taux) {
6445
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6445
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6446 6446
 					}
6447 6447
 					if ($obj->localtax1) {
6448
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6448
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6449 6449
 					}
6450 6450
 					if ($obj->localtax2) {
6451
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6451
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6452 6452
 					}
6453 6453
 					if (empty($positiverates)) {
6454 6454
 						$positiverates = '0';
6455 6455
 					}
6456
-					$tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6456
+					$tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6457 6457
 
6458 6458
 					$this->cache_vatrates[$obj->rowid] = $tmparray;
6459 6459
 				}
@@ -6473,7 +6473,7 @@  discard block
 block discarded – undo
6473 6473
 				return -1;
6474 6474
 			}
6475 6475
 		} else {
6476
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6476
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6477 6477
 			return -2;
6478 6478
 		}
6479 6479
 	}
@@ -6526,9 +6526,9 @@  discard block
 block discarded – undo
6526 6526
 		// Check parameters
6527 6527
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6528 6528
 			if ($societe_vendeuse->id == $mysoc->id) {
6529
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6529
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6530 6530
 			} else {
6531
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6531
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6532 6532
 			}
6533 6533
 			return $return;
6534 6534
 		}
@@ -6540,12 +6540,12 @@  discard block
 block discarded – undo
6540 6540
 		// Define list of countries to use to search VAT rates to show
6541 6541
 		// First we defined code_country to use to find list
6542 6542
 		if (is_object($societe_vendeuse)) {
6543
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6543
+			$code_country = "'".$societe_vendeuse->country_code."'";
6544 6544
 		} else {
6545
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6545
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6546 6546
 		}
6547 6547
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6548
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6548
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6549 6549
 			// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
6550 6550
 			// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
6551 6551
 			$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
@@ -6555,27 +6555,27 @@  discard block
 block discarded – undo
6555 6555
 					if ($type == 1) { // We know product is a service
6556 6556
 						switch ($selectVatComboMode) {
6557 6557
 							case '1':
6558
-								$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6558
+								$code_country .= ",'".$societe_acheteuse->country_code."'";
6559 6559
 								break;
6560 6560
 							case '2':
6561
-								$code_country = "'" . $societe_acheteuse->country_code . "'";
6561
+								$code_country = "'".$societe_acheteuse->country_code."'";
6562 6562
 								break;
6563 6563
 						}
6564 6564
 					}
6565 6565
 				} elseif (!$idprod) {  // We don't know type of product
6566 6566
 					switch ($selectVatComboMode) {
6567 6567
 						case '1':
6568
-							$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6568
+							$code_country .= ",'".$societe_acheteuse->country_code."'";
6569 6569
 							break;
6570 6570
 						case '2':
6571
-							$code_country = "'" . $societe_acheteuse->country_code . "'";
6571
+							$code_country = "'".$societe_acheteuse->country_code."'";
6572 6572
 							break;
6573 6573
 					}
6574 6574
 				} else {
6575 6575
 					$prodstatic = new Product($this->db);
6576 6576
 					$prodstatic->fetch($idprod);
6577 6577
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6578
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6578
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6579 6579
 					}
6580 6580
 				}
6581 6581
 			}
@@ -6637,13 +6637,13 @@  discard block
 block discarded – undo
6637 6637
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6638 6638
 				// of using supplier invoices (this is a very bad idea !)
6639 6639
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
6640
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6640
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6641 6641
 					$disabled = true;
6642 6642
 				}
6643 6643
 			}
6644 6644
 
6645 6645
 			if (!$options_only) {
6646
-				$return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6646
+				$return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6647 6647
 			}
6648 6648
 
6649 6649
 			$selectedfound = false;
@@ -6657,13 +6657,13 @@  discard block
 block discarded – undo
6657 6657
 				$key = $rate['txtva'];
6658 6658
 				$key .= $rate['nprtva'] ? '*' : '';
6659 6659
 				if ($mode > 0 && $rate['code']) {
6660
-					$key .= ' (' . $rate['code'] . ')';
6660
+					$key .= ' ('.$rate['code'].')';
6661 6661
 				}
6662 6662
 				if ($mode < 0) {
6663 6663
 					$key = $rate['rowid'];
6664 6664
 				}
6665 6665
 
6666
-				$return .= '<option value="' . $key . '"';
6666
+				$return .= '<option value="'.$key.'"';
6667 6667
 				if (!$selectedfound) {
6668 6668
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6669 6669
 						if ($defaultcode == $rate['code']) {
@@ -6734,7 +6734,7 @@  discard block
 block discarded – undo
6734 6734
 	public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = 0, $addplusone = '', $adddateof = '')
6735 6735
 	{
6736 6736
 		// phpcs:enable
6737
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6737
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6738 6738
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
6739 6739
 		if (!empty($nooutput)) {
6740 6740
 			return $retstring;
@@ -6763,11 +6763,11 @@  discard block
 block discarded – undo
6763 6763
 	{
6764 6764
 		global $langs;
6765 6765
 
6766
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6766
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6767 6767
 		if ($forcenewline) {
6768 6768
 			$ret .= '<br>';
6769 6769
 		}
6770
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6770
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6771 6771
 		return $ret;
6772 6772
 	}
6773 6773
 
@@ -6833,7 +6833,7 @@  discard block
 block discarded – undo
6833 6833
 		$orig_set_time = $set_time;
6834 6834
 
6835 6835
 		if ($set_time === '' && $emptydate == 0) {
6836
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
6836
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
6837 6837
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
6838 6838
 				$set_time = dol_now($gm);
6839 6839
 			} else {
@@ -6905,38 +6905,38 @@  discard block
 block discarded – undo
6905 6905
 				// Calendrier popup version eldy
6906 6906
 				if ($usecalendar == "eldy") {
6907 6907
 					// Input area to enter date manually
6908
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
6908
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6909 6909
 					$retstring .= ($disabled ? ' disabled' : '');
6910
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6910
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6911 6911
 					$retstring .= ' autocomplete="off">';
6912 6912
 
6913 6913
 					// Icon calendar
6914 6914
 					$retstringbuttom = '';
6915 6915
 					if (!$disabled) {
6916
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
6917
-						$base = DOL_URL_ROOT . '/core/';
6918
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
6919
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
6916
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
6917
+						$base = DOL_URL_ROOT.'/core/';
6918
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
6919
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
6920 6920
 					} else {
6921
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6921
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6922 6922
 					}
6923
-					$retstring = $retstringbuttom . $retstring;
6923
+					$retstring = $retstringbuttom.$retstring;
6924 6924
 
6925
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6926
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6927
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6925
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6926
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6927
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6928 6928
 				} elseif ($usecalendar == 'jquery' || $usecalendar == 'html') {
6929 6929
 					if (!$disabled && $usecalendar != 'html') {
6930 6930
 						// Output javascript for datepicker
6931 6931
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100));
6932 6932
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100));
6933 6933
 
6934
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
6935
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
6936
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
6934
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
6935
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
6936
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
6937 6937
 							autoclose: true,
6938 6938
 							todayHighlight: true,
6939
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
6939
+							yearRange: '" . $minYear.":".$maxYear."',";
6940 6940
 						if (!empty($conf->dol_use_jmobile)) {
6941 6941
 							$retstring .= "
6942 6942
 								beforeShow: function (input, datePicker) {
@@ -6951,7 +6951,7 @@  discard block
 block discarded – undo
6951 6951
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
6952 6952
 							$retstring .= "
6953 6953
 								showOn: 'button',	/* both has problem with autocompletion */
6954
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
6954
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
6955 6955
 								buttonImageOnly: true";
6956 6956
 						}
6957 6957
 						$retstring .= "
@@ -6963,46 +6963,46 @@  discard block
 block discarded – undo
6963 6963
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
6964 6964
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6965 6965
 					$retstring .= ($disabled ? ' disabled' : '');
6966
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
6967
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6966
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
6967
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6968 6968
 					$retstring .= ' autocomplete="off">';
6969 6969
 
6970 6970
 					// Icone calendrier
6971 6971
 					if ($disabled) {
6972
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6973
-						$retstring = $retstringbutton . $retstring;
6972
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6973
+						$retstring = $retstringbutton.$retstring;
6974 6974
 					}
6975 6975
 
6976 6976
 					$retstring .= '</div>';
6977
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6978
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6979
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6977
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6978
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6979
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6980 6980
 				} else {
6981 6981
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
6982 6982
 				}
6983 6983
 			} else {
6984 6984
 				// Show date with combo selects
6985 6985
 				// Day
6986
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
6986
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
6987 6987
 
6988 6988
 				if ($emptydate || $set_time == -1) {
6989 6989
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6990 6990
 				}
6991 6991
 
6992 6992
 				for ($day = 1; $day <= 31; $day++) {
6993
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
6993
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
6994 6994
 				}
6995 6995
 
6996 6996
 				$retstring .= "</select>";
6997 6997
 
6998
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
6998
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
6999 6999
 				if ($emptydate || $set_time == -1) {
7000 7000
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7001 7001
 				}
7002 7002
 
7003 7003
 				// Month
7004 7004
 				for ($month = 1; $month <= 12; $month++) {
7005
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
7005
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
7006 7006
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
7007 7007
 					$retstring .= "</option>";
7008 7008
 				}
@@ -7010,13 +7010,13 @@  discard block
 block discarded – undo
7010 7010
 
7011 7011
 				// Year
7012 7012
 				if ($emptydate || $set_time == -1) {
7013
-					$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 . '">';
7013
+					$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.'">';
7014 7014
 				} else {
7015
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
7015
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
7016 7016
 
7017 7017
 					$syear = (int) $syear;
7018 7018
 					for ($year = $syear - 10; $year < (int) $syear + 10; $year++) {
7019
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
7019
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
7020 7020
 					}
7021 7021
 					$retstring .= "</select>\n";
7022 7022
 				}
@@ -7040,15 +7040,15 @@  discard block
 block discarded – undo
7040 7040
 				}
7041 7041
 			}
7042 7042
 			// Show hour
7043
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
7043
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
7044 7044
 			if ($emptyhours) {
7045 7045
 				$retstring .= '<option value="-1">&nbsp;</option>';
7046 7046
 			}
7047 7047
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
7048 7048
 				if (strlen($hour) < 2) {
7049
-					$hour = "0" . $hour;
7049
+					$hour = "0".$hour;
7050 7050
 				}
7051
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7051
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7052 7052
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7053 7053
 				$retstring .= '</option>';
7054 7054
 			}
@@ -7061,17 +7061,17 @@  discard block
 block discarded – undo
7061 7061
 
7062 7062
 		if ($m) {
7063 7063
 			// Show minutes
7064
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7064
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7065 7065
 			if ($emptyhours) {
7066 7066
 				$retstring .= '<option value="-1">&nbsp;</option>';
7067 7067
 			}
7068 7068
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7069 7069
 				$min_str = sprintf("%02d", $min);
7070
-				$retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>';
7070
+				$retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>';
7071 7071
 			}
7072 7072
 			$retstring .= '</select>';
7073 7073
 
7074
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7074
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7075 7075
 		}
7076 7076
 
7077 7077
 		if ($d && $h) {
@@ -7094,10 +7094,10 @@  discard block
 block discarded – undo
7094 7094
 
7095 7095
 			// Generate the date part, depending on the use or not of the javascript calendar
7096 7096
 			if ($addnowlink == 1) { // server time expressed in user time setup
7097
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7098
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7099
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7100
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7097
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7098
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7099
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7100
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7101 7101
 			} elseif ($addnowlink == 2) {
7102 7102
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7103 7103
 				 * This break application for foreign languages.
@@ -7106,10 +7106,10 @@  discard block
 block discarded – undo
7106 7106
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7107 7107
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7108 7108
 				*/
7109
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7110
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7111
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7112
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7109
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7110
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7111
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7112
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7113 7113
 			}
7114 7114
 			/*if ($usecalendar == "eldy")
7115 7115
 			{
@@ -7129,11 +7129,11 @@  discard block
 block discarded – undo
7129 7129
 				}
7130 7130
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7131 7131
 				if ($addnowlink == 1) {
7132
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7133
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7132
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7133
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7134 7134
 				} elseif ($addnowlink == 2) {
7135
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7136
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7135
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7136
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7137 7137
 				}
7138 7138
 
7139 7139
 				if ($fullday) {
@@ -7147,11 +7147,11 @@  discard block
 block discarded – undo
7147 7147
 				}
7148 7148
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7149 7149
 				if ($addnowlink == 1) {
7150
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7151
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7150
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7151
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7152 7152
 				} elseif ($addnowlink == 2) {
7153
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7154
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7153
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7154
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7155 7155
 				}
7156 7156
 				if ($fullday) {
7157 7157
 					$reset_scripts .= ' } ';
@@ -7159,7 +7159,7 @@  discard block
 block discarded – undo
7159 7159
 			}
7160 7160
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7161 7161
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7162
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7162
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7163 7163
 				$retstring .= $langs->trans("Now");
7164 7164
 				$retstring .= '</button> ';
7165 7165
 			}
@@ -7171,16 +7171,16 @@  discard block
 block discarded – undo
7171 7171
 			$reset_scripts = "";
7172 7172
 
7173 7173
 			// Generate the date part, depending on the use or not of the javascript calendar
7174
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7175
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7176
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7177
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7174
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7175
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7176
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7177
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7178 7178
 			// Update the hour part
7179 7179
 			if ($h) {
7180 7180
 				if ($fullday) {
7181 7181
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7182 7182
 				}
7183
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7183
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7184 7184
 				if ($fullday) {
7185 7185
 					$reset_scripts .= ' } ';
7186 7186
 				}
@@ -7190,14 +7190,14 @@  discard block
 block discarded – undo
7190 7190
 				if ($fullday) {
7191 7191
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7192 7192
 				}
7193
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7193
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7194 7194
 				if ($fullday) {
7195 7195
 					$reset_scripts .= ' } ';
7196 7196
 				}
7197 7197
 			}
7198 7198
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7199 7199
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7200
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7200
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7201 7201
 				$retstring .= $langs->trans("DateStartPlusOne");
7202 7202
 				$retstring .= '</button> ';
7203 7203
 			}
@@ -7255,17 +7255,17 @@  discard block
 block discarded – undo
7255 7255
 			unset($TDurationTypes[$value]);
7256 7256
 		}
7257 7257
 
7258
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7258
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7259 7259
 		foreach ($TDurationTypes as $key => $typeduration) {
7260
-			$retstring .= '<option value="' . $key . '"';
7260
+			$retstring .= '<option value="'.$key.'"';
7261 7261
 			if ($key == $selected) {
7262 7262
 				$retstring .= " selected";
7263 7263
 			}
7264
-			$retstring .= ">" . $typeduration . "</option>";
7264
+			$retstring .= ">".$typeduration."</option>";
7265 7265
 		}
7266 7266
 		$retstring .= "</select>";
7267 7267
 
7268
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7268
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7269 7269
 
7270 7270
 		return $retstring;
7271 7271
 	}
@@ -7297,30 +7297,30 @@  discard block
 block discarded – undo
7297 7297
 
7298 7298
 		// Hours
7299 7299
 		if ($iSecond != '') {
7300
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7300
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7301 7301
 
7302 7302
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7303 7303
 			$minSelected = convertSecondToTime($iSecond, 'min');
7304 7304
 		}
7305 7305
 
7306 7306
 		if ($typehour == 'select') {
7307
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7307
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7308 7308
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7309
-				$retstring .= '<option value="' . $hour . '"';
7309
+				$retstring .= '<option value="'.$hour.'"';
7310 7310
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7311 7311
 					$retstring .= " selected";
7312 7312
 				}
7313
-				$retstring .= ">" . $hour . "</option>";
7313
+				$retstring .= ">".$hour."</option>";
7314 7314
 			}
7315 7315
 			$retstring .= "</select>";
7316 7316
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7317
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7317
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7318 7318
 		} else {
7319 7319
 			return 'BadValueForParameterTypeHour';
7320 7320
 		}
7321 7321
 
7322 7322
 		if ($typehour != 'text') {
7323
-			$retstring .= ' ' . $langs->trans('HourShort');
7323
+			$retstring .= ' '.$langs->trans('HourShort');
7324 7324
 		} else {
7325 7325
 			$retstring .= '<span class="">:</span>';
7326 7326
 		}
@@ -7335,21 +7335,21 @@  discard block
 block discarded – undo
7335 7335
 		}
7336 7336
 
7337 7337
 		if ($typehour == 'select' || $typehour == 'textselect') {
7338
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7338
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7339 7339
 			for ($min = 0; $min <= 55; $min += 5) {
7340
-				$retstring .= '<option value="' . $min . '"';
7340
+				$retstring .= '<option value="'.$min.'"';
7341 7341
 				if (is_numeric($minSelected) && $minSelected == $min) {
7342 7342
 					$retstring .= ' selected';
7343 7343
 				}
7344
-				$retstring .= '>' . $min . '</option>';
7344
+				$retstring .= '>'.$min.'</option>';
7345 7345
 			}
7346 7346
 			$retstring .= "</select>";
7347 7347
 		} elseif ($typehour == 'text') {
7348
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7348
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7349 7349
 		}
7350 7350
 
7351 7351
 		if ($typehour != 'text') {
7352
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7352
+			$retstring .= ' '.$langs->trans('MinuteShort');
7353 7353
 		}
7354 7354
 
7355 7355
 		$retstring .= "</span>";
@@ -7397,7 +7397,7 @@  discard block
 block discarded – undo
7397 7397
 			$placeholder = '';
7398 7398
 
7399 7399
 			if ($selected && empty($selected_input_value)) {
7400
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7400
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7401 7401
 				$tickettmpselect = new Ticket($this->db);
7402 7402
 				$tickettmpselect->fetch($selected);
7403 7403
 				$selected_input_value = $tickettmpselect->ref;
@@ -7405,17 +7405,17 @@  discard block
 block discarded – undo
7405 7405
 			}
7406 7406
 
7407 7407
 			$urloption = '';
7408
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7408
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7409 7409
 
7410 7410
 			if (empty($hidelabel)) {
7411
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7411
+				$out .= $langs->trans("RefOrLabel").' : ';
7412 7412
 			} elseif ($hidelabel > 1) {
7413
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7413
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7414 7414
 				if ($hidelabel == 2) {
7415 7415
 					$out .= img_picto($langs->trans("Search"), 'search');
7416 7416
 				}
7417 7417
 			}
7418
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7418
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7419 7419
 			if ($hidelabel == 3) {
7420 7420
 				$out .= img_picto($langs->trans("Search"), 'search');
7421 7421
 			}
@@ -7459,8 +7459,8 @@  discard block
 block discarded – undo
7459 7459
 
7460 7460
 		$sql = "SELECT ";
7461 7461
 		$sql .= $selectFields;
7462
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7463
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7462
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7463
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7464 7464
 
7465 7465
 		// Add criteria on ref/label
7466 7466
 		if ($filterkey != '') {
@@ -7476,7 +7476,7 @@  discard block
 block discarded – undo
7476 7476
 				if ($i > 0) {
7477 7477
 					$sql .= " AND ";
7478 7478
 				}
7479
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7479
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7480 7480
 				$sql .= ")";
7481 7481
 				$i++;
7482 7482
 			}
@@ -7489,22 +7489,22 @@  discard block
 block discarded – undo
7489 7489
 		$sql .= $this->db->plimit($limit, 0);
7490 7490
 
7491 7491
 		// Build output string
7492
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7492
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7493 7493
 		$result = $this->db->query($sql);
7494 7494
 		if ($result) {
7495
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7496
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7495
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7496
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7497 7497
 
7498 7498
 			$num = $this->db->num_rows($result);
7499 7499
 
7500 7500
 			$events = array();
7501 7501
 
7502 7502
 			if (!$forcecombo) {
7503
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7503
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7504 7504
 				$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT);
7505 7505
 			}
7506 7506
 
7507
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7507
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7508 7508
 
7509 7509
 			$textifempty = '';
7510 7510
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7521,7 +7521,7 @@  discard block
 block discarded – undo
7521 7521
 				}
7522 7522
 			}
7523 7523
 			if ($showempty) {
7524
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7524
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7525 7525
 			}
7526 7526
 
7527 7527
 			$i = 0;
@@ -7576,13 +7576,13 @@  discard block
 block discarded – undo
7576 7576
 		$outref = $objp->ref;
7577 7577
 		$outtype = $objp->fk_product_type;
7578 7578
 
7579
-		$opt = '<option value="' . $objp->rowid . '"';
7579
+		$opt = '<option value="'.$objp->rowid.'"';
7580 7580
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7581 7581
 		$opt .= '>';
7582 7582
 		$opt .= $objp->ref;
7583 7583
 		$objRef = $objp->ref;
7584 7584
 		if (!empty($filterkey) && $filterkey != '') {
7585
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7585
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7586 7586
 		}
7587 7587
 
7588 7588
 		$opt .= "</option>\n";
@@ -7623,7 +7623,7 @@  discard block
 block discarded – undo
7623 7623
 			$placeholder = '';
7624 7624
 
7625 7625
 			if ($selected && empty($selected_input_value)) {
7626
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7626
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7627 7627
 				$projecttmpselect = new Project($this->db);
7628 7628
 				$projecttmpselect->fetch($selected);
7629 7629
 				$selected_input_value = $projecttmpselect->ref;
@@ -7631,17 +7631,17 @@  discard block
 block discarded – undo
7631 7631
 			}
7632 7632
 
7633 7633
 			$urloption = '';
7634
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7634
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7635 7635
 
7636 7636
 			if (empty($hidelabel)) {
7637
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7637
+				$out .= $langs->trans("RefOrLabel").' : ';
7638 7638
 			} elseif ($hidelabel > 1) {
7639
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7639
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7640 7640
 				if ($hidelabel == 2) {
7641 7641
 					$out .= img_picto($langs->trans("Search"), 'search');
7642 7642
 				}
7643 7643
 			}
7644
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7644
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7645 7645
 			if ($hidelabel == 3) {
7646 7646
 				$out .= img_picto($langs->trans("Search"), 'search');
7647 7647
 			}
@@ -7684,8 +7684,8 @@  discard block
 block discarded – undo
7684 7684
 
7685 7685
 		$sql = "SELECT ";
7686 7686
 		$sql .= $selectFields;
7687
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7688
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7687
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7688
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7689 7689
 
7690 7690
 		// Add criteria on ref/label
7691 7691
 		if ($filterkey != '') {
@@ -7701,7 +7701,7 @@  discard block
 block discarded – undo
7701 7701
 				if ($i > 0) {
7702 7702
 					$sql .= " AND ";
7703 7703
 				}
7704
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7704
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7705 7705
 				$sql .= "";
7706 7706
 				$i++;
7707 7707
 			}
@@ -7714,22 +7714,22 @@  discard block
 block discarded – undo
7714 7714
 		$sql .= $this->db->plimit($limit, 0);
7715 7715
 
7716 7716
 		// Build output string
7717
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7717
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7718 7718
 		$result = $this->db->query($sql);
7719 7719
 		if ($result) {
7720
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7721
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7720
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7721
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7722 7722
 
7723 7723
 			$num = $this->db->num_rows($result);
7724 7724
 
7725 7725
 			$events = array();
7726 7726
 
7727 7727
 			if (!$forcecombo) {
7728
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7728
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7729 7729
 				$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
7730 7730
 			}
7731 7731
 
7732
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7732
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7733 7733
 
7734 7734
 			$textifempty = '';
7735 7735
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7746,7 +7746,7 @@  discard block
 block discarded – undo
7746 7746
 				}
7747 7747
 			}
7748 7748
 			if ($showempty) {
7749
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7749
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7750 7750
 			}
7751 7751
 
7752 7752
 			$i = 0;
@@ -7804,13 +7804,13 @@  discard block
 block discarded – undo
7804 7804
 		$outlabel = $objp->label;
7805 7805
 		$outtype = $objp->fk_product_type;
7806 7806
 
7807
-		$opt = '<option value="' . $objp->rowid . '"';
7807
+		$opt = '<option value="'.$objp->rowid.'"';
7808 7808
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7809 7809
 		$opt .= '>';
7810 7810
 		$opt .= $objp->ref;
7811 7811
 		$objRef = $objp->ref;
7812 7812
 		if (!empty($filterkey) && $filterkey != '') {
7813
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7813
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7814 7814
 		}
7815 7815
 
7816 7816
 		$opt .= "</option>\n";
@@ -7852,7 +7852,7 @@  discard block
 block discarded – undo
7852 7852
 			$placeholder = '';
7853 7853
 
7854 7854
 			if ($selected && empty($selected_input_value)) {
7855
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7855
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7856 7856
 				$adherenttmpselect = new Adherent($this->db);
7857 7857
 				$adherenttmpselect->fetch($selected);
7858 7858
 				$selected_input_value = $adherenttmpselect->ref;
@@ -7861,17 +7861,17 @@  discard block
 block discarded – undo
7861 7861
 
7862 7862
 			$urloption = '';
7863 7863
 
7864
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7864
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7865 7865
 
7866 7866
 			if (empty($hidelabel)) {
7867
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7867
+				$out .= $langs->trans("RefOrLabel").' : ';
7868 7868
 			} elseif ($hidelabel > 1) {
7869
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7869
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7870 7870
 				if ($hidelabel == 2) {
7871 7871
 					$out .= img_picto($langs->trans("Search"), 'search');
7872 7872
 				}
7873 7873
 			}
7874
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7874
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7875 7875
 			if ($hidelabel == 3) {
7876 7876
 				$out .= img_picto($langs->trans("Search"), 'search');
7877 7877
 			}
@@ -7916,8 +7916,8 @@  discard block
 block discarded – undo
7916 7916
 
7917 7917
 		$sql = "SELECT ";
7918 7918
 		$sql .= $selectFields;
7919
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
7920
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
7919
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
7920
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
7921 7921
 
7922 7922
 		// Add criteria on ref/label
7923 7923
 		if ($filterkey != '') {
@@ -7933,8 +7933,8 @@  discard block
 block discarded – undo
7933 7933
 				if ($i > 0) {
7934 7934
 					$sql .= " AND ";
7935 7935
 				}
7936
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7937
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
7936
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
7937
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
7938 7938
 				$i++;
7939 7939
 			}
7940 7940
 			if (count($search_crit) > 1) {
@@ -7943,27 +7943,27 @@  discard block
 block discarded – undo
7943 7943
 			$sql .= ')';
7944 7944
 		}
7945 7945
 		if ($status != -1) {
7946
-			$sql .= ' AND statut = ' . ((int) $status);
7946
+			$sql .= ' AND statut = '.((int) $status);
7947 7947
 		}
7948 7948
 		$sql .= $this->db->plimit($limit, 0);
7949 7949
 
7950 7950
 		// Build output string
7951
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
7951
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
7952 7952
 		$result = $this->db->query($sql);
7953 7953
 		if ($result) {
7954
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7955
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
7954
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7955
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
7956 7956
 
7957 7957
 			$num = $this->db->num_rows($result);
7958 7958
 
7959 7959
 			$events = array();
7960 7960
 
7961 7961
 			if (!$forcecombo) {
7962
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7962
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7963 7963
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
7964 7964
 			}
7965 7965
 
7966
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7966
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7967 7967
 
7968 7968
 			$textifempty = '';
7969 7969
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7980,7 +7980,7 @@  discard block
 block discarded – undo
7980 7980
 				}
7981 7981
 			}
7982 7982
 			if ($showempty) {
7983
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
7983
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
7984 7984
 			}
7985 7985
 
7986 7986
 			$i = 0;
@@ -8036,11 +8036,11 @@  discard block
 block discarded – undo
8036 8036
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
8037 8037
 		$outtype = $objp->fk_adherent_type;
8038 8038
 
8039
-		$opt = '<option value="' . $objp->rowid . '"';
8039
+		$opt = '<option value="'.$objp->rowid.'"';
8040 8040
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8041 8041
 		$opt .= '>';
8042 8042
 		if (!empty($filterkey) && $filterkey != '') {
8043
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
8043
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
8044 8044
 		}
8045 8045
 		$opt .= $outlabel;
8046 8046
 		$opt .= "</option>\n";
@@ -8075,8 +8075,8 @@  discard block
 block discarded – undo
8075 8075
 		$objectdescorig = $objectdesc;
8076 8076
 		$objecttmp = null;
8077 8077
 		$InfoFieldList = array();
8078
-		$filter = '';  // Ensure filter has value (for static analysis)
8079
-		$sortfield = '';  // Ensure filter has value (for static analysis)
8078
+		$filter = ''; // Ensure filter has value (for static analysis)
8079
+		$sortfield = ''; // Ensure filter has value (for static analysis)
8080 8080
 
8081 8081
 		if ($objectfield) {	// We must retrieve the objectdesc from the field or extrafield
8082 8082
 			// Example: $objectfield = 'product:options_package'
@@ -8115,9 +8115,9 @@  discard block
 block discarded – undo
8115 8115
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8116 8116
 			$reg = array();
8117 8117
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8118
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8118
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8119 8119
 			}
8120
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8120
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8121 8121
 
8122 8122
 			$classname = $InfoFieldList[0];
8123 8123
 			$classpath = $InfoFieldList[1];
@@ -8148,8 +8148,8 @@  discard block
 block discarded – undo
8148 8148
 		);
8149 8149
 
8150 8150
 		if (!is_object($objecttmp)) {
8151
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield, LOG_WARNING);
8152
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield;
8151
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield, LOG_WARNING);
8152
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield;
8153 8153
 		}
8154 8154
 		'@phan-var-force CommonObject $objecttmp';
8155 8155
 
@@ -8161,9 +8161,9 @@  discard block
 block discarded – undo
8161 8161
 		if ($prefixforautocompletemode == 'product') {
8162 8162
 			$prefixforautocompletemode = 'produit';
8163 8163
 		}
8164
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8164
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8165 8165
 
8166
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8166
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8167 8167
 
8168 8168
 		// Generate the combo HTML component
8169 8169
 		$out = '';
@@ -8192,13 +8192,13 @@  discard block
 block discarded – undo
8192 8192
 			}
8193 8193
 
8194 8194
 			// Set url and param to call to get json of the search results
8195
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8196
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8195
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8196
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8197 8197
 
8198 8198
 			// Activate the auto complete using ajax call.
8199 8199
 			$out .= ajax_autocompleter($preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0);
8200 8200
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8201
-			$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) . '"' : '') . ' />';
8201
+			$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).'"' : '').' />';
8202 8202
 		} else {
8203 8203
 			// Immediate load of table record.
8204 8204
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8238,16 +8238,16 @@  discard block
 block discarded – undo
8238 8238
 		if ($prefixforautocompletemode == 'societe') {
8239 8239
 			$prefixforautocompletemode = 'company';
8240 8240
 		}
8241
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8241
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8242 8242
 
8243 8243
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8244 8244
 			$tmpfieldstoshow = '';
8245 8245
 			foreach ($objecttmp->fields as $key => $val) {
8246
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
8246
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
8247 8247
 					continue;
8248 8248
 				}
8249 8249
 				if (!empty($val['showoncombobox'])) {
8250
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8250
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8251 8251
 				}
8252 8252
 			}
8253 8253
 			if ($tmpfieldstoshow) {
@@ -8275,18 +8275,18 @@  discard block
 block discarded – undo
8275 8275
 		$num = 0;
8276 8276
 
8277 8277
 		// Search data
8278
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8278
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8279 8279
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8280
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object";
8280
+			$sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object";
8281 8281
 		}
8282 8282
 		if (isset($objecttmp->ismultientitymanaged)) {
8283 8283
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8284 8284
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8285
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8285
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8286 8286
 			}
8287 8287
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8288 8288
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8289
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8289
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8290 8290
 				}
8291 8291
 			}
8292 8292
 		}
@@ -8306,21 +8306,21 @@  discard block
 block discarded – undo
8306 8306
 			$sql .= " WHERE 1=1";
8307 8307
 			if (isset($objecttmp->ismultientitymanaged)) {
8308 8308
 				if ($objecttmp->ismultientitymanaged == 1) {
8309
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8309
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8310 8310
 				}
8311 8311
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8312
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8312
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8313 8313
 				}
8314 8314
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8315 8315
 					if ($objecttmp->element == 'societe') {
8316
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8316
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8317 8317
 					} else {
8318
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8318
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8319 8319
 					}
8320 8320
 				}
8321 8321
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8322 8322
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8323
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8323
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8324 8324
 					}
8325 8325
 				}
8326 8326
 			}
@@ -8332,7 +8332,7 @@  discard block
 block discarded – undo
8332 8332
 				$errormessage = '';
8333 8333
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8334 8334
 				if ($errormessage) {
8335
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8335
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8336 8336
 				}
8337 8337
 			}
8338 8338
 		}
@@ -8344,7 +8344,7 @@  discard block
 block discarded – undo
8344 8344
 		$resql = $this->db->query($sql);
8345 8345
 		if ($resql) {
8346 8346
 			// Construct $out and $outarray
8347
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8347
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8348 8348
 
8349 8349
 			// 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
8350 8350
 			$textifempty = '&nbsp;';
@@ -8358,7 +8358,7 @@  discard block
 block discarded – undo
8358 8358
 				}
8359 8359
 			}
8360 8360
 			if ($showempty) {
8361
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8361
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8362 8362
 			}
8363 8363
 
8364 8364
 			$num = $this->db->num_rows($resql);
@@ -8381,9 +8381,9 @@  discard block
 block discarded – undo
8381 8381
 					}
8382 8382
 					if (empty($outputmode)) {
8383 8383
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8384
-							$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>';
8384
+							$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>';
8385 8385
 						} else {
8386
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8386
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8387 8387
 						}
8388 8388
 					} else {
8389 8389
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8396,10 +8396,10 @@  discard block
 block discarded – undo
8396 8396
 				}
8397 8397
 			}
8398 8398
 
8399
-			$out .= '</select>' . "\n";
8399
+			$out .= '</select>'."\n";
8400 8400
 
8401 8401
 			if (!$forcecombo) {
8402
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8402
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8403 8403
 				$out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0));
8404 8404
 			}
8405 8405
 		} else {
@@ -8462,8 +8462,8 @@  discard block
 block discarded – undo
8462 8462
 			}
8463 8463
 		}
8464 8464
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8465
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8466
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8465
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8466
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8467 8467
 		$out .= '>'."\n";
8468 8468
 
8469 8469
 		if ($show_empty) {
@@ -8474,7 +8474,7 @@  discard block
 block discarded – undo
8474 8474
 			if (!is_numeric($show_empty)) {
8475 8475
 				$textforempty = $show_empty;
8476 8476
 			}
8477
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8477
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8478 8478
 		}
8479 8479
 		if (is_array($array)) {
8480 8480
 			// Translate
@@ -8499,7 +8499,7 @@  discard block
 block discarded – undo
8499 8499
 					$value = $tmpvalue['label'];
8500 8500
 					$valuehtml = $tmpvalue['data-html'];
8501 8501
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8502
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8502
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8503 8503
 				} else {
8504 8504
 					$value = $tmpvalue;
8505 8505
 					$valuehtml = $tmpvalue;
@@ -8515,9 +8515,9 @@  discard block
 block discarded – undo
8515 8515
 				}
8516 8516
 				if ($key_in_label) {
8517 8517
 					if (empty($nohtmlescape)) {
8518
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8518
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8519 8519
 					} else {
8520
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8520
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8521 8521
 					}
8522 8522
 				} else {
8523 8523
 					if (empty($nohtmlescape)) {
@@ -8529,8 +8529,8 @@  discard block
 block discarded – undo
8529 8529
 						$selectOptionValue = '&nbsp;';
8530 8530
 					}
8531 8531
 				}
8532
-				$out .= '<option value="' . $key . '"';
8533
-				$out .= $style . $disabled;
8532
+				$out .= '<option value="'.$key.'"';
8533
+				$out .= $style.$disabled;
8534 8534
 				if (is_array($id)) {
8535 8535
 					if (in_array($key, $id) && !$disabled) {
8536 8536
 						$out .= ' selected'; // To preselect a value
@@ -8542,7 +8542,7 @@  discard block
 block discarded – undo
8542 8542
 					}
8543 8543
 				}
8544 8544
 				if (!empty($nohtmlescape)) {	// deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content.
8545
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8545
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8546 8546
 				}
8547 8547
 
8548 8548
 				if (is_array($tmpvalue)) {
@@ -8561,7 +8561,7 @@  discard block
 block discarded – undo
8561 8561
 		// Add code for jquery to use multiselect
8562 8562
 		if ($addjscombo && $jsbeautify) {
8563 8563
 			// Enhance with select2
8564
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8564
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8565 8565
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
8566 8566
 		}
8567 8567
 
@@ -8589,28 +8589,28 @@  discard block
 block discarded – undo
8589 8589
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8590 8590
 	{
8591 8591
 		global $conf, $langs;
8592
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8592
+		global $delayedhtmlcontent; // Will be used later outside of this function
8593 8593
 
8594 8594
 		// TODO Use an internal dolibarr component instead of select2
8595 8595
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8596 8596
 			return '';
8597 8597
 		}
8598 8598
 
8599
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8599
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8600 8600
 
8601 8601
 		$outdelayed = '';
8602 8602
 		if (!empty($conf->use_javascript_ajax)) {
8603 8603
 			$tmpplugin = 'select2';
8604
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8605
-		    	<script nonce="' . getNonce() . '">
8604
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8605
+		    	<script nonce="' . getNonce().'">
8606 8606
 		    	$(document).ready(function () {
8607 8607
 
8608
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8608
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8609 8609
 
8610
-	                $(".' . $htmlname . '").select2({
8610
+	                $(".' . $htmlname.'").select2({
8611 8611
 				    	ajax: {
8612 8612
 					    	dir: "ltr",
8613
-					    	url: "' . $url . '",
8613
+					    	url: "' . $url.'",
8614 8614
 					    	dataType: \'json\',
8615 8615
 					    	delay: 250,
8616 8616
 					    	data: function (params) {
@@ -8637,9 +8637,9 @@  discard block
 block discarded – undo
8637 8637
 				    	},
8638 8638
 		 				language: select2arrayoflanguage,
8639 8639
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8640
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8640
+					    placeholder: "' . dol_escape_js($placeholder).'",
8641 8641
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8642
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8642
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8643 8643
 				        formatResult: function (result, container, query, escapeMarkup) {
8644 8644
 	                        return escapeMarkup(result.text);
8645 8645
 	                    },
@@ -8647,10 +8647,10 @@  discard block
 block discarded – undo
8647 8647
 
8648 8648
 	                ' . ($callurlonselect ? '
8649 8649
 	                /* Code to execute a GET when we select a value */
8650
-	                $(".' . $htmlname . '").change(function() {
8651
-				    	var selected = $(".' . $htmlname . '").val();
8650
+	                $(".' . $htmlname.'").change(function() {
8651
+				    	var selected = $(".' . $htmlname.'").val();
8652 8652
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8653
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8653
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8654 8654
 	    			    $.each( saveRemoteData, function( key, value ) {
8655 8655
 	    				        if (key == selected)
8656 8656
 	    			            {
@@ -8658,7 +8658,7 @@  discard block
 block discarded – undo
8658 8658
 	    			                 location.assign(value.url);
8659 8659
 	    			            }
8660 8660
 	                    });
8661
-	    			});' : '') . '
8661
+	    			});' : '').'
8662 8662
 
8663 8663
 	    	   });
8664 8664
 		       </script>';
@@ -8694,14 +8694,14 @@  discard block
 block discarded – undo
8694 8694
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8695 8695
 	{
8696 8696
 		global $conf, $langs;
8697
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8697
+		global $delayedhtmlcontent; // Will be used later outside of this function
8698 8698
 
8699 8699
 		// TODO Use an internal dolibarr component instead of select2
8700 8700
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8701 8701
 			return '';
8702 8702
 		}
8703 8703
 
8704
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8704
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8705 8705
 
8706 8706
 		$formattedarrayresult = array();
8707 8707
 
@@ -8716,20 +8716,20 @@  discard block
 block discarded – undo
8716 8716
 		$outdelayed = '';
8717 8717
 		if (!empty($conf->use_javascript_ajax)) {
8718 8718
 			$tmpplugin = 'select2';
8719
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8720
-				<script nonce="' . getNonce() . '">
8719
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8720
+				<script nonce="' . getNonce().'">
8721 8721
 				$(document).ready(function () {
8722
-					var data = ' . json_encode($formattedarrayresult) . ';
8722
+					var data = ' . json_encode($formattedarrayresult).';
8723 8723
 
8724
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8724
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8725 8725
 
8726
-					$(".' . $htmlname . '").select2({
8726
+					$(".' . $htmlname.'").select2({
8727 8727
 						data: data,
8728 8728
 						language: select2arrayoflanguage,
8729 8729
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8730
-						placeholder: "' . dol_escape_js($placeholder) . '",
8730
+						placeholder: "' . dol_escape_js($placeholder).'",
8731 8731
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8732
-						minimumInputLength: ' . $minimumInputLength . ',
8732
+						minimumInputLength: ' . $minimumInputLength.',
8733 8733
 						formatResult: function (result, container, query, escapeMarkup) {
8734 8734
 							return escapeMarkup(result.text);
8735 8735
 						},
@@ -8768,11 +8768,11 @@  discard block
 block discarded – undo
8768 8768
 
8769 8769
 					' . ($callurlonselect ? '
8770 8770
 					/* Code to execute a GET when we select a value */
8771
-					$(".' . $htmlname . '").change(function() {
8772
-						var selected = $(".' . $htmlname . '").val();
8771
+					$(".' . $htmlname.'").change(function() {
8772
+						var selected = $(".' . $htmlname.'").val();
8773 8773
 						console.log("We select "+selected)
8774 8774
 
8775
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
8775
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
8776 8776
 						$.each( saveRemoteData, function( key, value ) {
8777 8777
 							if (key == selected)
8778 8778
 							{
@@ -8780,7 +8780,7 @@  discard block
 block discarded – undo
8780 8780
 								location.assign(value.url);
8781 8781
 							}
8782 8782
 						});
8783
-					});' : '') . '
8783
+					});' : '').'
8784 8784
 
8785 8785
 				});
8786 8786
 				</script>';
@@ -8829,7 +8829,7 @@  discard block
 block discarded – undo
8829 8829
 		$useenhancedmultiselect = 0;
8830 8830
 		if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
8831 8831
 			if ($addjscombo) {
8832
-				$useenhancedmultiselect = 1;	// Use the js multiselect in one line. Possible only if $addjscombo not 0.
8832
+				$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
8833 8833
 			}
8834 8834
 		}
8835 8835
 
@@ -8838,7 +8838,7 @@  discard block
 block discarded – undo
8838 8838
 		// submitted to nothing.
8839 8839
 		$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
8840 8840
 		// Output select component
8841
-		$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', (string) $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
8841
+		$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', (string) $width) ? $width : $width.'px').'"' : '').'>'."\n";
8842 8842
 		if (is_array($array) && !empty($array)) {
8843 8843
 			if ($value_as_key) {
8844 8844
 				$array = array_combine($array, $array);
@@ -8859,33 +8859,33 @@  discard block
 block discarded – undo
8859 8859
 						$tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml'];
8860 8860
 					}
8861 8861
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
8862
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
8862
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
8863 8863
 
8864
-					$out .= '<option value="' . $tmpkey . '"';
8864
+					$out .= '<option value="'.$tmpkey.'"';
8865 8865
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
8866 8866
 						$out .= ' selected';
8867 8867
 					}
8868 8868
 					if (!empty($tmplabelhtml)) {
8869
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8869
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8870 8870
 					} else {
8871
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
8872
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8871
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
8872
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8873 8873
 					}
8874 8874
 					$out .= '>';
8875 8875
 					$out .= dol_htmlentitiesbr($newval);
8876
-					$out .= '</option>' . "\n";
8876
+					$out .= '</option>'."\n";
8877 8877
 				}
8878 8878
 			}
8879 8879
 		}
8880
-		$out .= '</select>' . "\n";
8880
+		$out .= '</select>'."\n";
8881 8881
 
8882 8882
 		// Add code for jquery to use multiselect
8883 8883
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
8884
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
8885
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
8884
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
8885
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
8886 8886
 			if ($addjscombo == 1) {
8887 8887
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
8888
-				$out .= 'function formatResult(record, container) {' . "\n";
8888
+				$out .= 'function formatResult(record, container) {'."\n";
8889 8889
 				// If property data-html set, we decode html entities and use this.
8890 8890
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
8891 8891
 				$out .= '	if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {';
@@ -8893,26 +8893,26 @@  discard block
 block discarded – undo
8893 8893
 				$out .= '		return htmlEntityDecodeJs($(record.element).attr("data-html"));';
8894 8894
 				$out .= '	}'."\n";
8895 8895
 				$out .= '	return record.text;';
8896
-				$out .= '}' . "\n";
8897
-				$out .= 'function formatSelection(record) {' . "\n";
8896
+				$out .= '}'."\n";
8897
+				$out .= 'function formatSelection(record) {'."\n";
8898 8898
 				if ($elemtype == 'category') {
8899
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8899
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8900 8900
 				} else {
8901 8901
 					$out .= 'return record.text;';
8902 8902
 				}
8903
-				$out .= '}' . "\n";
8903
+				$out .= '}'."\n";
8904 8904
 				$out .= '$(document).ready(function () {
8905
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
8905
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
8906 8906
 				if ($placeholder) {
8907 8907
 					$out .= '
8908 8908
 								placeholder: {
8909 8909
 								    id: \'-1\',
8910
-								    text: \'' . dol_escape_js($placeholder) . '\'
8910
+								    text: \'' . dol_escape_js($placeholder).'\'
8911 8911
 								  },';
8912 8912
 				}
8913 8913
 				$out .= '		dir: \'ltr\',
8914 8914
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
8915
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
8915
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
8916 8916
 								// Specify format function for dropdown item
8917 8917
 								formatResult: formatResult,
8918 8918
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -8924,21 +8924,21 @@  discard block
 block discarded – undo
8924 8924
 
8925 8925
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
8926 8926
 								 the size only if component is not hidden by default on load */
8927
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
8927
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
8928 8928
 						});' . "\n";
8929 8929
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
8930 8930
 				// Add other js lib
8931 8931
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
8932 8932
 				// ...
8933
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
8933
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
8934 8934
 				$out .= '$(document).ready(function () {
8935
-							$(\'#' . $htmlname . '\').multiSelect({
8935
+							$(\'#' . $htmlname.'\').multiSelect({
8936 8936
 								containerHTML: \'<div class="multi-select-container">\',
8937 8937
 								menuHTML: \'<div class="multi-select-menu">\',
8938
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
8938
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
8939 8939
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
8940 8940
 								activeClass: \'multi-select-container--open\',
8941
-								noneText: \'' . $placeholder . '\'
8941
+								noneText: \'' . $placeholder.'\'
8942 8942
 							});
8943 8943
 						})';
8944 8944
 			}
@@ -8970,7 +8970,7 @@  discard block
 block discarded – undo
8970 8970
 			return '';
8971 8971
 		}
8972 8972
 
8973
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
8973
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
8974 8974
 
8975 8975
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
8976 8976
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -9013,19 +9013,19 @@  discard block
 block discarded – undo
9013 9013
 				}
9014 9014
 
9015 9015
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list
9016
-				$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>';
9017
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
9016
+				$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>';
9017
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
9018 9018
 			}
9019 9019
 		}
9020 9020
 
9021
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
9021
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
9022 9022
 
9023 9023
         <dl class="dropdown">
9024 9024
             <dt>
9025
-            <a href="#' . $htmlname . '">
9026
-              ' . img_picto('', 'list') . '
9025
+            <a href="#' . $htmlname.'">
9026
+              ' . img_picto('', 'list').'
9027 9027
             </a>
9028
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
9028
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
9029 9029
             </dt>
9030 9030
             <dd class="dropdowndd">
9031 9031
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -9037,19 +9037,19 @@  discard block
 block discarded – undo
9037 9037
             </dd>
9038 9038
         </dl>
9039 9039
 
9040
-        <script nonce="' . getNonce() . '" type="text/javascript">
9040
+        <script nonce="' . getNonce().'" type="text/javascript">
9041 9041
           jQuery(document).ready(function () {
9042
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
9042
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
9043 9043
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
9044 9044
 
9045 9045
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
9046 9046
 
9047 9047
                   var title = $(this).val() + ",";
9048 9048
                   if ($(this).is(\':checked\')) {
9049
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
9049
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
9050 9050
                   }
9051 9051
                   else {
9052
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
9052
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
9053 9053
                   }
9054 9054
                   // Now, we submit page
9055 9055
                   //$(this).parents(\'form:first\').submit();
@@ -9080,7 +9080,7 @@  discard block
 block discarded – undo
9080 9080
 	 */
9081 9081
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9082 9082
 	{
9083
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9083
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9084 9084
 
9085 9085
 		$cat = new Categorie($this->db);
9086 9086
 		$categories = $cat->containing($id, $type);
@@ -9090,10 +9090,10 @@  discard block
 block discarded – undo
9090 9090
 			foreach ($categories as $c) {
9091 9091
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
9092 9092
 				foreach ($ways as $way) {
9093
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9093
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9094 9094
 				}
9095 9095
 			}
9096
-			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9096
+			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9097 9097
 		}
9098 9098
 
9099 9099
 		if ($rendermode == 0) {
@@ -9141,15 +9141,15 @@  discard block
 block discarded – undo
9141 9141
 
9142 9142
 
9143 9143
 			print '<div class="div-table-responsive-no-min">';
9144
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9144
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9145 9145
 
9146 9146
 			print '<tr class="liste_titre">';
9147
-			print '<td>' . $langs->trans("Type") . '</td>';
9148
-			print '<td>' . $langs->trans("Ref") . '</td>';
9147
+			print '<td>'.$langs->trans("Type").'</td>';
9148
+			print '<td>'.$langs->trans("Ref").'</td>';
9149 9149
 			print '<td class="center"></td>';
9150
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9151
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9152
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9150
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9151
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9152
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9153 9153
 			print '<td></td>';
9154 9154
 			print '</tr>';
9155 9155
 
@@ -9168,13 +9168,13 @@  discard block
 block discarded – undo
9168 9168
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9169 9169
 					$element = $regs[1];
9170 9170
 					$subelement = $regs[2];
9171
-					$tplpath = $element . '/' . $subelement;
9171
+					$tplpath = $element.'/'.$subelement;
9172 9172
 				}
9173 9173
 				$tplname = 'linkedobjectblock';
9174 9174
 
9175 9175
 				// To work with non standard path
9176 9176
 				if ($objecttype == 'facture') {
9177
-					$tplpath = 'compta/' . $element;
9177
+					$tplpath = 'compta/'.$element;
9178 9178
 					if (!isModEnabled('invoice')) {
9179 9179
 						continue; // Do not show if module disabled
9180 9180
 					}
@@ -9185,7 +9185,7 @@  discard block
 block discarded – undo
9185 9185
 						continue; // Do not show if module disabled
9186 9186
 					}
9187 9187
 				} elseif ($objecttype == 'propal') {
9188
-					$tplpath = 'comm/' . $element;
9188
+					$tplpath = 'comm/'.$element;
9189 9189
 					if (!isModEnabled('propal')) {
9190 9190
 						continue; // Do not show if module disabled
9191 9191
 					}
@@ -9236,7 +9236,7 @@  discard block
 block discarded – undo
9236 9236
 				$linkedObjectBlock = $objects;
9237 9237
 
9238 9238
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9239
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9239
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9240 9240
 				foreach ($dirtpls as $reldir) {
9241 9241
 					$reldir = rtrim($reldir, '/');
9242 9242
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
@@ -9244,7 +9244,7 @@  discard block
 block discarded – undo
9244 9244
 						$noMoreLinkedObjectBlockAfter = 1;
9245 9245
 					}
9246 9246
 
9247
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9247
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9248 9248
 					if ($res) {
9249 9249
 						$nboftypesoutput++;
9250 9250
 						break;
@@ -9253,7 +9253,7 @@  discard block
 block discarded – undo
9253 9253
 			}
9254 9254
 
9255 9255
 			if (!$nboftypesoutput) {
9256
-				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9256
+				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9257 9257
 			}
9258 9258
 
9259 9259
 			print '</table>';
@@ -9293,14 +9293,14 @@  discard block
 block discarded – undo
9293 9293
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9294 9294
 			$listofidcompanytoscan = $object->thirdparty->id;
9295 9295
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9296
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9296
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9297 9297
 			}
9298 9298
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9299
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9299
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9300 9300
 				$tmpproject = new Project($this->db);
9301 9301
 				$tmpproject->fetch($object->fk_project);
9302 9302
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9303
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9303
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9304 9304
 				}
9305 9305
 				unset($tmpproject);
9306 9306
 			}
@@ -9310,63 +9310,63 @@  discard block
 block discarded – undo
9310 9310
 					'enabled' => isModEnabled('propal'),
9311 9311
 					'perms' => 1,
9312 9312
 					'label' => 'LinkToProposal',
9313
-					'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') . ')'),
9313
+					'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').')'),
9314 9314
 				'shipping' => array(
9315 9315
 					'enabled' => isModEnabled('shipping'),
9316 9316
 					'perms' => 1,
9317 9317
 					'label' => 'LinkToExpedition',
9318
-					'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') . ')'),
9318
+					'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').')'),
9319 9319
 				'order' => array(
9320 9320
 					'enabled' => isModEnabled('order'),
9321 9321
 					'perms' => 1,
9322 9322
 					'label' => 'LinkToOrder',
9323
-					'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') . ')'),
9323
+					'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').')'),
9324 9324
 				'invoice' => array(
9325 9325
 					'enabled' => isModEnabled('invoice'),
9326 9326
 					'perms' => 1,
9327 9327
 					'label' => 'LinkToInvoice',
9328
-					'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') . ')'),
9328
+					'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').')'),
9329 9329
 				'invoice_template' => array(
9330 9330
 					'enabled' => isModEnabled('invoice'),
9331 9331
 					'perms' => 1,
9332 9332
 					'label' => 'LinkToTemplateInvoice',
9333
-					'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') . ')'),
9333
+					'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').')'),
9334 9334
 				'contrat' => array(
9335 9335
 					'enabled' => isModEnabled('contract'),
9336 9336
 					'perms' => 1,
9337 9337
 					'label' => 'LinkToContract',
9338 9338
 					'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
9339
-							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'
9339
+							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'
9340 9340
 				),
9341 9341
 				'fichinter' => array(
9342 9342
 					'enabled' => isModEnabled('intervention'),
9343 9343
 					'perms' => 1,
9344 9344
 					'label' => 'LinkToIntervention',
9345
-					'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') . ')'),
9345
+					'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').')'),
9346 9346
 				'supplier_proposal' => array(
9347 9347
 					'enabled' => isModEnabled('supplier_proposal'),
9348 9348
 					'perms' => 1,
9349 9349
 					'label' => 'LinkToSupplierProposal',
9350
-					'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') . ')'),
9350
+					'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').')'),
9351 9351
 				'order_supplier' => array(
9352 9352
 					'enabled' => isModEnabled("supplier_order"),
9353 9353
 					'perms' => 1,
9354 9354
 					'label' => 'LinkToSupplierOrder',
9355
-					'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') . ')'),
9355
+					'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').')'),
9356 9356
 				'invoice_supplier' => array(
9357 9357
 					'enabled' => isModEnabled("supplier_invoice"),
9358 9358
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9359
-					'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') . ')'),
9359
+					'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').')'),
9360 9360
 				'ticket' => array(
9361 9361
 					'enabled' => isModEnabled('ticket'),
9362 9362
 					'perms' => 1,
9363 9363
 					'label' => 'LinkToTicket',
9364
-					'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') . ')'),
9364
+					'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').')'),
9365 9365
 				'mo' => array(
9366 9366
 					'enabled' => isModEnabled('mrp'),
9367 9367
 					'perms' => 1,
9368 9368
 					'label' => 'LinkToMo',
9369
-					'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') . ')')
9369
+					'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').')')
9370 9370
 			);
9371 9371
 		}
9372 9372
 
@@ -9402,22 +9402,22 @@  discard block
 block discarded – undo
9402 9402
 			}
9403 9403
 
9404 9404
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9405
-				print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9405
+				print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9406 9406
 
9407 9407
 				if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9408 9408
 					print '<br>'."\n";
9409 9409
 					print '<!-- form to add a link from anywhere -->'."\n";
9410
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9411
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9410
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9411
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9412 9412
 					print '<input type="hidden" name="action" value="addlinkbyref">';
9413
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9414
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9413
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9414
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9415 9415
 					print '<table class="noborder">';
9416 9416
 					print '<tr>';
9417 9417
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9418
-					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9419
-					print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9420
-					print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9418
+					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9419
+					print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9420
+					print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9421 9421
 					print '</tr>';
9422 9422
 					print '</table>';
9423 9423
 					print '</form>';
@@ -9432,48 +9432,48 @@  discard block
 block discarded – undo
9432 9432
 
9433 9433
 					print '<br>';
9434 9434
 					print '<!-- form to add a link from object to same thirdparty -->'."\n";
9435
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9435
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9436 9436
 					print '<input type="hidden" name="action" value="addlink">';
9437
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9438
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9439
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9437
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9438
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9439
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9440 9440
 					print '<table class="noborder">';
9441 9441
 					print '<tr class="liste_titre">';
9442 9442
 					print '<td class="nowrap"></td>';
9443
-					print '<td class="center">' . $langs->trans("Ref") . '</td>';
9444
-					print '<td class="left">' . $langs->trans("RefCustomer") . '</td>';
9445
-					print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9446
-					print '<td class="left">' . $langs->trans("Company") . '</td>';
9443
+					print '<td class="center">'.$langs->trans("Ref").'</td>';
9444
+					print '<td class="left">'.$langs->trans("RefCustomer").'</td>';
9445
+					print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9446
+					print '<td class="left">'.$langs->trans("Company").'</td>';
9447 9447
 					print '</tr>';
9448 9448
 					while ($i < $num) {
9449 9449
 						$objp = $this->db->fetch_object($resqllist);
9450 9450
 
9451 9451
 						print '<tr class="oddeven">';
9452 9452
 						print '<td class="left">';
9453
-						print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9453
+						print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9454 9454
 						print '</td>';
9455
-						print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9456
-						print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9455
+						print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9456
+						print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9457 9457
 						print '<td class="right">';
9458 9458
 						if ($possiblelink['label'] == 'LinkToContract') {
9459 9459
 							$form = new Form($this->db);
9460
-							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9460
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9461 9461
 						}
9462
-						print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9462
+						print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9463 9463
 						print '</td>';
9464
-						print '<td>' . $objp->name . '</td>';
9464
+						print '<td>'.$objp->name.'</td>';
9465 9465
 						print '</tr>';
9466 9466
 						$i++;
9467 9467
 					}
9468 9468
 					print '</table>';
9469 9469
 					print '<div class="center">';
9470 9470
 					if ($num) {
9471
-						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9471
+						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9472 9472
 					}
9473 9473
 					if (empty($conf->use_javascript_ajax)) {
9474
-						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9474
+						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9475 9475
 					} else {
9476
-						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>';
9476
+						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>';
9477 9477
 					}
9478 9478
 					print '</form>';
9479 9479
 					$this->db->free($resqllist);
@@ -9484,10 +9484,10 @@  discard block
 block discarded – undo
9484 9484
 
9485 9485
 				//$linktoelem.=($linktoelem?' &nbsp; ':'');
9486 9486
 				if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9487
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9487
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9488 9488
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9489 9489
 				} else {
9490
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9490
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9491 9491
 				}
9492 9492
 			}
9493 9493
 		}
@@ -9497,22 +9497,22 @@  discard block
 block discarded – undo
9497 9497
     		<dl class="dropdown" id="linktoobjectname">
9498 9498
     		';
9499 9499
 			if (!empty($conf->use_javascript_ajax)) {
9500
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9500
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9501 9501
 			}
9502 9502
 			$linktoelem .= '<dd>
9503 9503
     		<div class="multiselectlinkto">
9504
-    		<ul class="ulselectedfields">' . $linktoelemlist . '
9504
+    		<ul class="ulselectedfields">' . $linktoelemlist.'
9505 9505
     		</ul>
9506 9506
     		</div>
9507 9507
     		</dd>
9508 9508
     		</dl>';
9509 9509
 		} else {
9510
-			$linktoelem = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
9510
+			$linktoelem = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
9511 9511
 		}
9512 9512
 
9513 9513
 		if (!empty($conf->use_javascript_ajax)) {
9514 9514
 			print '<!-- Add js to show linkto box -->
9515
-				<script nonce="' . getNonce() . '">
9515
+				<script nonce="' . getNonce().'">
9516 9516
 				jQuery(document).ready(function() {
9517 9517
 					jQuery(".linkto").click(function() {
9518 9518
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9553,19 +9553,19 @@  discard block
 block discarded – undo
9553 9553
 
9554 9554
 		$disabled = ($disabled ? ' disabled' : '');
9555 9555
 
9556
-		$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9556
+		$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9557 9557
 		if ($useempty) {
9558
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9558
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9559 9559
 		}
9560 9560
 		if (("$value" == 'yes') || ($value == 1)) {
9561
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9562
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9561
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9562
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9563 9563
 		} else {
9564 9564
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9565
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9566
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9565
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9566
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9567 9567
 		}
9568
-		$resultyesno .= '</select>' . "\n";
9568
+		$resultyesno .= '</select>'."\n";
9569 9569
 
9570 9570
 		if ($addjscombo) {
9571 9571
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9589,12 +9589,12 @@  discard block
 block discarded – undo
9589 9589
 	{
9590 9590
 		// phpcs:enable
9591 9591
 		$sql = "SELECT rowid, label";
9592
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9593
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9592
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9593
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9594 9594
 		$sql .= " ORDER BY rowid";
9595 9595
 		$result = $this->db->query($sql);
9596 9596
 		if ($result) {
9597
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9597
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9598 9598
 			if ($useempty) {
9599 9599
 				print '<option value="-1">&nbsp;</option>';
9600 9600
 			}
@@ -9604,9 +9604,9 @@  discard block
 block discarded – undo
9604 9604
 			while ($i < $num) {
9605 9605
 				$obj = $this->db->fetch_object($result);
9606 9606
 				if ($selected == $obj->rowid) {
9607
-					print '<option value="' . $obj->rowid . '" selected>';
9607
+					print '<option value="'.$obj->rowid.'" selected>';
9608 9608
 				} else {
9609
-					print '<option value="' . $obj->rowid . '">';
9609
+					print '<option value="'.$obj->rowid.'">';
9610 9610
 				}
9611 9611
 				print $obj->label;
9612 9612
 				print '</option>';
@@ -9697,8 +9697,8 @@  discard block
 block discarded – undo
9697 9697
 				$stringforfirstkey .= ' CTL +';
9698 9698
 			}
9699 9699
 
9700
-			$previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
9701
-			$next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
9700
+			$previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>';
9701
+			$next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>';
9702 9702
 		}
9703 9703
 
9704 9704
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9706,18 +9706,18 @@  discard block
 block discarded – undo
9706 9706
 
9707 9707
 		// Right part of banner
9708 9708
 		if ($morehtmlright) {
9709
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9709
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9710 9710
 		}
9711 9711
 
9712 9712
 		if ($previous_ref || $next_ref || $morehtml) {
9713 9713
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9714 9714
 		}
9715 9715
 		if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) {
9716
-			$ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9716
+			$ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9717 9717
 		}
9718 9718
 		if ($shownav && ($previous_ref || $next_ref)) {
9719
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
9720
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
9719
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
9720
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
9721 9721
 		}
9722 9722
 		if ($previous_ref || $next_ref || $morehtml) {
9723 9723
 			$ret .= '</ul></div>';
@@ -9732,7 +9732,7 @@  discard block
 block discarded – undo
9732 9732
 			$morehtmlstatus = $hookmanager->resPrint;
9733 9733
 		}
9734 9734
 		if ($morehtmlstatus) {
9735
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
9735
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
9736 9736
 		}
9737 9737
 
9738 9738
 		$parameters = array();
@@ -9746,14 +9746,14 @@  discard block
 block discarded – undo
9746 9746
 		// Left part of banner
9747 9747
 		if ($morehtmlleft) {
9748 9748
 			if ($conf->browser->layout == 'phone') {
9749
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
9749
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
9750 9750
 			} else {
9751
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
9751
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
9752 9752
 			}
9753 9753
 		}
9754 9754
 
9755 9755
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
9756
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
9756
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
9757 9757
 
9758 9758
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
9759 9759
 		if ($object->element == 'societe') {
@@ -9767,7 +9767,7 @@  discard block
 block discarded – undo
9767 9767
 
9768 9768
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
9769 9769
 				if (!is_object($extralanguages)) {
9770
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
9770
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
9771 9771
 					$extralanguages = new ExtraLanguages($this->db);
9772 9772
 				}
9773 9773
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -9782,27 +9782,27 @@  discard block
 block discarded – undo
9782 9782
 						if ($object->array_languages['name'][$extralangcode]) {
9783 9783
 							$htmltext .= $object->array_languages['name'][$extralangcode];
9784 9784
 						} else {
9785
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
9785
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
9786 9786
 						}
9787 9787
 					}
9788
-					$ret .= '<!-- Show translations of name -->' . "\n";
9788
+					$ret .= '<!-- Show translations of name -->'."\n";
9789 9789
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
9790 9790
 				}
9791 9791
 			}
9792 9792
 		} elseif ($object->element == 'member') {
9793
-			$ret .= $object->ref . '<br>';
9793
+			$ret .= $object->ref.'<br>';
9794 9794
 			$fullname = $object->getFullName($langs);
9795 9795
 			if ($object->morphy == 'mor' && $object->societe) {
9796
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
9796
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
9797 9797
 			} else {
9798
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
9798
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
9799 9799
 			}
9800 9800
 		} elseif (in_array($object->element, array('contact', 'user'))) {
9801
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
9801
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
9802 9802
 		} elseif ($object->element == 'usergroup') {
9803 9803
 			$ret .= dol_htmlentities($object->name);
9804 9804
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
9805
-			$ret .= $object->ref . '<br>' . $object->label;
9805
+			$ret .= $object->ref.'<br>'.$object->label;
9806 9806
 		} elseif (in_array($object->element, array('adherent_type'))) {
9807 9807
 			$ret .= $object->label;
9808 9808
 		} elseif ($object->element == 'ecm_directories') {
@@ -9854,9 +9854,9 @@  discard block
 block discarded – undo
9854 9854
 		}
9855 9855
 
9856 9856
 		// Barcode image
9857
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
9858
-		$out = '<!-- url barcode = ' . $url . ' -->';
9859
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
9857
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
9858
+		$out = '<!-- url barcode = '.$url.' -->';
9859
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
9860 9860
 
9861 9861
 		return $out;
9862 9862
 	}
@@ -9896,28 +9896,28 @@  discard block
 block discarded – undo
9896 9896
 			if (!empty($object->logo)) {
9897 9897
 				if (dolIsAllowedForPreview($object->logo)) {
9898 9898
 					if ((string) $imagesize == 'mini') {
9899
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9899
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9900 9900
 					} elseif ((string) $imagesize == 'small') {
9901
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
9901
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
9902 9902
 					} else {
9903
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9903
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9904 9904
 					}
9905
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9905
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9906 9906
 				}
9907 9907
 			}
9908 9908
 			$email = $object->email;
9909 9909
 		} elseif ($modulepart == 'contact') {
9910
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
9910
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
9911 9911
 			if (!empty($object->photo)) {
9912 9912
 				if (dolIsAllowedForPreview($object->photo)) {
9913 9913
 					if ((string) $imagesize == 'mini') {
9914
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9914
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9915 9915
 					} elseif ((string) $imagesize == 'small') {
9916
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9916
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
9917 9917
 					} else {
9918
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9918
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9919 9919
 					}
9920
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9920
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9921 9921
 				}
9922 9922
 			}
9923 9923
 			$email = $object->email;
@@ -9927,17 +9927,17 @@  discard block
 block discarded – undo
9927 9927
 			if (!empty($object->photo)) {
9928 9928
 				if (dolIsAllowedForPreview($object->photo)) {
9929 9929
 					if ((string) $imagesize == 'mini') {
9930
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9930
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9931 9931
 					} elseif ((string) $imagesize == 'small') {
9932
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9932
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
9933 9933
 					} else {
9934
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9934
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9935 9935
 					}
9936
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9936
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9937 9937
 				}
9938 9938
 			}
9939 9939
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9940
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9940
+				$altfile = $object->id.".jpg"; // For backward compatibility
9941 9941
 			}
9942 9942
 			$email = $object->email;
9943 9943
 			$capture = 'user';
@@ -9946,17 +9946,17 @@  discard block
 block discarded – undo
9946 9946
 			if (!empty($object->photo)) {
9947 9947
 				if (dolIsAllowedForPreview($object->photo)) {
9948 9948
 					if ((string) $imagesize == 'mini') {
9949
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9949
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9950 9950
 					} elseif ((string) $imagesize == 'small') {
9951
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9951
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
9952 9952
 					} else {
9953
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9953
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9954 9954
 					}
9955
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9955
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9956 9956
 				}
9957 9957
 			}
9958 9958
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9959
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9959
+				$altfile = $object->id.".jpg"; // For backward compatibility
9960 9960
 			}
9961 9961
 			$email = $object->email;
9962 9962
 			$capture = 'user';
@@ -9982,35 +9982,35 @@  discard block
 block discarded – undo
9982 9982
 		$ret = '';
9983 9983
 
9984 9984
 		if ($dir) {
9985
-			if ($file && file_exists($dir . "/" . $file)) {
9985
+			if ($file && file_exists($dir."/".$file)) {
9986 9986
 				if ($addlinktofullsize) {
9987
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9987
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9988 9988
 					if ($urladvanced) {
9989
-						$ret .= '<a href="' . $urladvanced . '">';
9989
+						$ret .= '<a href="'.$urladvanced.'">';
9990 9990
 					} else {
9991
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9991
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9992 9992
 					}
9993 9993
 				}
9994
-				$ret .= '<img alt="" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">';
9994
+				$ret .= '<img alt="" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
9995 9995
 				if ($addlinktofullsize) {
9996 9996
 					$ret .= '</a>';
9997 9997
 				}
9998
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
9998
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
9999 9999
 				if ($addlinktofullsize) {
10000
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10000
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10001 10001
 					if ($urladvanced) {
10002
-						$ret .= '<a href="' . $urladvanced . '">';
10002
+						$ret .= '<a href="'.$urladvanced.'">';
10003 10003
 					} else {
10004
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10004
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10005 10005
 					}
10006 10006
 				}
10007
-				$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 . '">';
10007
+				$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.'">';
10008 10008
 				if ($addlinktofullsize) {
10009 10009
 					$ret .= '</a>';
10010 10010
 				}
10011 10011
 			} else {
10012 10012
 				$nophoto = '/public/theme/common/nophoto.png';
10013
-				$defaultimg = 'identicon';        // For gravatar
10013
+				$defaultimg = 'identicon'; // For gravatar
10014 10014
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
10015 10015
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) {
10016 10016
 						$nophoto = 'company';
@@ -10028,13 +10028,13 @@  discard block
 block discarded – undo
10028 10028
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
10029 10029
 					// see https://gravatar.com/site/implement/images/php/
10030 10030
 					$ret .= '<!-- Put link to gravatar -->';
10031
-					$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
10031
+					$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
10032 10032
 				} else {
10033 10033
 					if ($nophoto == 'company') {
10034
-						$ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
10034
+						$ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
10035 10035
 						//$ret .= '<div class="difforspanimgright"></div>';
10036 10036
 					} else {
10037
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
10037
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
10038 10038
 					}
10039 10039
 				}
10040 10040
 			}
@@ -10045,15 +10045,15 @@  discard block
 block discarded – undo
10045 10045
 				}
10046 10046
 				$ret .= '<table class="nobordernopadding centpercent">';
10047 10047
 				if ($object->photo) {
10048
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
10048
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
10049 10049
 				}
10050 10050
 				$ret .= '<tr><td class="tdoverflow">';
10051 10051
 				$maxfilesizearray = getMaxFileSizeArray();
10052 10052
 				$maxmin = $maxfilesizearray['maxmin'];
10053 10053
 				if ($maxmin > 0) {
10054
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
10054
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
10055 10055
 				}
10056
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
10056
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
10057 10057
 				$ret .= '</td></tr>';
10058 10058
 				$ret .= '</table>';
10059 10059
 			}
@@ -10107,38 +10107,38 @@  discard block
 block discarded – undo
10107 10107
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10108 10108
 			$sql .= ", e.label";
10109 10109
 		}
10110
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10110
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10111 10111
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10112
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10112
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10113 10113
 			if ($force_entity) {
10114
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10114
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10115 10115
 			} else {
10116 10116
 				$sql .= " WHERE ug.entity IS NOT NULL";
10117 10117
 			}
10118 10118
 		} else {
10119
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10119
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10120 10120
 		}
10121 10121
 		if (is_array($exclude) && $excludeGroups) {
10122
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10122
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10123 10123
 		}
10124 10124
 		if (is_array($include) && $includeGroups) {
10125
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10125
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10126 10126
 		}
10127 10127
 		$sql .= " ORDER BY ug.nom ASC";
10128 10128
 
10129
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10129
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10130 10130
 		$resql = $this->db->query($sql);
10131 10131
 		if ($resql) {
10132 10132
 			// Enhance with select2
10133
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10133
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10134 10134
 
10135
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10135
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10136 10136
 
10137 10137
 			$num = $this->db->num_rows($resql);
10138 10138
 			$i = 0;
10139 10139
 			if ($num) {
10140 10140
 				if ($show_empty && !$multiple) {
10141
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10141
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10142 10142
 				}
10143 10143
 
10144 10144
 				while ($i < $num) {
@@ -10151,11 +10151,11 @@  discard block
 block discarded – undo
10151 10151
 					$label = $obj->name;
10152 10152
 					$labelhtml = $obj->name;
10153 10153
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10154
-						$label .= " (" . $obj->label . ")";
10155
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10154
+						$label .= " (".$obj->label.")";
10155
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10156 10156
 					}
10157 10157
 
10158
-					$out .= '<option value="' . $obj->rowid . '"';
10158
+					$out .= '<option value="'.$obj->rowid.'"';
10159 10159
 					if ($disableline) {
10160 10160
 						$out .= ' disabled';
10161 10161
 					}
@@ -10171,9 +10171,9 @@  discard block
 block discarded – undo
10171 10171
 				}
10172 10172
 			} else {
10173 10173
 				if ($show_empty) {
10174
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10174
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10175 10175
 				}
10176
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10176
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10177 10177
 			}
10178 10178
 			$out .= '</select>';
10179 10179
 
@@ -10217,25 +10217,25 @@  discard block
 block discarded – undo
10217 10217
 		$out = '';
10218 10218
 
10219 10219
 		if (!empty($conf->use_javascript_ajax)) {
10220
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10220
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10221 10221
 		}
10222
-		$out .= '<script nonce="' . getNonce() . '">
10222
+		$out .= '<script nonce="'.getNonce().'">
10223 10223
             $(document).ready(function() {
10224
-                $("#' . $cssclass . 's").click(function() {
10224
+                $("#' . $cssclass.'s").click(function() {
10225 10225
                     if($(this).is(\':checked\')){
10226
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10227
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10226
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10227
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10228 10228
                     }
10229 10229
                     else
10230 10230
                     {
10231 10231
                         console.log("We uncheck all");
10232
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10232
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10233 10233
                     }' . "\n";
10234 10234
 		if ($calljsfunction) {
10235
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10235
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10236 10236
 		}
10237 10237
 		$out .= '         });
10238
-        	        $(".' . $cssclass . '").change(function() {
10238
+        	        $(".' . $cssclass.'").change(function() {
10239 10239
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10240 10240
 				});
10241 10241
 		 	});
@@ -10280,67 +10280,67 @@  discard block
 block discarded – undo
10280 10280
 		global $langs, $user;
10281 10281
 
10282 10282
 		$out = '';
10283
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10284
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10283
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10284
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10285 10285
 		if (!empty($excludeid)) {
10286
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10286
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10287 10287
 		}
10288 10288
 		$sql .= " ORDER BY label";
10289 10289
 
10290 10290
 		$resql = $this->db->query($sql);
10291 10291
 		if ($resql) {
10292
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10292
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10293 10293
 			if ($useempty) {
10294 10294
 				$out .= '<option value="0">&nbsp;</option>';
10295 10295
 			}
10296 10296
 
10297 10297
 			while ($obj = $this->db->fetch_object($resql)) {
10298
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10298
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10299 10299
 			}
10300 10300
 			$out .= '</select>';
10301
-			$out .= ajax_combobox('select_' . $htmlname);
10301
+			$out .= ajax_combobox('select_'.$htmlname);
10302 10302
 
10303 10303
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10304
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10304
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10305 10305
 			}
10306 10306
 
10307 10307
 			if (!empty($target)) {
10308
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10308
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10309 10309
 				$resql = $this->db->query($sql);
10310 10310
 				if ($resql) {
10311 10311
 					if ($this->db->num_rows($resql) > 0) {
10312 10312
 						$obj = $this->db->fetch_object($resql);
10313
-						$out .= '<script nonce="' . getNonce() . '">
10313
+						$out .= '<script nonce="'.getNonce().'">
10314 10314
 							$(function() {
10315
-								$("select[name=' . $target . ']").on("change", function() {
10315
+								$("select[name=' . $target.']").on("change", function() {
10316 10316
 									var current_val = $(this).val();
10317
-									if (current_val == ' . $obj->id . ') {';
10317
+									if (current_val == ' . $obj->id.') {';
10318 10318
 						if (!empty($default_selected) || !empty($selected)) {
10319
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10319
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10320 10320
 						}
10321 10321
 
10322 10322
 						$out .= '
10323
-										$("select[name=' . $htmlname . ']").change();
10323
+										$("select[name=' . $htmlname.']").change();
10324 10324
 									}
10325 10325
 								});
10326 10326
 
10327
-								$("select[name=' . $htmlname . ']").change(function() {
10327
+								$("select[name=' . $htmlname.']").change(function() {
10328 10328
 
10329
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10329
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10330 10330
 										// get price of kilometer to fill the unit price
10331 10331
 										$.ajax({
10332 10332
 											method: "POST",
10333 10333
 											dataType: "json",
10334
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10335
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '",
10334
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10335
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'",
10336 10336
 										}).done(function( data, textStatus, jqXHR ) {
10337 10337
 											console.log(data);
10338 10338
 											if (typeof data.up != "undefined") {
10339 10339
 												$("input[name=value_unit]").val(data.up);
10340
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10340
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10341 10341
 											} else {
10342 10342
 												$("input[name=value_unit]").val("");
10343
-												$("select[name=' . $htmlname . ']").attr("title", "");
10343
+												$("select[name=' . $htmlname.']").attr("title", "");
10344 10344
 											}
10345 10345
 										});
10346 10346
 									}
@@ -10370,18 +10370,18 @@  discard block
 block discarded – undo
10370 10370
 		global $conf, $langs;
10371 10371
 
10372 10372
 		$out = '';
10373
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10374
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10373
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10374
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10375 10375
 
10376 10376
 		$resql = $this->db->query($sql);
10377 10377
 		if ($resql) {
10378
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10378
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10379 10379
 			if ($useempty) {
10380 10380
 				$out .= '<option value="0"></option>';
10381 10381
 			}
10382 10382
 
10383 10383
 			while ($obj = $this->db->fetch_object($resql)) {
10384
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10384
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10385 10385
 			}
10386 10386
 			$out .= '</select>';
10387 10387
 		} else {
@@ -10412,12 +10412,12 @@  discard block
 block discarded – undo
10412 10412
 
10413 10413
 		$resql = $this->db->query($sql);
10414 10414
 		if ($resql) {
10415
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10415
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10416 10416
 			if ($useempty) {
10417 10417
 				$out .= '<option value="0"></option>';
10418 10418
 			}
10419 10419
 			if ($allchoice) {
10420
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10420
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10421 10421
 			}
10422 10422
 
10423 10423
 			$field = 'code';
@@ -10427,7 +10427,7 @@  discard block
 block discarded – undo
10427 10427
 
10428 10428
 			while ($obj = $this->db->fetch_object($resql)) {
10429 10429
 				$key = $langs->trans($obj->code);
10430
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10430
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10431 10431
 			}
10432 10432
 			$out .= '</select>';
10433 10433
 
@@ -10461,7 +10461,7 @@  discard block
 block discarded – undo
10461 10461
 	{
10462 10462
 		global $user, $conf, $langs;
10463 10463
 
10464
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10464
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10465 10465
 
10466 10466
 		if (is_null($usertofilter)) {
10467 10467
 			$usertofilter = $user;
@@ -10485,10 +10485,10 @@  discard block
 block discarded – undo
10485 10485
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10486 10486
             p.title, p.fk_soc, p.fk_statut, p.public,";
10487 10487
 		$sql .= ' s.nom as name';
10488
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10489
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10490
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10491
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10488
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10489
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10490
+		$sql .= ' '.$this->db->prefix().'facture as f';
10491
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10492 10492
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10493 10493
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10494 10494
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10499,14 +10499,14 @@  discard block
 block discarded – undo
10499 10499
 		if ($resql) {
10500 10500
 			// Use select2 selector
10501 10501
 			if (!empty($conf->use_javascript_ajax)) {
10502
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10502
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10503 10503
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10504 10504
 				$out .= $comboenhancement;
10505 10505
 				$morecss = 'minwidth200imp maxwidth500';
10506 10506
 			}
10507 10507
 
10508 10508
 			if (empty($option_only)) {
10509
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10509
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10510 10510
 			}
10511 10511
 			if (!empty($show_empty)) {
10512 10512
 				$out .= '<option value="0" class="optiongrey">';
@@ -10536,33 +10536,33 @@  discard block
 block discarded – undo
10536 10536
 						if ($showproject == 'all') {
10537 10537
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10538 10538
 							if ($obj->name) {
10539
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10539
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10540 10540
 							}
10541 10541
 
10542 10542
 							$disabled = 0;
10543 10543
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10544 10544
 								$disabled = 1;
10545
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10545
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10546 10546
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10547 10547
 								if ($discard_closed == 2) {
10548 10548
 									$disabled = 1;
10549 10549
 								}
10550
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10550
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10551 10551
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10552 10552
 								$disabled = 1;
10553
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10553
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10554 10554
 							}
10555 10555
 						}
10556 10556
 
10557 10557
 						if (!empty($selected) && $selected == $obj->rowid) {
10558
-							$out .= '<option value="' . $obj->rowid . '" selected';
10558
+							$out .= '<option value="'.$obj->rowid.'" selected';
10559 10559
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10560
-							$out .= '>' . $labeltoshow . '</option>';
10560
+							$out .= '>'.$labeltoshow.'</option>';
10561 10561
 						} else {
10562 10562
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10563 10563
 								$resultat = '';
10564 10564
 							} else {
10565
-								$resultat = '<option value="' . $obj->rowid . '"';
10565
+								$resultat = '<option value="'.$obj->rowid.'"';
10566 10566
 								if ($disabled) {
10567 10567
 									$resultat .= ' disabled';
10568 10568
 								}
@@ -10614,22 +10614,22 @@  discard block
 block discarded – undo
10614 10614
 
10615 10615
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10616 10616
 		//$sql.= ', el.fk_source';
10617
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10618
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10617
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10618
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10619 10619
 		$sql .= " ORDER BY f.titre ASC";
10620 10620
 
10621 10621
 		$resql = $this->db->query($sql);
10622 10622
 		if ($resql) {
10623 10623
 			// Use select2 selector
10624 10624
 			if (!empty($conf->use_javascript_ajax)) {
10625
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10625
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10626 10626
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10627 10627
 				$out .= $comboenhancement;
10628 10628
 				$morecss = 'minwidth200imp maxwidth500';
10629 10629
 			}
10630 10630
 
10631 10631
 			if (empty($option_only)) {
10632
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10632
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10633 10633
 			}
10634 10634
 			if (!empty($show_empty)) {
10635 10635
 				$out .= '<option value="0" class="optiongrey">';
@@ -10648,19 +10648,19 @@  discard block
 block discarded – undo
10648 10648
 					$disabled = 0;
10649 10649
 					if (!empty($obj->suspended)) {
10650 10650
 						$disabled = 1;
10651
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10651
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10652 10652
 					}
10653 10653
 
10654 10654
 
10655 10655
 					if (!empty($selected) && $selected == $obj->rowid) {
10656
-						$out .= '<option value="' . $obj->rowid . '" selected';
10656
+						$out .= '<option value="'.$obj->rowid.'" selected';
10657 10657
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10658
-						$out .= '>' . $labeltoshow . '</option>';
10658
+						$out .= '>'.$labeltoshow.'</option>';
10659 10659
 					} else {
10660 10660
 						if ($disabled && ($selected != $obj->rowid)) {
10661 10661
 							$resultat = '';
10662 10662
 						} else {
10663
-							$resultat = '<option value="' . $obj->rowid . '"';
10663
+							$resultat = '<option value="'.$obj->rowid.'"';
10664 10664
 							if ($disabled) {
10665 10665
 								$resultat .= ' disabled';
10666 10666
 							}
@@ -10700,14 +10700,14 @@  discard block
 block discarded – undo
10700 10700
 		global $langs;
10701 10701
 
10702 10702
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10703
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10703
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10704 10704
 		}
10705 10705
 
10706 10706
 		$ret = '';
10707 10707
 
10708 10708
 		$ret .= '<div class="divadvancedsearchfieldcomp inline-block">';
10709 10709
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10710
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10710
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10711 10711
 		$ret .= '</a>';
10712 10712
 
10713 10713
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -10751,29 +10751,29 @@  discard block
 block discarded – undo
10751 10751
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
10752 10752
 		}
10753 10753
 		$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%')) -->";
10754
-		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
10754
+		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
10755 10755
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
10756 10756
 
10757 10757
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
10758 10758
 		foreach ($arrayofcriterias as $criteria) {
10759 10759
 			foreach ($criteria as $criteriafamilykey => $criteriafamilyval) {
10760
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10760
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10761 10761
 					continue;
10762 10762
 				}
10763 10763
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
10764 10764
 					continue;
10765 10765
 				}
10766 10766
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
10767
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
10768
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
10769
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
10770
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
10771
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
10772
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
10773
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
10774
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
10767
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
10768
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
10769
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
10770
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
10771
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
10772
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
10773
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
10774
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
10775 10775
 				} else {
10776
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
10776
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
10777 10777
 				}
10778 10778
 			}
10779 10779
 		}
@@ -10781,7 +10781,7 @@  discard block
 block discarded – undo
10781 10781
 		$ret .= '</div>';
10782 10782
 
10783 10783
 		$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";
10784
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10784
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10785 10785
 
10786 10786
 		$ret .= '</div>';
10787 10787
 		$ret .= '</div>';
@@ -10855,7 +10855,7 @@  discard block
 block discarded – undo
10855 10855
 
10856 10856
 		$TModels = array();
10857 10857
 
10858
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
10858
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
10859 10859
 		$formmail = new FormMail($this->db);
10860 10860
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
10861 10861
 
@@ -10868,17 +10868,17 @@  discard block
 block discarded – undo
10868 10868
 			}
10869 10869
 		}
10870 10870
 
10871
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
10871
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
10872 10872
 
10873 10873
 		foreach ($TModels as $id_model => $label_model) {
10874
-			$retstring .= '<option value="' . $id_model . '"';
10875
-			$retstring .= ">" . $label_model . "</option>";
10874
+			$retstring .= '<option value="'.$id_model.'"';
10875
+			$retstring .= ">".$label_model."</option>";
10876 10876
 		}
10877 10877
 
10878 10878
 		$retstring .= "</select>";
10879 10879
 
10880 10880
 		if ($addjscombo) {
10881
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
10881
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
10882 10882
 		}
10883 10883
 
10884 10884
 		return $retstring;
@@ -10929,16 +10929,16 @@  discard block
 block discarded – undo
10929 10929
 
10930 10930
 		foreach ($buttons as $button) {
10931 10931
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
10932
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
10932
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
10933 10933
 		}
10934 10934
 		$retstring .= $withoutdiv ? '' : '</div>';
10935 10935
 
10936 10936
 		if ($dol_openinpopup) {
10937
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n";
10938
-			$retstring .= '<script nonce="' . getNonce() . '">';
10937
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n";
10938
+			$retstring .= '<script nonce="'.getNonce().'">';
10939 10939
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
10940
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\');
10941
-				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\');
10940
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\');
10941
+				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\');
10942 10942
 				 });';
10943 10943
 			$retstring .= '</script>';
10944 10944
 		}
@@ -10967,7 +10967,7 @@  discard block
 block discarded – undo
10967 10967
 		dol_syslog(__METHOD__, LOG_DEBUG);
10968 10968
 
10969 10969
 		$sql = "SELECT rowid, code, label as label";
10970
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
10970
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
10971 10971
 		$sql .= " WHERE active = 1";
10972 10972
 
10973 10973
 		$resql = $this->db->query($sql);
@@ -10978,7 +10978,7 @@  discard block
 block discarded – undo
10978 10978
 				$obj = $this->db->fetch_object($resql);
10979 10979
 
10980 10980
 				// If translation exists, we use it, otherwise we take the default wording
10981
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
10981
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
10982 10982
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
10983 10983
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
10984 10984
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -11010,18 +11010,18 @@  discard block
 block discarded – undo
11010 11010
 		global $langs, $user;
11011 11011
 
11012 11012
 		$out = '';
11013
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
11013
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
11014 11014
 
11015 11015
 		$this->load_cache_invoice_subtype();
11016 11016
 
11017
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
11017
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
11018 11018
 		if ($addempty) {
11019 11019
 			$out .= '<option value="0">&nbsp;</option>';
11020 11020
 		}
11021 11021
 
11022 11022
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
11023 11023
 			$label = $subtype['label'];
11024
-			$out .= '<option value="' . $subtype['rowid'] . '"';
11024
+			$out .= '<option value="'.$subtype['rowid'].'"';
11025 11025
 			if ($selected == $subtype['rowid']) {
11026 11026
 				$out .= ' selected="selected"';
11027 11027
 			}
Please login to merge, or discard this patch.
htdocs/core/modules/barcode/doc/phpbarcode.modules.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -194,16 +194,16 @@
 block discarded – undo
194 194
 				$this->error = "ErrorFailedToWriteInTempDirectory ".$conf->barcode->dir_temp;
195 195
 			}
196 196
 			$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->barcode->dir_temp);
197
-			dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
197
+			dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
198 198
 			return -1;
199 199
 		}
200 200
 
201 201
 		$newcode = $code;
202 202
 		if (!preg_match('/^\w+$/', $code) || dol_strlen($code) > 32) {
203
-			$newcode = dol_hash($newcode, 'md5');	// No need for security here, we can use md5
203
+			$newcode = dol_hash($newcode, 'md5'); // No need for security here, we can use md5
204 204
 		}
205 205
 
206
-		$file = $conf->barcode->dir_temp . '/barcode_' . $newcode . '_' . $encoding . '.png';
206
+		$file = $conf->barcode->dir_temp.'/barcode_'.$newcode.'_'.$encoding.'.png';
207 207
 
208 208
 		$filebarcode = $file; // global var to be used in barcode_outimage called by barcode_print in buildBarCode
209 209
 
Please login to merge, or discard this patch.
htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -169,16 +169,16 @@
 block discarded – undo
169 169
 			} else {
170 170
 				$this->error = "ErrorFailedToWriteInTempDirectory ".$conf->barcode->dir_temp;
171 171
 			}
172
-			dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
172
+			dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
173 173
 			return -1;
174 174
 		}
175 175
 
176 176
 		$newcode = $code;
177 177
 		if (!preg_match('/^\w+$/', $code) || dol_strlen($code) > 32) {
178
-			$newcode = dol_hash($newcode, 'md5');	// No need for security here, we can use md5
178
+			$newcode = dol_hash($newcode, 'md5'); // No need for security here, we can use md5
179 179
 		}
180 180
 
181
-		$file = $conf->barcode->dir_temp . '/barcode_' . $newcode . '_' . $encoding . '.png';
181
+		$file = $conf->barcode->dir_temp.'/barcode_'.$newcode.'_'.$encoding.'.png';
182 182
 
183 183
 		$tcpdfEncoding = $this->getTcpdfEncodingType($encoding);
184 184
 		if (empty($tcpdfEncoding)) {
Please login to merge, or discard this patch.
htdocs/societe/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 $sql .= ", s.canvas, s.tms as date_modification, s.status as status";
293 293
 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
294 294
 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
295
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
295
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
296 296
 }
297 297
 // TODO Replace this
298 298
 if (!$user->hasRight('societe', 'client', 'voir')) {
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 $sql .= $db->plimit($max, 0);
319 319
 
320 320
 //print $sql;
321
-$lastmodified="";
321
+$lastmodified = "";
322 322
 $result = $db->query($sql);
323 323
 if ($result) {
324 324
 	$num = $db->num_rows($result);
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 $sql .= ", sp.address as caddress, sp.phone as cphone";
409 409
 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."socpeople as sp";
410 410
 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
411
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
411
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
412 412
 }
413 413
 // TODO Replace this
414 414
 if (!$user->hasRight('societe', 'client', 'voir')) {
Please login to merge, or discard this patch.