Completed
Branch develop (a1d218)
by
unknown
17:18
created
htdocs/core/lib/price.lib.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -412,9 +412,9 @@  discard block
 block discarded – undo
412 412
 
413 413
 		if ($multicurrency_code) {
414 414
 			// Restore setup of currency accurency
415
-			$conf->global->MAIN_MAX_DECIMALS_UNIT = $savMAIN_MAX_DECIMALS_UNIT;  // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
416
-			$conf->global->MAIN_MAX_DECIMALS_TOT = $savMAIN_MAX_DECIMALS_TOT;  // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
417
-			$conf->global->MAIN_ROUNDING_RULE_TOT = $savMAIN_ROUNDING_RULE_TOT;  // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
415
+			$conf->global->MAIN_MAX_DECIMALS_UNIT = $savMAIN_MAX_DECIMALS_UNIT; // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
416
+			$conf->global->MAIN_MAX_DECIMALS_TOT = $savMAIN_MAX_DECIMALS_TOT; // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
417
+			$conf->global->MAIN_ROUNDING_RULE_TOT = $savMAIN_ROUNDING_RULE_TOT; // @phan-suppress-current-line PhanPossiblyUndeclaredVariable
418 418
 		}
419 419
 
420 420
 		$result[16] = $newresult[0];
@@ -438,8 +438,8 @@  discard block
 block discarded – undo
438 438
 		$result[22] = $result[6];
439 439
 		$result[23] = $result[7];
440 440
 		$result[24] = $result[8];
441
-		$result[25] = $result[9];   // @phan-ignore-current-line PhanTypePossiblyInvalidDimOffset
442
-		$result[26] = $result[10];  // @phan-ignore-current-line PhanTypePossiblyInvalidDimOffset
441
+		$result[25] = $result[9]; // @phan-ignore-current-line PhanTypePossiblyInvalidDimOffset
442
+		$result[26] = $result[10]; // @phan-ignore-current-line PhanTypePossiblyInvalidDimOffset
443 443
 	}
444 444
 	dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.getDolGlobalString('MAIN_ROUNDING_RULE_TOT').' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]);
445 445
 
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1227 added lines, -1227 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 wysiwyg is off.
293 293
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -297,12 +297,12 @@  discard block
 block discarded – undo
297 297
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
298 298
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
299 299
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
300
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
300
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
301 301
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
302 302
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
303 303
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
304 304
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
305
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
305
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
306 306
 				} elseif (preg_match('/^select;/', $typeofdata)) {
307 307
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
308 308
 					$arraylist = array();
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 					// TODO Not yet implemented. See code for extrafields
317 317
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
318 318
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
319
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
319
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
320 320
 					$doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7]));
321 321
 					$ret .= $doleditor->Create(1);
322 322
 				} elseif ($typeofdata == 'asis') {
@@ -331,19 +331,19 @@  discard block
 block discarded – undo
331 331
 					$ret .= '<td>';
332 332
 				}
333 333
 				//else $ret.='<div class="clearboth"></div>';
334
-				$ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
334
+				$ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
335 335
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
336
-					$ret .= '<br>' . "\n";
336
+					$ret .= '<br>'."\n";
337 337
 				}
338
-				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
338
+				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
339 339
 				if (empty($notabletag)) {
340 340
 					$ret .= '</td>';
341 341
 				}
342 342
 
343 343
 				if (empty($notabletag)) {
344
-					$ret .= '</tr></table>' . "\n";
344
+					$ret .= '</tr></table>'."\n";
345 345
 				}
346
-				$ret .= '</form>' . "\n";
346
+				$ret .= '</form>'."\n";
347 347
 			} else {		// view mode
348 348
 				if (preg_match('/^email/', $typeofdata)) {
349 349
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -355,15 +355,15 @@  discard block
 block discarded – undo
355 355
 					$ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : '');
356 356
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
357 357
 					$tmp = explode(':', $typeofdata);
358
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
358
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
359 359
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
360 360
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
361 361
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
362 362
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
363 363
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
364
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
364
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
365 365
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
366
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
366
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
367 367
 				} elseif (preg_match('/^select;/', $typeofdata)) {
368 368
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
369 369
 					$arraylist = array();
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
 					$ret .= $arraylist[$value];
375 375
 					if ($htmlname == 'fk_product_type') {
376 376
 						if ($value == 0) {
377
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
377
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
378 378
 						} else {
379
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
379
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
380 380
 						}
381 381
 					}
382 382
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
385 385
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
386 386
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
387
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
387
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
388 388
 					}
389 389
 					// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also
390 390
 					// clean data from some dangerous html
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
394 394
 						$ret .= dol_escape_htmltag($value);
395 395
 					} else {
396
-						$ret .= $value;        // $value must be already html escaped.
396
+						$ret .= $value; // $value must be already html escaped.
397 397
 					}
398 398
 				}
399 399
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 
432 432
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
433 433
 			if (!is_object($extralanguages)) {
434
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
434
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
435 435
 				$extralanguages = new ExtraLanguages($this->db);
436 436
 			}
437 437
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -440,17 +440,17 @@  discard block
 block discarded – undo
440 440
 				return ''; // No extralang field to show
441 441
 			}
442 442
 
443
-			$result .= '<!-- Widget for translation -->' . "\n";
444
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
443
+			$result .= '<!-- Widget for translation -->'."\n";
444
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
445 445
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
446 446
 			$result .= $s;
447 447
 			$result .= '</div>';
448 448
 
449
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
449
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
450 450
 
451 451
 			$resultforextrlang = '';
452 452
 			foreach ($arrayoflangcode as $langcode) {
453
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
453
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
454 454
 				if (empty($valuetoshow)) {
455 455
 					$object->fetchValuesForExtraLanguages();
456 456
 					//var_dump($object->array_languages);
@@ -462,17 +462,17 @@  discard block
 block discarded – undo
462 462
 
463 463
 				// TODO Use the showInputField() method of ExtraLanguages object
464 464
 				if ($typeofdata == 'textarea') {
465
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
465
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
466 466
 					$resultforextrlang .= $valuetoshow;
467 467
 					$resultforextrlang .= '</textarea>';
468 468
 				} else {
469
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
469
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
470 470
 				}
471 471
 			}
472 472
 			$result .= $resultforextrlang;
473 473
 
474 474
 			$result .= '</div>';
475
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
475
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
476 476
 		}
477 477
 
478 478
 		return $result;
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 				if (!empty($tmp[2])) {
536 536
 					$savemethod = $tmp[2];
537 537
 				}
538
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
538
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
539 539
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
540 540
 				$tmp = explode(':', $inputType);
541 541
 				$inputType = $tmp[0];
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 					$savemethod = $tmp[2];
547 547
 				}
548 548
 
549
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
549
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
550 550
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
551 551
 				$tmp = explode(':', $inputType);
552 552
 				$inputType = $tmp[0];
@@ -577,40 +577,40 @@  discard block
 block discarded – undo
577 577
 				}
578 578
 
579 579
 				if (isModEnabled('fckeditor')) {
580
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
580
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
581 581
 				} else {
582 582
 					$inputType = 'textarea';
583 583
 				}
584 584
 			}
585 585
 
586
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
587
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
588
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
589
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
586
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
587
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
588
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
589
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
590 590
 			if (!empty($savemethod)) {
591
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
591
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
592 592
 			}
593 593
 			if (!empty($ext_element)) {
594
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
594
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
595 595
 			}
596 596
 			if (!empty($custommsg)) {
597 597
 				if (is_array($custommsg)) {
598 598
 					if (!empty($custommsg['success'])) {
599
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
599
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
600 600
 					}
601 601
 					if (!empty($custommsg['error'])) {
602
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
602
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
603 603
 					}
604 604
 				} else {
605
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
605
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
606 606
 				}
607 607
 			}
608 608
 			if ($inputType == 'textarea') {
609
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
610
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
609
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
610
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
611 611
 			}
612
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
613
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
612
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
613
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
614 614
 		} else {
615 615
 			$out = $value;
616 616
 		}
@@ -639,12 +639,12 @@  discard block
 block discarded – undo
639 639
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
640 640
 	{
641 641
 		if ($incbefore) {
642
-			$text = $incbefore . $text;
642
+			$text = $incbefore.$text;
643 643
 		}
644 644
 		if (!$htmltext) {
645 645
 			return $text;
646 646
 		}
647
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
647
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
648 648
 
649 649
 		$tag = 'td';
650 650
 		if ($notabs == 2) {
@@ -658,11 +658,11 @@  discard block
 block discarded – undo
658 658
 
659 659
 		$extrastyle = '';
660 660
 		if ($direction < 0) {
661
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
661
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
662 662
 			$extrastyle = 'padding: 0px; padding-left: 3px;';
663 663
 		}
664 664
 		if ($direction > 0) {
665
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
665
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
666 666
 			$extrastyle = 'padding: 0px; padding-right: 3px;';
667 667
 		}
668 668
 
@@ -675,53 +675,53 @@  discard block
 block discarded – undo
675 675
 			$htmltext = str_replace('"', '&quot;', $htmltext);
676 676
 		} else {
677 677
 			$classfortooltip = 'classfortooltiponclick';
678
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
678
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
679 679
 		}
680 680
 		if ($tooltipon == 2 || $tooltipon == 3) {
681
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
681
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
682 682
 			if ($tooltiptrigger == '') {
683
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip
683
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip
684 684
 			} else {
685
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
685
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
686 686
 			}
687 687
 		} else {
688
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
688
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
689 689
 		}
690 690
 		if ($tooltipon == 1 || $tooltipon == 3) {
691
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
691
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
692 692
 			if ($tooltiptrigger == '') {
693
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip
693
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip
694 694
 			} else {
695
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
695
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
696 696
 			}
697 697
 		} else {
698
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
698
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
699 699
 		}
700 700
 		if (empty($notabs)) {
701 701
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
702 702
 		} elseif ($notabs == 2) {
703
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
703
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
704 704
 		}
705 705
 		// Define value if value is before
706 706
 		if ($direction < 0) {
707
-			$s .= '<' . $tag . $paramfortooltipimg;
707
+			$s .= '<'.$tag.$paramfortooltipimg;
708 708
 			if ($tag == 'td') {
709 709
 				$s .= ' class="valigntop" width="14"';
710 710
 			}
711
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
711
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
712 712
 		}
713 713
 		// Use another method to help avoid having a space in value in order to use this value with jquery
714 714
 		// Define label
715 715
 		if ((string) $text != '') {
716
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
716
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
717 717
 		}
718 718
 		// Define value if value is after
719 719
 		if ($direction > 0) {
720
-			$s .= '<' . $tag . $paramfortooltipimg;
720
+			$s .= '<'.$tag.$paramfortooltipimg;
721 721
 			if ($tag == 'td') {
722 722
 				$s .= ' class="valignmiddle" width="14"';
723 723
 			}
724
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
724
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
725 725
 		}
726 726
 		if (empty($notabs)) {
727 727
 			$s .= '</tr></table>';
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 
829 829
 		$disabled = 0;
830 830
 		$ret = '<div class="centpercent center">';
831
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
831
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
832 832
 
833 833
 		// Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks.
834 834
 		$parameters = array();
@@ -839,10 +839,10 @@  discard block
 block discarded – undo
839 839
 			return;
840 840
 		}
841 841
 		if (empty($reshook)) {
842
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
842
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
843 843
 			if (is_array($arrayofaction)) {
844 844
 				foreach ($arrayofaction as $code => $label) {
845
-					$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
845
+					$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
846 846
 				}
847 847
 			}
848 848
 		}
@@ -851,17 +851,17 @@  discard block
 block discarded – undo
851 851
 		$ret .= '</select>';
852 852
 
853 853
 		if (empty($conf->dol_optimize_smallscreen)) {
854
-			$ret .= ajax_combobox('.' . $name . 'select');
854
+			$ret .= ajax_combobox('.'.$name.'select');
855 855
 		}
856 856
 
857 857
 		// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
858 858
 		$ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER.
859
-		$ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">';
859
+		$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
860 860
 		$ret .= '</div>';
861 861
 
862 862
 		if (!empty($conf->use_javascript_ajax)) {
863 863
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
864
-    		<script nonce="' . getNonce() . '">
864
+    		<script nonce="' . getNonce().'">
865 865
                         function initCheckForSelect(mode, name, cssclass)	/* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */
866 866
         		{
867 867
         			atleastoneselected=0;
@@ -872,11 +872,11 @@  discard block
 block discarded – undo
872 872
 
873 873
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
874 874
 
875
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
875
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
876 876
     	  			{
877 877
                                     jQuery("."+name).show();
878
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
879
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
878
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
879
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
880 880
     	  			}
881 881
     	  			else
882 882
     	  			{
@@ -886,11 +886,11 @@  discard block
 block discarded – undo
886 886
         		}
887 887
 
888 888
         	jQuery(document).ready(function () {
889
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
890
-                    jQuery(".' . $cssclass . '").click(function() {
891
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
889
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
890
+                    jQuery(".' . $cssclass.'").click(function() {
891
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
892 892
                     });
893
-                        jQuery(".' . $name . 'select").change(function() {
893
+                        jQuery(".' . $name.'select").change(function() {
894 894
         			var massaction = $( this ).val();
895 895
         			var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
896 896
         			if (massaction == "builddoc")
@@ -898,18 +898,18 @@  discard block
 block discarded – undo
898 898
                         urlform = urlform + "#show_files";
899 899
     	            }
900 900
         			$( this ).closest("form").attr("action", urlform);
901
-                    console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
901
+                    console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
902 902
         	        /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
903 903
         			if ($(this).val() != \'0\')
904 904
     	  			{
905
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
906
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
907
-                                        jQuery(".' . $name . '"+massaction).show();
905
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
906
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
907
+                                        jQuery(".' . $name.'"+massaction).show();
908 908
     	  			}
909 909
     	  			else
910 910
     	  			{
911
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
912
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
911
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
912
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
913 913
     	  			}
914 914
     	        });
915 915
         	});
@@ -952,14 +952,14 @@  discard block
 block discarded – undo
952 952
 		$atleastonefavorite = 0;
953 953
 
954 954
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
955
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
955
+		$sql .= " FROM ".$this->db->prefix()."c_country";
956 956
 		$sql .= " WHERE active > 0";
957 957
 		//$sql.= " ORDER BY code ASC";
958 958
 
959
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
959
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
960 960
 		$resql = $this->db->query($sql);
961 961
 		if ($resql) {
962
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
962
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
963 963
 			$num = $this->db->num_rows($resql);
964 964
 			$i = 0;
965 965
 			if ($num) {
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 					$countryArray[$i]['rowid'] = $obj->rowid;
970 970
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
971 971
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
972
-					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
972
+					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
973 973
 					$countryArray[$i]['favorite'] = $obj->favorite;
974 974
 					$countryArray[$i]['eec'] = $obj->eec;
975 975
 					$favorite[$i] = $obj->favorite;
@@ -987,20 +987,20 @@  discard block
 block discarded – undo
987 987
 
988 988
 				if ($showempty) {
989 989
 					if (is_numeric($showempty)) {
990
-						$out .= '<option value="">&nbsp;</option>' . "\n";
990
+						$out .= '<option value="">&nbsp;</option>'."\n";
991 991
 					} else {
992
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
992
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
993 993
 					}
994 994
 				}
995 995
 
996 996
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
997 997
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
998
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
999
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
998
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
999
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
1000 1000
 					if ($mysoc->isInEEC()) {
1001
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
1001
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
1002 1002
 					}
1003
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
1003
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
1004 1004
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
1005 1005
 				}
1006 1006
 
@@ -1028,20 +1028,20 @@  discard block
 block discarded – undo
1028 1028
 						$labeltoshow .= '&nbsp;';
1029 1029
 					}
1030 1030
 					if ($row['code_iso']) {
1031
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1031
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1032 1032
 						if (empty($hideflags)) {
1033 1033
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1034
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1034
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1035 1035
 						}
1036 1036
 					}
1037 1037
 
1038 1038
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1039
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1039
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1040 1040
 					} else {
1041
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1041
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1042 1042
 					}
1043 1043
 					$out .= $labeltoshow;
1044
-					$out .= '</option>' . "\n";
1044
+					$out .= '</option>'."\n";
1045 1045
 				}
1046 1046
 			}
1047 1047
 			$out .= '</select>';
@@ -1050,8 +1050,8 @@  discard block
 block discarded – undo
1050 1050
 		}
1051 1051
 
1052 1052
 		// Make select dynamic
1053
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1054
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1053
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1054
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1055 1055
 
1056 1056
 		return $out;
1057 1057
 	}
@@ -1083,25 +1083,25 @@  discard block
 block discarded – undo
1083 1083
 		$incotermArray = array();
1084 1084
 
1085 1085
 		$sql = "SELECT rowid, code";
1086
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1086
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1087 1087
 		$sql .= " WHERE active > 0";
1088 1088
 		$sql .= " ORDER BY code ASC";
1089 1089
 
1090
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1090
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1091 1091
 		$resql = $this->db->query($sql);
1092 1092
 		if ($resql) {
1093 1093
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1094
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1094
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1095 1095
 				$out .= ajax_combobox($htmlname, $events);
1096 1096
 			}
1097 1097
 
1098 1098
 			if (!empty($page)) {
1099
-				$out .= '<form method="post" action="' . $page . '">';
1099
+				$out .= '<form method="post" action="'.$page.'">';
1100 1100
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1101
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1101
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1102 1102
 			}
1103 1103
 
1104
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1104
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1105 1105
 			$out .= '<option value="0">&nbsp;</option>';
1106 1106
 			$num = $this->db->num_rows($resql);
1107 1107
 			$i = 0;
@@ -1115,9 +1115,9 @@  discard block
 block discarded – undo
1115 1115
 
1116 1116
 				foreach ($incotermArray as $row) {
1117 1117
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1118
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1118
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1119 1119
 					} else {
1120
-						$out .= '<option value="' . $row['rowid'] . '">';
1120
+						$out .= '<option value="'.$row['rowid'].'">';
1121 1121
 					}
1122 1122
 
1123 1123
 					if ($row['code']) {
@@ -1130,13 +1130,13 @@  discard block
 block discarded – undo
1130 1130
 			$out .= '</select>';
1131 1131
 
1132 1132
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1133
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1133
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1134 1134
 				$moreattrib .= ' autocomplete="off"';
1135 1135
 			}
1136
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1136
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1137 1137
 
1138 1138
 			if (!empty($page)) {
1139
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1139
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1140 1140
 			}
1141 1141
 		} else {
1142 1142
 			dol_print_error($this->db);
@@ -1168,9 +1168,9 @@  discard block
 block discarded – undo
1168 1168
 		if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
1169 1169
 			|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
1170 1170
 			if (empty($hidetext)) {
1171
-				print $langs->trans("Type") . ': ';
1171
+				print $langs->trans("Type").': ';
1172 1172
 			}
1173
-			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1173
+			print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1174 1174
 			if ($showempty) {
1175 1175
 				print '<option value="-1"';
1176 1176
 				if ($selected == -1) {
@@ -1189,28 +1189,28 @@  discard block
 block discarded – undo
1189 1189
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1190 1190
 				print ' selected';
1191 1191
 			}
1192
-			print '>' . $langs->trans("Product");
1192
+			print '>'.$langs->trans("Product");
1193 1193
 
1194 1194
 			print '<option value="1"';
1195 1195
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1196 1196
 				print ' selected';
1197 1197
 			}
1198
-			print '>' . $langs->trans("Service");
1198
+			print '>'.$langs->trans("Service");
1199 1199
 
1200 1200
 			print '</select>';
1201
-			print ajax_combobox('select_' . $htmlname);
1201
+			print ajax_combobox('select_'.$htmlname);
1202 1202
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1203 1203
 		}
1204 1204
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1205 1205
 			print $langs->trans("Service");
1206
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1206
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1207 1207
 		}
1208 1208
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1209 1209
 			print $langs->trans("Product");
1210
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1210
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1211 1211
 		}
1212 1212
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1213
-			print '<input type="hidden" name="' . $htmlname . '" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1
1213
+			print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1
1214 1214
 		}
1215 1215
 	}
1216 1216
 
@@ -1236,7 +1236,7 @@  discard block
 block discarded – undo
1236 1236
 		$langs->load("trips");
1237 1237
 
1238 1238
 		$sql = "SELECT c.code, c.label";
1239
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1239
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1240 1240
 		$sql .= " WHERE active > 0";
1241 1241
 
1242 1242
 		$resql = $this->db->query($sql);
@@ -1277,11 +1277,11 @@  discard block
 block discarded – undo
1277 1277
 		// phpcs:enable
1278 1278
 		global $user, $langs;
1279 1279
 
1280
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1280
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1281 1281
 
1282 1282
 		$this->load_cache_types_fees();
1283 1283
 
1284
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1284
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1285 1285
 		if ($showempty) {
1286 1286
 			print '<option value="-1"';
1287 1287
 			if ($selected == -1) {
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 		}
1292 1292
 
1293 1293
 		foreach ($this->cache_types_fees as $key => $value) {
1294
-			print '<option value="' . $key . '"';
1294
+			print '<option value="'.$key.'"';
1295 1295
 			if ($key == $selected) {
1296 1296
 				print ' selected';
1297 1297
 			}
@@ -1343,12 +1343,12 @@  discard block
 block discarded – undo
1343 1343
 				$ajaxoptions = array();
1344 1344
 			}
1345 1345
 
1346
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1346
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1347 1347
 
1348 1348
 			// No immediate load of all database
1349 1349
 			$placeholder = '';
1350 1350
 			if ($selected && empty($selected_input_value)) {
1351
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1351
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1352 1352
 				$societetmp = new Societe($this->db);
1353 1353
 				$societetmp->fetch($selected);
1354 1354
 				$selected_input_value = $societetmp->name;
@@ -1356,18 +1356,18 @@  discard block
 block discarded – undo
1356 1356
 			}
1357 1357
 
1358 1358
 			// mode 1
1359
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : '');
1359
+			$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)) : '');
1360 1360
 
1361 1361
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1362 1362
 			if (empty($hidelabel)) {
1363
-				print $langs->trans("RefOrLabel") . ' : ';
1363
+				print $langs->trans("RefOrLabel").' : ';
1364 1364
 			} elseif ($hidelabel > 1) {
1365 1365
 				$placeholder = $langs->trans("RefOrLabel");
1366 1366
 				if ($hidelabel == 2) {
1367 1367
 					$out .= img_picto($langs->trans("Search"), 'search');
1368 1368
 				}
1369 1369
 			}
1370
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
1370
+			$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' : '').' />';
1371 1371
 			if ($hidelabel == 3) {
1372 1372
 				$out .= img_picto($langs->trans("Search"), 'search');
1373 1373
 			}
@@ -1429,12 +1429,12 @@  discard block
 block discarded – undo
1429 1429
 				$events = array();
1430 1430
 			}
1431 1431
 
1432
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1432
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1433 1433
 
1434 1434
 			// No immediate load of all database
1435 1435
 			$placeholder = '';
1436 1436
 			if ($selected && empty($selected_input_value)) {
1437
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1437
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1438 1438
 				$contacttmp = new Contact($this->db);
1439 1439
 				$contacttmp->fetch($selected);
1440 1440
 				$selected_input_value = $contacttmp->getFullName($langs);
@@ -1445,11 +1445,11 @@  discard block
 block discarded – undo
1445 1445
 			}
1446 1446
 
1447 1447
 			// mode 1
1448
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($exclude) ? '' : '&exclude=' . urlencode($exclude)) . ($showsoc ? '&showsoc=' . urlencode((string) ($showsoc)) : '');
1448
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($exclude) ? '' : '&exclude='.urlencode($exclude)).($showsoc ? '&showsoc='.urlencode((string) ($showsoc)) : '');
1449 1449
 
1450 1450
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1451 1451
 
1452
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
1452
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
1453 1453
 
1454 1454
 			$out .= ajax_event($htmlname, $events);
1455 1455
 
@@ -1546,30 +1546,30 @@  discard block
 block discarded – undo
1546 1546
 			$sql .= ", s.address, s.zip, s.town";
1547 1547
 			$sql .= ", dictp.code as country_code";
1548 1548
 		}
1549
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1549
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1550 1550
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1551
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1551
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1552 1552
 		}
1553 1553
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1554
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1554
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1555 1555
 		}
1556
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1556
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1557 1557
 		if (!empty($user->socid)) {
1558
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1558
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1559 1559
 		}
1560 1560
 		if ($filter) {
1561 1561
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1562 1562
 			// if not, by testSqlAndScriptInject() only.
1563
-			$sql .= " AND (" . $filter . ")";
1563
+			$sql .= " AND (".$filter.")";
1564 1564
 		}
1565 1565
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1566
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1566
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1567 1567
 		}
1568 1568
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1569 1569
 			$sql .= " AND s.status <> 0";
1570 1570
 		}
1571 1571
 		if (!empty($excludeids)) {
1572
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")";
1572
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")";
1573 1573
 		}
1574 1574
 		// Add where from hooks
1575 1575
 		$parameters = array();
@@ -1589,17 +1589,17 @@  discard block
 block discarded – undo
1589 1589
 				if ($i > 0) {
1590 1590
 					$sql .= " AND ";
1591 1591
 				}
1592
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1592
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1593 1593
 				$i++;
1594 1594
 			}
1595 1595
 			if (count($search_crit) > 1) {
1596 1596
 				$sql .= ")";
1597 1597
 			}
1598 1598
 			if (isModEnabled('barcode')) {
1599
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1599
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1600 1600
 			}
1601
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1602
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1601
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1602
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1603 1603
 			$sql .= ")";
1604 1604
 		}
1605 1605
 		$sql .= $this->db->order("nom", "ASC");
@@ -1610,7 +1610,7 @@  discard block
 block discarded – undo
1610 1610
 		$resql = $this->db->query($sql);
1611 1611
 		if ($resql) {
1612 1612
 			// Construct $out and $outarray
1613
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1613
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1614 1614
 
1615 1615
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1616 1616
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1623,7 +1623,7 @@  discard block
 block discarded – undo
1623 1623
 				}
1624 1624
 			}
1625 1625
 			if ($showempty) {
1626
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1626
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1627 1627
 			}
1628 1628
 
1629 1629
 			$companytemp = new Societe($this->db);
@@ -1636,18 +1636,18 @@  discard block
 block discarded – undo
1636 1636
 					$label = '';
1637 1637
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1638 1638
 						if (($obj->client) && (!empty($obj->code_client))) {
1639
-							$label = $obj->code_client . ' - ';
1639
+							$label = $obj->code_client.' - ';
1640 1640
 						}
1641 1641
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1642
-							$label .= $obj->code_fournisseur . ' - ';
1642
+							$label .= $obj->code_fournisseur.' - ';
1643 1643
 						}
1644
-						$label .= ' ' . $obj->name;
1644
+						$label .= ' '.$obj->name;
1645 1645
 					} else {
1646 1646
 						$label = $obj->name;
1647 1647
 					}
1648 1648
 
1649 1649
 					if (!empty($obj->name_alias)) {
1650
-						$label .= ' (' . $obj->name_alias . ')';
1650
+						$label .= ' ('.$obj->name_alias.')';
1651 1651
 					}
1652 1652
 
1653 1653
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1662,7 +1662,7 @@  discard block
 block discarded – undo
1662 1662
 						$companytemp->fournisseur = $obj->fournisseur;
1663 1663
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1664 1664
 						if ($tmptype) {
1665
-							$labelhtml .= ' ' . $tmptype;
1665
+							$labelhtml .= ' '.$tmptype;
1666 1666
 						}
1667 1667
 
1668 1668
 						if ($obj->client || $obj->fournisseur) {
@@ -1672,10 +1672,10 @@  discard block
 block discarded – undo
1672 1672
 							$label .= $langs->trans("Customer");
1673 1673
 						}
1674 1674
 						if ($obj->client == 2 || $obj->client == 3) {
1675
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1675
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1676 1676
 						}
1677 1677
 						if ($obj->fournisseur) {
1678
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1678
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1679 1679
 						}
1680 1680
 						if ($obj->client || $obj->fournisseur) {
1681 1681
 							$label .= ')';
@@ -1683,9 +1683,9 @@  discard block
 block discarded – undo
1683 1683
 					}
1684 1684
 
1685 1685
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1686
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1686
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1687 1687
 						if (!empty($obj->country_code)) {
1688
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1688
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1689 1689
 						}
1690 1690
 						$label .= $s;
1691 1691
 						$labelhtml .= $s;
@@ -1693,9 +1693,9 @@  discard block
 block discarded – undo
1693 1693
 
1694 1694
 					if (empty($outputmode)) {
1695 1695
 						if (in_array($obj->rowid, $selected)) {
1696
-							$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>';
1696
+							$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>';
1697 1697
 						} else {
1698
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1698
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1699 1699
 						}
1700 1700
 					} else {
1701 1701
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1707,9 +1707,9 @@  discard block
 block discarded – undo
1707 1707
 					}
1708 1708
 				}
1709 1709
 			}
1710
-			$out .= '</select>' . "\n";
1710
+			$out .= '</select>'."\n";
1711 1711
 			if (!$forcecombo) {
1712
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1712
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1713 1713
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("COMPANY_USE_SEARCH_TO_SELECT"));
1714 1714
 			}
1715 1715
 		} else {
@@ -1799,7 +1799,7 @@  discard block
 block discarded – undo
1799 1799
 		}
1800 1800
 
1801 1801
 		if (!is_object($hookmanager)) {
1802
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1802
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1803 1803
 			$hookmanager = new HookManager($this->db);
1804 1804
 		}
1805 1805
 
@@ -1808,13 +1808,13 @@  discard block
 block discarded – undo
1808 1808
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1809 1809
 			$sql .= ", s.nom as company, s.town AS company_town";
1810 1810
 		}
1811
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1811
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1812 1812
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1813
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1813
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1814 1814
 		}
1815
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1815
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1816 1816
 		if ($socid > 0 || $socid == -1) {
1817
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1817
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1818 1818
 		}
1819 1819
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1820 1820
 			$sql .= " AND sp.statut <> 0";
@@ -1822,7 +1822,7 @@  discard block
 block discarded – undo
1822 1822
 		if ($filter) {
1823 1823
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1824 1824
 			// if not, by testSqlAndScriptInject() only.
1825
-			$sql .= " AND (" . $filter . ")";
1825
+			$sql .= " AND (".$filter.")";
1826 1826
 		}
1827 1827
 		// Add where from hooks
1828 1828
 		$parameters = array();
@@ -1830,30 +1830,30 @@  discard block
 block discarded – undo
1830 1830
 		$sql .= $hookmanager->resPrint;
1831 1831
 		$sql .= " ORDER BY sp.lastname ASC";
1832 1832
 
1833
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1833
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1834 1834
 		$resql = $this->db->query($sql);
1835 1835
 		if ($resql) {
1836 1836
 			$num = $this->db->num_rows($resql);
1837 1837
 
1838 1838
 			if ($htmlname != 'none' && !$options_only) {
1839
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1839
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1840 1840
 			}
1841 1841
 
1842 1842
 			if ($showempty && !is_numeric($showempty)) {
1843 1843
 				$textforempty = $showempty;
1844
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1844
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1845 1845
 			} else {
1846 1846
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1847
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1847
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1848 1848
 				}
1849 1849
 				if ($showempty == 2) {
1850
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1850
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1851 1851
 				}
1852 1852
 			}
1853 1853
 
1854 1854
 			$i = 0;
1855 1855
 			if ($num) {
1856
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1856
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1857 1857
 				$contactstatic = new Contact($this->db);
1858 1858
 
1859 1859
 				while ($i < $num) {
@@ -1889,7 +1889,7 @@  discard block
 block discarded – undo
1889 1889
 						}
1890 1890
 						$extendedInfos = implode(' - ', $extendedInfos);
1891 1891
 						if (!empty($extendedInfos)) {
1892
-							$extendedInfos = ' - ' . $extendedInfos;
1892
+							$extendedInfos = ' - '.$extendedInfos;
1893 1893
 						}
1894 1894
 					}
1895 1895
 
@@ -1907,35 +1907,35 @@  discard block
 block discarded – undo
1907 1907
 								$disabled = 1;
1908 1908
 							}
1909 1909
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1910
-								$out .= '<option value="' . $obj->rowid . '"';
1910
+								$out .= '<option value="'.$obj->rowid.'"';
1911 1911
 								if ($disabled) {
1912 1912
 									$out .= ' disabled';
1913 1913
 								}
1914 1914
 								$out .= ' selected>';
1915 1915
 
1916
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1916
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1917 1917
 								if ($showfunction && $obj->poste) {
1918
-									$tmplabel .= ' (' . $obj->poste . ')';
1918
+									$tmplabel .= ' ('.$obj->poste.')';
1919 1919
 								}
1920 1920
 								if (($showsoc > 0) && $obj->company) {
1921
-									$tmplabel .= ' - (' . $obj->company . ')';
1921
+									$tmplabel .= ' - ('.$obj->company.')';
1922 1922
 								}
1923 1923
 
1924 1924
 								$out .= $tmplabel;
1925 1925
 								$out .= '</option>';
1926 1926
 							} else {
1927
-								$out .= '<option value="' . $obj->rowid . '"';
1927
+								$out .= '<option value="'.$obj->rowid.'"';
1928 1928
 								if ($disabled) {
1929 1929
 									$out .= ' disabled';
1930 1930
 								}
1931 1931
 								$out .= '>';
1932 1932
 
1933
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1933
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1934 1934
 								if ($showfunction && $obj->poste) {
1935
-									$tmplabel .= ' (' . $obj->poste . ')';
1935
+									$tmplabel .= ' ('.$obj->poste.')';
1936 1936
 								}
1937 1937
 								if (($showsoc > 0) && $obj->company) {
1938
-									$tmplabel .= ' - (' . $obj->company . ')';
1938
+									$tmplabel .= ' - ('.$obj->company.')';
1939 1939
 								}
1940 1940
 
1941 1941
 								$out .= $tmplabel;
@@ -1943,12 +1943,12 @@  discard block
 block discarded – undo
1943 1943
 							}
1944 1944
 						} else {
1945 1945
 							if (in_array($obj->rowid, $selected)) {
1946
-								$tmplabel = $contactstatic->getFullName($langs) . $extendedInfos;
1946
+								$tmplabel = $contactstatic->getFullName($langs).$extendedInfos;
1947 1947
 								if ($showfunction && $obj->poste) {
1948
-									$tmplabel .= ' (' . $obj->poste . ')';
1948
+									$tmplabel .= ' ('.$obj->poste.')';
1949 1949
 								}
1950 1950
 								if (($showsoc > 0) && $obj->company) {
1951
-									$tmplabel .= ' - (' . $obj->company . ')';
1951
+									$tmplabel .= ' - ('.$obj->company.')';
1952 1952
 								}
1953 1953
 
1954 1954
 								$out .= $tmplabel;
@@ -1963,7 +1963,7 @@  discard block
 block discarded – undo
1963 1963
 				}
1964 1964
 			} else {
1965 1965
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1966
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1966
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1967 1967
 				$out .= $labeltoshow;
1968 1968
 				$out .= '</option>';
1969 1969
 			}
@@ -1984,7 +1984,7 @@  discard block
 block discarded – undo
1984 1984
 			}
1985 1985
 
1986 1986
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1987
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1987
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1988 1988
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalInt("CONTACT_USE_SEARCH_TO_SELECT"));
1989 1989
 			}
1990 1990
 
@@ -2023,18 +2023,18 @@  discard block
 block discarded – undo
2023 2023
 		// On recherche les remises
2024 2024
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
2025 2025
 		$sql .= " re.description, re.fk_facture_source";
2026
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
2027
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
2028
-		$sql .= " AND re.entity = " . $conf->entity;
2026
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
2027
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
2028
+		$sql .= " AND re.entity = ".$conf->entity;
2029 2029
 		if ($filter) {
2030
-			$sql .= " AND " . $filter;
2030
+			$sql .= " AND ".$filter;
2031 2031
 		}
2032 2032
 		$sql .= " ORDER BY re.description ASC";
2033 2033
 
2034
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
2034
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
2035 2035
 		$resql = $this->db->query($sql);
2036 2036
 		if ($resql) {
2037
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
2037
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
2038 2038
 			$num = $this->db->num_rows($resql);
2039 2039
 
2040 2040
 			$qualifiedlines = $num;
@@ -2072,16 +2072,16 @@  discard block
 block discarded – undo
2072 2072
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
2073 2073
 						$tmpfac = new Facture($this->db);
2074 2074
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
2075
-							$desc = $desc . ' - ' . $tmpfac->ref;
2075
+							$desc = $desc.' - '.$tmpfac->ref;
2076 2076
 						}
2077 2077
 					}
2078 2078
 
2079
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
2079
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
2080 2080
 					$i++;
2081 2081
 				}
2082 2082
 			}
2083 2083
 			print '</select>';
2084
-			print ajax_combobox('select_' . $htmlname);
2084
+			print ajax_combobox('select_'.$htmlname);
2085 2085
 
2086 2086
 			return $qualifiedlines;
2087 2087
 		} else {
@@ -2188,14 +2188,14 @@  discard block
 block discarded – undo
2188 2188
 		if ($showlabelofentity) {
2189 2189
 			$sql .= ", e.label";
2190 2190
 		}
2191
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2191
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2192 2192
 		if ($showlabelofentity) {
2193
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2193
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2194 2194
 		}
2195 2195
 		// Condition here should be the same than into societe->getSalesRepresentatives().
2196 2196
 		if ($userissuperadminentityone && $force_entity != 'default') {
2197 2197
 			if (!empty($force_entity)) {
2198
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2198
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2199 2199
 			} else {
2200 2200
 				$sql .= " WHERE u.entity IS NOT NULL";
2201 2201
 			}
@@ -2203,18 +2203,18 @@  discard block
 block discarded – undo
2203 2203
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2204 2204
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2205 2205
 			} else {
2206
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2206
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2207 2207
 			}
2208 2208
 		}
2209 2209
 
2210 2210
 		if (!empty($user->socid)) {
2211
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2211
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2212 2212
 		}
2213 2213
 		if (is_array($exclude) && $excludeUsers) {
2214
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2214
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2215 2215
 		}
2216 2216
 		if ($includeUsers) {
2217
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2217
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2218 2218
 		}
2219 2219
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2220 2220
 			$sql .= " AND u.statut <> 0";
@@ -2226,7 +2226,7 @@  discard block
 block discarded – undo
2226 2226
 			$sql .= " AND u.fk_soc IS NULL";
2227 2227
 		}
2228 2228
 		if (!empty($morefilter)) {
2229
-			$sql .= " " . $morefilter;
2229
+			$sql .= " ".$morefilter;
2230 2230
 		}
2231 2231
 
2232 2232
 		//Add hook to filter on user (for example on usergroup define in custom modules)
@@ -2241,7 +2241,7 @@  discard block
 block discarded – undo
2241 2241
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2242 2242
 		}
2243 2243
 
2244
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2244
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2245 2245
 
2246 2246
 		$resql = $this->db->query($sql);
2247 2247
 		if ($resql) {
@@ -2249,7 +2249,7 @@  discard block
 block discarded – undo
2249 2249
 			$i = 0;
2250 2250
 			if ($num) {
2251 2251
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2252
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2252
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2253 2253
 				if ($show_empty && !$multiple) {
2254 2254
 					$textforempty = ' ';
2255 2255
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2258,10 +2258,10 @@  discard block
 block discarded – undo
2258 2258
 					if (!is_numeric($show_empty)) {
2259 2259
 						$textforempty = $show_empty;
2260 2260
 					}
2261
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2261
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2262 2262
 				}
2263 2263
 				if ($show_every) {
2264
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2264
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2265 2265
 				}
2266 2266
 
2267 2267
 				$userstatic = new User($this->db);
@@ -2308,21 +2308,21 @@  discard block
 block discarded – undo
2308 2308
 					}
2309 2309
 					if ($showstatus >= 0) {
2310 2310
 						if ($obj->status == 1 && $showstatus == 1) {
2311
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2312
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2311
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2312
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2313 2313
 						}
2314 2314
 						if ($obj->status == 0 && $showstatus == 1) {
2315
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2316
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2315
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2316
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2317 2317
 						}
2318 2318
 					}
2319 2319
 					if ($showlabelofentity) {
2320 2320
 						if (empty($obj->entity)) {
2321
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2322
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2321
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2322
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2323 2323
 						} else {
2324 2324
 							if ($obj->entity != $conf->entity) {
2325
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2325
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2326 2326
 								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2327 2327
 							}
2328 2328
 						}
@@ -2331,13 +2331,13 @@  discard block
 block discarded – undo
2331 2331
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2332 2332
 					if (!empty($disableline) && $disableline != '1') {
2333 2333
 						// Add text from $enableonlytext parameter
2334
-						$moreinfo .= ' - ' . $disableline;
2335
-						$moreinfohtml .= ' - ' . $disableline;
2334
+						$moreinfo .= ' - '.$disableline;
2335
+						$moreinfohtml .= ' - '.$disableline;
2336 2336
 					}
2337 2337
 					$labeltoshow .= $moreinfo;
2338 2338
 					$labeltoshowhtml .= $moreinfohtml;
2339 2339
 
2340
-					$out .= '<option value="' . $obj->rowid . '"';
2340
+					$out .= '<option value="'.$obj->rowid.'"';
2341 2341
 					if (!empty($disableline)) {
2342 2342
 						$out .= ' disabled';
2343 2343
 					}
@@ -2345,7 +2345,7 @@  discard block
 block discarded – undo
2345 2345
 						$out .= ' selected';
2346 2346
 					}
2347 2347
 					$out .= ' data-html="';
2348
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2348
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2349 2349
 					if ($showstatus >= 0 && $obj->status == 0) {
2350 2350
 						$outhtml .= '<strike class="opacitymediumxxx">';
2351 2351
 					}
@@ -2358,7 +2358,7 @@  discard block
 block discarded – undo
2358 2358
 					$out .= $labeltoshow;
2359 2359
 					$out .= '</option>';
2360 2360
 
2361
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2361
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2362 2362
 					$outarray2[$userstatic->id] = array(
2363 2363
 						'id' => $userstatic->id,
2364 2364
 						'label' => $labeltoshow,
@@ -2370,14 +2370,14 @@  discard block
 block discarded – undo
2370 2370
 					$i++;
2371 2371
 				}
2372 2372
 			} else {
2373
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2374
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2373
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2374
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2375 2375
 			}
2376 2376
 			$out .= '</select>';
2377 2377
 
2378 2378
 			if ($num && !$forcecombo) {
2379 2379
 				// Enhance with select2
2380
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2380
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2381 2381
 				$out .= ajax_combobox($htmlname);
2382 2382
 			}
2383 2383
 		} else {
@@ -2451,16 +2451,16 @@  discard block
 block discarded – undo
2451 2451
 			$out .= $userstatic->getNomUrl(-1);
2452 2452
 			if ($i == 0) {
2453 2453
 				$ownerid = $value['id'];
2454
-				$out .= ' (' . $langs->trans("Owner") . ')';
2454
+				$out .= ' ('.$langs->trans("Owner").')';
2455 2455
 			}
2456 2456
 			if ($nbassignetouser > 1 && $action != 'view') {
2457
-				$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 . '">';
2457
+				$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.'">';
2458 2458
 			}
2459 2459
 			// Show my availability
2460 2460
 			if ($showproperties) {
2461 2461
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2462 2462
 					$out .= '<div class="myavailability inline-block">';
2463
-					$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>';
2463
+					$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>';
2464 2464
 					$out .= '</div>';
2465 2465
 				}
2466 2466
 			}
@@ -2477,15 +2477,15 @@  discard block
 block discarded – undo
2477 2477
 		// Method with no ajax
2478 2478
 		if ($action != 'view') {
2479 2479
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2480
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2480
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2481 2481
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2482 2482
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2483
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2484
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2483
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2484
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2485 2485
 			$out .= '});';
2486 2486
 			$out .= '})</script>';
2487 2487
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2488
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2488
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2489 2489
 			$out .= '<br>';
2490 2490
 		}
2491 2491
 
@@ -2544,13 +2544,13 @@  discard block
 block discarded – undo
2544 2544
 			$resourcestatic->fetch($value['id']);
2545 2545
 			$out .= $resourcestatic->getNomUrl(-1);
2546 2546
 			if ($nbassignetoresource > 1 && $action != 'view') {
2547
-				$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 . '">';
2547
+				$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.'">';
2548 2548
 			}
2549 2549
 			// Show my availability
2550 2550
 			if ($showproperties) {
2551 2551
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2552 2552
 					$out .= '<div class="myavailability inline-block">';
2553
-					$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>';
2553
+					$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>';
2554 2554
 					$out .= '</div>';
2555 2555
 				}
2556 2556
 			}
@@ -2567,11 +2567,11 @@  discard block
 block discarded – undo
2567 2567
 		// Method with no ajax
2568 2568
 		if ($action != 'view') {
2569 2569
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">';
2570
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2570
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2571 2571
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2572 2572
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2573
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2574
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2573
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2574
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2575 2575
 			$out .= '});';
2576 2576
 			$out .= '})</script>';
2577 2577
 
@@ -2579,7 +2579,7 @@  discard block
 block discarded – undo
2579 2579
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2580 2580
 			$out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0);
2581 2581
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2582
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2582
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2583 2583
 			$out .= '<br>';
2584 2584
 		}
2585 2585
 
@@ -2641,7 +2641,7 @@  discard block
 block discarded – undo
2641 2641
 			$placeholder = '';
2642 2642
 
2643 2643
 			if ($selected && empty($selected_input_value)) {
2644
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2644
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2645 2645
 				$producttmpselect = new Product($this->db);
2646 2646
 				$producttmpselect->fetch($selected);
2647 2647
 				$selected_input_value = $producttmpselect->ref;
@@ -2656,17 +2656,17 @@  discard block
 block discarded – undo
2656 2656
 				}
2657 2657
 			}
2658 2658
 			// mode=1 means customers products
2659
-			$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;
2660
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2659
+			$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;
2660
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2661 2661
 
2662 2662
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2663 2663
 				// Code to automatically insert with javascript the select of attributes under the select of product
2664 2664
 				// when a parent of variant has been selected.
2665 2665
 				$out .= '
2666 2666
 				<!-- script to auto show attributes select tags if a variant was selected -->
2667
-				<script nonce="' . getNonce() . '">
2667
+				<script nonce="' . getNonce().'">
2668 2668
 					// auto show attributes fields
2669
-					selected = ' . json_encode($selected_combinations) . ';
2669
+					selected = ' . json_encode($selected_combinations).';
2670 2670
 					combvalues = {};
2671 2671
 
2672 2672
 					jQuery(document).ready(function () {
@@ -2677,7 +2677,7 @@  discard block
 block discarded – undo
2677 2677
 							}
2678 2678
 						});
2679 2679
 
2680
-						jQuery("input#' . $htmlname . '").change(function () {
2680
+						jQuery("input#' . $htmlname.'").change(function () {
2681 2681
 
2682 2682
 							if (!jQuery(this).val()) {
2683 2683
 								jQuery(\'div#attributes_box\').empty();
@@ -2686,7 +2686,7 @@  discard block
 block discarded – undo
2686 2686
 
2687 2687
 							console.log("A change has started. We get variants fields to inject html select");
2688 2688
 
2689
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2689
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2690 2690
 								id: jQuery(this).val()
2691 2691
 							}, function (data) {
2692 2692
 								jQuery(\'div#attributes_box\').empty();
@@ -2729,21 +2729,21 @@  discard block
 block discarded – undo
2729 2729
 							})
2730 2730
 						});
2731 2731
 
2732
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2732
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2733 2733
 					});
2734 2734
 				</script>
2735 2735
                 ';
2736 2736
 			}
2737 2737
 
2738 2738
 			if (empty($hidelabel)) {
2739
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2739
+				$out .= $langs->trans("RefOrLabel").' : ';
2740 2740
 			} elseif ($hidelabel > 1) {
2741
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2741
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2742 2742
 				if ($hidelabel == 2) {
2743 2743
 					$out .= img_picto($langs->trans("Search"), 'search');
2744 2744
 				}
2745 2745
 			}
2746
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2746
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2747 2747
 			if ($hidelabel == 3) {
2748 2748
 				$out .= img_picto($langs->trans("Search"), 'search');
2749 2749
 			}
@@ -2780,33 +2780,33 @@  discard block
 block discarded – undo
2780 2780
 		// phpcs:enable
2781 2781
 		global $db;
2782 2782
 
2783
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2783
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2784 2784
 
2785 2785
 		$error = 0;
2786 2786
 		$out = '';
2787 2787
 
2788 2788
 		if (!$forcecombo) {
2789
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2789
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2790 2790
 			$events = array();
2791 2791
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2792 2792
 		}
2793 2793
 
2794
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2794
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2795 2795
 
2796 2796
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2797
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2798
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2797
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2798
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2799 2799
 		if (!empty($status)) {
2800
-			$sql .= ' AND status = ' . (int) $status;
2800
+			$sql .= ' AND status = '.(int) $status;
2801 2801
 		}
2802 2802
 		if (!empty($type)) {
2803
-			$sql .= ' AND bomtype = ' . (int) $type;
2803
+			$sql .= ' AND bomtype = '.(int) $type;
2804 2804
 		}
2805 2805
 		if (!empty($TProducts)) {
2806
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2806
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2807 2807
 		}
2808 2808
 		if (!empty($limit)) {
2809
-			$sql .= ' LIMIT ' . (int) $limit;
2809
+			$sql .= ' LIMIT '.(int) $limit;
2810 2810
 		}
2811 2811
 		$resql = $db->query($sql);
2812 2812
 		if ($resql) {
@@ -2820,11 +2820,11 @@  discard block
 block discarded – undo
2820 2820
 			while ($obj = $db->fetch_object($resql)) {
2821 2821
 				$product = new Product($db);
2822 2822
 				$res = $product->fetch($obj->fk_product);
2823
-				$out .= '<option value="' . $obj->rowid . '"';
2823
+				$out .= '<option value="'.$obj->rowid.'"';
2824 2824
 				if ($obj->rowid == $selected) {
2825 2825
 					$out .= 'selected';
2826 2826
 				}
2827
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2827
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2828 2828
 			}
2829 2829
 		} else {
2830 2830
 			$error++;
@@ -2881,7 +2881,7 @@  discard block
 block discarded – undo
2881 2881
 
2882 2882
 		$warehouseStatusArray = array();
2883 2883
 		if (!empty($warehouseStatus)) {
2884
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2884
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2885 2885
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2886 2886
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2887 2887
 			}
@@ -2895,9 +2895,9 @@  discard block
 block discarded – undo
2895 2895
 
2896 2896
 		$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";
2897 2897
 		if (count($warehouseStatusArray)) {
2898
-			$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
2898
+			$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
2899 2899
 		} else {
2900
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2900
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2901 2901
 		}
2902 2902
 
2903 2903
 		$sql = "SELECT ";
@@ -2913,9 +2913,9 @@  discard block
 block discarded – undo
2913 2913
 
2914 2914
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2915 2915
 			//Product category
2916
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2917
-						FROM " . $this->db->prefix() . "categorie_product
2918
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2916
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2917
+						FROM " . $this->db->prefix()."categorie_product
2918
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2919 2919
 						LIMIT 1
2920 2920
 				) AS categorie_product_id ";
2921 2921
 		}
@@ -2941,15 +2941,15 @@  discard block
 block discarded – undo
2941 2941
 		}
2942 2942
 		// Price by quantity
2943 2943
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2944
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2944
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2945 2945
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2946
-				$sql .= " AND price_level = " . ((int) $price_level);
2946
+				$sql .= " AND price_level = ".((int) $price_level);
2947 2947
 			}
2948 2948
 			$sql .= " ORDER BY date_price";
2949 2949
 			$sql .= " DESC LIMIT 1) as price_rowid";
2950
-			$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
2950
+			$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
2951 2951
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2952
-				$sql .= " AND price_level = " . ((int) $price_level);
2952
+				$sql .= " AND price_level = ".((int) $price_level);
2953 2953
 			}
2954 2954
 			$sql .= " ORDER BY date_price";
2955 2955
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -2958,58 +2958,58 @@  discard block
 block discarded – undo
2958 2958
 
2959 2959
 		$sql .= " FROM ".$this->db->prefix()."product as p";
2960 2960
 		// Add from (left join) from hooks
2961
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
2961
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
2962 2962
 		$reshook = $hookmanager->executeHooks('selectProductsListFrom', $parameters); // Note that $action and $object may have been modified by hook
2963 2963
 		$sql .= $hookmanager->resPrint;
2964 2964
 
2965 2965
 		if (count($warehouseStatusArray)) {
2966
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
2967
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
2968
-			$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.
2966
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
2967
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
2968
+			$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.
2969 2969
 		}
2970 2970
 
2971 2971
 		// include search in supplier ref
2972 2972
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2973
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2973
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2974 2974
 		}
2975 2975
 
2976 2976
 		//Price by customer
2977 2977
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2978
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
2978
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
2979 2979
 		}
2980 2980
 		// Units
2981 2981
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
2982
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
2982
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
2983 2983
 		}
2984 2984
 		// Multilang : we add translation
2985 2985
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
2986
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
2986
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
2987 2987
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
2988
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
2988
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
2989 2989
 				$soc = new Societe($this->db);
2990 2990
 				$result = $soc->fetch($socid);
2991 2991
 				if ($result > 0 && !empty($soc->default_lang)) {
2992
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
2992
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
2993 2993
 				} else {
2994
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2994
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2995 2995
 				}
2996 2996
 			} else {
2997
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2997
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2998 2998
 			}
2999 2999
 		}
3000 3000
 
3001 3001
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
3002
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
3002
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
3003 3003
 		}
3004 3004
 
3005
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
3005
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
3006 3006
 
3007 3007
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
3008 3008
 			$sql .= " AND pac.rowid IS NULL";
3009 3009
 		}
3010 3010
 
3011 3011
 		if ($finished == 0) {
3012
-			$sql .= " AND p.finished = " . ((int) $finished);
3012
+			$sql .= " AND p.finished = ".((int) $finished);
3013 3013
 		} elseif ($finished == 1) {
3014 3014
 			$sql .= " AND p.finished = ".((int) $finished);
3015 3015
 		}
@@ -3017,18 +3017,18 @@  discard block
 block discarded – undo
3017 3017
 			$sql .= " AND p.tosell = ".((int) $status);
3018 3018
 		}
3019 3019
 		if ($status_purchase >= 0) {
3020
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
3020
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
3021 3021
 		}
3022 3022
 		// Filter by product type
3023 3023
 		if (strval($filtertype) != '') {
3024
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3024
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3025 3025
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
3026 3026
 			$sql .= " AND p.fk_product_type = 1";
3027 3027
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
3028 3028
 			$sql .= " AND p.fk_product_type = 0";
3029 3029
 		}
3030 3030
 		// Add where from hooks
3031
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
3031
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
3032 3032
 		$reshook = $hookmanager->executeHooks('selectProductsListWhere', $parameters); // Note that $action and $object may have been modified by hook
3033 3033
 		$sql .= $hookmanager->resPrint;
3034 3034
 		// Add criteria on ref/label
@@ -3045,21 +3045,21 @@  discard block
 block discarded – undo
3045 3045
 				if ($i > 0) {
3046 3046
 					$sql .= " AND ";
3047 3047
 				}
3048
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3048
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
3049 3049
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
3050
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3050
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
3051 3051
 				}
3052 3052
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
3053
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3053
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
3054 3054
 				}
3055 3055
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
3056
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3056
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
3057 3057
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
3058
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3058
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
3059 3059
 					}
3060 3060
 				}
3061 3061
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
3062
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3062
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3063 3063
 				}
3064 3064
 				$sql .= ")";
3065 3065
 				$i++;
@@ -3068,12 +3068,12 @@  discard block
 block discarded – undo
3068 3068
 				$sql .= ")";
3069 3069
 			}
3070 3070
 			if (isModEnabled('barcode')) {
3071
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3071
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3072 3072
 			}
3073 3073
 			$sql .= ')';
3074 3074
 		}
3075 3075
 		if (count($warehouseStatusArray)) {
3076
-			$sql .= " GROUP BY " . $selectFields;
3076
+			$sql .= " GROUP BY ".$selectFields;
3077 3077
 		}
3078 3078
 
3079 3079
 		//Sort by category
@@ -3088,23 +3088,23 @@  discard block
 block discarded – undo
3088 3088
 		$sql .= $this->db->plimit($limit, 0);
3089 3089
 
3090 3090
 		// Build output string
3091
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
3091
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
3092 3092
 		$result = $this->db->query($sql);
3093 3093
 		if ($result) {
3094
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3095
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3096
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3094
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3095
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3096
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3097 3097
 
3098 3098
 			$num = $this->db->num_rows($result);
3099 3099
 
3100 3100
 			$events = array();
3101 3101
 
3102 3102
 			if (!$forcecombo) {
3103
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3103
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3104 3104
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
3105 3105
 			}
3106 3106
 
3107
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
3107
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
3108 3108
 
3109 3109
 			$textifempty = '';
3110 3110
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -3121,7 +3121,7 @@  discard block
 block discarded – undo
3121 3121
 				}
3122 3122
 			}
3123 3123
 			if ($showempty) {
3124
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
3124
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
3125 3125
 			}
3126 3126
 
3127 3127
 			$i = 0;
@@ -3132,11 +3132,11 @@  discard block
 block discarded – undo
3132 3132
 
3133 3133
 				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
3134 3134
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
3135
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
3136
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
3135
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
3136
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
3137 3137
 					$sql .= " ORDER BY quantity ASC";
3138 3138
 
3139
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
3139
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
3140 3140
 					$result2 = $this->db->query($sql);
3141 3141
 					if ($result2) {
3142 3142
 						$nb_prices = $this->db->num_rows($result2);
@@ -3174,7 +3174,7 @@  discard block
 block discarded – undo
3174 3174
 						$price_product = new Product($this->db);
3175 3175
 						$price_product->fetch($objp->rowid, '', '', 1);
3176 3176
 
3177
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3177
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3178 3178
 						$priceparser = new PriceParser($this->db);
3179 3179
 						$price_result = $priceparser->parseProduct($price_product);
3180 3180
 						if ($price_result >= 0) {
@@ -3258,7 +3258,7 @@  discard block
 block discarded – undo
3258 3258
 			$label = $objp->label_translated;
3259 3259
 		}
3260 3260
 		if (!empty($filterkey) && $filterkey != '') {
3261
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3261
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3262 3262
 		}
3263 3263
 
3264 3264
 		$outkey = $objp->rowid;
@@ -3279,32 +3279,32 @@  discard block
 block discarded – undo
3279 3279
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3280 3280
 
3281 3281
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3282
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3282
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3283 3283
 		}
3284 3284
 
3285 3285
 		// Units
3286 3286
 		$outvalUnits = '';
3287 3287
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3288 3288
 			if (!empty($objp->unit_short)) {
3289
-				$outvalUnits .= ' - ' . $objp->unit_short;
3289
+				$outvalUnits .= ' - '.$objp->unit_short;
3290 3290
 			}
3291 3291
 		}
3292 3292
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3293 3293
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3294 3294
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3295
-				$outvalUnits .= ' - ' . $unitToShow;
3295
+				$outvalUnits .= ' - '.$unitToShow;
3296 3296
 			}
3297 3297
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3298
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3299
-				$outvalUnits .= ' - ' . $unitToShow;
3298
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3299
+				$outvalUnits .= ' - '.$unitToShow;
3300 3300
 			}
3301 3301
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3302 3302
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3303
-				$outvalUnits .= ' - ' . $unitToShow;
3303
+				$outvalUnits .= ' - '.$unitToShow;
3304 3304
 			}
3305 3305
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3306 3306
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3307
-				$outvalUnits .= ' - ' . $unitToShow;
3307
+				$outvalUnits .= ' - '.$unitToShow;
3308 3308
 			}
3309 3309
 		}
3310 3310
 		if ($outdurationvalue && $outdurationunit) {
@@ -3316,14 +3316,14 @@  discard block
 block discarded – undo
3316 3316
 				'y' => $langs->trans('Year')
3317 3317
 			);
3318 3318
 			if (isset($da[$outdurationunit])) {
3319
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3319
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3320 3320
 			}
3321 3321
 		}
3322 3322
 
3323
-		$opt = '<option value="' . $objp->rowid . '"';
3323
+		$opt = '<option value="'.$objp->rowid.'"';
3324 3324
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3325 3325
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3326
-			$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 . '"';
3326
+			$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.'"';
3327 3327
 		}
3328 3328
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3329 3329
 			if ($user->hasRight('stock', 'lire')) {
@@ -3335,36 +3335,36 @@  discard block
 block discarded – undo
3335 3335
 			}
3336 3336
 		}
3337 3337
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3338
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3339
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3338
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3339
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3340 3340
 		}
3341 3341
 		$opt .= '>';
3342 3342
 		$opt .= $objp->ref;
3343 3343
 		if (!empty($objp->custref)) {
3344
-			$opt .= ' (' . $objp->custref . ')';
3344
+			$opt .= ' ('.$objp->custref.')';
3345 3345
 		}
3346 3346
 		if ($outbarcode) {
3347
-			$opt .= ' (' . $outbarcode . ')';
3347
+			$opt .= ' ('.$outbarcode.')';
3348 3348
 		}
3349
-		$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
3349
+		$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
3350 3350
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3351
-			$opt .= ' (' . getCountry($outorigin, 1) . ')';
3351
+			$opt .= ' ('.getCountry($outorigin, 1).')';
3352 3352
 		}
3353 3353
 
3354 3354
 		$objRef = $objp->ref;
3355 3355
 		if (!empty($objp->custref)) {
3356
-			$objRef .= ' (' . $objp->custref . ')';
3356
+			$objRef .= ' ('.$objp->custref.')';
3357 3357
 		}
3358 3358
 		if (!empty($filterkey) && $filterkey != '') {
3359
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3359
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3360 3360
 		}
3361 3361
 		$outval .= $objRef;
3362 3362
 		if ($outbarcode) {
3363
-			$outval .= ' (' . $outbarcode . ')';
3363
+			$outval .= ' ('.$outbarcode.')';
3364 3364
 		}
3365
-		$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
3365
+		$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
3366 3366
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3367
-			$outval .= ' (' . getCountry($outorigin, 1) . ')';
3367
+			$outval .= ' ('.getCountry($outorigin, 1).')';
3368 3368
 		}
3369 3369
 
3370 3370
 		// Units
@@ -3377,35 +3377,35 @@  discard block
 block discarded – undo
3377 3377
 		// If we need a particular price level (from 1 to n)
3378 3378
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
3379 3379
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3380
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3381
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3382
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3383
-			$sql .= " AND price_level = " . ((int) $price_level);
3380
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3381
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3382
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3383
+			$sql .= " AND price_level = ".((int) $price_level);
3384 3384
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3385 3385
 			$sql .= " LIMIT 1";
3386 3386
 
3387
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3387
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3388 3388
 			$result2 = $this->db->query($sql);
3389 3389
 			if ($result2) {
3390 3390
 				$objp2 = $this->db->fetch_object($result2);
3391 3391
 				if ($objp2) {
3392 3392
 					$found = 1;
3393 3393
 					if ($objp2->price_base_type == 'HT') {
3394
-						$opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3395
-						$outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3394
+						$opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3395
+						$outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3396 3396
 					} else {
3397
-						$opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3398
-						$outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3397
+						$opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3398
+						$outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3399 3399
 					}
3400 3400
 					$outprice_ht = price($objp2->price);
3401 3401
 					$outprice_ttc = price($objp2->price_ttc);
3402 3402
 					$outpricebasetype = $objp2->price_base_type;
3403 3403
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3404
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3405
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3404
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3405
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3406 3406
 					} else {
3407
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3408
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3407
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3408
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3409 3409
 					}
3410 3410
 				}
3411 3411
 			} else {
@@ -3419,13 +3419,13 @@  discard block
 block discarded – undo
3419 3419
 			$outqty = $objp->quantity;
3420 3420
 			$outdiscount = $objp->remise_percent;
3421 3421
 			if ($objp->quantity == 1) {
3422
-				$opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3423
-				$outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3422
+				$opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3423
+				$outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3424 3424
 				$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3425 3425
 				$outval .= $langs->transnoentities("Unit");
3426 3426
 			} else {
3427
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3428
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3427
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3428
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3429 3429
 				$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3430 3430
 				$outval .= $langs->transnoentities("Units");
3431 3431
 			}
@@ -3433,16 +3433,16 @@  discard block
 block discarded – undo
3433 3433
 			$outprice_ht = price($objp->unitprice);
3434 3434
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3435 3435
 			$outpricebasetype = $objp->price_base_type;
3436
-			$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
3437
-			$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
3436
+			$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
3437
+			$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
3438 3438
 		}
3439 3439
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3440
-			$opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3441
-			$outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3440
+			$opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3441
+			$outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3442 3442
 		}
3443 3443
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3444
-			$opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3445
-			$outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3444
+			$opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3445
+			$outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3446 3446
 		}
3447 3447
 
3448 3448
 		// Price by customer
@@ -3451,11 +3451,11 @@  discard block
 block discarded – undo
3451 3451
 				$found = 1;
3452 3452
 
3453 3453
 				if ($objp->custprice_base_type == 'HT') {
3454
-					$opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3455
-					$outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3454
+					$opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3455
+					$outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3456 3456
 				} else {
3457
-					$opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3458
-					$outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3457
+					$opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3458
+					$outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3459 3459
 				}
3460 3460
 
3461 3461
 				$outprice_ht = price($objp->custprice);
@@ -3469,11 +3469,11 @@  discard block
 block discarded – undo
3469 3469
 		// If level no defined or multiprice not found, we used the default price
3470 3470
 		if (empty($hidepriceinlabel) && !$found) {
3471 3471
 			if ($objp->price_base_type == 'HT') {
3472
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3473
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3472
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3473
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3474 3474
 			} else {
3475
-				$opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3476
-				$outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3475
+				$opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3476
+				$outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3477 3477
 			}
3478 3478
 			$outprice_ht = price($objp->price);
3479 3479
 			$outprice_ttc = price($objp->price_ttc);
@@ -3484,14 +3484,14 @@  discard block
 block discarded – undo
3484 3484
 
3485 3485
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3486 3486
 			if ($user->hasRight('stock', 'lire')) {
3487
-				$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3487
+				$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3488 3488
 
3489 3489
 				if ($objp->stock > 0) {
3490 3490
 					$outval .= ' - <span class="product_line_stock_ok">';
3491 3491
 				} elseif ($objp->stock <= 0) {
3492 3492
 					$outval .= ' - <span class="product_line_stock_too_low">';
3493 3493
 				}
3494
-				$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3494
+				$outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3495 3495
 				$outval .= '</span>';
3496 3496
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3497 3497
 					$langs->load("stocks");
@@ -3501,9 +3501,9 @@  discard block
 block discarded – undo
3501 3501
 					$tmpproduct->load_virtual_stock();
3502 3502
 					$virtualstock = $tmpproduct->stock_theorique;
3503 3503
 
3504
-					$opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3504
+					$opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3505 3505
 
3506
-					$outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3506
+					$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
3507 3507
 					if ($virtualstock > 0) {
3508 3508
 						$outval .= '<span class="product_line_stock_ok">';
3509 3509
 					} elseif ($virtualstock <= 0) {
@@ -3581,7 +3581,7 @@  discard block
 block discarded – undo
3581 3581
 		$selected_input_value = '';
3582 3582
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3583 3583
 			if ($selected > 0) {
3584
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3584
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3585 3585
 				$producttmpselect = new Product($this->db);
3586 3586
 				$producttmpselect->fetch($selected);
3587 3587
 				$selected_input_value = $producttmpselect->ref;
@@ -3589,10 +3589,10 @@  discard block
 block discarded – undo
3589 3589
 			}
3590 3590
 
3591 3591
 			// mode=2 means suppliers products
3592
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3593
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3592
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3593
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3594 3594
 
3595
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3595
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3596 3596
 		} else {
3597 3597
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3598 3598
 		}
@@ -3652,25 +3652,25 @@  discard block
 block discarded – undo
3652 3652
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3653 3653
 			$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";
3654 3654
 		}
3655
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3656
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3655
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3656
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3657 3657
 		if ($socid > 0) {
3658
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3658
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3659 3659
 		}
3660
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3660
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3661 3661
 		// Units
3662 3662
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3663
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3663
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3664 3664
 		}
3665
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3665
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3666 3666
 		if ($statut != -1) {
3667
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3667
+			$sql .= " AND p.tobuy = ".((int) $statut);
3668 3668
 		}
3669 3669
 		if (strval($filtertype) != '') {
3670
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3670
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3671 3671
 		}
3672 3672
 		if (!empty($filtre)) {
3673
-			$sql .= " " . $filtre;
3673
+			$sql .= " ".$filtre;
3674 3674
 		}
3675 3675
 		// Add where from hooks
3676 3676
 		$parameters = array();
@@ -3690,9 +3690,9 @@  discard block
 block discarded – undo
3690 3690
 				if ($i > 0) {
3691 3691
 					$sql .= " AND ";
3692 3692
 				}
3693
-				$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) . "%'";
3693
+				$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)."%'";
3694 3694
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3695
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3695
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3696 3696
 				}
3697 3697
 				$sql .= ")";
3698 3698
 				$i++;
@@ -3701,8 +3701,8 @@  discard block
 block discarded – undo
3701 3701
 				$sql .= ")";
3702 3702
 			}
3703 3703
 			if (isModEnabled('barcode')) {
3704
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3705
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3704
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3705
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3706 3706
 			}
3707 3707
 			$sql .= ')';
3708 3708
 		}
@@ -3711,20 +3711,20 @@  discard block
 block discarded – undo
3711 3711
 
3712 3712
 		// Build output string
3713 3713
 
3714
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3714
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3715 3715
 		$result = $this->db->query($sql);
3716 3716
 		if ($result) {
3717
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3718
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3717
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3718
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3719 3719
 
3720 3720
 			$num = $this->db->num_rows($result);
3721 3721
 
3722 3722
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3723
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3723
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3724 3724
 			if (!$selected) {
3725
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3725
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3726 3726
 			} else {
3727
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3727
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3728 3728
 			}
3729 3729
 
3730 3730
 			$i = 0;
@@ -3739,7 +3739,7 @@  discard block
 block discarded – undo
3739 3739
 
3740 3740
 				$outkey = $objp->idprodfournprice; // id in table of price
3741 3741
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3742
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3742
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3743 3743
 				}
3744 3744
 
3745 3745
 				$outref = $objp->ref;
@@ -3754,23 +3754,23 @@  discard block
 block discarded – undo
3754 3754
 				$outvalUnits = '';
3755 3755
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3756 3756
 					if (!empty($objp->unit_short)) {
3757
-						$outvalUnits .= ' - ' . $objp->unit_short;
3757
+						$outvalUnits .= ' - '.$objp->unit_short;
3758 3758
 					}
3759 3759
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3760 3760
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3761
-						$outvalUnits .= ' - ' . $unitToShow;
3761
+						$outvalUnits .= ' - '.$unitToShow;
3762 3762
 					}
3763 3763
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3764
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3765
-						$outvalUnits .= ' - ' . $unitToShow;
3764
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3765
+						$outvalUnits .= ' - '.$unitToShow;
3766 3766
 					}
3767 3767
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3768 3768
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3769
-						$outvalUnits .= ' - ' . $unitToShow;
3769
+						$outvalUnits .= ' - '.$unitToShow;
3770 3770
 					}
3771 3771
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3772 3772
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3773
-						$outvalUnits .= ' - ' . $unitToShow;
3773
+						$outvalUnits .= ' - '.$unitToShow;
3774 3774
 					}
3775 3775
 					if ($outdurationvalue && $outdurationunit) {
3776 3776
 						$da = array(
@@ -3781,22 +3781,22 @@  discard block
 block discarded – undo
3781 3781
 							'y' => $langs->trans('Year')
3782 3782
 						);
3783 3783
 						if (isset($da[$outdurationunit])) {
3784
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3784
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3785 3785
 						}
3786 3786
 					}
3787 3787
 				}
3788 3788
 
3789 3789
 				$objRef = $objp->ref;
3790 3790
 				if ($filterkey && $filterkey != '') {
3791
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3791
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3792 3792
 				}
3793 3793
 				$objRefFourn = $objp->ref_fourn;
3794 3794
 				if ($filterkey && $filterkey != '') {
3795
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3795
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3796 3796
 				}
3797 3797
 				$label = $objp->label;
3798 3798
 				if ($filterkey && $filterkey != '') {
3799
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3799
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3800 3800
 				}
3801 3801
 
3802 3802
 				switch ($objp->fk_product_type) {
@@ -3819,21 +3819,21 @@  discard block
 block discarded – undo
3819 3819
 
3820 3820
 				$optlabel .= $objp->ref;
3821 3821
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3822
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3822
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3823 3823
 				}
3824 3824
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3825
-					$optlabel .= ' (' . $outbarcode . ')';
3825
+					$optlabel .= ' ('.$outbarcode.')';
3826 3826
 				}
3827
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3827
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3828 3828
 
3829 3829
 				$outvallabel = $objRef;
3830 3830
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3831
-					$outvallabel .= ' (' . $objRefFourn . ')';
3831
+					$outvallabel .= ' ('.$objRefFourn.')';
3832 3832
 				}
3833 3833
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3834
-					$outvallabel .= ' (' . $outbarcode . ')';
3834
+					$outvallabel .= ' ('.$outbarcode.')';
3835 3835
 				}
3836
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3836
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3837 3837
 
3838 3838
 				// Units
3839 3839
 				$optlabel .= $outvalUnits;
@@ -3850,7 +3850,7 @@  discard block
 block discarded – undo
3850 3850
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3851 3851
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3852 3852
 
3853
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3853
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3854 3854
 						$priceparser = new PriceParser($this->db);
3855 3855
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3856 3856
 						if ($price_result >= 0) {
@@ -3861,57 +3861,57 @@  discard block
 block discarded – undo
3861 3861
 						}
3862 3862
 					}
3863 3863
 					if ($objp->quantity == 1) {
3864
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3865
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3864
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3865
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3866 3866
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3867 3867
 						$outvallabel .= $langs->transnoentities("Unit");
3868 3868
 					} else {
3869
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3870
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3871
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3872
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3869
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3870
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3871
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3872
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3873 3873
 					}
3874 3874
 
3875 3875
 					if ($objp->quantity > 1) {
3876
-						$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
3877
-						$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
3876
+						$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
3877
+						$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
3878 3878
 					}
3879 3879
 					if ($objp->remise_percent >= 1) {
3880
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3881
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3880
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3881
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3882 3882
 					}
3883 3883
 					if ($objp->duration) {
3884
-						$optlabel .= " - " . $objp->duration;
3885
-						$outvallabel .= " - " . $objp->duration;
3884
+						$optlabel .= " - ".$objp->duration;
3885
+						$outvallabel .= " - ".$objp->duration;
3886 3886
 					}
3887 3887
 					if (!$socid) {
3888
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3889
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3888
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3889
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3890 3890
 					}
3891 3891
 					if ($objp->supplier_reputation) {
3892 3892
 						//TODO dictionary
3893 3893
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3894 3894
 
3895
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3896
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3895
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3896
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3897 3897
 					}
3898 3898
 				} else {
3899
-					$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3900
-					$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3899
+					$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3900
+					$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3901 3901
 				}
3902 3902
 
3903 3903
 				if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3904 3904
 					$novirtualstock = ($showstockinlist == 2);
3905 3905
 
3906 3906
 					if ($user->hasRight('stock', 'lire')) {
3907
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3907
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3908 3908
 
3909 3909
 						if ($objp->stock > 0) {
3910 3910
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3911 3911
 						} elseif ($objp->stock <= 0) {
3912 3912
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3913 3913
 						}
3914
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3914
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3915 3915
 						$optlabel .= '</span>';
3916 3916
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3917 3917
 							$langs->load("stocks");
@@ -3921,9 +3921,9 @@  discard block
 block discarded – undo
3921 3921
 							$tmpproduct->load_virtual_stock();
3922 3922
 							$virtualstock = $tmpproduct->stock_theorique;
3923 3923
 
3924
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3924
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3925 3925
 
3926
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3926
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
3927 3927
 							if ($virtualstock > 0) {
3928 3928
 								$optlabel .= '<span class="product_line_stock_ok">';
3929 3929
 							} elseif ($virtualstock <= 0) {
@@ -3937,7 +3937,7 @@  discard block
 block discarded – undo
3937 3937
 					}
3938 3938
 				}
3939 3939
 
3940
-				$optstart = '<option value="' . $outkey . '"';
3940
+				$optstart = '<option value="'.$outkey.'"';
3941 3941
 				if ($selected && $selected == $objp->idprodfournprice) {
3942 3942
 					$optstart .= ' selected';
3943 3943
 				}
@@ -3946,31 +3946,31 @@  discard block
 block discarded – undo
3946 3946
 				}
3947 3947
 
3948 3948
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
3949
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
3950
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
3951
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
3952
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
3953
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
3954
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
3955
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
3956
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
3957
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
3958
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
3949
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
3950
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
3951
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
3952
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
3953
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
3954
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
3955
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
3956
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
3957
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
3958
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
3959 3959
 					if (isModEnabled('multicurrency')) {
3960
-						$optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"';
3961
-						$optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"';
3960
+						$optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"';
3961
+						$optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"';
3962 3962
 					}
3963 3963
 				}
3964
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
3964
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
3965 3965
 
3966 3966
 				$outarrayentry = array(
3967 3967
 					'key' => $outkey,
3968 3968
 					'value' => $outref,
3969 3969
 					'label' => $outvallabel,
3970 3970
 					'qty' => $outqty,
3971
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
3972
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3973
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3971
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3972
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3973
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3974 3974
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
3975 3975
 					'tva_tx' => price2num($objp->tva_tx),
3976 3976
 					'default_vat_code' => $objp->default_vat_code,
@@ -4000,17 +4000,17 @@  discard block
 block discarded – undo
4000 4000
 				// Add new entry
4001 4001
 				// "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
4002 4002
 				// "label" value of json key array is used by jQuery automatically as text for combo box
4003
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
4003
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
4004 4004
 				$outarraypush = array(
4005 4005
 					'key' => $outkey,
4006 4006
 					'value' => $outref,
4007 4007
 					'label' => $outvallabel,
4008 4008
 					'qty' => $outqty,
4009
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
4009
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
4010 4010
 					'price_qty_ht_locale' => price($objp->fprice),
4011
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
4011
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
4012 4012
 					'price_unit_ht_locale' => price($objp->unitprice),
4013
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
4013
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
4014 4014
 					'tva_tx_formated' => price($objp->tva_tx),
4015 4015
 					'tva_tx' => price2num($objp->tva_tx),
4016 4016
 					'default_vat_code' => $objp->default_vat_code,
@@ -4043,7 +4043,7 @@  discard block
 block discarded – undo
4043 4043
 
4044 4044
 			$this->db->free($result);
4045 4045
 
4046
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
4046
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
4047 4047
 			$out .= ajax_combobox($htmlname);
4048 4048
 		} else {
4049 4049
 			dol_print_error($this->db);
@@ -4075,43 +4075,43 @@  discard block
 block discarded – undo
4075 4075
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
4076 4076
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
4077 4077
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
4078
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
4079
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
4080
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
4081
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
4078
+		$sql .= " FROM ".$this->db->prefix()."product as p";
4079
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
4080
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
4081
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
4082 4082
 		$sql .= " AND p.tobuy = 1";
4083 4083
 		$sql .= " AND s.fournisseur = 1";
4084
-		$sql .= " AND p.rowid = " . ((int) $productid);
4084
+		$sql .= " AND p.rowid = ".((int) $productid);
4085 4085
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
4086 4086
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
4087 4087
 		} else {
4088 4088
 			$sql .= " ORDER BY pfp.unitprice ASC";
4089 4089
 		}
4090 4090
 
4091
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
4091
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
4092 4092
 		$result = $this->db->query($sql);
4093 4093
 
4094 4094
 		if ($result) {
4095 4095
 			$num = $this->db->num_rows($result);
4096 4096
 
4097
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4097
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4098 4098
 
4099 4099
 			if (!$num) {
4100
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
4100
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
4101 4101
 			} else {
4102
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4102
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4103 4103
 				$form .= '<option value="0">&nbsp;</option>';
4104 4104
 
4105 4105
 				$i = 0;
4106 4106
 				while ($i < $num) {
4107 4107
 					$objp = $this->db->fetch_object($result);
4108 4108
 
4109
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
4109
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
4110 4110
 					//if there is only one supplier, preselect it
4111 4111
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
4112 4112
 						$opt .= ' selected';
4113 4113
 					}
4114
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
4114
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
4115 4115
 
4116 4116
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
4117 4117
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -4121,7 +4121,7 @@  discard block
 block discarded – undo
4121 4121
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
4122 4122
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
4123 4123
 
4124
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
4124
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
4125 4125
 						$priceparser = new PriceParser($this->db);
4126 4126
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
4127 4127
 						if ($price_result >= 0) {
@@ -4132,10 +4132,10 @@  discard block
 block discarded – undo
4132 4132
 						}
4133 4133
 					}
4134 4134
 					if ($objp->quantity == 1) {
4135
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
4135
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
4136 4136
 					}
4137 4137
 
4138
-					$opt .= $objp->quantity . ' ';
4138
+					$opt .= $objp->quantity.' ';
4139 4139
 
4140 4140
 					if ($objp->quantity == 1) {
4141 4141
 						$opt .= $langs->trans("Unit");
@@ -4144,10 +4144,10 @@  discard block
 block discarded – undo
4144 4144
 					}
4145 4145
 					if ($objp->quantity > 1) {
4146 4146
 						$opt .= " - ";
4147
-						$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");
4147
+						$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");
4148 4148
 					}
4149 4149
 					if ($objp->duration) {
4150
-						$opt .= " - " . $objp->duration;
4150
+						$opt .= " - ".$objp->duration;
4151 4151
 					}
4152 4152
 					$opt .= "</option>\n";
4153 4153
 
@@ -4185,8 +4185,8 @@  discard block
 block discarded – undo
4185 4185
 		dol_syslog(__METHOD__, LOG_DEBUG);
4186 4186
 
4187 4187
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4188
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4189
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4188
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4189
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4190 4190
 		$sql .= " AND active > 0";
4191 4191
 		$sql .= " ORDER BY sortorder";
4192 4192
 
@@ -4198,7 +4198,7 @@  discard block
 block discarded – undo
4198 4198
 				$obj = $this->db->fetch_object($resql);
4199 4199
 
4200 4200
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4201
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4201
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4202 4202
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4203 4203
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4204 4204
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4226,7 +4226,7 @@  discard block
 block discarded – undo
4226 4226
 		// phpcs:enable
4227 4227
 		global $langs;
4228 4228
 
4229
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4229
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4230 4230
 		if ($num > 0) {
4231 4231
 			return 0; // Cache already loaded
4232 4232
 		}
@@ -4236,7 +4236,7 @@  discard block
 block discarded – undo
4236 4236
 		$langs->load('propal');
4237 4237
 
4238 4238
 		$sql = "SELECT rowid, code, label, position";
4239
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4239
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4240 4240
 		$sql .= " WHERE active > 0";
4241 4241
 
4242 4242
 		$resql = $this->db->query($sql);
@@ -4247,7 +4247,7 @@  discard block
 block discarded – undo
4247 4247
 				$obj = $this->db->fetch_object($resql);
4248 4248
 
4249 4249
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4250
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4250
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4251 4251
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4252 4252
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4253 4253
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4279,17 +4279,17 @@  discard block
 block discarded – undo
4279 4279
 
4280 4280
 		$this->load_cache_availability();
4281 4281
 
4282
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4282
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4283 4283
 
4284
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4284
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4285 4285
 		if ($addempty) {
4286 4286
 			print '<option value="0">&nbsp;</option>';
4287 4287
 		}
4288 4288
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4289 4289
 			if ($selected == $id) {
4290
-				print '<option value="' . $id . '" selected>';
4290
+				print '<option value="'.$id.'" selected>';
4291 4291
 			} else {
4292
-				print '<option value="' . $id . '">';
4292
+				print '<option value="'.$id.'">';
4293 4293
 			}
4294 4294
 			print dol_escape_htmltag($arrayavailability['label']);
4295 4295
 			print '</option>';
@@ -4310,13 +4310,13 @@  discard block
 block discarded – undo
4310 4310
 	{
4311 4311
 		global $langs;
4312 4312
 
4313
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4313
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4314 4314
 		if ($num > 0) {
4315 4315
 			return 0; // Cache already loaded
4316 4316
 		}
4317 4317
 
4318 4318
 		$sql = "SELECT rowid, code, label";
4319
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4319
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4320 4320
 		$sql .= " WHERE active > 0";
4321 4321
 
4322 4322
 		$resql = $this->db->query($sql);
@@ -4329,8 +4329,8 @@  discard block
 block discarded – undo
4329 4329
 
4330 4330
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4331 4331
 				$label = ($obj->label != '-' ? $obj->label : '');
4332
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4333
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4332
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4333
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4334 4334
 				}
4335 4335
 				if ($langs->trans($obj->code) != $obj->code) {
4336 4336
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4370,9 +4370,9 @@  discard block
 block discarded – undo
4370 4370
 
4371 4371
 		$this->loadCacheInputReason();
4372 4372
 
4373
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4373
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4374 4374
 		if ($addempty) {
4375
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4375
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4376 4376
 		}
4377 4377
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4378 4378
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4380,9 +4380,9 @@  discard block
 block discarded – undo
4380 4380
 			}
4381 4381
 
4382 4382
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4383
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4383
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4384 4384
 			} else {
4385
-				print '<option value="' . $arraydemandreason['id'] . '">';
4385
+				print '<option value="'.$arraydemandreason['id'].'">';
4386 4386
 			}
4387 4387
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4388 4388
 			print $langs->trans($label);
@@ -4392,7 +4392,7 @@  discard block
 block discarded – undo
4392 4392
 		if ($user->admin && empty($notooltip)) {
4393 4393
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4394 4394
 		}
4395
-		print ajax_combobox('select_' . $htmlname);
4395
+		print ajax_combobox('select_'.$htmlname);
4396 4396
 	}
4397 4397
 
4398 4398
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4407,7 +4407,7 @@  discard block
 block discarded – undo
4407 4407
 		// phpcs:enable
4408 4408
 		global $langs;
4409 4409
 
4410
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4410
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4411 4411
 		if ($num > 0) {
4412 4412
 			return $num; // Cache already loaded
4413 4413
 		}
@@ -4417,8 +4417,8 @@  discard block
 block discarded – undo
4417 4417
 		$this->cache_types_paiements = array();
4418 4418
 
4419 4419
 		$sql = "SELECT id, code, libelle as label, type, active";
4420
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4421
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4420
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4421
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4422 4422
 
4423 4423
 		$resql = $this->db->query($sql);
4424 4424
 		if ($resql) {
@@ -4428,7 +4428,7 @@  discard block
 block discarded – undo
4428 4428
 				$obj = $this->db->fetch_object($resql);
4429 4429
 
4430 4430
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4431
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4431
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4432 4432
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4433 4433
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4434 4434
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4500,17 +4500,17 @@  discard block
 block discarded – undo
4500 4500
 		global $langs, $user, $conf;
4501 4501
 
4502 4502
 		$out = '';
4503
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4503
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4504 4504
 
4505 4505
 		$this->load_cache_conditions_paiements();
4506 4506
 
4507 4507
 		// Set default value if not already set by caller
4508 4508
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4509
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4509
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4510 4510
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4511 4511
 		}
4512 4512
 
4513
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4513
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4514 4514
 		if ($addempty) {
4515 4515
 			$out .= '<option value="0">&nbsp;</option>';
4516 4516
 		}
@@ -4524,9 +4524,9 @@  discard block
 block discarded – undo
4524 4524
 
4525 4525
 			if ($selected == $id) {
4526 4526
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4527
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4527
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4528 4528
 			} else {
4529
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4529
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4530 4530
 			}
4531 4531
 			$label = $arrayconditions['label'];
4532 4532
 
@@ -4544,21 +4544,21 @@  discard block
 block discarded – undo
4544 4544
 		$out .= ajax_combobox($htmlname);
4545 4545
 
4546 4546
 		if ($deposit_percent >= 0) {
4547
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4548
-			$out .= $langs->trans('DepositPercent') . ' : ';
4549
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4547
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4548
+			$out .= $langs->trans('DepositPercent').' : ';
4549
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4550 4550
 			$out .= '</span>';
4551 4551
 			$out .= '
4552
-				<script nonce="' . getNonce() . '">
4552
+				<script nonce="' . getNonce().'">
4553 4553
 					$(document).ready(function () {
4554
-						$("#' . $htmlname . '").change(function () {
4554
+						$("#' . $htmlname.'").change(function () {
4555 4555
 							let $selected = $(this).find("option:selected");
4556 4556
 							let depositPercent = $selected.attr("data-deposit_percent");
4557 4557
 
4558 4558
 							if (depositPercent.length > 0) {
4559
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4559
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4560 4560
 							} else {
4561
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4561
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4562 4562
 							}
4563 4563
 
4564 4564
 							return true;
@@ -4596,7 +4596,7 @@  discard block
 block discarded – undo
4596 4596
 
4597 4597
 		$out = '';
4598 4598
 
4599
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4599
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4600 4600
 
4601 4601
 		$filterarray = array();
4602 4602
 		if ($filtertype == 'CRDT') {
@@ -4611,11 +4611,11 @@  discard block
 block discarded – undo
4611 4611
 
4612 4612
 		// Set default value if not already set by caller
4613 4613
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4614
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4614
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4615 4615
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4616 4616
 		}
4617 4617
 
4618
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4618
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4619 4619
 		if ($empty) {
4620 4620
 			$out .= '<option value="">&nbsp;</option>';
4621 4621
 		}
@@ -4636,13 +4636,13 @@  discard block
 block discarded – undo
4636 4636
 			}
4637 4637
 
4638 4638
 			if ($format == 0) {
4639
-				$out .= '<option value="' . $id . '"';
4639
+				$out .= '<option value="'.$id.'"';
4640 4640
 			} elseif ($format == 1) {
4641
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4641
+				$out .= '<option value="'.$arraytypes['code'].'"';
4642 4642
 			} elseif ($format == 2) {
4643
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4643
+				$out .= '<option value="'.$arraytypes['code'].'"';
4644 4644
 			} elseif ($format == 3) {
4645
-				$out .= '<option value="' . $id . '"';
4645
+				$out .= '<option value="'.$id.'"';
4646 4646
 			}
4647 4647
 			// Print attribute selected or not
4648 4648
 			if ($format == 1 || $format == 2) {
@@ -4672,7 +4672,7 @@  discard block
 block discarded – undo
4672 4672
 		if ($user->admin && !$noadmininfo) {
4673 4673
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4674 4674
 		}
4675
-		$out .= ajax_combobox('select' . $htmlname);
4675
+		$out .= ajax_combobox('select'.$htmlname);
4676 4676
 
4677 4677
 		if (empty($nooutput)) {
4678 4678
 			print $out;
@@ -4694,22 +4694,22 @@  discard block
 block discarded – undo
4694 4694
 	{
4695 4695
 		global $langs;
4696 4696
 
4697
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4697
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4698 4698
 		$options = array(
4699 4699
 			'HT' => $langs->trans("HT"),
4700 4700
 			'TTC' => $langs->trans("TTC")
4701 4701
 		);
4702 4702
 		foreach ($options as $id => $value) {
4703 4703
 			if ($selected == $id) {
4704
-				$return .= '<option value="' . $id . '" selected>' . $value;
4704
+				$return .= '<option value="'.$id.'" selected>'.$value;
4705 4705
 			} else {
4706
-				$return .= '<option value="' . $id . '">' . $value;
4706
+				$return .= '<option value="'.$id.'">'.$value;
4707 4707
 			}
4708 4708
 			$return .= '</option>';
4709 4709
 		}
4710 4710
 		$return .= '</select>';
4711 4711
 		if ($addjscombo) {
4712
-			$return .= ajax_combobox('select_' . $htmlname);
4712
+			$return .= ajax_combobox('select_'.$htmlname);
4713 4713
 		}
4714 4714
 
4715 4715
 		return $return;
@@ -4727,7 +4727,7 @@  discard block
 block discarded – undo
4727 4727
 		// phpcs:enable
4728 4728
 		global $langs;
4729 4729
 
4730
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4730
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4731 4731
 		if ($num > 0) {
4732 4732
 			return $num; // Cache already loaded
4733 4733
 		}
@@ -4737,8 +4737,8 @@  discard block
 block discarded – undo
4737 4737
 		$this->cache_transport_mode = array();
4738 4738
 
4739 4739
 		$sql = "SELECT rowid, code, label, active";
4740
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4741
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4740
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4741
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4742 4742
 
4743 4743
 		$resql = $this->db->query($sql);
4744 4744
 		if ($resql) {
@@ -4748,7 +4748,7 @@  discard block
 block discarded – undo
4748 4748
 				$obj = $this->db->fetch_object($resql);
4749 4749
 
4750 4750
 				// If traduction exist, we use it else we take the default label
4751
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4751
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4752 4752
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4753 4753
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4754 4754
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4782,11 +4782,11 @@  discard block
 block discarded – undo
4782 4782
 	{
4783 4783
 		global $langs, $user;
4784 4784
 
4785
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4785
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4786 4786
 
4787 4787
 		$this->load_cache_transport_mode();
4788 4788
 
4789
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4789
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4790 4790
 		if ($empty) {
4791 4791
 			print '<option value="">&nbsp;</option>';
4792 4792
 		}
@@ -4802,13 +4802,13 @@  discard block
 block discarded – undo
4802 4802
 			}
4803 4803
 
4804 4804
 			if ($format == 0) {
4805
-				print '<option value="' . $id . '"';
4805
+				print '<option value="'.$id.'"';
4806 4806
 			} elseif ($format == 1) {
4807
-				print '<option value="' . $arraytypes['code'] . '"';
4807
+				print '<option value="'.$arraytypes['code'].'"';
4808 4808
 			} elseif ($format == 2) {
4809
-				print '<option value="' . $arraytypes['code'] . '"';
4809
+				print '<option value="'.$arraytypes['code'].'"';
4810 4810
 			} elseif ($format == 3) {
4811
-				print '<option value="' . $id . '"';
4811
+				print '<option value="'.$id.'"';
4812 4812
 			}
4813 4813
 			// If text is selected, we compare with code, else with id
4814 4814
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4856,31 +4856,31 @@  discard block
 block discarded – undo
4856 4856
 		$langs->load("deliveries");
4857 4857
 
4858 4858
 		$sql = "SELECT rowid, code, libelle as label";
4859
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4859
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4860 4860
 		$sql .= " WHERE active > 0";
4861 4861
 		if ($filtre) {
4862
-			$sql .= " AND " . $filtre;
4862
+			$sql .= " AND ".$filtre;
4863 4863
 		}
4864 4864
 		$sql .= " ORDER BY libelle ASC";
4865 4865
 
4866
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4866
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4867 4867
 		$result = $this->db->query($sql);
4868 4868
 		if ($result) {
4869 4869
 			$num = $this->db->num_rows($result);
4870 4870
 			$i = 0;
4871 4871
 			if ($num) {
4872
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4872
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4873 4873
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4874 4874
 					print '<option value="-1">&nbsp;</option>';
4875 4875
 				}
4876 4876
 				while ($i < $num) {
4877 4877
 					$obj = $this->db->fetch_object($result);
4878 4878
 					if ($selected == $obj->rowid) {
4879
-						print '<option value="' . $obj->rowid . '" selected>';
4879
+						print '<option value="'.$obj->rowid.'" selected>';
4880 4880
 					} else {
4881
-						print '<option value="' . $obj->rowid . '">';
4881
+						print '<option value="'.$obj->rowid.'">';
4882 4882
 					}
4883
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4883
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4884 4884
 					print '</option>';
4885 4885
 					$i++;
4886 4886
 				}
@@ -4889,7 +4889,7 @@  discard block
 block discarded – undo
4889 4889
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4890 4890
 				}
4891 4891
 
4892
-				print ajax_combobox('select' . $htmlname);
4892
+				print ajax_combobox('select'.$htmlname);
4893 4893
 			} else {
4894 4894
 				print $langs->trans("NoShippingMethodDefined");
4895 4895
 			}
@@ -4914,16 +4914,16 @@  discard block
 block discarded – undo
4914 4914
 		$langs->load("deliveries");
4915 4915
 
4916 4916
 		if ($htmlname != "none") {
4917
-			print '<form method="POST" action="' . $page . '">';
4917
+			print '<form method="POST" action="'.$page.'">';
4918 4918
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4919
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4919
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4920 4920
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4921
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4921
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4922 4922
 			print '</form>';
4923 4923
 		} else {
4924 4924
 			if ($selected) {
4925 4925
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
4926
-				print $langs->trans("SendingMethod" . strtoupper($code));
4926
+				print $langs->trans("SendingMethod".strtoupper($code));
4927 4927
 			} else {
4928 4928
 				print "&nbsp;";
4929 4929
 			}
@@ -4946,10 +4946,10 @@  discard block
 block discarded – undo
4946 4946
 
4947 4947
 		$opt = '<option value="" selected></option>';
4948 4948
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
4949
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
4950
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
4949
+		$sql .= ' FROM '.$this->db->prefix().'facture';
4950
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
4951 4951
 		$sql .= ' AND situation_counter >= 1';
4952
-		$sql .= ' AND fk_soc = ' . (int) $socid;
4952
+		$sql .= ' AND fk_soc = '.(int) $socid;
4953 4953
 		$sql .= ' AND type <> 2';
4954 4954
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
4955 4955
 		$resql = $this->db->query($sql);
@@ -4967,19 +4967,19 @@  discard block
 block discarded – undo
4967 4967
 						//Not prov?
4968 4968
 						if (substr($obj->ref, 1, 4) != 'PROV') {
4969 4969
 							if ($selected == $obj->rowid) {
4970
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
4970
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
4971 4971
 							} else {
4972
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
4972
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
4973 4973
 							}
4974 4974
 						}
4975 4975
 					}
4976 4976
 				}
4977 4977
 			}
4978 4978
 		} else {
4979
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
4979
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
4980 4980
 		}
4981 4981
 		if ($opt == '<option value ="" selected></option>') {
4982
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
4982
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
4983 4983
 		}
4984 4984
 		return $opt;
4985 4985
 	}
@@ -4999,12 +4999,12 @@  discard block
 block discarded – undo
4999 4999
 
5000 5000
 		$langs->load('products');
5001 5001
 
5002
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
5002
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
5003 5003
 
5004
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
5004
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
5005 5005
 		$sql .= ' WHERE active > 0';
5006 5006
 		if (!empty($unit_type)) {
5007
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
5007
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
5008 5008
 		}
5009 5009
 		$sql .= " ORDER BY sortorder";
5010 5010
 
@@ -5016,14 +5016,14 @@  discard block
 block discarded – undo
5016 5016
 
5017 5017
 			while ($res = $this->db->fetch_object($resql)) {
5018 5018
 				$unitLabel = $res->label;
5019
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
5020
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
5019
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
5020
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
5021 5021
 				}
5022 5022
 
5023 5023
 				if ($selected == $res->rowid) {
5024
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
5024
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
5025 5025
 				} else {
5026
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
5026
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
5027 5027
 				}
5028 5028
 			}
5029 5029
 			$return .= '</select>';
@@ -5058,23 +5058,23 @@  discard block
 block discarded – undo
5058 5058
 		$num = 0;
5059 5059
 
5060 5060
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
5061
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
5062
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
5061
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
5062
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
5063 5063
 		if ($status != 2) {
5064
-			$sql .= " AND clos = " . (int) $status;
5064
+			$sql .= " AND clos = ".(int) $status;
5065 5065
 		}
5066 5066
 		if ($filtre) {	// TODO Support USF
5067
-			$sql .= " AND " . $filtre;
5067
+			$sql .= " AND ".$filtre;
5068 5068
 		}
5069 5069
 		$sql .= " ORDER BY label";
5070 5070
 
5071
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
5071
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
5072 5072
 		$result = $this->db->query($sql);
5073 5073
 		if ($result) {
5074 5074
 			$num = $this->db->num_rows($result);
5075 5075
 			$i = 0;
5076 5076
 			if ($num) {
5077
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5077
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5078 5078
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5079 5079
 					$out .= '<option value="-1">&nbsp;</option>';
5080 5080
 				}
@@ -5082,27 +5082,27 @@  discard block
 block discarded – undo
5082 5082
 				while ($i < $num) {
5083 5083
 					$obj = $this->db->fetch_object($result);
5084 5084
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
5085
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
5085
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
5086 5086
 					} else {
5087
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
5087
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
5088 5088
 					}
5089 5089
 					$out .= trim($obj->label);
5090 5090
 					if ($showcurrency) {
5091
-						$out .= ' (' . $obj->currency_code . ')';
5091
+						$out .= ' ('.$obj->currency_code.')';
5092 5092
 					}
5093 5093
 					if ($status == 2 && $obj->status == 1) {
5094
-						$out .= ' (' . $langs->trans("Closed") . ')';
5094
+						$out .= ' ('.$langs->trans("Closed").')';
5095 5095
 					}
5096 5096
 					$out .= '</option>';
5097 5097
 					$i++;
5098 5098
 				}
5099 5099
 				$out .= "</select>";
5100
-				$out .= ajax_combobox('select' . $htmlname);
5100
+				$out .= ajax_combobox('select'.$htmlname);
5101 5101
 			} else {
5102 5102
 				if ($status == 0) {
5103
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
5103
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
5104 5104
 				} else {
5105
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
5105
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
5106 5106
 				}
5107 5107
 			}
5108 5108
 		} else {
@@ -5138,23 +5138,23 @@  discard block
 block discarded – undo
5138 5138
 		$num = 0;
5139 5139
 
5140 5140
 		$sql = "SELECT rowid, name, fk_country, status, entity";
5141
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
5141
+		$sql .= " FROM ".$this->db->prefix()."establishment";
5142 5142
 		$sql .= " WHERE 1=1";
5143 5143
 		if ($status != 2) {
5144
-			$sql .= " AND status = " . (int) $status;
5144
+			$sql .= " AND status = ".(int) $status;
5145 5145
 		}
5146 5146
 		if ($filtre) {	// TODO Support USF
5147
-			$sql .= " AND " . $filtre;
5147
+			$sql .= " AND ".$filtre;
5148 5148
 		}
5149 5149
 		$sql .= " ORDER BY name";
5150 5150
 
5151
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
5151
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
5152 5152
 		$result = $this->db->query($sql);
5153 5153
 		if ($result) {
5154 5154
 			$num = $this->db->num_rows($result);
5155 5155
 			$i = 0;
5156 5156
 			if ($num) {
5157
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5157
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5158 5158
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5159 5159
 					print '<option value="-1">&nbsp;</option>';
5160 5160
 				}
@@ -5162,13 +5162,13 @@  discard block
 block discarded – undo
5162 5162
 				while ($i < $num) {
5163 5163
 					$obj = $this->db->fetch_object($result);
5164 5164
 					if ($selected == $obj->rowid) {
5165
-						print '<option value="' . $obj->rowid . '" selected>';
5165
+						print '<option value="'.$obj->rowid.'" selected>';
5166 5166
 					} else {
5167
-						print '<option value="' . $obj->rowid . '">';
5167
+						print '<option value="'.$obj->rowid.'">';
5168 5168
 					}
5169 5169
 					print trim($obj->name);
5170 5170
 					if ($status == 2 && $obj->status == 1) {
5171
-						print ' (' . $langs->trans("Closed") . ')';
5171
+						print ' ('.$langs->trans("Closed").')';
5172 5172
 					}
5173 5173
 					print '</option>';
5174 5174
 					$i++;
@@ -5176,9 +5176,9 @@  discard block
 block discarded – undo
5176 5176
 				print "</select>";
5177 5177
 			} else {
5178 5178
 				if ($status == 0) {
5179
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5179
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5180 5180
 				} else {
5181
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5181
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5182 5182
 				}
5183 5183
 			}
5184 5184
 
@@ -5202,20 +5202,20 @@  discard block
 block discarded – undo
5202 5202
 	{
5203 5203
 		global $langs;
5204 5204
 		if ($htmlname != "none") {
5205
-			print '<form method="POST" action="' . $page . '">';
5205
+			print '<form method="POST" action="'.$page.'">';
5206 5206
 			print '<input type="hidden" name="action" value="setbankaccount">';
5207
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5207
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5208 5208
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5209 5209
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5210 5210
 			if ($nbaccountfound > 0) {
5211
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5211
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5212 5212
 			}
5213 5213
 			print '</form>';
5214 5214
 		} else {
5215 5215
 			$langs->load('banks');
5216 5216
 
5217 5217
 			if ($selected) {
5218
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5218
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5219 5219
 				$bankstatic = new Account($this->db);
5220 5220
 				$result = $bankstatic->fetch($selected);
5221 5221
 				if ($result) {
@@ -5254,19 +5254,19 @@  discard block
 block discarded – undo
5254 5254
 		global $conf, $langs;
5255 5255
 		$langs->load("categories");
5256 5256
 
5257
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5257
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5258 5258
 
5259 5259
 		// For backward compatibility
5260 5260
 		if (is_numeric($type)) {
5261
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5261
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5262 5262
 		}
5263 5263
 
5264 5264
 		if ($type === Categorie::TYPE_BANK_LINE) {
5265 5265
 			// TODO Move this into common category feature
5266 5266
 			$cate_arbo = array();
5267 5267
 			$sql = "SELECT c.label, c.rowid";
5268
-			$sql .= " FROM " . $this->db->prefix() . "bank_categ as c";
5269
-			$sql .= " WHERE entity = " . $conf->entity;
5268
+			$sql .= " FROM ".$this->db->prefix()."bank_categ as c";
5269
+			$sql .= " WHERE entity = ".$conf->entity;
5270 5270
 			$sql .= " ORDER BY c.label";
5271 5271
 			$result = $this->db->query($sql);
5272 5272
 			if ($result) {
@@ -5292,12 +5292,12 @@  discard block
 block discarded – undo
5292 5292
 		$outarrayrichhtml = array();
5293 5293
 
5294 5294
 
5295
-		$output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5295
+		$output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5296 5296
 		if (is_array($cate_arbo)) {
5297 5297
 			$num = count($cate_arbo);
5298 5298
 
5299 5299
 			if (!$num) {
5300
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5300
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5301 5301
 			} else {
5302 5302
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5303 5303
 					$output .= '<option value="-1">&nbsp;</option>';
@@ -5309,15 +5309,15 @@  discard block
 block discarded – undo
5309 5309
 						$add = '';
5310 5310
 					}
5311 5311
 
5312
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5312
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5313 5313
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5314 5314
 
5315 5315
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5316 5316
 
5317 5317
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5318 5318
 
5319
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5320
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5319
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5320
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5321 5321
 					$output .= '>';
5322 5322
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5323 5323
 					$output .= '</option>';
@@ -5359,7 +5359,7 @@  discard block
 block discarded – undo
5359 5359
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5360 5360
 	{
5361 5361
 		// phpcs:enable
5362
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5362
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5363 5363
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5364 5364
 	}
5365 5365
 
@@ -5394,7 +5394,7 @@  discard block
 block discarded – undo
5394 5394
 	{
5395 5395
 		global $langs, $conf;
5396 5396
 
5397
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5397
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5398 5398
 		$formconfirm = '';
5399 5399
 		$inputok = array();
5400 5400
 		$inputko = array();
@@ -5418,27 +5418,27 @@  discard block
 block discarded – undo
5418 5418
 			foreach ($formquestion as $key => $input) {
5419 5419
 				if (is_array($input) && !empty($input)) {
5420 5420
 					if ($input['type'] == 'hidden') {
5421
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5422
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5421
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5422
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5423 5423
 
5424
-						$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";
5424
+						$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";
5425 5425
 					}
5426 5426
 				}
5427 5427
 			}
5428 5428
 
5429 5429
 			// Now add questions
5430 5430
 			$moreonecolumn = '';
5431
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5431
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5432 5432
 			foreach ($formquestion as $key => $input) {
5433 5433
 				if (is_array($input) && !empty($input)) {
5434
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5435
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5436
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5434
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5435
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5436
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5437 5437
 
5438 5438
 					if ($input['type'] == 'text') {
5439
-						$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";
5439
+						$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";
5440 5440
 					} elseif ($input['type'] == 'password') {
5441
-						$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";
5441
+						$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";
5442 5442
 					} elseif ($input['type'] == 'textarea') {
5443 5443
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5444 5444
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5446,8 +5446,8 @@  discard block
 block discarded – undo
5446 5446
 						$more .= '</textarea>';
5447 5447
 						$more .= '</div></div>'."\n";*/
5448 5448
 						$moreonecolumn .= '<div class="margintoponly">';
5449
-						$moreonecolumn .= $input['label'] . '<br>';
5450
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5449
+						$moreonecolumn .= $input['label'].'<br>';
5450
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5451 5451
 						$moreonecolumn .= $input['value'];
5452 5452
 						$moreonecolumn .= '</textarea>';
5453 5453
 						$moreonecolumn .= '</div>';
@@ -5464,20 +5464,20 @@  discard block
 block discarded – undo
5464 5464
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5465 5465
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5466 5466
 
5467
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5467
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5468 5468
 						if (!empty($input['label'])) {
5469
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5469
+							$more .= $input['label'].'</div><div class="tagtd left">';
5470 5470
 						}
5471 5471
 						if ($input['type'] == 'select') {
5472 5472
 							$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);
5473 5473
 						} else {
5474 5474
 							$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);
5475 5475
 						}
5476
-						$more .= '</div></div>' . "\n";
5476
+						$more .= '</div></div>'."\n";
5477 5477
 					} elseif ($input['type'] == 'checkbox') {
5478 5478
 						$more .= '<div class="tagtr">';
5479
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5480
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5479
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5480
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5481 5481
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5482 5482
 							$more .= ' checked';
5483 5483
 						}
@@ -5488,19 +5488,19 @@  discard block
 block discarded – undo
5488 5488
 							$more .= ' disabled';
5489 5489
 						}
5490 5490
 						$more .= ' /></div>';
5491
-						$more .= '</div>' . "\n";
5491
+						$more .= '</div>'."\n";
5492 5492
 					} elseif ($input['type'] == 'radio') {
5493 5493
 						$i = 0;
5494 5494
 						foreach ($input['values'] as $selkey => $selval) {
5495 5495
 							$more .= '<div class="tagtr">';
5496 5496
 							if (isset($input['label'])) {
5497 5497
 								if ($i == 0) {
5498
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5498
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5499 5499
 								} else {
5500
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5500
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5501 5501
 								}
5502 5502
 							}
5503
-							$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;
5503
+							$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;
5504 5504
 							if (!empty($input['disabled'])) {
5505 5505
 								$more .= ' disabled';
5506 5506
 							}
@@ -5508,12 +5508,12 @@  discard block
 block discarded – undo
5508 5508
 								$more .= ' checked="checked"';
5509 5509
 							}
5510 5510
 							$more .= ' /> ';
5511
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5512
-							$more .= '</div></div>' . "\n";
5511
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5512
+							$more .= '</div></div>'."\n";
5513 5513
 							$i++;
5514 5514
 						}
5515 5515
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5516
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5516
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5517 5517
 						$more .= '<div class="tagtd">';
5518 5518
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5519 5519
 						$h = $m = 0;
@@ -5531,24 +5531,24 @@  discard block
 block discarded – undo
5531 5531
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5532 5532
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5533 5533
 						if (!empty($input['label'])) {
5534
-							$more .= $input['label'] . '</div><div class="tagtd">';
5534
+							$more .= $input['label'].'</div><div class="tagtd">';
5535 5535
 						}
5536 5536
 						$more .= $input['value'];
5537
-						$more .= '</div></div>' . "\n";
5537
+						$more .= '</div></div>'."\n";
5538 5538
 					} elseif ($input['type'] == 'onecolumn') {
5539 5539
 						$moreonecolumn .= '<div class="margintoponly">';
5540 5540
 						$moreonecolumn .= $input['value'];
5541
-						$moreonecolumn .= '</div>' . "\n";
5541
+						$moreonecolumn .= '</div>'."\n";
5542 5542
 					} elseif ($input['type'] == 'hidden') {
5543 5543
 						// Do nothing more, already added by a previous loop
5544 5544
 					} elseif ($input['type'] == 'separator') {
5545 5545
 						$more .= '<br>';
5546 5546
 					} else {
5547
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5547
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5548 5548
 					}
5549 5549
 				}
5550 5550
 			}
5551
-			$more .= '</div>' . "\n";
5551
+			$more .= '</div>'."\n";
5552 5552
 			$more .= $moreonecolumn;
5553 5553
 		}
5554 5554
 
@@ -5570,10 +5570,10 @@  discard block
 block discarded – undo
5570 5570
 				$button = $useajax;
5571 5571
 				$useajax = 1;
5572 5572
 				$autoOpen = false;
5573
-				$dialogconfirm .= '-' . $button;
5573
+				$dialogconfirm .= '-'.$button;
5574 5574
 			}
5575
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5576
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5575
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5576
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5577 5577
 
5578 5578
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5579 5579
 			if (is_array($formquestion)) {
@@ -5596,24 +5596,24 @@  discard block
 block discarded – undo
5596 5596
 			}
5597 5597
 
5598 5598
 			// Show JQuery confirm box.
5599
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5599
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5600 5600
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5601
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5601
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5602 5602
 			}
5603 5603
 			if (!empty($more)) {
5604
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5604
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5605 5605
 			}
5606
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : '');
5607
-			$formconfirm .= '</div>' . "\n";
5606
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : '');
5607
+			$formconfirm .= '</div>'."\n";
5608 5608
 
5609
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5610
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5609
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5610
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5611 5611
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5612 5612
 			$formconfirm .= 'jQuery(document).ready(function() {
5613 5613
             $(function() {
5614
-            	$( "#' . $dialogconfirm . '" ).dialog(
5614
+            	$( "#' . $dialogconfirm.'" ).dialog(
5615 5615
             	{
5616
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5616
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5617 5617
 			if ($newselectedchoice == 'no') {
5618 5618
 				$formconfirm .= '
5619 5619
 						open: function() {
@@ -5623,24 +5623,24 @@  discard block
 block discarded – undo
5623 5623
 
5624 5624
 			$jsforcursor = '';
5625 5625
 			if ($useajax == 1) {
5626
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5627
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5626
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5627
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5628 5628
 			}
5629 5629
 
5630 5630
 			$postconfirmas = 'GET';
5631 5631
 
5632 5632
 			$formconfirm .= '
5633 5633
                     resizable: false,
5634
-                    height: "' . $height . '",
5635
-                    width: "' . $width . '",
5634
+                    height: "' . $height.'",
5635
+                    width: "' . $width.'",
5636 5636
                     modal: true,
5637 5637
                     closeOnEscape: false,
5638 5638
                     buttons: {
5639
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5640
-							var options = "token=' . urlencode(newToken()) . '";
5641
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5642
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5643
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5639
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5640
+							var options = "token=' . urlencode(newToken()).'";
5641
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5642
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5643
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5644 5644
 
5645 5645
                          	if (inputok.length > 0) {
5646 5646
                          		$.each(inputok, function(i, inputname) {
@@ -5674,11 +5674,11 @@  discard block
 block discarded – undo
5674 5674
 							}
5675 5675
 	                        $(this).dialog("close");
5676 5676
                         },
5677
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5678
-                        	var options = "token=' . urlencode(newToken()) . '";
5679
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5680
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5681
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5677
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5678
+                        	var options = "token=' . urlencode(newToken()).'";
5679
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5680
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5681
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5682 5682
                          	if (inputko.length > 0) {
5683 5683
                          		$.each(inputko, function(i, inputname) {
5684 5684
                          			var more = "";
@@ -5710,10 +5710,10 @@  discard block
 block discarded – undo
5710 5710
                 }
5711 5711
                 );
5712 5712
 
5713
-            	var button = "' . $button . '";
5713
+            	var button = "' . $button.'";
5714 5714
             	if (button.length > 0) {
5715 5715
                 	$( "#" + button ).click(function() {
5716
-                		$("#' . $dialogconfirm . '").dialog("open");
5716
+                		$("#' . $dialogconfirm.'").dialog("open");
5717 5717
         			});
5718 5718
                 }
5719 5719
             });
@@ -5721,44 +5721,44 @@  discard block
 block discarded – undo
5721 5721
             </script>';
5722 5722
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5723 5723
 		} else {
5724
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5724
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5725 5725
 
5726 5726
 			if (empty($disableformtag)) {
5727
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n";
5727
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
5728 5728
 			}
5729 5729
 
5730
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5731
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5730
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5731
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5732 5732
 
5733
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5733
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5734 5734
 
5735 5735
 			// Line title
5736 5736
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5737
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5738
-			$formconfirm .= '</td></tr>' . "\n";
5737
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5738
+			$formconfirm .= '</td></tr>'."\n";
5739 5739
 
5740 5740
 			// Line text
5741 5741
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5742
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5742
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5743 5743
 			}
5744 5744
 
5745 5745
 			// Line form fields
5746 5746
 			if ($more) {
5747
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5747
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5748 5748
 				$formconfirm .= $more;
5749
-				$formconfirm .= '</td></tr>' . "\n";
5749
+				$formconfirm .= '</td></tr>'."\n";
5750 5750
 			}
5751 5751
 
5752 5752
 			// Line with question
5753 5753
 			$formconfirm .= '<tr class="valid">';
5754
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5754
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5755 5755
 			$formconfirm .= '<td class="valid center">';
5756 5756
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5757
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5757
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5758 5758
 			$formconfirm .= '</td>';
5759
-			$formconfirm .= '</tr>' . "\n";
5759
+			$formconfirm .= '</tr>'."\n";
5760 5760
 
5761
-			$formconfirm .= '</table>' . "\n";
5761
+			$formconfirm .= '</table>'."\n";
5762 5762
 
5763 5763
 			if (empty($disableformtag)) {
5764 5764
 				$formconfirm .= "</form>\n";
@@ -5767,7 +5767,7 @@  discard block
 block discarded – undo
5767 5767
 
5768 5768
 			if (!empty($conf->use_javascript_ajax)) {
5769 5769
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5770
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5770
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5771 5771
 				$formconfirm .= '
5772 5772
 				$(document).ready(function () {
5773 5773
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5779,7 +5779,7 @@  discard block
 block discarded – undo
5779 5779
 					});
5780 5780
 				});
5781 5781
 				';
5782
-				$formconfirm .= '</script>' . "\n";
5782
+				$formconfirm .= '</script>'."\n";
5783 5783
 			}
5784 5784
 
5785 5785
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5811,8 +5811,8 @@  discard block
 block discarded – undo
5811 5811
 		// phpcs:enable
5812 5812
 		global $langs;
5813 5813
 
5814
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5815
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5814
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5815
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5816 5816
 
5817 5817
 		$out = '';
5818 5818
 
@@ -5820,11 +5820,11 @@  discard block
 block discarded – undo
5820 5820
 
5821 5821
 		$langs->load("project");
5822 5822
 		if ($htmlname != "none") {
5823
-			$out .= '<form method="post" action="' . $page . '">';
5823
+			$out .= '<form method="post" action="'.$page.'">';
5824 5824
 			$out .= '<input type="hidden" name="action" value="classin">';
5825
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5825
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5826 5826
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5827
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5827
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5828 5828
 			$out .= '</form>';
5829 5829
 		} else {
5830 5830
 			$out .= '<span class="project_head_block">';
@@ -5833,7 +5833,7 @@  discard block
 block discarded – undo
5833 5833
 				$projet->fetch($selected);
5834 5834
 				$out .= $projet->getNomUrl(0, '', 1);
5835 5835
 			} else {
5836
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5836
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5837 5837
 			}
5838 5838
 			$out .= '</span>';
5839 5839
 		}
@@ -5870,14 +5870,14 @@  discard block
 block discarded – undo
5870 5870
 		$out = '';
5871 5871
 
5872 5872
 		if ($htmlname != "none") {
5873
-			$out .= '<form method="POST" action="' . $page . '">';
5873
+			$out .= '<form method="POST" action="'.$page.'">';
5874 5874
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5875
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5875
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5876 5876
 			if ($type) {
5877
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5877
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5878 5878
 			}
5879 5879
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5880
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5880
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5881 5881
 			$out .= '</form>';
5882 5882
 		} else {
5883 5883
 			if ($selected) {
@@ -5922,12 +5922,12 @@  discard block
 block discarded – undo
5922 5922
 		// phpcs:enable
5923 5923
 		global $langs;
5924 5924
 		if ($htmlname != "none") {
5925
-			print '<form method="post" action="' . $page . '">';
5925
+			print '<form method="post" action="'.$page.'">';
5926 5926
 			print '<input type="hidden" name="action" value="setavailability">';
5927
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5927
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5928 5928
 			$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
5929
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5930
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
5929
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5930
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
5931 5931
 			print '</form>';
5932 5932
 		} else {
5933 5933
 			if ($selected) {
@@ -5953,11 +5953,11 @@  discard block
 block discarded – undo
5953 5953
 	{
5954 5954
 		global $langs;
5955 5955
 		if ($htmlname != "none") {
5956
-			print '<form method="post" action="' . $page . '">';
5956
+			print '<form method="post" action="'.$page.'">';
5957 5957
 			print '<input type="hidden" name="action" value="setdemandreason">';
5958
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5958
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5959 5959
 			$this->selectInputReason($selected, $htmlname, -1, $addempty);
5960
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5960
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5961 5961
 			print '</form>';
5962 5962
 		} else {
5963 5963
 			if ($selected) {
@@ -5997,17 +5997,17 @@  discard block
 block discarded – undo
5997 5997
 		$ret = '';
5998 5998
 
5999 5999
 		if ($htmlname != "none") {
6000
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
6001
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
6002
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
6000
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
6001
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
6002
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
6003 6003
 			if ($type) {
6004
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6004
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6005 6005
 			}
6006 6006
 			$ret .= '<table class="nobordernopadding">';
6007 6007
 			$ret .= '<tr><td>';
6008
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
6008
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
6009 6009
 			$ret .= '</td>';
6010
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6010
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6011 6011
 			$ret .= '</tr></table></form>';
6012 6012
 		} else {
6013 6013
 			if ($displayhour) {
@@ -6042,15 +6042,15 @@  discard block
 block discarded – undo
6042 6042
 		global $langs;
6043 6043
 
6044 6044
 		if ($htmlname != "none") {
6045
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
6046
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
6047
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6045
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
6046
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
6047
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6048 6048
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
6049
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6049
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6050 6050
 			print '</form>';
6051 6051
 		} else {
6052 6052
 			if ($selected) {
6053
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
6053
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
6054 6054
 				$theuser = new User($this->db);
6055 6055
 				$theuser->fetch($selected);
6056 6056
 				print $theuser->getNomUrl(1);
@@ -6083,14 +6083,14 @@  discard block
 block discarded – undo
6083 6083
 
6084 6084
 		$out = '';
6085 6085
 		if ($htmlname != "none") {
6086
-			$out .= '<form method="POST" action="' . $page . '">';
6086
+			$out .= '<form method="POST" action="'.$page.'">';
6087 6087
 			$out .= '<input type="hidden" name="action" value="setmode">';
6088
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6088
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6089 6089
 			if ($type) {
6090
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
6090
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
6091 6091
 			}
6092 6092
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
6093
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6093
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6094 6094
 			$out .= '</form>';
6095 6095
 		} else {
6096 6096
 			if ($selected) {
@@ -6123,11 +6123,11 @@  discard block
 block discarded – undo
6123 6123
 	{
6124 6124
 		global $langs;
6125 6125
 		if ($htmlname != "none") {
6126
-			print '<form method="POST" action="' . $page . '">';
6126
+			print '<form method="POST" action="'.$page.'">';
6127 6127
 			print '<input type="hidden" name="action" value="settransportmode">';
6128
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6128
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6129 6129
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
6130
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6130
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6131 6131
 			print '</form>';
6132 6132
 		} else {
6133 6133
 			if ($selected) {
@@ -6154,14 +6154,14 @@  discard block
 block discarded – undo
6154 6154
 		// phpcs:enable
6155 6155
 		global $langs;
6156 6156
 		if ($htmlname != "none") {
6157
-			print '<form method="POST" action="' . $page . '">';
6157
+			print '<form method="POST" action="'.$page.'">';
6158 6158
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
6159
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6159
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6160 6160
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
6161
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6161
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6162 6162
 			print '</form>';
6163 6163
 		} else {
6164
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6164
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6165 6165
 			print !empty($selected) ? currency_name($selected, 1) : '&nbsp;';
6166 6166
 		}
6167 6167
 	}
@@ -6183,21 +6183,21 @@  discard block
 block discarded – undo
6183 6183
 		global $langs, $mysoc, $conf;
6184 6184
 
6185 6185
 		if ($htmlname != "none") {
6186
-			print '<form method="POST" action="' . $page . '">';
6186
+			print '<form method="POST" action="'.$page.'">';
6187 6187
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6188
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6189
-			print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6188
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6189
+			print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6190 6190
 			print '<select name="calculation_mode">';
6191
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6192
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6191
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6192
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6193 6193
 			print '</select> ';
6194
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6194
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6195 6195
 			print '</form>';
6196 6196
 		} else {
6197 6197
 			if (!empty($rate)) {
6198 6198
 				print price($rate, 1, $langs, 0, 0);
6199 6199
 				if ($currency && $rate != 1) {
6200
-					print ' &nbsp; (' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')';
6200
+					print ' &nbsp; ('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')';
6201 6201
 				}
6202 6202
 			} else {
6203 6203
 				print 1;
@@ -6228,9 +6228,9 @@  discard block
 block discarded – undo
6228 6228
 		// phpcs:enable
6229 6229
 		global $conf, $langs;
6230 6230
 		if ($htmlname != "none") {
6231
-			print '<form method="post" action="' . $page . '">';
6231
+			print '<form method="post" action="'.$page.'">';
6232 6232
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6233
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6233
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6234 6234
 			print '<div class="inline-block">';
6235 6235
 			if (!empty($discount_type)) {
6236 6236
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6268,24 +6268,24 @@  discard block
 block discarded – undo
6268 6268
 			print '</div>';
6269 6269
 			if (empty($hidelist)) {
6270 6270
 				print '<div class="inline-block" style="padding-right: 10px">';
6271
-				$newfilter = 'discount_type=' . intval($discount_type);
6271
+				$newfilter = 'discount_type='.intval($discount_type);
6272 6272
 				if (!empty($discount_type)) {
6273 6273
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6274 6274
 				} else {
6275 6275
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6276 6276
 				}
6277 6277
 				if ($filter) {
6278
-					$newfilter .= ' AND (' . $filter . ')';
6278
+					$newfilter .= ' AND ('.$filter.')';
6279 6279
 				}
6280 6280
 				// output the combo of discounts
6281 6281
 				$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
6282 6282
 				if ($nbqualifiedlines > 0) {
6283
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6283
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6284 6284
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6285
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6285
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6286 6286
 					}
6287 6287
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6288
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6288
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6289 6289
 					}
6290 6290
 
6291 6291
 					print '>';
@@ -6325,23 +6325,23 @@  discard block
 block discarded – undo
6325 6325
 		global $langs;
6326 6326
 
6327 6327
 		if ($htmlname != "none") {
6328
-			print '<form method="post" action="' . $page . '">';
6328
+			print '<form method="post" action="'.$page.'">';
6329 6329
 			print '<input type="hidden" name="action" value="set_contact">';
6330
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6330
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6331 6331
 			print '<table class="nobordernopadding">';
6332 6332
 			print '<tr><td>';
6333 6333
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6334 6334
 			$num = $this->num;
6335 6335
 			if ($num == 0) {
6336 6336
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6337
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6337
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6338 6338
 			}
6339 6339
 			print '</td>';
6340
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6340
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6341 6341
 			print '</tr></table></form>';
6342 6342
 		} else {
6343 6343
 			if ($selected) {
6344
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6344
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6345 6345
 				$contact = new Contact($this->db);
6346 6346
 				$contact->fetch($selected);
6347 6347
 				print $contact->getFullName($langs);
@@ -6376,20 +6376,20 @@  discard block
 block discarded – undo
6376 6376
 
6377 6377
 		$out = '';
6378 6378
 		if ($htmlname != "none") {
6379
-			$out .= '<form method="post" action="' . $page . '">';
6379
+			$out .= '<form method="post" action="'.$page.'">';
6380 6380
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6381
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6381
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6382 6382
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6383
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6383
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6384 6384
 			$out .= '</form>';
6385 6385
 		} else {
6386 6386
 			if ($selected) {
6387
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6387
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6388 6388
 				$soc = new Societe($this->db);
6389 6389
 				$soc->fetch($selected);
6390 6390
 				$out .= $soc->getNomUrl(0, '');
6391 6391
 			} else {
6392
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6392
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6393 6393
 			}
6394 6394
 		}
6395 6395
 
@@ -6439,22 +6439,22 @@  discard block
 block discarded – undo
6439 6439
 			$selected = 'EUR'; // Pour compatibilite
6440 6440
 		}
6441 6441
 
6442
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6442
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6443 6443
 		if ($useempty) {
6444 6444
 			$out .= '<option value="-1" selected></option>';
6445 6445
 		}
6446 6446
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6447 6447
 			$labeltoshow = $currency['label'];
6448 6448
 			if ($mode == 1) {
6449
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6449
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6450 6450
 			} else {
6451
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6451
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6452 6452
 			}
6453 6453
 
6454 6454
 			if ($selected && $selected == $code_iso) {
6455
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6455
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6456 6456
 			} else {
6457
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6457
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6458 6458
 			}
6459 6459
 			$out .= $labeltoshow;
6460 6460
 			$out .= '</option>';
@@ -6465,7 +6465,7 @@  discard block
 block discarded – undo
6465 6465
 		}
6466 6466
 
6467 6467
 		// Make select dynamic
6468
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6468
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6469 6469
 		$out .= ajax_combobox($htmlname);
6470 6470
 
6471 6471
 		return $out;
@@ -6491,10 +6491,10 @@  discard block
 block discarded – undo
6491 6491
 
6492 6492
 		$TCurrency = array();
6493 6493
 
6494
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6495
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6494
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6495
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6496 6496
 		if ($filter) {
6497
-			$sql .= " AND " . $filter;
6497
+			$sql .= " AND ".$filter;
6498 6498
 		}
6499 6499
 		$resql = $this->db->query($sql);
6500 6500
 		if ($resql) {
@@ -6504,7 +6504,7 @@  discard block
 block discarded – undo
6504 6504
 		}
6505 6505
 
6506 6506
 		$out = '';
6507
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6507
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6508 6508
 		if ($useempty) {
6509 6509
 			$out .= '<option value="">&nbsp;</option>';
6510 6510
 		}
@@ -6516,13 +6516,13 @@  discard block
 block discarded – undo
6516 6516
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6517 6517
 				if (isset($TCurrency[$code_iso])) {
6518 6518
 					if (!empty($selected) && $selected == $code_iso) {
6519
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6519
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6520 6520
 					} else {
6521
-						$out .= '<option value="' . $code_iso . '">';
6521
+						$out .= '<option value="'.$code_iso.'">';
6522 6522
 					}
6523 6523
 
6524 6524
 					$out .= $currency['label'];
6525
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6525
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6526 6526
 					$out .= '</option>';
6527 6527
 				}
6528 6528
 			}
@@ -6531,7 +6531,7 @@  discard block
 block discarded – undo
6531 6531
 		$out .= '</select>';
6532 6532
 
6533 6533
 		// Make select dynamic
6534
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6534
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6535 6535
 		$out .= ajax_combobox($htmlname);
6536 6536
 
6537 6537
 		return $out;
@@ -6562,7 +6562,7 @@  discard block
 block discarded – undo
6562 6562
 		$sql .= " WHERE t.fk_pays = c.rowid";
6563 6563
 		$sql .= " AND t.active > 0";
6564 6564
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6565
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6565
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6566 6566
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6567 6567
 
6568 6568
 		$resql = $this->db->query($sql);
@@ -6574,30 +6574,30 @@  discard block
 block discarded – undo
6574 6574
 
6575 6575
 					$tmparray = array();
6576 6576
 					$tmparray['rowid']			= $obj->rowid;
6577
-					$tmparray['type_vat']		= $obj->type_vat;
6578
-					$tmparray['code']			= $obj->code;
6577
+					$tmparray['type_vat'] = $obj->type_vat;
6578
+					$tmparray['code'] = $obj->code;
6579 6579
 					$tmparray['txtva']			= $obj->taux;
6580
-					$tmparray['nprtva']			= $obj->recuperableonly;
6580
+					$tmparray['nprtva'] = $obj->recuperableonly;
6581 6581
 					$tmparray['localtax1']	    = $obj->localtax1;
6582 6582
 					$tmparray['localtax1_type']	= $obj->localtax1_type;
6583 6583
 					$tmparray['localtax2']	    = $obj->localtax2;
6584 6584
 					$tmparray['localtax2_type']	= $obj->localtax1_type;
6585
-					$tmparray['label']			= $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6586
-					$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
6585
+					$tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6586
+					$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
6587 6587
 					$positiverates = '';
6588 6588
 					if ($obj->taux) {
6589
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6589
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6590 6590
 					}
6591 6591
 					if ($obj->localtax1) {
6592
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6592
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6593 6593
 					}
6594 6594
 					if ($obj->localtax2) {
6595
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6595
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6596 6596
 					}
6597 6597
 					if (empty($positiverates)) {
6598 6598
 						$positiverates = '0';
6599 6599
 					}
6600
-					$tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6600
+					$tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6601 6601
 
6602 6602
 					$this->cache_vatrates[$obj->rowid] = $tmparray;
6603 6603
 				}
@@ -6617,7 +6617,7 @@  discard block
 block discarded – undo
6617 6617
 				return -1;
6618 6618
 			}
6619 6619
 		} else {
6620
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6620
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6621 6621
 			return -2;
6622 6622
 		}
6623 6623
 	}
@@ -6670,9 +6670,9 @@  discard block
 block discarded – undo
6670 6670
 		// Check parameters
6671 6671
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6672 6672
 			if ($societe_vendeuse->id == $mysoc->id) {
6673
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6673
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6674 6674
 			} else {
6675
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6675
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6676 6676
 			}
6677 6677
 			return $return;
6678 6678
 		}
@@ -6684,12 +6684,12 @@  discard block
 block discarded – undo
6684 6684
 		// Define list of countries to use to search VAT rates to show
6685 6685
 		// First we defined code_country to use to find list
6686 6686
 		if (is_object($societe_vendeuse)) {
6687
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6687
+			$code_country = "'".$societe_vendeuse->country_code."'";
6688 6688
 		} else {
6689
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6689
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6690 6690
 		}
6691 6691
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6692
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6692
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6693 6693
 			// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
6694 6694
 			// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
6695 6695
 			$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
@@ -6699,27 +6699,27 @@  discard block
 block discarded – undo
6699 6699
 					if ($type == 1) { // We know product is a service
6700 6700
 						switch ($selectVatComboMode) {
6701 6701
 							case '1':
6702
-								$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6702
+								$code_country .= ",'".$societe_acheteuse->country_code."'";
6703 6703
 								break;
6704 6704
 							case '2':
6705
-								$code_country = "'" . $societe_acheteuse->country_code . "'";
6705
+								$code_country = "'".$societe_acheteuse->country_code."'";
6706 6706
 								break;
6707 6707
 						}
6708 6708
 					}
6709 6709
 				} elseif (!$idprod) {  // We don't know type of product
6710 6710
 					switch ($selectVatComboMode) {
6711 6711
 						case '1':
6712
-							$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6712
+							$code_country .= ",'".$societe_acheteuse->country_code."'";
6713 6713
 							break;
6714 6714
 						case '2':
6715
-							$code_country = "'" . $societe_acheteuse->country_code . "'";
6715
+							$code_country = "'".$societe_acheteuse->country_code."'";
6716 6716
 							break;
6717 6717
 					}
6718 6718
 				} else {
6719 6719
 					$prodstatic = new Product($this->db);
6720 6720
 					$prodstatic->fetch($idprod);
6721 6721
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6722
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6722
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6723 6723
 					}
6724 6724
 				}
6725 6725
 			}
@@ -6781,13 +6781,13 @@  discard block
 block discarded – undo
6781 6781
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6782 6782
 				// of using supplier invoices (this is a very bad idea !)
6783 6783
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
6784
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6784
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6785 6785
 					$disabled = true;
6786 6786
 				}
6787 6787
 			}
6788 6788
 
6789 6789
 			if (!$options_only) {
6790
-				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6790
+				$return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6791 6791
 			}
6792 6792
 
6793 6793
 			$selectedfound = false;
@@ -6801,13 +6801,13 @@  discard block
 block discarded – undo
6801 6801
 				$key = $rate['txtva'];
6802 6802
 				$key .= $rate['nprtva'] ? '*' : '';
6803 6803
 				if ($mode > 0 && $rate['code']) {
6804
-					$key .= ' (' . $rate['code'] . ')';
6804
+					$key .= ' ('.$rate['code'].')';
6805 6805
 				}
6806 6806
 				if ($mode < 0) {
6807 6807
 					$key = $rate['rowid'];
6808 6808
 				}
6809 6809
 
6810
-				$return .= '<option value="' . $key . '"';
6810
+				$return .= '<option value="'.$key.'"';
6811 6811
 				if (!$selectedfound) {
6812 6812
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6813 6813
 						if ($defaultcode == $rate['code']) {
@@ -6878,7 +6878,7 @@  discard block
 block discarded – undo
6878 6878
 	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 = '')
6879 6879
 	{
6880 6880
 		// phpcs:enable
6881
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6881
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6882 6882
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
6883 6883
 		if (!empty($nooutput)) {
6884 6884
 			return $retstring;
@@ -6907,11 +6907,11 @@  discard block
 block discarded – undo
6907 6907
 	{
6908 6908
 		global $langs;
6909 6909
 
6910
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6910
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6911 6911
 		if ($forcenewline) {
6912 6912
 			$ret .= '<br>';
6913 6913
 		}
6914
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6914
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6915 6915
 		return $ret;
6916 6916
 	}
6917 6917
 
@@ -6977,7 +6977,7 @@  discard block
 block discarded – undo
6977 6977
 		$orig_set_time = $set_time;
6978 6978
 
6979 6979
 		if ($set_time === '' && $emptydate == 0) {
6980
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
6980
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
6981 6981
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
6982 6982
 				$set_time = dol_now($gm);
6983 6983
 			} else {
@@ -7049,38 +7049,38 @@  discard block
 block discarded – undo
7049 7049
 				// Calendrier popup version eldy
7050 7050
 				if ($usecalendar == "eldy") {
7051 7051
 					// Input area to enter date manually
7052
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
7052
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
7053 7053
 					$retstring .= ($disabled ? ' disabled' : '');
7054
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7054
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7055 7055
 					$retstring .= ' autocomplete="off">';
7056 7056
 
7057 7057
 					// Icon calendar
7058 7058
 					$retstringbuttom = '';
7059 7059
 					if (!$disabled) {
7060
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
7061
-						$base = DOL_URL_ROOT . '/core/';
7062
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
7063
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
7060
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
7061
+						$base = DOL_URL_ROOT.'/core/';
7062
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
7063
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
7064 7064
 					} else {
7065
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
7065
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
7066 7066
 					}
7067
-					$retstring = $retstringbuttom . $retstring;
7067
+					$retstring = $retstringbuttom.$retstring;
7068 7068
 
7069
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7070
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7071
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7069
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7070
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7071
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7072 7072
 				} elseif ($usecalendar == 'jquery' || $usecalendar == 'html') {
7073 7073
 					if (!$disabled && $usecalendar != 'html') {
7074 7074
 						// Output javascript for datepicker
7075 7075
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100));
7076 7076
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100));
7077 7077
 
7078
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
7079
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
7080
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
7078
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
7079
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
7080
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
7081 7081
 							autoclose: true,
7082 7082
 							todayHighlight: true,
7083
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
7083
+							yearRange: '" . $minYear.":".$maxYear."',";
7084 7084
 						if (!empty($conf->dol_use_jmobile)) {
7085 7085
 							$retstring .= "
7086 7086
 								beforeShow: function (input, datePicker) {
@@ -7095,7 +7095,7 @@  discard block
 block discarded – undo
7095 7095
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
7096 7096
 							$retstring .= "
7097 7097
 								showOn: 'button',	/* both has problem with autocompletion */
7098
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
7098
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
7099 7099
 								buttonImageOnly: true";
7100 7100
 						}
7101 7101
 						$retstring .= "
@@ -7107,46 +7107,46 @@  discard block
 block discarded – undo
7107 7107
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
7108 7108
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
7109 7109
 					$retstring .= ($disabled ? ' disabled' : '');
7110
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
7111
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7110
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
7111
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
7112 7112
 					$retstring .= ' autocomplete="off">';
7113 7113
 
7114 7114
 					// Icone calendrier
7115 7115
 					if ($disabled) {
7116
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
7117
-						$retstring = $retstringbutton . $retstring;
7116
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
7117
+						$retstring = $retstringbutton.$retstring;
7118 7118
 					}
7119 7119
 
7120 7120
 					$retstring .= '</div>';
7121
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
7122
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
7123
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
7121
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
7122
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
7123
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
7124 7124
 				} else {
7125 7125
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
7126 7126
 				}
7127 7127
 			} else {
7128 7128
 				// Show date with combo selects
7129 7129
 				// Day
7130
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
7130
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
7131 7131
 
7132 7132
 				if ($emptydate || $set_time == -1) {
7133 7133
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7134 7134
 				}
7135 7135
 
7136 7136
 				for ($day = 1; $day <= 31; $day++) {
7137
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
7137
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
7138 7138
 				}
7139 7139
 
7140 7140
 				$retstring .= "</select>";
7141 7141
 
7142
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
7142
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
7143 7143
 				if ($emptydate || $set_time == -1) {
7144 7144
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7145 7145
 				}
7146 7146
 
7147 7147
 				// Month
7148 7148
 				for ($month = 1; $month <= 12; $month++) {
7149
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
7149
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
7150 7150
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
7151 7151
 					$retstring .= "</option>";
7152 7152
 				}
@@ -7154,13 +7154,13 @@  discard block
 block discarded – undo
7154 7154
 
7155 7155
 				// Year
7156 7156
 				if ($emptydate || $set_time == -1) {
7157
-					$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 . '">';
7157
+					$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.'">';
7158 7158
 				} else {
7159
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
7159
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
7160 7160
 
7161 7161
 					$syear = (int) $syear;
7162 7162
 					for ($year = $syear - 10; $year < (int) $syear + 10; $year++) {
7163
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
7163
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
7164 7164
 					}
7165 7165
 					$retstring .= "</select>\n";
7166 7166
 				}
@@ -7184,15 +7184,15 @@  discard block
 block discarded – undo
7184 7184
 				}
7185 7185
 			}
7186 7186
 			// Show hour
7187
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
7187
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
7188 7188
 			if ($emptyhours) {
7189 7189
 				$retstring .= '<option value="-1">&nbsp;</option>';
7190 7190
 			}
7191 7191
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
7192 7192
 				if (strlen($hour) < 2) {
7193
-					$hour = "0" . $hour;
7193
+					$hour = "0".$hour;
7194 7194
 				}
7195
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7195
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7196 7196
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7197 7197
 				$retstring .= '</option>';
7198 7198
 			}
@@ -7205,17 +7205,17 @@  discard block
 block discarded – undo
7205 7205
 
7206 7206
 		if ($m) {
7207 7207
 			// Show minutes
7208
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7208
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7209 7209
 			if ($emptyhours) {
7210 7210
 				$retstring .= '<option value="-1">&nbsp;</option>';
7211 7211
 			}
7212 7212
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7213 7213
 				$min_str = sprintf("%02d", $min);
7214
-				$retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>';
7214
+				$retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>';
7215 7215
 			}
7216 7216
 			$retstring .= '</select>';
7217 7217
 
7218
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7218
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7219 7219
 		}
7220 7220
 
7221 7221
 		if ($d && $h) {
@@ -7238,10 +7238,10 @@  discard block
 block discarded – undo
7238 7238
 
7239 7239
 			// Generate the date part, depending on the use or not of the javascript calendar
7240 7240
 			if ($addnowlink == 1) { // server time expressed in user time setup
7241
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7242
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7243
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7244
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7241
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7242
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7243
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7244
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7245 7245
 			} elseif ($addnowlink == 2) {
7246 7246
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7247 7247
 				 * This break application for foreign languages.
@@ -7250,10 +7250,10 @@  discard block
 block discarded – undo
7250 7250
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7251 7251
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7252 7252
 				*/
7253
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7254
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7255
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7256
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7253
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7254
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7255
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7256
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7257 7257
 			}
7258 7258
 			/*if ($usecalendar == "eldy")
7259 7259
 			{
@@ -7273,11 +7273,11 @@  discard block
 block discarded – undo
7273 7273
 				}
7274 7274
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7275 7275
 				if ($addnowlink == 1) {
7276
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7277
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7276
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7277
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7278 7278
 				} elseif ($addnowlink == 2) {
7279
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7280
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7279
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7280
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7281 7281
 				}
7282 7282
 
7283 7283
 				if ($fullday) {
@@ -7291,11 +7291,11 @@  discard block
 block discarded – undo
7291 7291
 				}
7292 7292
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7293 7293
 				if ($addnowlink == 1) {
7294
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7295
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7294
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7295
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7296 7296
 				} elseif ($addnowlink == 2) {
7297
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7298
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7297
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7298
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7299 7299
 				}
7300 7300
 				if ($fullday) {
7301 7301
 					$reset_scripts .= ' } ';
@@ -7303,7 +7303,7 @@  discard block
 block discarded – undo
7303 7303
 			}
7304 7304
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7305 7305
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7306
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7306
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7307 7307
 				$retstring .= $langs->trans("Now");
7308 7308
 				$retstring .= '</button> ';
7309 7309
 			}
@@ -7315,16 +7315,16 @@  discard block
 block discarded – undo
7315 7315
 			$reset_scripts = "";
7316 7316
 
7317 7317
 			// Generate the date part, depending on the use or not of the javascript calendar
7318
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7319
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7320
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7321
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7318
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7319
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7320
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7321
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7322 7322
 			// Update the hour part
7323 7323
 			if ($h) {
7324 7324
 				if ($fullday) {
7325 7325
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7326 7326
 				}
7327
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7327
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7328 7328
 				if ($fullday) {
7329 7329
 					$reset_scripts .= ' } ';
7330 7330
 				}
@@ -7334,14 +7334,14 @@  discard block
 block discarded – undo
7334 7334
 				if ($fullday) {
7335 7335
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7336 7336
 				}
7337
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7337
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7338 7338
 				if ($fullday) {
7339 7339
 					$reset_scripts .= ' } ';
7340 7340
 				}
7341 7341
 			}
7342 7342
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7343 7343
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7344
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7344
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7345 7345
 				$retstring .= $langs->trans("DateStartPlusOne");
7346 7346
 				$retstring .= '</button> ';
7347 7347
 			}
@@ -7399,17 +7399,17 @@  discard block
 block discarded – undo
7399 7399
 			unset($TDurationTypes[$value]);
7400 7400
 		}
7401 7401
 
7402
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7402
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7403 7403
 		foreach ($TDurationTypes as $key => $typeduration) {
7404
-			$retstring .= '<option value="' . $key . '"';
7404
+			$retstring .= '<option value="'.$key.'"';
7405 7405
 			if ($key == $selected) {
7406 7406
 				$retstring .= " selected";
7407 7407
 			}
7408
-			$retstring .= ">" . $typeduration . "</option>";
7408
+			$retstring .= ">".$typeduration."</option>";
7409 7409
 		}
7410 7410
 		$retstring .= "</select>";
7411 7411
 
7412
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7412
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7413 7413
 
7414 7414
 		return $retstring;
7415 7415
 	}
@@ -7441,30 +7441,30 @@  discard block
 block discarded – undo
7441 7441
 
7442 7442
 		// Hours
7443 7443
 		if ($iSecond != '') {
7444
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7444
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7445 7445
 
7446 7446
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7447 7447
 			$minSelected = convertSecondToTime($iSecond, 'min');
7448 7448
 		}
7449 7449
 
7450 7450
 		if ($typehour == 'select') {
7451
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7451
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7452 7452
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7453
-				$retstring .= '<option value="' . $hour . '"';
7453
+				$retstring .= '<option value="'.$hour.'"';
7454 7454
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7455 7455
 					$retstring .= " selected";
7456 7456
 				}
7457
-				$retstring .= ">" . $hour . "</option>";
7457
+				$retstring .= ">".$hour."</option>";
7458 7458
 			}
7459 7459
 			$retstring .= "</select>";
7460 7460
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7461
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7461
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7462 7462
 		} else {
7463 7463
 			return 'BadValueForParameterTypeHour';
7464 7464
 		}
7465 7465
 
7466 7466
 		if ($typehour != 'text') {
7467
-			$retstring .= ' ' . $langs->trans('HourShort');
7467
+			$retstring .= ' '.$langs->trans('HourShort');
7468 7468
 		} else {
7469 7469
 			$retstring .= '<span class="">:</span>';
7470 7470
 		}
@@ -7479,21 +7479,21 @@  discard block
 block discarded – undo
7479 7479
 		}
7480 7480
 
7481 7481
 		if ($typehour == 'select' || $typehour == 'textselect') {
7482
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7482
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7483 7483
 			for ($min = 0; $min <= 55; $min += 5) {
7484
-				$retstring .= '<option value="' . $min . '"';
7484
+				$retstring .= '<option value="'.$min.'"';
7485 7485
 				if (is_numeric($minSelected) && $minSelected == $min) {
7486 7486
 					$retstring .= ' selected';
7487 7487
 				}
7488
-				$retstring .= '>' . $min . '</option>';
7488
+				$retstring .= '>'.$min.'</option>';
7489 7489
 			}
7490 7490
 			$retstring .= "</select>";
7491 7491
 		} elseif ($typehour == 'text') {
7492
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7492
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7493 7493
 		}
7494 7494
 
7495 7495
 		if ($typehour != 'text') {
7496
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7496
+			$retstring .= ' '.$langs->trans('MinuteShort');
7497 7497
 		}
7498 7498
 
7499 7499
 		$retstring .= "</span>";
@@ -7541,7 +7541,7 @@  discard block
 block discarded – undo
7541 7541
 			$placeholder = '';
7542 7542
 
7543 7543
 			if ($selected && empty($selected_input_value)) {
7544
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7544
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7545 7545
 				$tickettmpselect = new Ticket($this->db);
7546 7546
 				$tickettmpselect->fetch($selected);
7547 7547
 				$selected_input_value = $tickettmpselect->ref;
@@ -7549,17 +7549,17 @@  discard block
 block discarded – undo
7549 7549
 			}
7550 7550
 
7551 7551
 			$urloption = '';
7552
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7552
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7553 7553
 
7554 7554
 			if (empty($hidelabel)) {
7555
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7555
+				$out .= $langs->trans("RefOrLabel").' : ';
7556 7556
 			} elseif ($hidelabel > 1) {
7557
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7557
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7558 7558
 				if ($hidelabel == 2) {
7559 7559
 					$out .= img_picto($langs->trans("Search"), 'search');
7560 7560
 				}
7561 7561
 			}
7562
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7562
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7563 7563
 			if ($hidelabel == 3) {
7564 7564
 				$out .= img_picto($langs->trans("Search"), 'search');
7565 7565
 			}
@@ -7603,8 +7603,8 @@  discard block
 block discarded – undo
7603 7603
 
7604 7604
 		$sql = "SELECT ";
7605 7605
 		$sql .= $selectFields;
7606
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7607
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7606
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7607
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7608 7608
 
7609 7609
 		// Add criteria on ref/label
7610 7610
 		if ($filterkey != '') {
@@ -7620,7 +7620,7 @@  discard block
 block discarded – undo
7620 7620
 				if ($i > 0) {
7621 7621
 					$sql .= " AND ";
7622 7622
 				}
7623
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7623
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7624 7624
 				$sql .= ")";
7625 7625
 				$i++;
7626 7626
 			}
@@ -7633,22 +7633,22 @@  discard block
 block discarded – undo
7633 7633
 		$sql .= $this->db->plimit($limit, 0);
7634 7634
 
7635 7635
 		// Build output string
7636
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7636
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7637 7637
 		$result = $this->db->query($sql);
7638 7638
 		if ($result) {
7639
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7640
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7639
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7640
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7641 7641
 
7642 7642
 			$num = $this->db->num_rows($result);
7643 7643
 
7644 7644
 			$events = array();
7645 7645
 
7646 7646
 			if (!$forcecombo) {
7647
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7647
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7648 7648
 				$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT);
7649 7649
 			}
7650 7650
 
7651
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7651
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7652 7652
 
7653 7653
 			$textifempty = '';
7654 7654
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7665,7 +7665,7 @@  discard block
 block discarded – undo
7665 7665
 				}
7666 7666
 			}
7667 7667
 			if ($showempty) {
7668
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7668
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7669 7669
 			}
7670 7670
 
7671 7671
 			$i = 0;
@@ -7720,13 +7720,13 @@  discard block
 block discarded – undo
7720 7720
 		$outref = $objp->ref;
7721 7721
 		$outtype = $objp->fk_product_type;
7722 7722
 
7723
-		$opt = '<option value="' . $objp->rowid . '"';
7723
+		$opt = '<option value="'.$objp->rowid.'"';
7724 7724
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7725 7725
 		$opt .= '>';
7726 7726
 		$opt .= $objp->ref;
7727 7727
 		$objRef = $objp->ref;
7728 7728
 		if (!empty($filterkey) && $filterkey != '') {
7729
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7729
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7730 7730
 		}
7731 7731
 
7732 7732
 		$opt .= "</option>\n";
@@ -7767,7 +7767,7 @@  discard block
 block discarded – undo
7767 7767
 			$placeholder = '';
7768 7768
 
7769 7769
 			if ($selected && empty($selected_input_value)) {
7770
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7770
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7771 7771
 				$projecttmpselect = new Project($this->db);
7772 7772
 				$projecttmpselect->fetch($selected);
7773 7773
 				$selected_input_value = $projecttmpselect->ref;
@@ -7775,17 +7775,17 @@  discard block
 block discarded – undo
7775 7775
 			}
7776 7776
 
7777 7777
 			$urloption = '';
7778
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7778
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7779 7779
 
7780 7780
 			if (empty($hidelabel)) {
7781
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7781
+				$out .= $langs->trans("RefOrLabel").' : ';
7782 7782
 			} elseif ($hidelabel > 1) {
7783
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7783
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7784 7784
 				if ($hidelabel == 2) {
7785 7785
 					$out .= img_picto($langs->trans("Search"), 'search');
7786 7786
 				}
7787 7787
 			}
7788
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7788
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7789 7789
 			if ($hidelabel == 3) {
7790 7790
 				$out .= img_picto($langs->trans("Search"), 'search');
7791 7791
 			}
@@ -7828,8 +7828,8 @@  discard block
 block discarded – undo
7828 7828
 
7829 7829
 		$sql = "SELECT ";
7830 7830
 		$sql .= $selectFields;
7831
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7832
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7831
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7832
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7833 7833
 
7834 7834
 		// Add criteria on ref/label
7835 7835
 		if ($filterkey != '') {
@@ -7845,7 +7845,7 @@  discard block
 block discarded – undo
7845 7845
 				if ($i > 0) {
7846 7846
 					$sql .= " AND ";
7847 7847
 				}
7848
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7848
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7849 7849
 				$sql .= "";
7850 7850
 				$i++;
7851 7851
 			}
@@ -7858,22 +7858,22 @@  discard block
 block discarded – undo
7858 7858
 		$sql .= $this->db->plimit($limit, 0);
7859 7859
 
7860 7860
 		// Build output string
7861
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7861
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7862 7862
 		$result = $this->db->query($sql);
7863 7863
 		if ($result) {
7864
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7865
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7864
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7865
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7866 7866
 
7867 7867
 			$num = $this->db->num_rows($result);
7868 7868
 
7869 7869
 			$events = array();
7870 7870
 
7871 7871
 			if (!$forcecombo) {
7872
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7872
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7873 7873
 				$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
7874 7874
 			}
7875 7875
 
7876
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7876
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7877 7877
 
7878 7878
 			$textifempty = '';
7879 7879
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7890,7 +7890,7 @@  discard block
 block discarded – undo
7890 7890
 				}
7891 7891
 			}
7892 7892
 			if ($showempty) {
7893
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7893
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7894 7894
 			}
7895 7895
 
7896 7896
 			$i = 0;
@@ -7948,13 +7948,13 @@  discard block
 block discarded – undo
7948 7948
 		$outlabel = $objp->label;
7949 7949
 		$outtype = $objp->fk_product_type;
7950 7950
 
7951
-		$opt = '<option value="' . $objp->rowid . '"';
7951
+		$opt = '<option value="'.$objp->rowid.'"';
7952 7952
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7953 7953
 		$opt .= '>';
7954 7954
 		$opt .= $objp->ref;
7955 7955
 		$objRef = $objp->ref;
7956 7956
 		if (!empty($filterkey) && $filterkey != '') {
7957
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7957
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7958 7958
 		}
7959 7959
 
7960 7960
 		$opt .= "</option>\n";
@@ -7996,7 +7996,7 @@  discard block
 block discarded – undo
7996 7996
 			$placeholder = '';
7997 7997
 
7998 7998
 			if ($selected && empty($selected_input_value)) {
7999
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7999
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
8000 8000
 				$adherenttmpselect = new Adherent($this->db);
8001 8001
 				$adherenttmpselect->fetch($selected);
8002 8002
 				$selected_input_value = $adherenttmpselect->ref;
@@ -8005,17 +8005,17 @@  discard block
 block discarded – undo
8005 8005
 
8006 8006
 			$urloption = '';
8007 8007
 
8008
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8008
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
8009 8009
 
8010 8010
 			if (empty($hidelabel)) {
8011
-				$out .= $langs->trans("RefOrLabel") . ' : ';
8011
+				$out .= $langs->trans("RefOrLabel").' : ';
8012 8012
 			} elseif ($hidelabel > 1) {
8013
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
8013
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
8014 8014
 				if ($hidelabel == 2) {
8015 8015
 					$out .= img_picto($langs->trans("Search"), 'search');
8016 8016
 				}
8017 8017
 			}
8018
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
8018
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
8019 8019
 			if ($hidelabel == 3) {
8020 8020
 				$out .= img_picto($langs->trans("Search"), 'search');
8021 8021
 			}
@@ -8060,8 +8060,8 @@  discard block
 block discarded – undo
8060 8060
 
8061 8061
 		$sql = "SELECT ";
8062 8062
 		$sql .= $selectFields;
8063
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
8064
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
8063
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
8064
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
8065 8065
 
8066 8066
 		// Add criteria on ref/label
8067 8067
 		if ($filterkey != '') {
@@ -8077,8 +8077,8 @@  discard block
 block discarded – undo
8077 8077
 				if ($i > 0) {
8078 8078
 					$sql .= " AND ";
8079 8079
 				}
8080
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
8081
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
8080
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
8081
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
8082 8082
 				$i++;
8083 8083
 			}
8084 8084
 			if (count($search_crit) > 1) {
@@ -8087,27 +8087,27 @@  discard block
 block discarded – undo
8087 8087
 			$sql .= ')';
8088 8088
 		}
8089 8089
 		if ($status != -1) {
8090
-			$sql .= ' AND statut = ' . ((int) $status);
8090
+			$sql .= ' AND statut = '.((int) $status);
8091 8091
 		}
8092 8092
 		$sql .= $this->db->plimit($limit, 0);
8093 8093
 
8094 8094
 		// Build output string
8095
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
8095
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
8096 8096
 		$result = $this->db->query($sql);
8097 8097
 		if ($result) {
8098
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
8099
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
8098
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
8099
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
8100 8100
 
8101 8101
 			$num = $this->db->num_rows($result);
8102 8102
 
8103 8103
 			$events = array();
8104 8104
 
8105 8105
 			if (!$forcecombo) {
8106
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8106
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8107 8107
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
8108 8108
 			}
8109 8109
 
8110
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
8110
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
8111 8111
 
8112 8112
 			$textifempty = '';
8113 8113
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -8124,7 +8124,7 @@  discard block
 block discarded – undo
8124 8124
 				}
8125 8125
 			}
8126 8126
 			if ($showempty) {
8127
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
8127
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
8128 8128
 			}
8129 8129
 
8130 8130
 			$i = 0;
@@ -8180,11 +8180,11 @@  discard block
 block discarded – undo
8180 8180
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
8181 8181
 		$outtype = $objp->fk_adherent_type;
8182 8182
 
8183
-		$opt = '<option value="' . $objp->rowid . '"';
8183
+		$opt = '<option value="'.$objp->rowid.'"';
8184 8184
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8185 8185
 		$opt .= '>';
8186 8186
 		if (!empty($filterkey) && $filterkey != '') {
8187
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
8187
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
8188 8188
 		}
8189 8189
 		$opt .= $outlabel;
8190 8190
 		$opt .= "</option>\n";
@@ -8222,8 +8222,8 @@  discard block
 block discarded – undo
8222 8222
 		$objecttmp = null;
8223 8223
 		$InfoFieldList = array();
8224 8224
 		$classname = '';
8225
-		$filter = '';  // Ensure filter has value (for static analysis)
8226
-		$sortfield = '';  // Ensure filter has value (for static analysis)
8225
+		$filter = ''; // Ensure filter has value (for static analysis)
8226
+		$sortfield = ''; // Ensure filter has value (for static analysis)
8227 8227
 
8228 8228
 		if ($objectfield) {	// We must retrieve the objectdesc from the field or extrafield
8229 8229
 			// Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield'
@@ -8267,9 +8267,9 @@  discard block
 block discarded – undo
8267 8267
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8268 8268
 			$reg = array();
8269 8269
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8270
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8270
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8271 8271
 			}
8272
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8272
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8273 8273
 
8274 8274
 			$classname = $InfoFieldList[0];
8275 8275
 			$classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1];
@@ -8300,8 +8300,8 @@  discard block
 block discarded – undo
8300 8300
 		);
8301 8301
 
8302 8302
 		if (!is_object($objecttmp)) {
8303
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8304
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8303
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING);
8304
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc;
8305 8305
 		}
8306 8306
 		'@phan-var-force CommonObject $objecttmp';
8307 8307
 
@@ -8313,9 +8313,9 @@  discard block
 block discarded – undo
8313 8313
 		if ($prefixforautocompletemode == 'product') {
8314 8314
 			$prefixforautocompletemode = 'produit';
8315 8315
 		}
8316
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8316
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8317 8317
 
8318
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8318
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8319 8319
 
8320 8320
 		// Generate the combo HTML component
8321 8321
 		$out = '';
@@ -8344,13 +8344,13 @@  discard block
 block discarded – undo
8344 8344
 			}
8345 8345
 
8346 8346
 			// Set url and param to call to get json of the search results
8347
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8348
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8347
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8348
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8349 8349
 
8350 8350
 			// Activate the auto complete using ajax call.
8351 8351
 			$out .= ajax_autocompleter($preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0);
8352 8352
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8353
-			$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) . '"' : '') . ' />';
8353
+			$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).'"' : '').' />';
8354 8354
 		} else {
8355 8355
 			// Immediate load of table record.
8356 8356
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8390,16 +8390,16 @@  discard block
 block discarded – undo
8390 8390
 		if ($prefixforautocompletemode == 'societe') {
8391 8391
 			$prefixforautocompletemode = 'company';
8392 8392
 		}
8393
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8393
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8394 8394
 
8395 8395
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8396 8396
 			$tmpfieldstoshow = '';
8397 8397
 			foreach ($objecttmp->fields as $key => $val) {
8398
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
8398
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
8399 8399
 					continue;
8400 8400
 				}
8401 8401
 				if (!empty($val['showoncombobox'])) {
8402
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8402
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8403 8403
 				}
8404 8404
 			}
8405 8405
 			if ($tmpfieldstoshow) {
@@ -8427,18 +8427,18 @@  discard block
 block discarded – undo
8427 8427
 		$num = 0;
8428 8428
 
8429 8429
 		// Search data
8430
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8430
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8431 8431
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8432
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object";
8432
+			$sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object";
8433 8433
 		}
8434 8434
 		if (isset($objecttmp->ismultientitymanaged)) {
8435 8435
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8436 8436
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8437
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8437
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8438 8438
 			}
8439 8439
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8440 8440
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8441
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8441
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8442 8442
 				}
8443 8443
 			}
8444 8444
 		}
@@ -8458,21 +8458,21 @@  discard block
 block discarded – undo
8458 8458
 			$sql .= " WHERE 1=1";
8459 8459
 			if (isset($objecttmp->ismultientitymanaged)) {
8460 8460
 				if ($objecttmp->ismultientitymanaged == 1) {
8461
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8461
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8462 8462
 				}
8463 8463
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8464
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8464
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8465 8465
 				}
8466 8466
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8467 8467
 					if ($objecttmp->element == 'societe') {
8468
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8468
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8469 8469
 					} else {
8470
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8470
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8471 8471
 					}
8472 8472
 				}
8473 8473
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8474 8474
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8475
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8475
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8476 8476
 					}
8477 8477
 				}
8478 8478
 			}
@@ -8484,7 +8484,7 @@  discard block
 block discarded – undo
8484 8484
 				$errormessage = '';
8485 8485
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8486 8486
 				if ($errormessage) {
8487
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8487
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8488 8488
 				}
8489 8489
 			}
8490 8490
 		}
@@ -8496,7 +8496,7 @@  discard block
 block discarded – undo
8496 8496
 		$resql = $this->db->query($sql);
8497 8497
 		if ($resql) {
8498 8498
 			// Construct $out and $outarray
8499
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8499
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8500 8500
 
8501 8501
 			// 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
8502 8502
 			$textifempty = '&nbsp;';
@@ -8510,7 +8510,7 @@  discard block
 block discarded – undo
8510 8510
 				}
8511 8511
 			}
8512 8512
 			if ($showempty) {
8513
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8513
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8514 8514
 			}
8515 8515
 
8516 8516
 			$num = $this->db->num_rows($resql);
@@ -8533,9 +8533,9 @@  discard block
 block discarded – undo
8533 8533
 					}
8534 8534
 					if (empty($outputmode)) {
8535 8535
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8536
-							$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>';
8536
+							$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>';
8537 8537
 						} else {
8538
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8538
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8539 8539
 						}
8540 8540
 					} else {
8541 8541
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8548,10 +8548,10 @@  discard block
 block discarded – undo
8548 8548
 				}
8549 8549
 			}
8550 8550
 
8551
-			$out .= '</select>' . "\n";
8551
+			$out .= '</select>'."\n";
8552 8552
 
8553 8553
 			if (!$forcecombo) {
8554
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8554
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8555 8555
 				$out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0));
8556 8556
 			}
8557 8557
 		} else {
@@ -8615,8 +8615,8 @@  discard block
 block discarded – undo
8615 8615
 			}
8616 8616
 		}
8617 8617
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8618
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8619
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8618
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8619
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8620 8620
 		$out .= '>'."\n";
8621 8621
 
8622 8622
 		if ($show_empty) {
@@ -8627,7 +8627,7 @@  discard block
 block discarded – undo
8627 8627
 			if (!is_numeric($show_empty)) {
8628 8628
 				$textforempty = $show_empty;
8629 8629
 			}
8630
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8630
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8631 8631
 		}
8632 8632
 		if (is_array($array)) {
8633 8633
 			// Translate
@@ -8652,7 +8652,7 @@  discard block
 block discarded – undo
8652 8652
 					$value = $tmpvalue['label'];
8653 8653
 					//$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html'];
8654 8654
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8655
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8655
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8656 8656
 				} else {
8657 8657
 					$value = $tmpvalue;
8658 8658
 					//$valuehtml = $tmpvalue;
@@ -8668,9 +8668,9 @@  discard block
 block discarded – undo
8668 8668
 				}
8669 8669
 				if ($key_in_label) {
8670 8670
 					if (empty($nohtmlescape)) {
8671
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8671
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8672 8672
 					} else {
8673
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8673
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8674 8674
 					}
8675 8675
 				} else {
8676 8676
 					if (empty($nohtmlescape)) {
@@ -8682,8 +8682,8 @@  discard block
 block discarded – undo
8682 8682
 						$selectOptionValue = '&nbsp;';
8683 8683
 					}
8684 8684
 				}
8685
-				$out .= '<option value="' . $key . '"';
8686
-				$out .= $style . $disabled;
8685
+				$out .= '<option value="'.$key.'"';
8686
+				$out .= $style.$disabled;
8687 8687
 				if (is_array($id)) {
8688 8688
 					if (in_array($key, $id) && !$disabled) {
8689 8689
 						$out .= ' selected'; // To preselect a value
@@ -8695,7 +8695,7 @@  discard block
 block discarded – undo
8695 8695
 					}
8696 8696
 				}
8697 8697
 				if (!empty($nohtmlescape)) {	// deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content.
8698
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8698
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8699 8699
 				}
8700 8700
 
8701 8701
 				if (is_array($tmpvalue)) {
@@ -8715,7 +8715,7 @@  discard block
 block discarded – undo
8715 8715
 		// Add code for jquery to use multiselect
8716 8716
 		if ($addjscombo && $jsbeautify) {
8717 8717
 			// Enhance with select2
8718
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8718
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8719 8719
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
8720 8720
 		}
8721 8721
 
@@ -8743,28 +8743,28 @@  discard block
 block discarded – undo
8743 8743
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8744 8744
 	{
8745 8745
 		global $conf, $langs;
8746
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8746
+		global $delayedhtmlcontent; // Will be used later outside of this function
8747 8747
 
8748 8748
 		// TODO Use an internal dolibarr component instead of select2
8749 8749
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8750 8750
 			return '';
8751 8751
 		}
8752 8752
 
8753
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8753
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8754 8754
 
8755 8755
 		$outdelayed = '';
8756 8756
 		if (!empty($conf->use_javascript_ajax)) {
8757 8757
 			$tmpplugin = 'select2';
8758
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8759
-		    	<script nonce="' . getNonce() . '">
8758
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8759
+		    	<script nonce="' . getNonce().'">
8760 8760
 		    	$(document).ready(function () {
8761 8761
 
8762
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8762
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8763 8763
 
8764
-	                $(".' . $htmlname . '").select2({
8764
+	                $(".' . $htmlname.'").select2({
8765 8765
 				    	ajax: {
8766 8766
 					    	dir: "ltr",
8767
-					    	url: "' . $url . '",
8767
+					    	url: "' . $url.'",
8768 8768
 					    	dataType: \'json\',
8769 8769
 					    	delay: 250,
8770 8770
 					    	data: function (params) {
@@ -8791,9 +8791,9 @@  discard block
 block discarded – undo
8791 8791
 				    	},
8792 8792
 		 				language: select2arrayoflanguage,
8793 8793
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8794
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8794
+					    placeholder: "' . dol_escape_js($placeholder).'",
8795 8795
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8796
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8796
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8797 8797
 				        formatResult: function (result, container, query, escapeMarkup) {
8798 8798
 	                        return escapeMarkup(result.text);
8799 8799
 	                    },
@@ -8801,10 +8801,10 @@  discard block
 block discarded – undo
8801 8801
 
8802 8802
 	                ' . ($callurlonselect ? '
8803 8803
 	                /* Code to execute a GET when we select a value */
8804
-	                $(".' . $htmlname . '").change(function() {
8805
-				    	var selected = $(".' . $htmlname . '").val();
8804
+	                $(".' . $htmlname.'").change(function() {
8805
+				    	var selected = $(".' . $htmlname.'").val();
8806 8806
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8807
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8807
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8808 8808
 	    			    $.each( saveRemoteData, function( key, value ) {
8809 8809
 	    				        if (key == selected)
8810 8810
 	    			            {
@@ -8812,7 +8812,7 @@  discard block
 block discarded – undo
8812 8812
 	    			                 location.assign(value.url);
8813 8813
 	    			            }
8814 8814
 	                    });
8815
-	    			});' : '') . '
8815
+	    			});' : '').'
8816 8816
 
8817 8817
 	    	   });
8818 8818
 		       </script>';
@@ -8848,14 +8848,14 @@  discard block
 block discarded – undo
8848 8848
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8849 8849
 	{
8850 8850
 		global $conf, $langs;
8851
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8851
+		global $delayedhtmlcontent; // Will be used later outside of this function
8852 8852
 
8853 8853
 		// TODO Use an internal dolibarr component instead of select2
8854 8854
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8855 8855
 			return '';
8856 8856
 		}
8857 8857
 
8858
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8858
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8859 8859
 
8860 8860
 		$formattedarrayresult = array();
8861 8861
 
@@ -8870,20 +8870,20 @@  discard block
 block discarded – undo
8870 8870
 		$outdelayed = '';
8871 8871
 		if (!empty($conf->use_javascript_ajax)) {
8872 8872
 			$tmpplugin = 'select2';
8873
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8874
-				<script nonce="' . getNonce() . '">
8873
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8874
+				<script nonce="' . getNonce().'">
8875 8875
 				$(document).ready(function () {
8876
-					var data = ' . json_encode($formattedarrayresult) . ';
8876
+					var data = ' . json_encode($formattedarrayresult).';
8877 8877
 
8878
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8878
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8879 8879
 
8880
-					$(".' . $htmlname . '").select2({
8880
+					$(".' . $htmlname.'").select2({
8881 8881
 						data: data,
8882 8882
 						language: select2arrayoflanguage,
8883 8883
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8884
-						placeholder: "' . dol_escape_js($placeholder) . '",
8884
+						placeholder: "' . dol_escape_js($placeholder).'",
8885 8885
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8886
-						minimumInputLength: ' . $minimumInputLength . ',
8886
+						minimumInputLength: ' . $minimumInputLength.',
8887 8887
 						formatResult: function (result, container, query, escapeMarkup) {
8888 8888
 							return escapeMarkup(result.text);
8889 8889
 						},
@@ -8922,11 +8922,11 @@  discard block
 block discarded – undo
8922 8922
 
8923 8923
 					' . ($callurlonselect ? '
8924 8924
 					/* Code to execute a GET when we select a value */
8925
-					$(".' . $htmlname . '").change(function() {
8926
-						var selected = $(".' . $htmlname . '").val();
8925
+					$(".' . $htmlname.'").change(function() {
8926
+						var selected = $(".' . $htmlname.'").val();
8927 8927
 						console.log("We select "+selected)
8928 8928
 
8929
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
8929
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
8930 8930
 						$.each( saveRemoteData, function( key, value ) {
8931 8931
 							if (key == selected)
8932 8932
 							{
@@ -8934,7 +8934,7 @@  discard block
 block discarded – undo
8934 8934
 								location.assign(value.url);
8935 8935
 							}
8936 8936
 						});
8937
-					});' : '') . '
8937
+					});' : '').'
8938 8938
 
8939 8939
 				});
8940 8940
 				</script>';
@@ -8983,7 +8983,7 @@  discard block
 block discarded – undo
8983 8983
 		$useenhancedmultiselect = 0;
8984 8984
 		if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
8985 8985
 			if ($addjscombo) {
8986
-				$useenhancedmultiselect = 1;	// Use the js multiselect in one line. Possible only if $addjscombo not 0.
8986
+				$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
8987 8987
 			}
8988 8988
 		}
8989 8989
 
@@ -8992,7 +8992,7 @@  discard block
 block discarded – undo
8992 8992
 		// submitted to nothing.
8993 8993
 		$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
8994 8994
 		// Output select component
8995
-		$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";
8995
+		$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";
8996 8996
 		if (is_array($array) && !empty($array)) {
8997 8997
 			if ($value_as_key) {
8998 8998
 				$array = array_combine($array, $array);
@@ -9013,33 +9013,33 @@  discard block
 block discarded – undo
9013 9013
 						$tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml'];
9014 9014
 					}
9015 9015
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
9016
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
9016
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
9017 9017
 
9018
-					$out .= '<option value="' . $tmpkey . '"';
9018
+					$out .= '<option value="'.$tmpkey.'"';
9019 9019
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
9020 9020
 						$out .= ' selected';
9021 9021
 					}
9022 9022
 					if (!empty($tmplabelhtml)) {
9023
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
9023
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
9024 9024
 					} else {
9025
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
9026
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
9025
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
9026
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
9027 9027
 					}
9028 9028
 					$out .= '>';
9029 9029
 					$out .= dol_htmlentitiesbr($newval);
9030
-					$out .= '</option>' . "\n";
9030
+					$out .= '</option>'."\n";
9031 9031
 				}
9032 9032
 			}
9033 9033
 		}
9034
-		$out .= '</select>' . "\n";
9034
+		$out .= '</select>'."\n";
9035 9035
 
9036 9036
 		// Add code for jquery to use multiselect
9037 9037
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
9038
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
9039
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
9038
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
9039
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
9040 9040
 			if ($addjscombo == 1) {
9041 9041
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
9042
-				$out .= 'function formatResult(record, container) {' . "\n";
9042
+				$out .= 'function formatResult(record, container) {'."\n";
9043 9043
 				// If property data-html set, we decode html entities and use this.
9044 9044
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
9045 9045
 				$out .= '	if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {';
@@ -9047,26 +9047,26 @@  discard block
 block discarded – undo
9047 9047
 				$out .= '		return htmlEntityDecodeJs($(record.element).attr("data-html"));';
9048 9048
 				$out .= '	}'."\n";
9049 9049
 				$out .= '	return record.text;';
9050
-				$out .= '}' . "\n";
9051
-				$out .= 'function formatSelection(record) {' . "\n";
9050
+				$out .= '}'."\n";
9051
+				$out .= 'function formatSelection(record) {'."\n";
9052 9052
 				if ($elemtype == 'category') {
9053
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
9053
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
9054 9054
 				} else {
9055 9055
 					$out .= 'return record.text;';
9056 9056
 				}
9057
-				$out .= '}' . "\n";
9057
+				$out .= '}'."\n";
9058 9058
 				$out .= '$(document).ready(function () {
9059
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
9059
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
9060 9060
 				if ($placeholder) {
9061 9061
 					$out .= '
9062 9062
 								placeholder: {
9063 9063
 								    id: \'-1\',
9064
-								    text: \'' . dol_escape_js($placeholder) . '\'
9064
+								    text: \'' . dol_escape_js($placeholder).'\'
9065 9065
 								  },';
9066 9066
 				}
9067 9067
 				$out .= '		dir: \'ltr\',
9068 9068
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
9069
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
9069
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
9070 9070
 								// Specify format function for dropdown item
9071 9071
 								formatResult: formatResult,
9072 9072
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -9078,21 +9078,21 @@  discard block
 block discarded – undo
9078 9078
 
9079 9079
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
9080 9080
 								 the size only if component is not hidden by default on load */
9081
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
9081
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
9082 9082
 						});' . "\n";
9083 9083
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
9084 9084
 				// Add other js lib
9085 9085
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
9086 9086
 				// ...
9087
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
9087
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
9088 9088
 				$out .= '$(document).ready(function () {
9089
-							$(\'#' . $htmlname . '\').multiSelect({
9089
+							$(\'#' . $htmlname.'\').multiSelect({
9090 9090
 								containerHTML: \'<div class="multi-select-container">\',
9091 9091
 								menuHTML: \'<div class="multi-select-menu">\',
9092
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
9092
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
9093 9093
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
9094 9094
 								activeClass: \'multi-select-container--open\',
9095
-								noneText: \'' . $placeholder . '\'
9095
+								noneText: \'' . $placeholder.'\'
9096 9096
 							});
9097 9097
 						})';
9098 9098
 			}
@@ -9125,7 +9125,7 @@  discard block
 block discarded – undo
9125 9125
 			return '';
9126 9126
 		}
9127 9127
 
9128
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
9128
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
9129 9129
 
9130 9130
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
9131 9131
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -9168,19 +9168,19 @@  discard block
 block discarded – undo
9168 9168
 				}
9169 9169
 
9170 9170
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list  @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
9171
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
9172
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
9171
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
9172
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
9173 9173
 			}
9174 9174
 		}
9175 9175
 
9176
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
9176
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
9177 9177
 
9178 9178
         <dl class="dropdown">
9179 9179
             <dt>
9180
-            <a href="#' . $htmlname . '">
9181
-              ' . img_picto('', 'list') . '
9180
+            <a href="#' . $htmlname.'">
9181
+              ' . img_picto('', 'list').'
9182 9182
             </a>
9183
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
9183
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
9184 9184
             </dt>
9185 9185
             <dd class="dropdowndd">
9186 9186
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -9192,19 +9192,19 @@  discard block
 block discarded – undo
9192 9192
             </dd>
9193 9193
         </dl>
9194 9194
 
9195
-        <script nonce="' . getNonce() . '" type="text/javascript">
9195
+        <script nonce="' . getNonce().'" type="text/javascript">
9196 9196
           jQuery(document).ready(function () {
9197
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
9197
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
9198 9198
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
9199 9199
 
9200 9200
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
9201 9201
 
9202 9202
                   var title = $(this).val() + ",";
9203 9203
                   if ($(this).is(\':checked\')) {
9204
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
9204
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
9205 9205
                   }
9206 9206
                   else {
9207
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
9207
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
9208 9208
                   }
9209 9209
                   // Now, we submit page
9210 9210
                   //$(this).parents(\'form:first\').submit();
@@ -9235,7 +9235,7 @@  discard block
 block discarded – undo
9235 9235
 	 */
9236 9236
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9237 9237
 	{
9238
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9238
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9239 9239
 
9240 9240
 		$cat = new Categorie($this->db);
9241 9241
 		$categories = $cat->containing($id, $type);
@@ -9245,10 +9245,10 @@  discard block
 block discarded – undo
9245 9245
 			foreach ($categories as $c) {
9246 9246
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
9247 9247
 				foreach ($ways as $way) {
9248
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9248
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9249 9249
 				}
9250 9250
 			}
9251
-			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9251
+			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9252 9252
 		}
9253 9253
 
9254 9254
 		if ($rendermode == 0) {
@@ -9296,15 +9296,15 @@  discard block
 block discarded – undo
9296 9296
 
9297 9297
 
9298 9298
 			print '<div class="div-table-responsive-no-min">';
9299
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9299
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9300 9300
 
9301 9301
 			print '<tr class="liste_titre">';
9302
-			print '<td>' . $langs->trans("Type") . '</td>';
9303
-			print '<td>' . $langs->trans("Ref") . '</td>';
9302
+			print '<td>'.$langs->trans("Type").'</td>';
9303
+			print '<td>'.$langs->trans("Ref").'</td>';
9304 9304
 			print '<td class="center"></td>';
9305
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9306
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9307
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9305
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9306
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9307
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9308 9308
 			print '<td></td>';
9309 9309
 			print '</tr>';
9310 9310
 
@@ -9323,13 +9323,13 @@  discard block
 block discarded – undo
9323 9323
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9324 9324
 					$element = $regs[1];
9325 9325
 					$subelement = $regs[2];
9326
-					$tplpath = $element . '/' . $subelement;
9326
+					$tplpath = $element.'/'.$subelement;
9327 9327
 				}
9328 9328
 				$tplname = 'linkedobjectblock';
9329 9329
 
9330 9330
 				// To work with non standard path
9331 9331
 				if ($objecttype == 'facture') {
9332
-					$tplpath = 'compta/' . $element;
9332
+					$tplpath = 'compta/'.$element;
9333 9333
 					if (!isModEnabled('invoice')) {
9334 9334
 						continue; // Do not show if module disabled
9335 9335
 					}
@@ -9340,7 +9340,7 @@  discard block
 block discarded – undo
9340 9340
 						continue; // Do not show if module disabled
9341 9341
 					}
9342 9342
 				} elseif ($objecttype == 'propal') {
9343
-					$tplpath = 'comm/' . $element;
9343
+					$tplpath = 'comm/'.$element;
9344 9344
 					if (!isModEnabled('propal')) {
9345 9345
 						continue; // Do not show if module disabled
9346 9346
 					}
@@ -9391,7 +9391,7 @@  discard block
 block discarded – undo
9391 9391
 				$linkedObjectBlock = $objects;
9392 9392
 
9393 9393
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9394
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9394
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9395 9395
 				foreach ($dirtpls as $reldir) {
9396 9396
 					$reldir = rtrim($reldir, '/');
9397 9397
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
@@ -9399,7 +9399,7 @@  discard block
 block discarded – undo
9399 9399
 						$noMoreLinkedObjectBlockAfter = 1;
9400 9400
 					}
9401 9401
 
9402
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9402
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9403 9403
 					if ($res) {
9404 9404
 						$nboftypesoutput++;
9405 9405
 						break;
@@ -9408,7 +9408,7 @@  discard block
 block discarded – undo
9408 9408
 			}
9409 9409
 
9410 9410
 			if (!$nboftypesoutput) {
9411
-				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9411
+				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9412 9412
 			}
9413 9413
 
9414 9414
 			print '</table>';
@@ -9448,14 +9448,14 @@  discard block
 block discarded – undo
9448 9448
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9449 9449
 			$listofidcompanytoscan = $object->thirdparty->id;
9450 9450
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9451
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9451
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9452 9452
 			}
9453 9453
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9454
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9454
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9455 9455
 				$tmpproject = new Project($this->db);
9456 9456
 				$tmpproject->fetch($object->fk_project);
9457 9457
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9458
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9458
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9459 9459
 				}
9460 9460
 				unset($tmpproject);
9461 9461
 			}
@@ -9465,63 +9465,63 @@  discard block
 block discarded – undo
9465 9465
 					'enabled' => isModEnabled('propal'),
9466 9466
 					'perms' => 1,
9467 9467
 					'label' => 'LinkToProposal',
9468
-					'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') . ')'),
9468
+					'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').')'),
9469 9469
 				'shipping' => array(
9470 9470
 					'enabled' => isModEnabled('shipping'),
9471 9471
 					'perms' => 1,
9472 9472
 					'label' => 'LinkToExpedition',
9473
-					'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') . ')'),
9473
+					'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').')'),
9474 9474
 				'order' => array(
9475 9475
 					'enabled' => isModEnabled('order'),
9476 9476
 					'perms' => 1,
9477 9477
 					'label' => 'LinkToOrder',
9478
-					'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') . ')'),
9478
+					'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').')'),
9479 9479
 				'invoice' => array(
9480 9480
 					'enabled' => isModEnabled('invoice'),
9481 9481
 					'perms' => 1,
9482 9482
 					'label' => 'LinkToInvoice',
9483
-					'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') . ')'),
9483
+					'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').')'),
9484 9484
 				'invoice_template' => array(
9485 9485
 					'enabled' => isModEnabled('invoice'),
9486 9486
 					'perms' => 1,
9487 9487
 					'label' => 'LinkToTemplateInvoice',
9488
-					'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') . ')'),
9488
+					'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').')'),
9489 9489
 				'contrat' => array(
9490 9490
 					'enabled' => isModEnabled('contract'),
9491 9491
 					'perms' => 1,
9492 9492
 					'label' => 'LinkToContract',
9493 9493
 					'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
9494
-							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'
9494
+							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'
9495 9495
 				),
9496 9496
 				'fichinter' => array(
9497 9497
 					'enabled' => isModEnabled('intervention'),
9498 9498
 					'perms' => 1,
9499 9499
 					'label' => 'LinkToIntervention',
9500
-					'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') . ')'),
9500
+					'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').')'),
9501 9501
 				'supplier_proposal' => array(
9502 9502
 					'enabled' => isModEnabled('supplier_proposal'),
9503 9503
 					'perms' => 1,
9504 9504
 					'label' => 'LinkToSupplierProposal',
9505
-					'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') . ')'),
9505
+					'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').')'),
9506 9506
 				'order_supplier' => array(
9507 9507
 					'enabled' => isModEnabled("supplier_order"),
9508 9508
 					'perms' => 1,
9509 9509
 					'label' => 'LinkToSupplierOrder',
9510
-					'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') . ')'),
9510
+					'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').')'),
9511 9511
 				'invoice_supplier' => array(
9512 9512
 					'enabled' => isModEnabled("supplier_invoice"),
9513 9513
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9514
-					'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') . ')'),
9514
+					'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').')'),
9515 9515
 				'ticket' => array(
9516 9516
 					'enabled' => isModEnabled('ticket'),
9517 9517
 					'perms' => 1,
9518 9518
 					'label' => 'LinkToTicket',
9519
-					'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') . ')'),
9519
+					'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').')'),
9520 9520
 				'mo' => array(
9521 9521
 					'enabled' => isModEnabled('mrp'),
9522 9522
 					'perms' => 1,
9523 9523
 					'label' => 'LinkToMo',
9524
-					'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') . ')')
9524
+					'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').')')
9525 9525
 			);
9526 9526
 		}
9527 9527
 
@@ -9557,22 +9557,22 @@  discard block
 block discarded – undo
9557 9557
 			}
9558 9558
 
9559 9559
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9560
-				print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9560
+				print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9561 9561
 
9562 9562
 				if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9563 9563
 					print '<br>'."\n";
9564 9564
 					print '<!-- form to add a link from anywhere -->'."\n";
9565
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9566
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9565
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9566
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9567 9567
 					print '<input type="hidden" name="action" value="addlinkbyref">';
9568
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9569
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9568
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9569
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9570 9570
 					print '<table class="noborder">';
9571 9571
 					print '<tr>';
9572 9572
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9573
-					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9574
-					print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9575
-					print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9573
+					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9574
+					print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9575
+					print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9576 9576
 					print '</tr>';
9577 9577
 					print '</table>';
9578 9578
 					print '</form>';
@@ -9587,48 +9587,48 @@  discard block
 block discarded – undo
9587 9587
 
9588 9588
 					print '<br>';
9589 9589
 					print '<!-- form to add a link from object to same thirdparty -->'."\n";
9590
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9590
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9591 9591
 					print '<input type="hidden" name="action" value="addlink">';
9592
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9593
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9594
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9592
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9593
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9594
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9595 9595
 					print '<table class="noborder">';
9596 9596
 					print '<tr class="liste_titre">';
9597 9597
 					print '<td class="nowrap"></td>';
9598
-					print '<td class="center">' . $langs->trans("Ref") . '</td>';
9599
-					print '<td class="left">' . $langs->trans("RefCustomer") . '</td>';
9600
-					print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9601
-					print '<td class="left">' . $langs->trans("Company") . '</td>';
9598
+					print '<td class="center">'.$langs->trans("Ref").'</td>';
9599
+					print '<td class="left">'.$langs->trans("RefCustomer").'</td>';
9600
+					print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9601
+					print '<td class="left">'.$langs->trans("Company").'</td>';
9602 9602
 					print '</tr>';
9603 9603
 					while ($i < $num) {
9604 9604
 						$objp = $this->db->fetch_object($resqllist);
9605 9605
 
9606 9606
 						print '<tr class="oddeven">';
9607 9607
 						print '<td class="left">';
9608
-						print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9608
+						print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9609 9609
 						print '</td>';
9610
-						print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9611
-						print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9610
+						print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9611
+						print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9612 9612
 						print '<td class="right">';
9613 9613
 						if ($possiblelink['label'] == 'LinkToContract') {
9614 9614
 							$form = new Form($this->db);
9615
-							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9615
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9616 9616
 						}
9617
-						print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9617
+						print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9618 9618
 						print '</td>';
9619
-						print '<td>' . $objp->name . '</td>';
9619
+						print '<td>'.$objp->name.'</td>';
9620 9620
 						print '</tr>';
9621 9621
 						$i++;
9622 9622
 					}
9623 9623
 					print '</table>';
9624 9624
 					print '<div class="center">';
9625 9625
 					if ($num) {
9626
-						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9626
+						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9627 9627
 					}
9628 9628
 					if (empty($conf->use_javascript_ajax)) {
9629
-						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9629
+						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9630 9630
 					} else {
9631
-						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>';
9631
+						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>';
9632 9632
 					}
9633 9633
 					print '</form>';
9634 9634
 					$this->db->free($resqllist);
@@ -9639,10 +9639,10 @@  discard block
 block discarded – undo
9639 9639
 
9640 9640
 				//$linktoelem.=($linktoelem?' &nbsp; ':'');
9641 9641
 				if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9642
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9642
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9643 9643
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9644 9644
 				} else {
9645
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9645
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9646 9646
 				}
9647 9647
 			}
9648 9648
 		}
@@ -9652,22 +9652,22 @@  discard block
 block discarded – undo
9652 9652
     		<dl class="dropdown" id="linktoobjectname">
9653 9653
     		';
9654 9654
 			if (!empty($conf->use_javascript_ajax)) {
9655
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9655
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9656 9656
 			}
9657 9657
 			$linktoelem .= '<dd>
9658 9658
     		<div class="multiselectlinkto">
9659
-    		<ul class="ulselectedfields">' . $linktoelemlist . '
9659
+    		<ul class="ulselectedfields">' . $linktoelemlist.'
9660 9660
     		</ul>
9661 9661
     		</div>
9662 9662
     		</dd>
9663 9663
     		</dl>';
9664 9664
 		} else {
9665
-			$linktoelem = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
9665
+			$linktoelem = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
9666 9666
 		}
9667 9667
 
9668 9668
 		if (!empty($conf->use_javascript_ajax)) {
9669 9669
 			print '<!-- Add js to show linkto box -->
9670
-				<script nonce="' . getNonce() . '">
9670
+				<script nonce="' . getNonce().'">
9671 9671
 				jQuery(document).ready(function() {
9672 9672
 					jQuery(".linkto").click(function() {
9673 9673
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9708,19 +9708,19 @@  discard block
 block discarded – undo
9708 9708
 
9709 9709
 		$disabled = ($disabled ? ' disabled' : '');
9710 9710
 
9711
-		$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9711
+		$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9712 9712
 		if ($useempty) {
9713
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9713
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9714 9714
 		}
9715 9715
 		if (("$value" == 'yes') || ($value == 1)) {
9716
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9717
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9716
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9717
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9718 9718
 		} else {
9719 9719
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9720
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9721
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9720
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9721
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9722 9722
 		}
9723
-		$resultyesno .= '</select>' . "\n";
9723
+		$resultyesno .= '</select>'."\n";
9724 9724
 
9725 9725
 		if ($addjscombo) {
9726 9726
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9744,12 +9744,12 @@  discard block
 block discarded – undo
9744 9744
 	{
9745 9745
 		// phpcs:enable
9746 9746
 		$sql = "SELECT rowid, label";
9747
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9748
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9747
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9748
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9749 9749
 		$sql .= " ORDER BY rowid";
9750 9750
 		$result = $this->db->query($sql);
9751 9751
 		if ($result) {
9752
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9752
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9753 9753
 			if ($useempty) {
9754 9754
 				print '<option value="-1">&nbsp;</option>';
9755 9755
 			}
@@ -9759,9 +9759,9 @@  discard block
 block discarded – undo
9759 9759
 			while ($i < $num) {
9760 9760
 				$obj = $this->db->fetch_object($result);
9761 9761
 				if ($selected == $obj->rowid) {
9762
-					print '<option value="' . $obj->rowid . '" selected>';
9762
+					print '<option value="'.$obj->rowid.'" selected>';
9763 9763
 				} else {
9764
-					print '<option value="' . $obj->rowid . '">';
9764
+					print '<option value="'.$obj->rowid.'">';
9765 9765
 				}
9766 9766
 				print $obj->label;
9767 9767
 				print '</option>';
@@ -9852,8 +9852,8 @@  discard block
 block discarded – undo
9852 9852
 				$stringforfirstkey .= ' CTL +';
9853 9853
 			}
9854 9854
 
9855
-			$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>';
9856
-			$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>';
9855
+			$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>';
9856
+			$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>';
9857 9857
 		}
9858 9858
 
9859 9859
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9861,18 +9861,18 @@  discard block
 block discarded – undo
9861 9861
 
9862 9862
 		// Right part of banner
9863 9863
 		if ($morehtmlright) {
9864
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9864
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9865 9865
 		}
9866 9866
 
9867 9867
 		if ($previous_ref || $next_ref || $morehtml) {
9868 9868
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9869 9869
 		}
9870 9870
 		if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) {
9871
-			$ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9871
+			$ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9872 9872
 		}
9873 9873
 		if ($shownav && ($previous_ref || $next_ref)) {
9874
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
9875
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
9874
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
9875
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
9876 9876
 		}
9877 9877
 		if ($previous_ref || $next_ref || $morehtml) {
9878 9878
 			$ret .= '</ul></div>';
@@ -9887,7 +9887,7 @@  discard block
 block discarded – undo
9887 9887
 			$morehtmlstatus = $hookmanager->resPrint;
9888 9888
 		}
9889 9889
 		if ($morehtmlstatus) {
9890
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
9890
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
9891 9891
 		}
9892 9892
 
9893 9893
 		$parameters = array();
@@ -9901,14 +9901,14 @@  discard block
 block discarded – undo
9901 9901
 		// Left part of banner
9902 9902
 		if ($morehtmlleft) {
9903 9903
 			if ($conf->browser->layout == 'phone') {
9904
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
9904
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
9905 9905
 			} else {
9906
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
9906
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
9907 9907
 			}
9908 9908
 		}
9909 9909
 
9910 9910
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
9911
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
9911
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
9912 9912
 
9913 9913
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
9914 9914
 		if ($object->element == 'societe') {
@@ -9922,7 +9922,7 @@  discard block
 block discarded – undo
9922 9922
 
9923 9923
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
9924 9924
 				if (!is_object($extralanguages)) {
9925
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
9925
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
9926 9926
 					$extralanguages = new ExtraLanguages($this->db);
9927 9927
 				}
9928 9928
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -9937,29 +9937,29 @@  discard block
 block discarded – undo
9937 9937
 						if ($object->array_languages['name'][$extralangcode]) {
9938 9938
 							$htmltext .= $object->array_languages['name'][$extralangcode];
9939 9939
 						} else {
9940
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
9940
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
9941 9941
 						}
9942 9942
 					}
9943
-					$ret .= '<!-- Show translations of name -->' . "\n";
9943
+					$ret .= '<!-- Show translations of name -->'."\n";
9944 9944
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
9945 9945
 				}
9946 9946
 			}
9947 9947
 		} elseif ($object->element == 'member') {
9948 9948
 			'@phan-var-force Adherent $object';
9949
-			$ret .= $object->ref . '<br>';
9949
+			$ret .= $object->ref.'<br>';
9950 9950
 			$fullname = $object->getFullName($langs);
9951 9951
 			if ($object->morphy == 'mor' && $object->societe) {
9952
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
9952
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
9953 9953
 			} else {
9954
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
9954
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
9955 9955
 			}
9956 9956
 		} elseif (in_array($object->element, array('contact', 'user'))) {
9957
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
9957
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
9958 9958
 		} elseif ($object->element == 'usergroup') {
9959 9959
 			$ret .= dol_htmlentities($object->name);
9960 9960
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
9961 9961
 			'@phan-var-force ActionComm $object';
9962
-			$ret .= $object->ref . '<br>' . $object->label;
9962
+			$ret .= $object->ref.'<br>'.$object->label;
9963 9963
 		} elseif (in_array($object->element, array('adherent_type'))) {
9964 9964
 			$ret .= $object->label;
9965 9965
 		} elseif ($object->element == 'ecm_directories') {
@@ -10012,9 +10012,9 @@  discard block
 block discarded – undo
10012 10012
 		}
10013 10013
 
10014 10014
 		// Barcode image  @phan-suppress-next-line PhanUndeclaredProperty
10015
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
10016
-		$out = '<!-- url barcode = ' . $url . ' -->';
10017
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
10015
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
10016
+		$out = '<!-- url barcode = '.$url.' -->';
10017
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
10018 10018
 
10019 10019
 		return $out;
10020 10020
 	}
@@ -10041,7 +10041,7 @@  discard block
 block discarded – undo
10041 10041
 		global $conf, $langs;
10042 10042
 
10043 10043
 		$entity = (empty($object->entity) ? $conf->entity : $object->entity);
10044
-		$id = (empty($object->id) ? $object->rowid : $object->id);  // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
10044
+		$id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
10045 10045
 
10046 10046
 		$dir = '';
10047 10047
 		$file = '';
@@ -10054,28 +10054,28 @@  discard block
 block discarded – undo
10054 10054
 			if (!empty($object->logo)) {
10055 10055
 				if (dolIsAllowedForPreview($object->logo)) {
10056 10056
 					if ((string) $imagesize == 'mini') {
10057
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
10057
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
10058 10058
 					} elseif ((string) $imagesize == 'small') {
10059
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
10059
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
10060 10060
 					} else {
10061
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
10061
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
10062 10062
 					}
10063
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
10063
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
10064 10064
 				}
10065 10065
 			}
10066 10066
 			$email = $object->email;
10067 10067
 		} elseif ($modulepart == 'contact') {
10068
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
10068
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
10069 10069
 			if (!empty($object->photo)) {
10070 10070
 				if (dolIsAllowedForPreview($object->photo)) {
10071 10071
 					if ((string) $imagesize == 'mini') {
10072
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10072
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10073 10073
 					} elseif ((string) $imagesize == 'small') {
10074
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10074
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
10075 10075
 					} else {
10076
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
10076
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
10077 10077
 					}
10078
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
10078
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
10079 10079
 				}
10080 10080
 			}
10081 10081
 			$email = $object->email;
@@ -10085,17 +10085,17 @@  discard block
 block discarded – undo
10085 10085
 			if (!empty($object->photo)) {
10086 10086
 				if (dolIsAllowedForPreview($object->photo)) {
10087 10087
 					if ((string) $imagesize == 'mini') {
10088
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10088
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10089 10089
 					} elseif ((string) $imagesize == 'small') {
10090
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10090
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
10091 10091
 					} else {
10092
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
10092
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
10093 10093
 					}
10094
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
10094
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
10095 10095
 				}
10096 10096
 			}
10097 10097
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
10098
-				$altfile = $object->id . ".jpg"; // For backward compatibility
10098
+				$altfile = $object->id.".jpg"; // For backward compatibility
10099 10099
 			}
10100 10100
 			$email = $object->email;
10101 10101
 			$capture = 'user';
@@ -10104,17 +10104,17 @@  discard block
 block discarded – undo
10104 10104
 			if (!empty($object->photo)) {
10105 10105
 				if (dolIsAllowedForPreview($object->photo)) {
10106 10106
 					if ((string) $imagesize == 'mini') {
10107
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
10107
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
10108 10108
 					} elseif ((string) $imagesize == 'small') {
10109
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
10109
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
10110 10110
 					} else {
10111
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
10111
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
10112 10112
 					}
10113
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
10113
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
10114 10114
 				}
10115 10115
 			}
10116 10116
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
10117
-				$altfile = $object->id . ".jpg"; // For backward compatibility
10117
+				$altfile = $object->id.".jpg"; // For backward compatibility
10118 10118
 			}
10119 10119
 			$email = $object->email;
10120 10120
 			$capture = 'user';
@@ -10140,35 +10140,35 @@  discard block
 block discarded – undo
10140 10140
 		$ret = '';
10141 10141
 
10142 10142
 		if ($dir) {
10143
-			if ($file && file_exists($dir . "/" . $file)) {
10143
+			if ($file && file_exists($dir."/".$file)) {
10144 10144
 				if ($addlinktofullsize) {
10145
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10145
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10146 10146
 					if ($urladvanced) {
10147
-						$ret .= '<a href="' . $urladvanced . '">';
10147
+						$ret .= '<a href="'.$urladvanced.'">';
10148 10148
 					} else {
10149
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10149
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10150 10150
 					}
10151 10151
 				}
10152
-				$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 . '">';
10152
+				$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.'">';
10153 10153
 				if ($addlinktofullsize) {
10154 10154
 					$ret .= '</a>';
10155 10155
 				}
10156
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
10156
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
10157 10157
 				if ($addlinktofullsize) {
10158
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10158
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10159 10159
 					if ($urladvanced) {
10160
-						$ret .= '<a href="' . $urladvanced . '">';
10160
+						$ret .= '<a href="'.$urladvanced.'">';
10161 10161
 					} else {
10162
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10162
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10163 10163
 					}
10164 10164
 				}
10165
-				$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 . '">';
10165
+				$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.'">';
10166 10166
 				if ($addlinktofullsize) {
10167 10167
 					$ret .= '</a>';
10168 10168
 				}
10169 10169
 			} else {
10170 10170
 				$nophoto = '/public/theme/common/nophoto.png';
10171
-				$defaultimg = 'identicon';        // For gravatar
10171
+				$defaultimg = 'identicon'; // For gravatar
10172 10172
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
10173 10173
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) {
10174 10174
 						$nophoto = 'company';
@@ -10186,13 +10186,13 @@  discard block
 block discarded – undo
10186 10186
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
10187 10187
 					// see https://gravatar.com/site/implement/images/php/
10188 10188
 					$ret .= '<!-- Put link to gravatar -->';
10189
-					$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
10189
+					$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
10190 10190
 				} else {
10191 10191
 					if ($nophoto == 'company') {
10192
-						$ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
10192
+						$ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
10193 10193
 						//$ret .= '<div class="difforspanimgright"></div>';
10194 10194
 					} else {
10195
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
10195
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
10196 10196
 					}
10197 10197
 				}
10198 10198
 			}
@@ -10203,15 +10203,15 @@  discard block
 block discarded – undo
10203 10203
 				}
10204 10204
 				$ret .= '<table class="nobordernopadding centpercent">';
10205 10205
 				if ($object->photo) {
10206
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
10206
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
10207 10207
 				}
10208 10208
 				$ret .= '<tr><td class="tdoverflow">';
10209 10209
 				$maxfilesizearray = getMaxFileSizeArray();
10210 10210
 				$maxmin = $maxfilesizearray['maxmin'];
10211 10211
 				if ($maxmin > 0) {
10212
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
10212
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
10213 10213
 				}
10214
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
10214
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
10215 10215
 				$ret .= '</td></tr>';
10216 10216
 				$ret .= '</table>';
10217 10217
 			}
@@ -10265,38 +10265,38 @@  discard block
 block discarded – undo
10265 10265
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10266 10266
 			$sql .= ", e.label";
10267 10267
 		}
10268
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10268
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10269 10269
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10270
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10270
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10271 10271
 			if ($force_entity) {
10272
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10272
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10273 10273
 			} else {
10274 10274
 				$sql .= " WHERE ug.entity IS NOT NULL";
10275 10275
 			}
10276 10276
 		} else {
10277
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10277
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10278 10278
 		}
10279 10279
 		if (is_array($exclude) && $excludeGroups) {
10280
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10280
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10281 10281
 		}
10282 10282
 		if (is_array($include) && $includeGroups) {
10283
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10283
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10284 10284
 		}
10285 10285
 		$sql .= " ORDER BY ug.nom ASC";
10286 10286
 
10287
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10287
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10288 10288
 		$resql = $this->db->query($sql);
10289 10289
 		if ($resql) {
10290 10290
 			// Enhance with select2
10291
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10291
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10292 10292
 
10293
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10293
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10294 10294
 
10295 10295
 			$num = $this->db->num_rows($resql);
10296 10296
 			$i = 0;
10297 10297
 			if ($num) {
10298 10298
 				if ($show_empty && !$multiple) {
10299
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10299
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10300 10300
 				}
10301 10301
 
10302 10302
 				while ($i < $num) {
@@ -10309,11 +10309,11 @@  discard block
 block discarded – undo
10309 10309
 					$label = $obj->name;
10310 10310
 					$labelhtml = $obj->name;
10311 10311
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10312
-						$label .= " (" . $obj->label . ")";
10313
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10312
+						$label .= " (".$obj->label.")";
10313
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10314 10314
 					}
10315 10315
 
10316
-					$out .= '<option value="' . $obj->rowid . '"';
10316
+					$out .= '<option value="'.$obj->rowid.'"';
10317 10317
 					if ($disableline) {
10318 10318
 						$out .= ' disabled';
10319 10319
 					}
@@ -10329,9 +10329,9 @@  discard block
 block discarded – undo
10329 10329
 				}
10330 10330
 			} else {
10331 10331
 				if ($show_empty) {
10332
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10332
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10333 10333
 				}
10334
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10334
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10335 10335
 			}
10336 10336
 			$out .= '</select>';
10337 10337
 
@@ -10375,25 +10375,25 @@  discard block
 block discarded – undo
10375 10375
 		$out = '';
10376 10376
 
10377 10377
 		if (!empty($conf->use_javascript_ajax)) {
10378
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10378
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10379 10379
 		}
10380
-		$out .= '<script nonce="' . getNonce() . '">
10380
+		$out .= '<script nonce="'.getNonce().'">
10381 10381
             $(document).ready(function() {
10382
-                $("#' . $cssclass . 's").click(function() {
10382
+                $("#' . $cssclass.'s").click(function() {
10383 10383
                     if($(this).is(\':checked\')){
10384
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10385
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10384
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10385
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10386 10386
                     }
10387 10387
                     else
10388 10388
                     {
10389 10389
                         console.log("We uncheck all");
10390
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10390
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10391 10391
                     }' . "\n";
10392 10392
 		if ($calljsfunction) {
10393
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10393
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10394 10394
 		}
10395 10395
 		$out .= '         });
10396
-        	        $(".' . $cssclass . '").change(function() {
10396
+        	        $(".' . $cssclass.'").change(function() {
10397 10397
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10398 10398
 				});
10399 10399
 		 	});
@@ -10438,67 +10438,67 @@  discard block
 block discarded – undo
10438 10438
 		global $langs, $user;
10439 10439
 
10440 10440
 		$out = '';
10441
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10442
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10441
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10442
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10443 10443
 		if (!empty($excludeid)) {
10444
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10444
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10445 10445
 		}
10446 10446
 		$sql .= " ORDER BY label";
10447 10447
 
10448 10448
 		$resql = $this->db->query($sql);
10449 10449
 		if ($resql) {
10450
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10450
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10451 10451
 			if ($useempty) {
10452 10452
 				$out .= '<option value="0">&nbsp;</option>';
10453 10453
 			}
10454 10454
 
10455 10455
 			while ($obj = $this->db->fetch_object($resql)) {
10456
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10456
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10457 10457
 			}
10458 10458
 			$out .= '</select>';
10459
-			$out .= ajax_combobox('select_' . $htmlname);
10459
+			$out .= ajax_combobox('select_'.$htmlname);
10460 10460
 
10461 10461
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10462
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10462
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10463 10463
 			}
10464 10464
 
10465 10465
 			if (!empty($target)) {
10466
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10466
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10467 10467
 				$resql = $this->db->query($sql);
10468 10468
 				if ($resql) {
10469 10469
 					if ($this->db->num_rows($resql) > 0) {
10470 10470
 						$obj = $this->db->fetch_object($resql);
10471
-						$out .= '<script nonce="' . getNonce() . '">
10471
+						$out .= '<script nonce="'.getNonce().'">
10472 10472
 							$(function() {
10473
-								$("select[name=' . $target . ']").on("change", function() {
10473
+								$("select[name=' . $target.']").on("change", function() {
10474 10474
 									var current_val = $(this).val();
10475
-									if (current_val == ' . $obj->id . ') {';
10475
+									if (current_val == ' . $obj->id.') {';
10476 10476
 						if (!empty($default_selected) || !empty($selected)) {
10477
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10477
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10478 10478
 						}
10479 10479
 
10480 10480
 						$out .= '
10481
-										$("select[name=' . $htmlname . ']").change();
10481
+										$("select[name=' . $htmlname.']").change();
10482 10482
 									}
10483 10483
 								});
10484 10484
 
10485
-								$("select[name=' . $htmlname . ']").change(function() {
10485
+								$("select[name=' . $htmlname.']").change(function() {
10486 10486
 
10487
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10487
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10488 10488
 										// get price of kilometer to fill the unit price
10489 10489
 										$.ajax({
10490 10490
 											method: "POST",
10491 10491
 											dataType: "json",
10492
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10493
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '",
10492
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10493
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'",
10494 10494
 										}).done(function( data, textStatus, jqXHR ) {
10495 10495
 											console.log(data);
10496 10496
 											if (typeof data.up != "undefined") {
10497 10497
 												$("input[name=value_unit]").val(data.up);
10498
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10498
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10499 10499
 											} else {
10500 10500
 												$("input[name=value_unit]").val("");
10501
-												$("select[name=' . $htmlname . ']").attr("title", "");
10501
+												$("select[name=' . $htmlname.']").attr("title", "");
10502 10502
 											}
10503 10503
 										});
10504 10504
 									}
@@ -10528,18 +10528,18 @@  discard block
 block discarded – undo
10528 10528
 		global $conf, $langs;
10529 10529
 
10530 10530
 		$out = '';
10531
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10532
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10531
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10532
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10533 10533
 
10534 10534
 		$resql = $this->db->query($sql);
10535 10535
 		if ($resql) {
10536
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10536
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10537 10537
 			if ($useempty) {
10538 10538
 				$out .= '<option value="0"></option>';
10539 10539
 			}
10540 10540
 
10541 10541
 			while ($obj = $this->db->fetch_object($resql)) {
10542
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10542
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10543 10543
 			}
10544 10544
 			$out .= '</select>';
10545 10545
 		} else {
@@ -10570,12 +10570,12 @@  discard block
 block discarded – undo
10570 10570
 
10571 10571
 		$resql = $this->db->query($sql);
10572 10572
 		if ($resql) {
10573
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10573
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10574 10574
 			if ($useempty) {
10575 10575
 				$out .= '<option value="0"></option>';
10576 10576
 			}
10577 10577
 			if ($allchoice) {
10578
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10578
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10579 10579
 			}
10580 10580
 
10581 10581
 			$field = 'code';
@@ -10585,7 +10585,7 @@  discard block
 block discarded – undo
10585 10585
 
10586 10586
 			while ($obj = $this->db->fetch_object($resql)) {
10587 10587
 				$key = $langs->trans($obj->code);
10588
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10588
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10589 10589
 			}
10590 10590
 			$out .= '</select>';
10591 10591
 
@@ -10619,7 +10619,7 @@  discard block
 block discarded – undo
10619 10619
 	{
10620 10620
 		global $user, $conf, $langs;
10621 10621
 
10622
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10622
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10623 10623
 
10624 10624
 		if (is_null($usertofilter)) {
10625 10625
 			$usertofilter = $user;
@@ -10643,10 +10643,10 @@  discard block
 block discarded – undo
10643 10643
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10644 10644
             p.title, p.fk_soc, p.fk_statut, p.public,";
10645 10645
 		$sql .= ' s.nom as name';
10646
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10647
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10648
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10649
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10646
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10647
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10648
+		$sql .= ' '.$this->db->prefix().'facture as f';
10649
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10650 10650
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10651 10651
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10652 10652
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10657,14 +10657,14 @@  discard block
 block discarded – undo
10657 10657
 		if ($resql) {
10658 10658
 			// Use select2 selector
10659 10659
 			if (!empty($conf->use_javascript_ajax)) {
10660
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10660
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10661 10661
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10662 10662
 				$out .= $comboenhancement;
10663 10663
 				$morecss = 'minwidth200imp maxwidth500';
10664 10664
 			}
10665 10665
 
10666 10666
 			if (empty($option_only)) {
10667
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10667
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10668 10668
 			}
10669 10669
 			if (!empty($show_empty)) {
10670 10670
 				$out .= '<option value="0" class="optiongrey">';
@@ -10694,33 +10694,33 @@  discard block
 block discarded – undo
10694 10694
 						if ($showproject == 'all') {
10695 10695
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10696 10696
 							if ($obj->name) {
10697
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10697
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10698 10698
 							}
10699 10699
 
10700 10700
 							$disabled = 0;
10701 10701
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10702 10702
 								$disabled = 1;
10703
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10703
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10704 10704
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10705 10705
 								if ($discard_closed == 2) {
10706 10706
 									$disabled = 1;
10707 10707
 								}
10708
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10708
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10709 10709
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10710 10710
 								$disabled = 1;
10711
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10711
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10712 10712
 							}
10713 10713
 						}
10714 10714
 
10715 10715
 						if (!empty($selected) && $selected == $obj->rowid) {
10716
-							$out .= '<option value="' . $obj->rowid . '" selected';
10716
+							$out .= '<option value="'.$obj->rowid.'" selected';
10717 10717
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10718
-							$out .= '>' . $labeltoshow . '</option>';
10718
+							$out .= '>'.$labeltoshow.'</option>';
10719 10719
 						} else {
10720 10720
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10721 10721
 								$resultat = '';
10722 10722
 							} else {
10723
-								$resultat = '<option value="' . $obj->rowid . '"';
10723
+								$resultat = '<option value="'.$obj->rowid.'"';
10724 10724
 								if ($disabled) {
10725 10725
 									$resultat .= ' disabled';
10726 10726
 								}
@@ -10772,22 +10772,22 @@  discard block
 block discarded – undo
10772 10772
 
10773 10773
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10774 10774
 		//$sql.= ', el.fk_source';
10775
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10776
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10775
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10776
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10777 10777
 		$sql .= " ORDER BY f.titre ASC";
10778 10778
 
10779 10779
 		$resql = $this->db->query($sql);
10780 10780
 		if ($resql) {
10781 10781
 			// Use select2 selector
10782 10782
 			if (!empty($conf->use_javascript_ajax)) {
10783
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10783
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10784 10784
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10785 10785
 				$out .= $comboenhancement;
10786 10786
 				$morecss = 'minwidth200imp maxwidth500';
10787 10787
 			}
10788 10788
 
10789 10789
 			if (empty($option_only)) {
10790
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10790
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10791 10791
 			}
10792 10792
 			if (!empty($show_empty)) {
10793 10793
 				$out .= '<option value="0" class="optiongrey">';
@@ -10806,19 +10806,19 @@  discard block
 block discarded – undo
10806 10806
 					$disabled = 0;
10807 10807
 					if (!empty($obj->suspended)) {
10808 10808
 						$disabled = 1;
10809
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10809
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10810 10810
 					}
10811 10811
 
10812 10812
 
10813 10813
 					if (!empty($selected) && $selected == $obj->rowid) {
10814
-						$out .= '<option value="' . $obj->rowid . '" selected';
10814
+						$out .= '<option value="'.$obj->rowid.'" selected';
10815 10815
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10816
-						$out .= '>' . $labeltoshow . '</option>';
10816
+						$out .= '>'.$labeltoshow.'</option>';
10817 10817
 					} else {
10818 10818
 						if ($disabled && ($selected != $obj->rowid)) {
10819 10819
 							$resultat = '';
10820 10820
 						} else {
10821
-							$resultat = '<option value="' . $obj->rowid . '"';
10821
+							$resultat = '<option value="'.$obj->rowid.'"';
10822 10822
 							if ($disabled) {
10823 10823
 								$resultat .= ' disabled';
10824 10824
 							}
@@ -10858,14 +10858,14 @@  discard block
 block discarded – undo
10858 10858
 		global $langs;
10859 10859
 
10860 10860
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10861
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10861
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10862 10862
 		}
10863 10863
 
10864 10864
 		$ret = '';
10865 10865
 
10866 10866
 		$ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">';
10867 10867
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10868
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth hideonsmartphone" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10868
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth hideonsmartphone" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10869 10869
 		$ret .= '</a>';
10870 10870
 
10871 10871
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -10909,29 +10909,29 @@  discard block
 block discarded – undo
10909 10909
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
10910 10910
 		}
10911 10911
 		$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%')) -->";
10912
-		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
10912
+		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
10913 10913
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
10914 10914
 
10915 10915
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
10916 10916
 		foreach ($arrayofcriterias as $criteria) {
10917 10917
 			foreach ($criteria as $criteriafamilykey => $criteriafamilyval) {
10918
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10918
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10919 10919
 					continue;
10920 10920
 				}
10921 10921
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
10922 10922
 					continue;
10923 10923
 				}
10924 10924
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
10925
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
10926
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
10927
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
10928
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
10929
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
10930
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
10931
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
10932
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
10925
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
10926
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
10927
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
10928
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
10929
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
10930
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
10931
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
10932
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
10933 10933
 				} else {
10934
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
10934
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
10935 10935
 				}
10936 10936
 			}
10937 10937
 		}
@@ -10939,7 +10939,7 @@  discard block
 block discarded – undo
10939 10939
 		$ret .= '</div>';
10940 10940
 
10941 10941
 		$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";
10942
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10942
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10943 10943
 
10944 10944
 		$ret .= '</div>';
10945 10945
 		$ret .= '</div>';
@@ -11013,7 +11013,7 @@  discard block
 block discarded – undo
11013 11013
 
11014 11014
 		$TModels = array();
11015 11015
 
11016
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
11016
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
11017 11017
 		$formmail = new FormMail($this->db);
11018 11018
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
11019 11019
 
@@ -11026,17 +11026,17 @@  discard block
 block discarded – undo
11026 11026
 			}
11027 11027
 		}
11028 11028
 
11029
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
11029
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
11030 11030
 
11031 11031
 		foreach ($TModels as $id_model => $label_model) {
11032
-			$retstring .= '<option value="' . $id_model . '"';
11033
-			$retstring .= ">" . $label_model . "</option>";
11032
+			$retstring .= '<option value="'.$id_model.'"';
11033
+			$retstring .= ">".$label_model."</option>";
11034 11034
 		}
11035 11035
 
11036 11036
 		$retstring .= "</select>";
11037 11037
 
11038 11038
 		if ($addjscombo) {
11039
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
11039
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
11040 11040
 		}
11041 11041
 
11042 11042
 		return $retstring;
@@ -11087,16 +11087,16 @@  discard block
 block discarded – undo
11087 11087
 
11088 11088
 		foreach ($buttons as $button) {
11089 11089
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
11090
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
11090
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
11091 11091
 		}
11092 11092
 		$retstring .= $withoutdiv ? '' : '</div>';
11093 11093
 
11094 11094
 		if ($dol_openinpopup) {
11095
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n";
11096
-			$retstring .= '<script nonce="' . getNonce() . '">';
11095
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n";
11096
+			$retstring .= '<script nonce="'.getNonce().'">';
11097 11097
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
11098
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\');
11099
-				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\');
11098
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\');
11099
+				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\');
11100 11100
 				 });';
11101 11101
 			$retstring .= '</script>';
11102 11102
 		}
@@ -11125,7 +11125,7 @@  discard block
 block discarded – undo
11125 11125
 		dol_syslog(__METHOD__, LOG_DEBUG);
11126 11126
 
11127 11127
 		$sql = "SELECT rowid, code, label as label";
11128
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
11128
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
11129 11129
 		$sql .= " WHERE active = 1";
11130 11130
 
11131 11131
 		$resql = $this->db->query($sql);
@@ -11136,7 +11136,7 @@  discard block
 block discarded – undo
11136 11136
 				$obj = $this->db->fetch_object($resql);
11137 11137
 
11138 11138
 				// If translation exists, we use it, otherwise we take the default wording
11139
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11139
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11140 11140
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
11141 11141
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
11142 11142
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -11168,18 +11168,18 @@  discard block
 block discarded – undo
11168 11168
 		global $langs, $user;
11169 11169
 
11170 11170
 		$out = '';
11171
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
11171
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
11172 11172
 
11173 11173
 		$this->load_cache_invoice_subtype();
11174 11174
 
11175
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
11175
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
11176 11176
 		if ($addempty) {
11177 11177
 			$out .= '<option value="0">&nbsp;</option>';
11178 11178
 		}
11179 11179
 
11180 11180
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
11181 11181
 			$label = $subtype['label'];
11182
-			$out .= '<option value="' . $subtype['rowid'] . '"';
11182
+			$out .= '<option value="'.$subtype['rowid'].'"';
11183 11183
 			if ($selected == $subtype['rowid']) {
11184 11184
 				$out .= ' selected="selected"';
11185 11185
 			}
Please login to merge, or discard this patch.
htdocs/core/class/extrafields.class.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 					'start' => isset($value['start']) ? $value['start'] : '',
1143 1143
 					'end'   => isset($value['end']) ? $value['end'] : ''
1144 1144
 				);
1145
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1145
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1146 1146
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
1147 1147
 				$out .= '</div><div class="nowrap">';
1148 1148
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
 					'start' => isset($value['start']) ? $value['start'] : '',
1168 1168
 					'end'   => isset($value['end']) ? $value['end'] : ''
1169 1169
 				);
1170
-				$out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">';
1170
+				$out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">';
1171 1171
 				$out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel');
1172 1172
 				$out .= '</div><div class="nowrap">';
1173 1173
 				$out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
 			} else {
1238 1238
 				$out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1);
1239 1239
 			}
1240
-			$out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">';	// A hidden field ending with "_boolean" that is always set to 1.
1240
+			$out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1.
1241 1241
 		} elseif ($type == 'price') {
1242 1242
 			if (!empty($value)) {		// $value in memory is a php numeric, we format it into user number format.
1243 1243
 				$value = price($value);
@@ -1259,7 +1259,7 @@  discard block
 block discarded – undo
1259 1259
 			}
1260 1260
 			$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> ';
1261 1261
 		} elseif ($type == 'select') {
1262
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
1262
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
1263 1263
 			if ($mode) {
1264 1264
 				$options = array();
1265 1265
 				foreach ($param['options'] as $okey => $val) {
@@ -1314,7 +1314,7 @@  discard block
 block discarded – undo
1314 1314
 				$out .= '</select>';
1315 1315
 			}
1316 1316
 		} elseif ($type == 'sellist') {
1317
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
1317
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
1318 1318
 			if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
1319 1319
 				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1320 1320
 				$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
 			}
1478 1478
 			$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, '', 0, '', 0, '100%');
1479 1479
 		} elseif ($type == 'radio') {
1480
-			$out = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
1480
+			$out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
1481 1481
 			foreach ($param['options'] as $keyopt => $val) {
1482 1482
 				$out .= '<input class="flat '.$morecss.'" type="radio" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '');
1483 1483
 				$out .= ' value="'.$keyopt.'"';
@@ -1705,7 +1705,7 @@  discard block
 block discarded – undo
1705 1705
 
1706 1706
 			$tmparray = explode(':', $param_list[0]);
1707 1707
 
1708
-			$element = $extrafieldsobjectkey;		// $extrafieldsobjectkey comes from $object->table_element but we need $object->element
1708
+			$element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element
1709 1709
 			if ($element == 'socpeople') {
1710 1710
 				$element = 'contact';
1711 1711
 			} elseif ($element == 'projet') {
@@ -1713,8 +1713,8 @@  discard block
 block discarded – undo
1713 1713
 			}
1714 1714
 
1715 1715
 			//$objectdesc = $param_list[0];				// Example: 'ObjectName:classPath:1:(status:=:1)'	Replaced by next line: this was propagated also a filter by ajax call that was blocked by some WAF
1716
-			$objectdesc = $tmparray[0];					// Example: 'ObjectName:classPath'					To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found.
1717
-			$objectfield = $element.':options_'.$key;	// Example: 'actioncomm:options_fff'				To be used in priority to know object linked with all its definition (including filters)
1716
+			$objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath'					To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found.
1717
+			$objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff'				To be used in priority to know object linked with all its definition (including filters)
1718 1718
 
1719 1719
 			$out = $form->selectForForms($objectdesc, $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '', $objectfield);
1720 1720
 		} elseif (in_array($type, ['point', 'multipts', 'linestrg', 'polygon'])) {
@@ -1779,7 +1779,7 @@  discard block
 block discarded – undo
1779 1779
 
1780 1780
 		$label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
1781 1781
 		$type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
1782
-		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key];			// Can be '255', '24,8'...
1782
+		$size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'...
1783 1783
 		$default = $this->attributes[$extrafieldsobjectkey]['default'][$key];
1784 1784
 		$computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key];
1785 1785
 		$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
@@ -1801,7 +1801,7 @@  discard block
 block discarded – undo
1801 1801
 		if ($type == 'date') {
1802 1802
 			$showsize = 10;
1803 1803
 			if ($value !== '') {
1804
-				$value = dol_print_date($value, 'day');	// For date without hour, date is always GMT for storage and output
1804
+				$value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output
1805 1805
 			}
1806 1806
 		} elseif ($type == 'datetime') {
1807 1807
 			$showsize = 19;
@@ -1926,9 +1926,9 @@  discard block
 block discarded – undo
1926 1926
 								$translabel = $outputlangs->trans($obj->$field_toshow);
1927 1927
 
1928 1928
 								if ($translabel != $obj->$field_toshow) {
1929
-									$value .= dol_trunc($translabel, 24) . ' ';
1929
+									$value .= dol_trunc($translabel, 24).' ';
1930 1930
 								} else {
1931
-									$value .= $obj->$field_toshow . ' ';
1931
+									$value .= $obj->$field_toshow.' ';
1932 1932
 								}
1933 1933
 							}
1934 1934
 						}
@@ -1949,13 +1949,13 @@  discard block
 block discarded – undo
1949 1949
 					$toprint = array();
1950 1950
 					$obj = $this->db->fetch_object($resql);
1951 1951
 					if ($obj->rowid) {
1952
-						require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1952
+						require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1953 1953
 						$c = new Categorie($this->db);
1954 1954
 						$result = $c->fetch($obj->rowid);
1955 1955
 						if ($result > 0) {
1956 1956
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
1957 1957
 							foreach ($ways as $way) {
1958
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
1958
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>';
1959 1959
 							}
1960 1960
 						}
1961 1961
 					}
@@ -2107,7 +2107,7 @@  discard block
 block discarded – undo
2107 2107
 			} else {
2108 2108
 				$value = '';
2109 2109
 			}
2110
-		} elseif (in_array($type, ['multipts','linestrg', 'polygon'])) {
2110
+		} elseif (in_array($type, ['multipts', 'linestrg', 'polygon'])) {
2111 2111
 			if (!empty($value)) {
2112 2112
 				require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeophp.class.php';
2113 2113
 				$dolgeophp = new DolGeoPHP($this->db);
@@ -2211,12 +2211,12 @@  discard block
 block discarded – undo
2211 2211
 		if ($mode == 'create') {
2212 2212
 			// On create mode, force separator group to not be collapsible
2213 2213
 			$extrafield_collapse_display_value = 1;
2214
-			$expand_display = true;	// We force group to be shown expanded
2214
+			$expand_display = true; // We force group to be shown expanded
2215 2215
 			$disabledcookiewrite = 1; // We keep status of group unchanged into the cookie
2216 2216
 		}
2217 2217
 
2218 2218
 		$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">';
2219
-		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="' . $colspan . '"' : '').'>';
2219
+		$out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>';
2220 2220
 		// Some js code will be injected here to manage the collapsing of extrafields
2221 2221
 		// Output the picto
2222 2222
 		$out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>';
@@ -2298,7 +2298,7 @@  discard block
 block discarded – undo
2298 2298
 					continue;
2299 2299
 				}
2300 2300
 
2301
-				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) {
2301
+				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) {
2302 2302
 					//when unticking boolean field, it's not set in POST
2303 2303
 					continue;
2304 2304
 				}
@@ -2327,7 +2327,7 @@  discard block
 block discarded – undo
2327 2327
 						$onlykey === '@GETPOSTISSET'
2328 2328
 						&& in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst'))
2329 2329
 						&& in_array(abs($enabled), array(2, 5))
2330
-						&& ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided
2330
+						&& !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided
2331 2331
 					)
2332 2332
 				) {
2333 2333
 					continue;
@@ -2464,16 +2464,16 @@  discard block
 block discarded – undo
2464 2464
 				}
2465 2465
 
2466 2466
 				if (in_array($key_type, array('date'))) {
2467
-					$dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start';
2468
-					$dateparamname_end   = $keysuffix . 'options_' . $key . $keyprefix . '_end';
2469
-					if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) {
2467
+					$dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start';
2468
+					$dateparamname_end   = $keysuffix.'options_'.$key.$keyprefix.'_end';
2469
+					if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) {
2470 2470
 						$value_key = array();
2471 2471
 						// values provided as a component year, month, day, etc.
2472
-						if (GETPOST($dateparamname_start . 'year')) {
2473
-							$value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'));
2472
+						if (GETPOST($dateparamname_start.'year')) {
2473
+							$value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'));
2474 2474
 						}
2475
-						if (GETPOST($dateparamname_start . 'year')) {
2476
-							$value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'));
2475
+						if (GETPOST($dateparamname_start.'year')) {
2476
+							$value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'));
2477 2477
 						}
2478 2478
 					} elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) {
2479 2479
 						// Clean parameters
@@ -2482,22 +2482,22 @@  discard block
 block discarded – undo
2482 2482
 						continue; // Value was not provided, we should not set it.
2483 2483
 					}
2484 2484
 				} elseif (in_array($key_type, array('datetime', 'datetimegmt'))) {
2485
-					$dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start';
2486
-					$dateparamname_end   = $keysuffix . 'options_' . $key . $keyprefix . '_end';
2487
-					if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) {
2485
+					$dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start';
2486
+					$dateparamname_end   = $keysuffix.'options_'.$key.$keyprefix.'_end';
2487
+					if (GETPOST($dateparamname_start.'year') && GETPOST($dateparamname_end.'year')) {
2488 2488
 						// values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc.
2489
-						$dateparamname_end_hour = GETPOSTINT($dateparamname_end . 'hour') != '-1' ? GETPOSTINT($dateparamname_end . 'hour') : '23';
2490
-						$dateparamname_end_min = GETPOSTINT($dateparamname_end . 'min') != '-1' ? GETPOSTINT($dateparamname_end . 'min') : '59';
2491
-						$dateparamname_end_sec = GETPOSTINT($dateparamname_end . 'sec') != '-1' ? GETPOSTINT($dateparamname_end . 'sec') : '59';
2489
+						$dateparamname_end_hour = GETPOSTINT($dateparamname_end.'hour') != '-1' ? GETPOSTINT($dateparamname_end.'hour') : '23';
2490
+						$dateparamname_end_min = GETPOSTINT($dateparamname_end.'min') != '-1' ? GETPOSTINT($dateparamname_end.'min') : '59';
2491
+						$dateparamname_end_sec = GETPOSTINT($dateparamname_end.'sec') != '-1' ? GETPOSTINT($dateparamname_end.'sec') : '59';
2492 2492
 						if ($key_type == 'datetimegmt') {
2493 2493
 							$value_key = array(
2494
-								'start' => dol_mktime(GETPOSTINT($dateparamname_start . 'hour'), GETPOSTINT($dateparamname_start . 'min'), GETPOSTINT($dateparamname_start . 'sec'), GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'gmt'),
2495
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'gmt')
2494
+								'start' => dol_mktime(GETPOSTINT($dateparamname_start.'hour'), GETPOSTINT($dateparamname_start.'min'), GETPOSTINT($dateparamname_start.'sec'), GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'gmt'),
2495
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'gmt')
2496 2496
 							);
2497 2497
 						} else {
2498 2498
 							$value_key = array(
2499
-								'start' => dol_mktime(GETPOSTINT($dateparamname_start . 'hour'), GETPOSTINT($dateparamname_start . 'min'), GETPOSTINT($dateparamname_start . 'sec'), GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'tzuserrel'),
2500
-								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'tzuserrel')
2499
+								'start' => dol_mktime(GETPOSTINT($dateparamname_start.'hour'), GETPOSTINT($dateparamname_start.'min'), GETPOSTINT($dateparamname_start.'sec'), GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'tzuserrel'),
2500
+								'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'tzuserrel')
2501 2501
 							);
2502 2502
 						}
2503 2503
 					} elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) {
Please login to merge, or discard this patch.
dev/tools/phan/config_extended.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -64,29 +64,29 @@
 block discarded – undo
64 64
 		// Dolibarr uses a lot of internal deprecated stuff, not reporting
65 65
 		'PhanDeprecatedProperty',
66 66
 
67
-		'PhanCompatibleNegativeStringOffset',	// return false positive
68
-		'PhanPluginConstantVariableBool',		// a lot of false positive, in most cases, we want to keep the code as it is
67
+		'PhanCompatibleNegativeStringOffset', // return false positive
68
+		'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
69 69
 
70
-		'PhanPluginWhitespaceTab',		// Dolibarr used tabs
71
-		'PhanPluginCanUsePHP71Void',	// Dolibarr is maintaining 7.0 compatibility
72
-		'PhanPluginShortArray',			// Dolibarr uses array()
73
-		'PhanPluginShortArrayList',		// Dolibarr uses array()
70
+		'PhanPluginWhitespaceTab', // Dolibarr used tabs
71
+		'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
72
+		'PhanPluginShortArray', // Dolibarr uses array()
73
+		'PhanPluginShortArrayList', // Dolibarr uses array()
74 74
 		// Fixers From PHPDocToRealTypesPlugin:
75
-		'PhanPluginCanUseParamType',			// Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
76
-		'PhanPluginCanUseReturnType',			// Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
77
-		'PhanPluginCanUseNullableParamType',	// Fixer - Report/Add nullable parameter types in the function definition
78
-		'PhanPluginCanUseNullableReturnType',	// Fixer - Report/Add nullable return types in the function definition
75
+		'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
76
+		'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
77
+		'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
78
+		'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition
79 79
 
80
-		'PhanPluginNonBoolBranch',			// Not essential - 31240+ occurrences
81
-		'PhanPluginNumericalComparison',	// Not essential - 19870+ occurrences
82
-		'PhanTypeMismatchArgument',			// Not essential - 12300+ occurrences
83
-		'PhanPluginNonBoolInLogicalArith',	// Not essential - 11040+ occurrences
84
-		'PhanPluginConstantVariableScalar',	// Not essential - 5180+ occurrences
80
+		'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
81
+		'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
82
+		'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences
83
+		'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
84
+		'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
85 85
 		'PhanPluginDuplicateAdjacentStatement',
86
-		'PhanPluginDuplicateConditionalTernaryDuplication',		// 2750+ occurrences
87
-		'PhanPluginDuplicateConditionalNullCoalescing',	// Not essential - 990+ occurrences
88
-		'PhanPluginRedundantAssignmentInGlobalScope',	// Not essential, a lot of false warning
89
-		'PhanPluginDuplicateCatchStatementBody',  // Requires PHP7.1 - 50+ occurrences
86
+		'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences
87
+		'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences
88
+		'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning
89
+		'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences
90 90
 ];
91 91
 
92 92
 return $config;
Please login to merge, or discard this patch.
dev/tools/phan/config.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
 	'bom' => 'Bom',
84 84
 	'bookcal' => 'BookCal',
85 85
 	'bookmark' => 'Bookmark',
86
-	'cashdesk' => null,  // TODO: fill in proper class
86
+	'cashdesk' => null, // TODO: fill in proper class
87 87
 	'category' => 'Categorie',
88 88
 	'clicktodial' => 'ClickToDial',
89 89
 	'collab' => 'Collab',
90 90
 	'comptabilite' => 'Comptabilite',
91
-	'contact' => null,  // TODO: fill in proper class
91
+	'contact' => null, // TODO: fill in proper class
92 92
 	'contract' => 'Contrat',
93 93
 	'cron' => 'Cron',
94 94
 	'datapolicy' => 'DataPolicy',
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	'don' => 'Don',
101 101
 	'dynamicprices' => 'DynamicPrices',
102 102
 	'ecm' => 'ECM',
103
-	'ecotax' => null,  // TODO: External module ?
103
+	'ecotax' => null, // TODO: External module ?
104 104
 	'emailcollector' => 'EmailCollector',
105 105
 	'eventorganization' => 'EventOrganization',
106 106
 	'expensereport' => 'ExpenseReport',
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	'fournisseur' => 'Fournisseur',
112 112
 	'ftp' => 'FTP',
113 113
 	'geoipmaxmind' => 'GeoIPMaxmind',
114
-	'google' => null,  // External ?
114
+	'google' => null, // External ?
115 115
 	'gravatar' => 'Gravatar',
116 116
 	'holiday' => 'Holiday',
117 117
 	'hrm' => 'HRM',
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	'ldap' => 'Ldap',
126 126
 	'loan' => 'Loan',
127 127
 	'mailing' => 'Mailing',
128
-	'mailman' => null,  // Same module as mailmanspip -> MailmanSpip ??
128
+	'mailman' => null, // Same module as mailmanspip -> MailmanSpip ??
129 129
 	'mailmanspip' => 'MailmanSpip',
130 130
 	'margin' => 'Margin',
131 131
 	'member' => 'Adherent',
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	'notification' => 'Notification',
139 139
 	'numberwords' => null, // Not provided by default, no module tests
140 140
 	'oauth' => 'Oauth',
141
-	'openstreetmap' => null,  // External module?
141
+	'openstreetmap' => null, // External module?
142 142
 	'opensurvey' => 'OpenSurvey',
143 143
 	'order' => 'Commande',
144 144
 	'partnership' => 'Partnership',
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
 	'stock' => 'Stock',
166 166
 	'stocktransfer' => 'StockTransfer',
167 167
 	'stripe' => 'Stripe',
168
-	'supplier_invoice' => null,  // Special case, uses invoice
169
-	'supplier_order' => null,  // Special case, uses invoice
168
+	'supplier_invoice' => null, // Special case, uses invoice
169
+	'supplier_order' => null, // Special case, uses invoice
170 170
 	'supplier_proposal' => 'SupplierProposal',
171 171
 	'syslog' => 'Syslog',
172 172
 	'takepos' => 'TakePos',
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	//	'processes' => 6,
229 229
 	'backward_compatibility_checks' => false,
230 230
 	'simplify_ast' => true,
231
-	'analyzed_file_extensions' => ['php','inc'],
231
+	'analyzed_file_extensions' => ['php', 'inc'],
232 232
 	'globals_type_map' => [
233 233
 		'action' => 'string',
234 234
 		'actioncode' => 'string',
@@ -273,12 +273,12 @@  discard block
 block discarded – undo
273 273
 		'menumanager' => '\MenuManager',
274 274
 		'mysoc' => '\Societe',
275 275
 		'nblines' => '\int',
276
-		'obj' => '\CommonObject',     // Deprecated
276
+		'obj' => '\CommonObject', // Deprecated
277 277
 		'object_rights' => 'int|stdClass',
278 278
 		'objectoffield' => '\CommonObject',
279 279
 		'senderissupplier' => 'int<0,2>',
280 280
 		'user' => '\User',
281
-		'website' => 'string',  // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334  // Disable because Phan infers Website type
281
+		'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334  // Disable because Phan infers Website type
282 282
 		'websitepage' => '\WebSitePage',
283 283
 		'websitepagefile' => 'string',
284 284
 		// 'object' => '\CommonObject',  // Deprecated, not enabled because conflicts with $object assignments
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 	// your application should be included in this list.
303 303
 	'directory_list' => [
304 304
 		'htdocs',
305
-		PHAN_DIR . '/stubs/',
305
+		PHAN_DIR.'/stubs/',
306 306
 	],
307 307
 
308 308
 	// A directory list that defines files that will be excluded
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 		'htdocs/includes/',
321 321
 		'htdocs/install/doctemplates/websites/',
322 322
 		'htdocs/core/class/lessc.class.php', // External library
323
-		PHAN_DIR . '/stubs/',
323
+		PHAN_DIR.'/stubs/',
324 324
 	],
325 325
 	//'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
326 326
 	'exclude_file_regex' => '@^('  // @phpstan-ignore-line
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 		.'|htdocs/includes/stripe/.*'  // @phpstan-ignore-line
336 336
 		.'|htdocs/conf/conf.php'  // @phpstan-ignore-line
337 337
 		// .'|htdocs/[^h].*/.*'  // For testing @phpstan-ignore-line
338
-		.')@',  // @phpstan-ignore-line
338
+		.')@', // @phpstan-ignore-line
339 339
 
340 340
 	// A list of plugin files to execute.
341 341
 	// Plugins which are bundled with Phan can be added here by providing their name
@@ -351,14 +351,14 @@  discard block
 block discarded – undo
351 351
 		'/^isModEnabled$/' => [0, $moduleNameRegex, 'UnknownModuleName'],
352 352
 		// Note: trick to have different key for same regex:
353 353
 		'/^isModEnable[d]$/' => [0, $deprecatedModuleNameRegex, "DeprecatedModuleName"],
354
-		'/^sanitizeVal$/' => [1, $sanitizeRegex,"UnknownSanitizeType"],
355
-		'/^checkVal$/' => [1, $sanitizeRegex,"UnknownCheckValSanitizeType"],
356
-		'/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex,"UnknownExtrafieldTypeBack"],
357
-		'/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}',"InvalidDolNowArgument"],  // '', 0, 1 match bool and int values
358
-		'/^dol_mktime$/' => [6, '{^(?:|0|1|auto|gmt|tz(?:server|ref|user(?:rel)?|,[+a-zA-Z-/]+))$}',"InvalidDolMktimeArgument"],  // '', 0, 1 match bool and int values
359
-		'/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}',"InvalidDolMktimeArgument"],
360
-		'/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidGetPostFloatRounding"],
361
-		'/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidPrice2NumRounding"],
354
+		'/^sanitizeVal$/' => [1, $sanitizeRegex, "UnknownSanitizeType"],
355
+		'/^checkVal$/' => [1, $sanitizeRegex, "UnknownCheckValSanitizeType"],
356
+		'/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex, "UnknownExtrafieldTypeBack"],
357
+		'/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}', "InvalidDolNowArgument"], // '', 0, 1 match bool and int values
358
+		'/^dol_mktime$/' => [6, '{^(?:|0|1|auto|gmt|tz(?:server|ref|user(?:rel)?|,[+a-zA-Z-/]+))$}', "InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values
359
+		'/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}', "InvalidDolMktimeArgument"],
360
+		'/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}', "InvalidGetPostFloatRounding"],
361
+		'/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}', "InvalidPrice2NumRounding"],
362 362
 	],
363 363
 	'plugins' => [
364 364
 		__DIR__.'/plugins/NoVarDumpPlugin.php',
@@ -419,34 +419,34 @@  discard block
 block discarded – undo
419 419
 		// Dolibarr uses a lot of internal deprecated stuff, not reporting
420 420
 		'PhanDeprecatedProperty',
421 421
 
422
-		'PhanCompatibleNegativeStringOffset',	// return false positive
423
-		'PhanPluginConstantVariableBool',		// a lot of false positive, in most cases, we want to keep the code as it is
422
+		'PhanCompatibleNegativeStringOffset', // return false positive
423
+		'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
424 424
 
425
-		'PhanPluginWhitespaceTab',		// Dolibarr used tabs
426
-		'PhanPluginCanUsePHP71Void',	// Dolibarr is maintaining 7.0 compatibility
427
-		'PhanPluginShortArray',			// Dolibarr uses array()
428
-		'PhanPluginShortArrayList',		// Dolibarr uses array()
425
+		'PhanPluginWhitespaceTab', // Dolibarr used tabs
426
+		'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
427
+		'PhanPluginShortArray', // Dolibarr uses array()
428
+		'PhanPluginShortArrayList', // Dolibarr uses array()
429 429
 		// Fixers From PHPDocToRealTypesPlugin:
430
-		'PhanPluginCanUseParamType',			// Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
431
-		'PhanPluginCanUseReturnType',			// Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
432
-		'PhanPluginCanUseNullableParamType',	// Fixer - Report/Add nullable parameter types in the function definition
433
-		'PhanPluginCanUseNullableReturnType',	// Fixer - Report/Add nullable return types in the function definition
430
+		'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
431
+		'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
432
+		'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
433
+		'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition
434 434
 
435
-		'PhanPluginNonBoolBranch',			// Not essential - 31240+ occurrences
436
-		'PhanPluginNumericalComparison',	// Not essential - 19870+ occurrences
437
-		'PhanTypeMismatchArgument',			// Not essential - 12300+ occurrences
438
-		'PhanPluginNonBoolInLogicalArith',	// Not essential - 11040+ occurrences
439
-		'PhanPluginConstantVariableScalar',	// Not essential - 5180+ occurrences
435
+		'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
436
+		'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
437
+		'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences
438
+		'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
439
+		'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
440 440
 		'PhanPluginDuplicateAdjacentStatement',
441
-		'PhanPluginDuplicateConditionalTernaryDuplication',		// 2750+ occurrences
442
-		'PhanPluginDuplicateConditionalNullCoalescing',	// Not essential - 990+ occurrences
443
-		'PhanPluginRedundantAssignmentInGlobalScope',	// Not essential, a lot of false warning
444
-		'PhanPluginDuplicateCatchStatementBody',  // Requires PHP7.1 - 50+ occurrences
441
+		'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences
442
+		'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences
443
+		'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning
444
+		'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences
445 445
 
446
-		'PhanPluginUnknownArrayMethodParamType',	// Too many troubles to manage. Is enabled into config_extended only.
447
-		'PhanPluginUnknownArrayMethodReturnType',	// Too many troubles to manage. Is enabled into config_extended only.
448
-		'PhanUndeclaredGlobalVariable',			// Too many false positives on .tpl.php files. Is enabled into config_extended only.
449
-		'PhanPluginUnknownObjectMethodCall',	// False positive for some class. Is enabled into config_extended only.
446
+		'PhanPluginUnknownArrayMethodParamType', // Too many troubles to manage. Is enabled into config_extended only.
447
+		'PhanPluginUnknownArrayMethodReturnType', // Too many troubles to manage. Is enabled into config_extended only.
448
+		'PhanUndeclaredGlobalVariable', // Too many false positives on .tpl.php files. Is enabled into config_extended only.
449
+		'PhanPluginUnknownObjectMethodCall', // False positive for some class. Is enabled into config_extended only.
450 450
 	],
451 451
 	// You can put relative paths to internal stubs in this config option.
452 452
 	// Phan will continue using its detailed type annotations,
@@ -465,31 +465,31 @@  discard block
 block discarded – undo
465 465
 		//'xdebug'	=> 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php',
466 466
 		//'memcached'  => PHAN_DIR . '/your_internal_stubs_folder_name/memcached.phan_php',
467 467
 		//'PDO'  => PHAN_DIR . '/stubs/PDO.phan_php',
468
-		'brotli'  => PHAN_DIR . '/stubs/brotli.phan_php',
469
-		'curl'  => PHAN_DIR . '/stubs/curl.phan_php',
470
-		'calendar'  => PHAN_DIR . '/stubs/calendar.phan_php',
471
-		'fileinfo'  => PHAN_DIR . '/stubs/fileinfo.phan_php',
472
-		'ftp'  => PHAN_DIR . '/stubs/ftp.phan_php',
473
-		'gd'  => PHAN_DIR . '/stubs/gd.phan_php',
474
-		'geoip'  => PHAN_DIR . '/stubs/geoip.phan_php',
475
-		'imagick'  => PHAN_DIR . '/stubs/imagick.phan_php',
476
-		'imap'  => PHAN_DIR . '/stubs/imap.phan_php',
477
-		'intl'  => PHAN_DIR . '/stubs/intl.phan_php',
478
-		'ldap'  => PHAN_DIR . '/stubs/ldap.phan_php',
479
-		'mcrypt'  => PHAN_DIR . '/stubs/mcrypt.phan_php',
480
-		'memcache'  => PHAN_DIR . '/stubs/memcache.phan_php',
481
-		'memcached' => PHAN_DIR . '/stubs/memcached.phan_php',
482
-		'mysqli'  => PHAN_DIR . '/stubs/mysqli.phan_php',
483
-		'pdo_cubrid'  => PHAN_DIR . '/stubs/pdo_cubrid.phan_php',
484
-		'pdo_mysql'  => PHAN_DIR . '/stubs/pdo_mysql.phan_php',
485
-		'pdo_pgsql'  => PHAN_DIR . '/stubs/pdo_pgsql.phan_php',
486
-		'pdo_sqlite'  => PHAN_DIR . '/stubs/pdo_sqlite.phan_php',
487
-		'pgsql'  => PHAN_DIR . '/stubs/pgsql.phan_php',
488
-		'session'  => PHAN_DIR . '/stubs/session.phan_php',
489
-		'simplexml'  => PHAN_DIR . '/stubs/SimpleXML.phan_php',
490
-		'soap'  => PHAN_DIR . '/stubs/soap.phan_php',
491
-		'sockets'  => PHAN_DIR . '/stubs/sockets.phan_php',
492
-		'tidy'  => PHAN_DIR . '/stubs/tidy.phan_php',
493
-		'zip'  => PHAN_DIR . '/stubs/zip.phan_php',
468
+		'brotli'  => PHAN_DIR.'/stubs/brotli.phan_php',
469
+		'curl'  => PHAN_DIR.'/stubs/curl.phan_php',
470
+		'calendar'  => PHAN_DIR.'/stubs/calendar.phan_php',
471
+		'fileinfo'  => PHAN_DIR.'/stubs/fileinfo.phan_php',
472
+		'ftp'  => PHAN_DIR.'/stubs/ftp.phan_php',
473
+		'gd'  => PHAN_DIR.'/stubs/gd.phan_php',
474
+		'geoip'  => PHAN_DIR.'/stubs/geoip.phan_php',
475
+		'imagick'  => PHAN_DIR.'/stubs/imagick.phan_php',
476
+		'imap'  => PHAN_DIR.'/stubs/imap.phan_php',
477
+		'intl'  => PHAN_DIR.'/stubs/intl.phan_php',
478
+		'ldap'  => PHAN_DIR.'/stubs/ldap.phan_php',
479
+		'mcrypt'  => PHAN_DIR.'/stubs/mcrypt.phan_php',
480
+		'memcache'  => PHAN_DIR.'/stubs/memcache.phan_php',
481
+		'memcached' => PHAN_DIR.'/stubs/memcached.phan_php',
482
+		'mysqli'  => PHAN_DIR.'/stubs/mysqli.phan_php',
483
+		'pdo_cubrid'  => PHAN_DIR.'/stubs/pdo_cubrid.phan_php',
484
+		'pdo_mysql'  => PHAN_DIR.'/stubs/pdo_mysql.phan_php',
485
+		'pdo_pgsql'  => PHAN_DIR.'/stubs/pdo_pgsql.phan_php',
486
+		'pdo_sqlite'  => PHAN_DIR.'/stubs/pdo_sqlite.phan_php',
487
+		'pgsql'  => PHAN_DIR.'/stubs/pgsql.phan_php',
488
+		'session'  => PHAN_DIR.'/stubs/session.phan_php',
489
+		'simplexml'  => PHAN_DIR.'/stubs/SimpleXML.phan_php',
490
+		'soap'  => PHAN_DIR.'/stubs/soap.phan_php',
491
+		'sockets'  => PHAN_DIR.'/stubs/sockets.phan_php',
492
+		'tidy'  => PHAN_DIR.'/stubs/tidy.phan_php',
493
+		'zip'  => PHAN_DIR.'/stubs/zip.phan_php',
494 494
 	],
495 495
 ];
Please login to merge, or discard this patch.