Completed
Branch develop (16edaf)
by
unknown
16:33
created
htdocs/core/tpl/login.tpl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 	?>
400 400
 	<div class="center login_main_message">
401 401
 	<?php
402
-	$message = $_SESSION['dol_loginmesg'];	// By default this is an error message
402
+	$message = $_SESSION['dol_loginmesg']; // By default this is an error message
403 403
 	if (preg_match('/<!-- warning -->/', $message)) {	// if it contains this comment, this is a warning message
404 404
 		$message = str_replace('<!-- warning -->', '', $message);
405 405
 		print '<div class="warning" role="alert">';
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 			libxml_disable_entity_loader(true);
429 429
 		}
430 430
 
431
-		$xml = simplexml_load_string($resgetcommitstrip['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
431
+		$xml = simplexml_load_string($resgetcommitstrip['content'], 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
432 432
 		$little = $xml->channel->item[0]->children('content', true);
433 433
 		print preg_replace('/width="650" height="658"/', '', $little->encoded);
434 434
 	}
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1218 added lines, -1218 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
121 121
 			if (!empty($perm)) {
122 122
 				$tmp = explode(':', $typeofdata);
123
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
123
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
124 124
 				if ($fieldrequired) {
125 125
 					$ret .= '<span class="fieldrequired">';
126 126
 				}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 				if ($fieldrequired) {
133 133
 					$ret .= '</span>';
134 134
 				}
135
-				$ret .= '</div>' . "\n";
135
+				$ret .= '</div>'."\n";
136 136
 			} else {
137 137
 				if ($fieldrequired) {
138 138
 					$ret .= '<span class="fieldrequired">';
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 			if (empty($notabletag) && $perm) {
171 171
 				$ret .= '<td class="right">';
172 172
 			}
173
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
174
-				$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>';
173
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
174
+				$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 175
 			}
176 176
 			if (!empty($notabletag) && $notabletag == 1) {
177 177
 				if ($text) {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 			} elseif ($reg[1] == 'int') {
239 239
 				$typeofdata = 'numeric';
240 240
 			} else {
241
-				return 'ErrorBadParameter ' . $typeofdata;
241
+				return 'ErrorBadParameter '.$typeofdata;
242 242
 			}
243 243
 		}
244 244
 
@@ -249,13 +249,13 @@  discard block
 block discarded – undo
249 249
 			if ($editaction == '') {
250 250
 				$editaction = GETPOST('action', 'aZ09');
251 251
 			}
252
-			$editmode = ($editaction == 'edit' . $htmlname);
252
+			$editmode = ($editaction == 'edit'.$htmlname);
253 253
 			if ($editmode) {	// edit mode
254 254
 				$ret .= "\n";
255
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
256
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
257
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
258
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
255
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
256
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
257
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
258
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
259 259
 				if (empty($notabletag)) {
260 260
 					$ret .= '<table class="nobordernopadding centpercent">';
261 261
 				}
@@ -264,28 +264,28 @@  discard block
 block discarded – undo
264 264
 				}
265 265
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
266 266
 					$tmp = explode(':', $typeofdata);
267
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
267
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
268 268
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
269 269
 					$tmp = explode(':', $typeofdata);
270 270
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
271
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
271
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
272 272
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
273 273
 					$tmp = explode(':', $typeofdata);
274 274
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
275
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
275
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
276 276
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
277 277
 					$tmp = explode(':', $typeofdata);
278
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
278
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
279 279
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
280 280
 					$tmp = explode(':', $typeofdata);
281 281
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
282 282
 					$morealt = '';
283 283
 					if (preg_match('/%/', $cols)) {
284
-						$morealt = ' style="width: ' . $cols . '"';
284
+						$morealt = ' style="width: '.$cols.'"';
285 285
 						$cols = '';
286 286
 					}
287 287
 					$valuetoshow = ($editvalue ? $editvalue : $value);
288
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
288
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
289 289
 					// textarea convert automatically entities chars into simple chars.
290 290
 					// So we convert & into &amp; so a string like 'a &lt; <b>b</b><br>é<br>&lt;script&gt;alert('X');&lt;script&gt;' stay a correct html and is not converted by textarea component when wysiwig is off.
291 291
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -295,12 +295,12 @@  discard block
 block discarded – undo
295 295
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
296 296
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
297 297
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
298
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
298
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
299 299
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
300 300
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
301 301
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
302 302
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
303
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
303
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
304 304
 				} elseif (preg_match('/^select;/', $typeofdata)) {
305 305
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
306 306
 					$arraylist = array();
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 					// TODO Not yet implemented. See code for extrafields
315 315
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
316 316
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
317
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
317
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
318 318
 					$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]));
319 319
 					$ret .= $doleditor->Create(1);
320 320
 				} elseif ($typeofdata == 'asis') {
@@ -329,19 +329,19 @@  discard block
 block discarded – undo
329 329
 					$ret .= '<td>';
330 330
 				}
331 331
 				//else $ret.='<div class="clearboth"></div>';
332
-				$ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
332
+				$ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
333 333
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
334
-					$ret .= '<br>' . "\n";
334
+					$ret .= '<br>'."\n";
335 335
 				}
336
-				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
336
+				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
337 337
 				if (empty($notabletag)) {
338 338
 					$ret .= '</td>';
339 339
 				}
340 340
 
341 341
 				if (empty($notabletag)) {
342
-					$ret .= '</tr></table>' . "\n";
342
+					$ret .= '</tr></table>'."\n";
343 343
 				}
344
-				$ret .= '</form>' . "\n";
344
+				$ret .= '</form>'."\n";
345 345
 			} else {		// view mode
346 346
 				if (preg_match('/^email/', $typeofdata)) {
347 347
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -353,15 +353,15 @@  discard block
 block discarded – undo
353 353
 					$ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : '');
354 354
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
355 355
 					$tmp = explode(':', $typeofdata);
356
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
356
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
357 357
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
358 358
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
359 359
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
360 360
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
361 361
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
362
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
362
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
363 363
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
364
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
364
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
365 365
 				} elseif (preg_match('/^select;/', $typeofdata)) {
366 366
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
367 367
 					$arraylist = array();
@@ -372,9 +372,9 @@  discard block
 block discarded – undo
372 372
 					$ret .= $arraylist[$value];
373 373
 					if ($htmlname == 'fk_product_type') {
374 374
 						if ($value == 0) {
375
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
375
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
376 376
 						} else {
377
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
377
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
378 378
 						}
379 379
 					}
380 380
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
383 383
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
384 384
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
385
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
385
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
386 386
 					}
387 387
 					// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also
388 388
 					// clean data from some dangerous html
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
392 392
 						$ret .= dol_escape_htmltag($value);
393 393
 					} else {
394
-						$ret .= $value;        // $value must be already html escaped.
394
+						$ret .= $value; // $value must be already html escaped.
395 395
 					}
396 396
 				}
397 397
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 
430 430
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
431 431
 			if (!is_object($extralanguages)) {
432
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
432
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
433 433
 				$extralanguages = new ExtraLanguages($this->db);
434 434
 			}
435 435
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -438,17 +438,17 @@  discard block
 block discarded – undo
438 438
 				return ''; // No extralang field to show
439 439
 			}
440 440
 
441
-			$result .= '<!-- Widget for translation -->' . "\n";
442
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
441
+			$result .= '<!-- Widget for translation -->'."\n";
442
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
443 443
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
444 444
 			$result .= $s;
445 445
 			$result .= '</div>';
446 446
 
447
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
447
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
448 448
 
449 449
 			$resultforextrlang = '';
450 450
 			foreach ($arrayoflangcode as $langcode) {
451
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
451
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
452 452
 				if (empty($valuetoshow)) {
453 453
 					$object->fetchValuesForExtraLanguages();
454 454
 					//var_dump($object->array_languages);
@@ -460,17 +460,17 @@  discard block
 block discarded – undo
460 460
 
461 461
 				// TODO Use the showInputField() method of ExtraLanguages object
462 462
 				if ($typeofdata == 'textarea') {
463
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
463
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
464 464
 					$resultforextrlang .= $valuetoshow;
465 465
 					$resultforextrlang .= '</textarea>';
466 466
 				} else {
467
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
467
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
468 468
 				}
469 469
 			}
470 470
 			$result .= $resultforextrlang;
471 471
 
472 472
 			$result .= '</div>';
473
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
473
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
474 474
 		}
475 475
 
476 476
 		return $result;
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 				if (!empty($tmp[2])) {
534 534
 					$savemethod = $tmp[2];
535 535
 				}
536
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
536
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
537 537
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
538 538
 				$tmp = explode(':', $inputType);
539 539
 				$inputType = $tmp[0];
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 					$savemethod = $tmp[2];
545 545
 				}
546 546
 
547
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
547
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
548 548
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
549 549
 				$tmp = explode(':', $inputType);
550 550
 				$inputType = $tmp[0];
@@ -575,40 +575,40 @@  discard block
 block discarded – undo
575 575
 				}
576 576
 
577 577
 				if (isModEnabled('fckeditor')) {
578
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
578
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
579 579
 				} else {
580 580
 					$inputType = 'textarea';
581 581
 				}
582 582
 			}
583 583
 
584
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
585
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
586
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
587
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
584
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
585
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
586
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
587
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
588 588
 			if (!empty($savemethod)) {
589
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
589
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
590 590
 			}
591 591
 			if (!empty($ext_element)) {
592
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
592
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
593 593
 			}
594 594
 			if (!empty($custommsg)) {
595 595
 				if (is_array($custommsg)) {
596 596
 					if (!empty($custommsg['success'])) {
597
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
597
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
598 598
 					}
599 599
 					if (!empty($custommsg['error'])) {
600
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
600
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
601 601
 					}
602 602
 				} else {
603
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
603
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
604 604
 				}
605 605
 			}
606 606
 			if ($inputType == 'textarea') {
607
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
608
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
607
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
608
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
609 609
 			}
610
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
611
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
610
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
611
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
612 612
 		} else {
613 613
 			$out = $value;
614 614
 		}
@@ -637,12 +637,12 @@  discard block
 block discarded – undo
637 637
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
638 638
 	{
639 639
 		if ($incbefore) {
640
-			$text = $incbefore . $text;
640
+			$text = $incbefore.$text;
641 641
 		}
642 642
 		if (!$htmltext) {
643 643
 			return $text;
644 644
 		}
645
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
645
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
646 646
 
647 647
 		$tag = 'td';
648 648
 		if ($notabs == 2) {
@@ -656,11 +656,11 @@  discard block
 block discarded – undo
656 656
 
657 657
 		$extrastyle = '';
658 658
 		if ($direction < 0) {
659
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
659
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
660 660
 			$extrastyle = 'padding: 0px; padding-left: 3px;';
661 661
 		}
662 662
 		if ($direction > 0) {
663
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
663
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
664 664
 			$extrastyle = 'padding: 0px; padding-right: 3px;';
665 665
 		}
666 666
 
@@ -673,53 +673,53 @@  discard block
 block discarded – undo
673 673
 			$htmltext = str_replace('"', '&quot;', $htmltext);
674 674
 		} else {
675 675
 			$classfortooltip = 'classfortooltiponclick';
676
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
676
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
677 677
 		}
678 678
 		if ($tooltipon == 2 || $tooltipon == 3) {
679
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
679
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
680 680
 			if ($tooltiptrigger == '') {
681
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip
681
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip
682 682
 			} else {
683
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
683
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
684 684
 			}
685 685
 		} else {
686
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
686
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
687 687
 		}
688 688
 		if ($tooltipon == 1 || $tooltipon == 3) {
689
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
689
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
690 690
 			if ($tooltiptrigger == '') {
691
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip
691
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip
692 692
 			} else {
693
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
693
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
694 694
 			}
695 695
 		} else {
696
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
696
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
697 697
 		}
698 698
 		if (empty($notabs)) {
699 699
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
700 700
 		} elseif ($notabs == 2) {
701
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
701
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
702 702
 		}
703 703
 		// Define value if value is before
704 704
 		if ($direction < 0) {
705
-			$s .= '<' . $tag . $paramfortooltipimg;
705
+			$s .= '<'.$tag.$paramfortooltipimg;
706 706
 			if ($tag == 'td') {
707 707
 				$s .= ' class="valigntop" width="14"';
708 708
 			}
709
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
709
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
710 710
 		}
711 711
 		// Use another method to help avoid having a space in value in order to use this value with jquery
712 712
 		// Define label
713 713
 		if ((string) $text != '') {
714
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
714
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
715 715
 		}
716 716
 		// Define value if value is after
717 717
 		if ($direction > 0) {
718
-			$s .= '<' . $tag . $paramfortooltipimg;
718
+			$s .= '<'.$tag.$paramfortooltipimg;
719 719
 			if ($tag == 'td') {
720 720
 				$s .= ' class="valignmiddle" width="14"';
721 721
 			}
722
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
722
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
723 723
 		}
724 724
 		if (empty($notabs)) {
725 725
 			$s .= '</tr></table>';
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 
827 827
 		$disabled = 0;
828 828
 		$ret = '<div class="centpercent center">';
829
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
829
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
830 830
 
831 831
 		// 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.
832 832
 		$parameters = array();
@@ -836,9 +836,9 @@  discard block
 block discarded – undo
836 836
 			return;
837 837
 		}
838 838
 		if (empty($reshook)) {
839
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
839
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
840 840
 			foreach ($arrayofaction as $code => $label) {
841
-				$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
841
+				$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
842 842
 			}
843 843
 		}
844 844
 		$ret .= $hookmanager->resPrint;
@@ -846,17 +846,17 @@  discard block
 block discarded – undo
846 846
 		$ret .= '</select>';
847 847
 
848 848
 		if (empty($conf->dol_optimize_smallscreen)) {
849
-			$ret .= ajax_combobox('.' . $name . 'select');
849
+			$ret .= ajax_combobox('.'.$name.'select');
850 850
 		}
851 851
 
852 852
 		// 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
853 853
 		$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.
854
-		$ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">';
854
+		$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")).'">';
855 855
 		$ret .= '</div>';
856 856
 
857 857
 		if (!empty($conf->use_javascript_ajax)) {
858 858
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
859
-    		<script nonce="' . getNonce() . '">
859
+    		<script nonce="' . getNonce().'">
860 860
                         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 */
861 861
         		{
862 862
         			atleastoneselected=0;
@@ -867,11 +867,11 @@  discard block
 block discarded – undo
867 867
 
868 868
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
869 869
 
870
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
870
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
871 871
     	  			{
872 872
                                     jQuery("."+name).show();
873
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
874
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
873
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
874
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
875 875
     	  			}
876 876
     	  			else
877 877
     	  			{
@@ -881,11 +881,11 @@  discard block
 block discarded – undo
881 881
         		}
882 882
 
883 883
         	jQuery(document).ready(function () {
884
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
885
-                    jQuery(".' . $cssclass . '").click(function() {
886
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
884
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
885
+                    jQuery(".' . $cssclass.'").click(function() {
886
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
887 887
                     });
888
-                        jQuery(".' . $name . 'select").change(function() {
888
+                        jQuery(".' . $name.'select").change(function() {
889 889
         			var massaction = $( this ).val();
890 890
         			var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
891 891
         			if (massaction == "builddoc")
@@ -893,18 +893,18 @@  discard block
 block discarded – undo
893 893
                         urlform = urlform + "#show_files";
894 894
     	            }
895 895
         			$( this ).closest("form").attr("action", urlform);
896
-                    console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
896
+                    console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
897 897
         	        /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
898 898
         			if ($(this).val() != \'0\')
899 899
     	  			{
900
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
901
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
902
-                                        jQuery(".' . $name . '"+massaction).show();
900
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
901
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
902
+                                        jQuery(".' . $name.'"+massaction).show();
903 903
     	  			}
904 904
     	  			else
905 905
     	  			{
906
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
907
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
906
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
907
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
908 908
     	  			}
909 909
     	        });
910 910
         	});
@@ -947,14 +947,14 @@  discard block
 block discarded – undo
947 947
 		$atleastonefavorite = 0;
948 948
 
949 949
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
950
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
950
+		$sql .= " FROM ".$this->db->prefix()."c_country";
951 951
 		$sql .= " WHERE active > 0";
952 952
 		//$sql.= " ORDER BY code ASC";
953 953
 
954
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
954
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
955 955
 		$resql = $this->db->query($sql);
956 956
 		if ($resql) {
957
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
957
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
958 958
 			$num = $this->db->num_rows($resql);
959 959
 			$i = 0;
960 960
 			if ($num) {
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 					$countryArray[$i]['rowid'] = $obj->rowid;
965 965
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
966 966
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
967
-					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
967
+					$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 : ''));
968 968
 					$countryArray[$i]['favorite'] = $obj->favorite;
969 969
 					$countryArray[$i]['eec'] = $obj->eec;
970 970
 					$favorite[$i] = $obj->favorite;
@@ -982,20 +982,20 @@  discard block
 block discarded – undo
982 982
 
983 983
 				if ($showempty) {
984 984
 					if (is_numeric($showempty)) {
985
-						$out .= '<option value="">&nbsp;</option>' . "\n";
985
+						$out .= '<option value="">&nbsp;</option>'."\n";
986 986
 					} else {
987
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
987
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
988 988
 					}
989 989
 				}
990 990
 
991 991
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
992 992
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
993
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
994
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
993
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
994
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
995 995
 					if ($mysoc->isInEEC()) {
996
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
996
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
997 997
 					}
998
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
998
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
999 999
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
1000 1000
 				}
1001 1001
 
@@ -1023,20 +1023,20 @@  discard block
 block discarded – undo
1023 1023
 						$labeltoshow .= '&nbsp;';
1024 1024
 					}
1025 1025
 					if ($row['code_iso']) {
1026
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1026
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1027 1027
 						if (empty($hideflags)) {
1028 1028
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1029
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1029
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1030 1030
 						}
1031 1031
 					}
1032 1032
 
1033 1033
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1034
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1034
+						$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']).'">';
1035 1035
 					} else {
1036
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1036
+						$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']).'">';
1037 1037
 					}
1038 1038
 					$out .= $labeltoshow;
1039
-					$out .= '</option>' . "\n";
1039
+					$out .= '</option>'."\n";
1040 1040
 				}
1041 1041
 			}
1042 1042
 			$out .= '</select>';
@@ -1045,8 +1045,8 @@  discard block
 block discarded – undo
1045 1045
 		}
1046 1046
 
1047 1047
 		// Make select dynamic
1048
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1049
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1048
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1049
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1050 1050
 
1051 1051
 		return $out;
1052 1052
 	}
@@ -1078,25 +1078,25 @@  discard block
 block discarded – undo
1078 1078
 		$incotermArray = array();
1079 1079
 
1080 1080
 		$sql = "SELECT rowid, code";
1081
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1081
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1082 1082
 		$sql .= " WHERE active > 0";
1083 1083
 		$sql .= " ORDER BY code ASC";
1084 1084
 
1085
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1085
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1086 1086
 		$resql = $this->db->query($sql);
1087 1087
 		if ($resql) {
1088 1088
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1089
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1089
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1090 1090
 				$out .= ajax_combobox($htmlname, $events);
1091 1091
 			}
1092 1092
 
1093 1093
 			if (!empty($page)) {
1094
-				$out .= '<form method="post" action="' . $page . '">';
1094
+				$out .= '<form method="post" action="'.$page.'">';
1095 1095
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1096
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1096
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1097 1097
 			}
1098 1098
 
1099
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1099
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1100 1100
 			$out .= '<option value="0">&nbsp;</option>';
1101 1101
 			$num = $this->db->num_rows($resql);
1102 1102
 			$i = 0;
@@ -1110,9 +1110,9 @@  discard block
 block discarded – undo
1110 1110
 
1111 1111
 				foreach ($incotermArray as $row) {
1112 1112
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1113
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1113
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1114 1114
 					} else {
1115
-						$out .= '<option value="' . $row['rowid'] . '">';
1115
+						$out .= '<option value="'.$row['rowid'].'">';
1116 1116
 					}
1117 1117
 
1118 1118
 					if ($row['code']) {
@@ -1125,13 +1125,13 @@  discard block
 block discarded – undo
1125 1125
 			$out .= '</select>';
1126 1126
 
1127 1127
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1128
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1128
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1129 1129
 				$moreattrib .= ' autocomplete="off"';
1130 1130
 			}
1131
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1131
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1132 1132
 
1133 1133
 			if (!empty($page)) {
1134
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1134
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1135 1135
 			}
1136 1136
 		} else {
1137 1137
 			dol_print_error($this->db);
@@ -1162,9 +1162,9 @@  discard block
 block discarded – undo
1162 1162
 		if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
1163 1163
 			|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
1164 1164
 			if (empty($hidetext)) {
1165
-				print $langs->trans("Type") . ': ';
1165
+				print $langs->trans("Type").': ';
1166 1166
 			}
1167
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1167
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1168 1168
 			if ($showempty) {
1169 1169
 				print '<option value="-1"';
1170 1170
 				if ($selected == -1) {
@@ -1177,28 +1177,28 @@  discard block
 block discarded – undo
1177 1177
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1178 1178
 				print ' selected';
1179 1179
 			}
1180
-			print '>' . $langs->trans("Product");
1180
+			print '>'.$langs->trans("Product");
1181 1181
 
1182 1182
 			print '<option value="1"';
1183 1183
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1184 1184
 				print ' selected';
1185 1185
 			}
1186
-			print '>' . $langs->trans("Service");
1186
+			print '>'.$langs->trans("Service");
1187 1187
 
1188 1188
 			print '</select>';
1189
-			print ajax_combobox('select_' . $htmlname);
1189
+			print ajax_combobox('select_'.$htmlname);
1190 1190
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1191 1191
 		}
1192 1192
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1193 1193
 			print $langs->trans("Service");
1194
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1194
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1195 1195
 		}
1196 1196
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1197 1197
 			print $langs->trans("Product");
1198
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1198
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1199 1199
 		}
1200 1200
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1201
-			print '<input type="hidden" name="' . $htmlname . '" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1
1201
+			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
1202 1202
 		}
1203 1203
 	}
1204 1204
 
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
 		$langs->load("trips");
1225 1225
 
1226 1226
 		$sql = "SELECT c.code, c.label";
1227
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1227
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1228 1228
 		$sql .= " WHERE active > 0";
1229 1229
 
1230 1230
 		$resql = $this->db->query($sql);
@@ -1265,11 +1265,11 @@  discard block
 block discarded – undo
1265 1265
 		// phpcs:enable
1266 1266
 		global $user, $langs;
1267 1267
 
1268
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1268
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1269 1269
 
1270 1270
 		$this->load_cache_types_fees();
1271 1271
 
1272
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1272
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1273 1273
 		if ($showempty) {
1274 1274
 			print '<option value="-1"';
1275 1275
 			if ($selected == -1) {
@@ -1279,7 +1279,7 @@  discard block
 block discarded – undo
1279 1279
 		}
1280 1280
 
1281 1281
 		foreach ($this->cache_types_fees as $key => $value) {
1282
-			print '<option value="' . $key . '"';
1282
+			print '<option value="'.$key.'"';
1283 1283
 			if ($key == $selected) {
1284 1284
 				print ' selected';
1285 1285
 			}
@@ -1330,12 +1330,12 @@  discard block
 block discarded – undo
1330 1330
 				$ajaxoptions = array();
1331 1331
 			}
1332 1332
 
1333
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1333
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1334 1334
 
1335 1335
 			// No immediate load of all database
1336 1336
 			$placeholder = '';
1337 1337
 			if ($selected && empty($selected_input_value)) {
1338
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1338
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1339 1339
 				$societetmp = new Societe($this->db);
1340 1340
 				$societetmp->fetch($selected);
1341 1341
 				$selected_input_value = $societetmp->name;
@@ -1343,25 +1343,25 @@  discard block
 block discarded – undo
1343 1343
 			}
1344 1344
 
1345 1345
 			// mode 1
1346
-			$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)) : '');
1346
+			$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)) : '');
1347 1347
 
1348 1348
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1349 1349
 			if (empty($hidelabel)) {
1350
-				print $langs->trans("RefOrLabel") . ' : ';
1350
+				print $langs->trans("RefOrLabel").' : ';
1351 1351
 			} elseif ($hidelabel > 1) {
1352 1352
 				$placeholder = $langs->trans("RefOrLabel");
1353 1353
 				if ($hidelabel == 2) {
1354 1354
 					$out .= img_picto($langs->trans("Search"), 'search');
1355 1355
 				}
1356 1356
 			}
1357
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
1357
+			$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' : '').' />';
1358 1358
 			if ($hidelabel == 3) {
1359 1359
 				$out .= img_picto($langs->trans("Search"), 'search');
1360 1360
 			}
1361 1361
 
1362 1362
 			$out .= ajax_event($htmlname, $events);
1363 1363
 
1364
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1364
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1365 1365
 		} else {
1366 1366
 			// Immediate load of all database
1367 1367
 			$out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode);
@@ -1445,30 +1445,30 @@  discard block
 block discarded – undo
1445 1445
 			$sql .= ", s.address, s.zip, s.town";
1446 1446
 			$sql .= ", dictp.code as country_code";
1447 1447
 		}
1448
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1448
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1449 1449
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1450
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1450
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1451 1451
 		}
1452 1452
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1453
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1453
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1454 1454
 		}
1455
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1455
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1456 1456
 		if (!empty($user->socid)) {
1457
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1457
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1458 1458
 		}
1459 1459
 		if ($filter) {
1460 1460
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1461 1461
 			// if not, by testSqlAndScriptInject() only.
1462
-			$sql .= " AND (" . $filter . ")";
1462
+			$sql .= " AND (".$filter.")";
1463 1463
 		}
1464 1464
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1465
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1465
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1466 1466
 		}
1467 1467
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1468 1468
 			$sql .= " AND s.status <> 0";
1469 1469
 		}
1470 1470
 		if (!empty($excludeids)) {
1471
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")";
1471
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")";
1472 1472
 		}
1473 1473
 		// Add where from hooks
1474 1474
 		$parameters = array();
@@ -1488,17 +1488,17 @@  discard block
 block discarded – undo
1488 1488
 				if ($i > 0) {
1489 1489
 					$sql .= " AND ";
1490 1490
 				}
1491
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1491
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1492 1492
 				$i++;
1493 1493
 			}
1494 1494
 			if (count($search_crit) > 1) {
1495 1495
 				$sql .= ")";
1496 1496
 			}
1497 1497
 			if (isModEnabled('barcode')) {
1498
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1498
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1499 1499
 			}
1500
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1501
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1500
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1501
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1502 1502
 			$sql .= ")";
1503 1503
 		}
1504 1504
 		$sql .= $this->db->order("nom", "ASC");
@@ -1509,12 +1509,12 @@  discard block
 block discarded – undo
1509 1509
 		$resql = $this->db->query($sql);
1510 1510
 		if ($resql) {
1511 1511
 			if (!$forcecombo) {
1512
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1512
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1513 1513
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT"));
1514 1514
 			}
1515 1515
 
1516 1516
 			// Construct $out and $outarray
1517
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1517
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1518 1518
 
1519 1519
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1520 1520
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1527,7 +1527,7 @@  discard block
 block discarded – undo
1527 1527
 				}
1528 1528
 			}
1529 1529
 			if ($showempty) {
1530
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1530
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1531 1531
 			}
1532 1532
 
1533 1533
 			$companytemp = new Societe($this->db);
@@ -1540,18 +1540,18 @@  discard block
 block discarded – undo
1540 1540
 					$label = '';
1541 1541
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1542 1542
 						if (($obj->client) && (!empty($obj->code_client))) {
1543
-							$label = $obj->code_client . ' - ';
1543
+							$label = $obj->code_client.' - ';
1544 1544
 						}
1545 1545
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1546
-							$label .= $obj->code_fournisseur . ' - ';
1546
+							$label .= $obj->code_fournisseur.' - ';
1547 1547
 						}
1548
-						$label .= ' ' . $obj->name;
1548
+						$label .= ' '.$obj->name;
1549 1549
 					} else {
1550 1550
 						$label = $obj->name;
1551 1551
 					}
1552 1552
 
1553 1553
 					if (!empty($obj->name_alias)) {
1554
-						$label .= ' (' . $obj->name_alias . ')';
1554
+						$label .= ' ('.$obj->name_alias.')';
1555 1555
 					}
1556 1556
 
1557 1557
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1566,7 +1566,7 @@  discard block
 block discarded – undo
1566 1566
 						$companytemp->fournisseur = $obj->fournisseur;
1567 1567
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1568 1568
 						if ($tmptype) {
1569
-							$labelhtml .= ' ' . $tmptype;
1569
+							$labelhtml .= ' '.$tmptype;
1570 1570
 						}
1571 1571
 
1572 1572
 						if ($obj->client || $obj->fournisseur) {
@@ -1576,10 +1576,10 @@  discard block
 block discarded – undo
1576 1576
 							$label .= $langs->trans("Customer");
1577 1577
 						}
1578 1578
 						if ($obj->client == 2 || $obj->client == 3) {
1579
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1579
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1580 1580
 						}
1581 1581
 						if ($obj->fournisseur) {
1582
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1582
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1583 1583
 						}
1584 1584
 						if ($obj->client || $obj->fournisseur) {
1585 1585
 							$label .= ')';
@@ -1587,9 +1587,9 @@  discard block
 block discarded – undo
1587 1587
 					}
1588 1588
 
1589 1589
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1590
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1590
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1591 1591
 						if (!empty($obj->country_code)) {
1592
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1592
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1593 1593
 						}
1594 1594
 						$label .= $s;
1595 1595
 						$labelhtml .= $s;
@@ -1597,9 +1597,9 @@  discard block
 block discarded – undo
1597 1597
 
1598 1598
 					if (empty($outputmode)) {
1599 1599
 						if (in_array($obj->rowid, $selected)) {
1600
-							$out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1600
+							$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>';
1601 1601
 						} else {
1602
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1602
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1603 1603
 						}
1604 1604
 					} else {
1605 1605
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
 					}
1612 1612
 				}
1613 1613
 			}
1614
-			$out .= '</select>' . "\n";
1614
+			$out .= '</select>'."\n";
1615 1615
 		} else {
1616 1616
 			dol_print_error($this->db);
1617 1617
 		}
@@ -1645,18 +1645,18 @@  discard block
 block discarded – undo
1645 1645
 		// On recherche les remises
1646 1646
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
1647 1647
 		$sql .= " re.description, re.fk_facture_source";
1648
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
1649
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
1650
-		$sql .= " AND re.entity = " . $conf->entity;
1648
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
1649
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
1650
+		$sql .= " AND re.entity = ".$conf->entity;
1651 1651
 		if ($filter) {
1652
-			$sql .= " AND " . $filter;
1652
+			$sql .= " AND ".$filter;
1653 1653
 		}
1654 1654
 		$sql .= " ORDER BY re.description ASC";
1655 1655
 
1656
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
1656
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
1657 1657
 		$resql = $this->db->query($sql);
1658 1658
 		if ($resql) {
1659
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
1659
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
1660 1660
 			$num = $this->db->num_rows($resql);
1661 1661
 
1662 1662
 			$qualifiedlines = $num;
@@ -1694,16 +1694,16 @@  discard block
 block discarded – undo
1694 1694
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
1695 1695
 						$tmpfac = new Facture($this->db);
1696 1696
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
1697
-							$desc = $desc . ' - ' . $tmpfac->ref;
1697
+							$desc = $desc.' - '.$tmpfac->ref;
1698 1698
 						}
1699 1699
 					}
1700 1700
 
1701
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
1701
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
1702 1702
 					$i++;
1703 1703
 				}
1704 1704
 			}
1705 1705
 			print '</select>';
1706
-			print ajax_combobox('select_' . $htmlname);
1706
+			print ajax_combobox('select_'.$htmlname);
1707 1707
 
1708 1708
 			return $qualifiedlines;
1709 1709
 		} else {
@@ -1784,7 +1784,7 @@  discard block
 block discarded – undo
1784 1784
 		$out = '';
1785 1785
 
1786 1786
 		if (!is_object($hookmanager)) {
1787
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1787
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1788 1788
 			$hookmanager = new HookManager($this->db);
1789 1789
 		}
1790 1790
 
@@ -1793,13 +1793,13 @@  discard block
 block discarded – undo
1793 1793
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1794 1794
 			$sql .= ", s.nom as company, s.town AS company_town";
1795 1795
 		}
1796
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1796
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1797 1797
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1798
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1798
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1799 1799
 		}
1800
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1800
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1801 1801
 		if ($socid > 0 || $socid == -1) {
1802
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1802
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1803 1803
 		}
1804 1804
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1805 1805
 			$sql .= " AND sp.statut <> 0";
@@ -1810,30 +1810,30 @@  discard block
 block discarded – undo
1810 1810
 		$sql .= $hookmanager->resPrint;
1811 1811
 		$sql .= " ORDER BY sp.lastname ASC";
1812 1812
 
1813
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1813
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1814 1814
 		$resql = $this->db->query($sql);
1815 1815
 		if ($resql) {
1816 1816
 			$num = $this->db->num_rows($resql);
1817 1817
 
1818 1818
 			if ($htmlname != 'none' && !$options_only) {
1819
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1819
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1820 1820
 			}
1821 1821
 
1822 1822
 			if ($showempty && !is_numeric($showempty)) {
1823 1823
 				$textforempty = $showempty;
1824
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1824
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1825 1825
 			} else {
1826 1826
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1827
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1827
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1828 1828
 				}
1829 1829
 				if ($showempty == 2) {
1830
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1830
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1831 1831
 				}
1832 1832
 			}
1833 1833
 
1834 1834
 			$i = 0;
1835 1835
 			if ($num) {
1836
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1836
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1837 1837
 				$contactstatic = new Contact($this->db);
1838 1838
 
1839 1839
 				while ($i < $num) {
@@ -1869,7 +1869,7 @@  discard block
 block discarded – undo
1869 1869
 						}
1870 1870
 						$extendedInfos = implode(' - ', $extendedInfos);
1871 1871
 						if (!empty($extendedInfos)) {
1872
-							$extendedInfos = ' - ' . $extendedInfos;
1872
+							$extendedInfos = ' - '.$extendedInfos;
1873 1873
 						}
1874 1874
 					}
1875 1875
 
@@ -1886,42 +1886,42 @@  discard block
 block discarded – undo
1886 1886
 								$disabled = 1;
1887 1887
 							}
1888 1888
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1889
-								$out .= '<option value="' . $obj->rowid . '"';
1889
+								$out .= '<option value="'.$obj->rowid.'"';
1890 1890
 								if ($disabled) {
1891 1891
 									$out .= ' disabled';
1892 1892
 								}
1893 1893
 								$out .= ' selected>';
1894
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1894
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1895 1895
 								if ($showfunction && $obj->poste) {
1896
-									$out .= ' (' . $obj->poste . ')';
1896
+									$out .= ' ('.$obj->poste.')';
1897 1897
 								}
1898 1898
 								if (($showsoc > 0) && $obj->company) {
1899
-									$out .= ' - (' . $obj->company . ')';
1899
+									$out .= ' - ('.$obj->company.')';
1900 1900
 								}
1901 1901
 								$out .= '</option>';
1902 1902
 							} else {
1903
-								$out .= '<option value="' . $obj->rowid . '"';
1903
+								$out .= '<option value="'.$obj->rowid.'"';
1904 1904
 								if ($disabled) {
1905 1905
 									$out .= ' disabled';
1906 1906
 								}
1907 1907
 								$out .= '>';
1908
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1908
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1909 1909
 								if ($showfunction && $obj->poste) {
1910
-									$out .= ' (' . $obj->poste . ')';
1910
+									$out .= ' ('.$obj->poste.')';
1911 1911
 								}
1912 1912
 								if (($showsoc > 0) && $obj->company) {
1913
-									$out .= ' - (' . $obj->company . ')';
1913
+									$out .= ' - ('.$obj->company.')';
1914 1914
 								}
1915 1915
 								$out .= '</option>';
1916 1916
 							}
1917 1917
 						} else {
1918 1918
 							if (in_array($obj->rowid, $selected)) {
1919
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1919
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1920 1920
 								if ($showfunction && $obj->poste) {
1921
-									$out .= ' (' . $obj->poste . ')';
1921
+									$out .= ' ('.$obj->poste.')';
1922 1922
 								}
1923 1923
 								if (($showsoc > 0) && $obj->company) {
1924
-									$out .= ' - (' . $obj->company . ')';
1924
+									$out .= ' - ('.$obj->company.')';
1925 1925
 								}
1926 1926
 							}
1927 1927
 						}
@@ -1930,7 +1930,7 @@  discard block
 block discarded – undo
1930 1930
 				}
1931 1931
 			} else {
1932 1932
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1933
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1933
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1934 1934
 				$out .= $labeltoshow;
1935 1935
 				$out .= '</option>';
1936 1936
 			}
@@ -1951,7 +1951,7 @@  discard block
 block discarded – undo
1951 1951
 			}
1952 1952
 
1953 1953
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1954
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1954
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1955 1955
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
1956 1956
 			}
1957 1957
 
@@ -2056,11 +2056,11 @@  discard block
 block discarded – undo
2056 2056
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2057 2057
 			$sql .= ", e.label";
2058 2058
 		}
2059
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2059
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2060 2060
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
2061
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2061
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2062 2062
 			if (!empty($force_entity)) {
2063
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2063
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2064 2064
 			} else {
2065 2065
 				$sql .= " WHERE u.entity IS NOT NULL";
2066 2066
 			}
@@ -2068,17 +2068,17 @@  discard block
 block discarded – undo
2068 2068
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2069 2069
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2070 2070
 			} else {
2071
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2071
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2072 2072
 			}
2073 2073
 		}
2074 2074
 		if (!empty($user->socid)) {
2075
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2075
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2076 2076
 		}
2077 2077
 		if (is_array($exclude) && $excludeUsers) {
2078
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2078
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2079 2079
 		}
2080 2080
 		if ($includeUsers) {
2081
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2081
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2082 2082
 		}
2083 2083
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2084 2084
 			$sql .= " AND u.statut <> 0";
@@ -2090,7 +2090,7 @@  discard block
 block discarded – undo
2090 2090
 			$sql .= " AND u.fk_soc IS NULL";
2091 2091
 		}
2092 2092
 		if (!empty($morefilter)) {
2093
-			$sql .= " " . $morefilter;
2093
+			$sql .= " ".$morefilter;
2094 2094
 		}
2095 2095
 
2096 2096
 		//Add hook to filter on user (for example on usergroup define in custom modules)
@@ -2105,7 +2105,7 @@  discard block
 block discarded – undo
2105 2105
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2106 2106
 		}
2107 2107
 
2108
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2108
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2109 2109
 
2110 2110
 		$resql = $this->db->query($sql);
2111 2111
 		if ($resql) {
@@ -2113,7 +2113,7 @@  discard block
 block discarded – undo
2113 2113
 			$i = 0;
2114 2114
 			if ($num) {
2115 2115
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2116
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2116
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2117 2117
 				if ($show_empty && !$multiple) {
2118 2118
 					$textforempty = ' ';
2119 2119
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2122,10 +2122,10 @@  discard block
 block discarded – undo
2122 2122
 					if (!is_numeric($show_empty)) {
2123 2123
 						$textforempty = $show_empty;
2124 2124
 					}
2125
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2125
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2126 2126
 				}
2127 2127
 				if ($show_every) {
2128
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2128
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2129 2129
 				}
2130 2130
 
2131 2131
 				$userstatic = new User($this->db);
@@ -2172,22 +2172,22 @@  discard block
 block discarded – undo
2172 2172
 					}
2173 2173
 					if ($showstatus >= 0) {
2174 2174
 						if ($obj->status == 1 && $showstatus == 1) {
2175
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2176
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2175
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2176
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2177 2177
 						}
2178 2178
 						if ($obj->status == 0 && $showstatus == 1) {
2179
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2180
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2179
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2180
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2181 2181
 						}
2182 2182
 					}
2183 2183
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity)) {
2184 2184
 						if (empty($obj->entity)) {
2185
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2186
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2185
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2186
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2187 2187
 						} else {
2188 2188
 							if ($obj->entity != $conf->entity) {
2189
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2190
-								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2189
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2190
+								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2191 2191
 							}
2192 2192
 						}
2193 2193
 					}
@@ -2195,13 +2195,13 @@  discard block
 block discarded – undo
2195 2195
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2196 2196
 					if (!empty($disableline) && $disableline != '1') {
2197 2197
 						// Add text from $enableonlytext parameter
2198
-						$moreinfo .= ' - ' . $disableline;
2199
-						$moreinfohtml .= ' - ' . $disableline;
2198
+						$moreinfo .= ' - '.$disableline;
2199
+						$moreinfohtml .= ' - '.$disableline;
2200 2200
 					}
2201 2201
 					$labeltoshow .= $moreinfo;
2202 2202
 					$labeltoshowhtml .= $moreinfohtml;
2203 2203
 
2204
-					$out .= '<option value="' . $obj->rowid . '"';
2204
+					$out .= '<option value="'.$obj->rowid.'"';
2205 2205
 					if (!empty($disableline)) {
2206 2206
 						$out .= ' disabled';
2207 2207
 					}
@@ -2209,7 +2209,7 @@  discard block
 block discarded – undo
2209 2209
 						$out .= ' selected';
2210 2210
 					}
2211 2211
 					$out .= ' data-html="';
2212
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2212
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2213 2213
 					if ($showstatus >= 0 && $obj->status == 0) {
2214 2214
 						$outhtml .= '<strike class="opacitymediumxxx">';
2215 2215
 					}
@@ -2222,7 +2222,7 @@  discard block
 block discarded – undo
2222 2222
 					$out .= $labeltoshow;
2223 2223
 					$out .= '</option>';
2224 2224
 
2225
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2225
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2226 2226
 					$outarray2[$userstatic->id] = array(
2227 2227
 						'id' => $userstatic->id,
2228 2228
 						'label' => $labeltoshow,
@@ -2234,14 +2234,14 @@  discard block
 block discarded – undo
2234 2234
 					$i++;
2235 2235
 				}
2236 2236
 			} else {
2237
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2238
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2237
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2238
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2239 2239
 			}
2240 2240
 			$out .= '</select>';
2241 2241
 
2242 2242
 			if ($num && !$forcecombo) {
2243 2243
 				// Enhance with select2
2244
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2244
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2245 2245
 				$out .= ajax_combobox($htmlname);
2246 2246
 			}
2247 2247
 		} else {
@@ -2311,16 +2311,16 @@  discard block
 block discarded – undo
2311 2311
 			$out .= $userstatic->getNomUrl(-1);
2312 2312
 			if ($i == 0) {
2313 2313
 				$ownerid = $value['id'];
2314
-				$out .= ' (' . $langs->trans("Owner") . ')';
2314
+				$out .= ' ('.$langs->trans("Owner").')';
2315 2315
 			}
2316 2316
 			if ($nbassignetouser > 1 && $action != 'view') {
2317
-				$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 . '">';
2317
+				$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.'">';
2318 2318
 			}
2319 2319
 			// Show my availability
2320 2320
 			if ($showproperties) {
2321 2321
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2322 2322
 					$out .= '<div class="myavailability inline-block">';
2323
-					$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>';
2323
+					$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>';
2324 2324
 					$out .= '</div>';
2325 2325
 				}
2326 2326
 			}
@@ -2337,15 +2337,15 @@  discard block
 block discarded – undo
2337 2337
 		// Method with no ajax
2338 2338
 		if ($action != 'view') {
2339 2339
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2340
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2340
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2341 2341
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2342 2342
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2343
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2344
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2343
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2344
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2345 2345
 			$out .= '});';
2346 2346
 			$out .= '})</script>';
2347 2347
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2348
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2348
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2349 2349
 			$out .= '<br>';
2350 2350
 		}
2351 2351
 
@@ -2400,13 +2400,13 @@  discard block
 block discarded – undo
2400 2400
 			$resourcestatic->fetch($value['id']);
2401 2401
 			$out .= $resourcestatic->getNomUrl(-1);
2402 2402
 			if ($nbassignetoresource > 1 && $action != 'view') {
2403
-				$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 . '">';
2403
+				$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.'">';
2404 2404
 			}
2405 2405
 			// Show my availability
2406 2406
 			if ($showproperties) {
2407 2407
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2408 2408
 					$out .= '<div class="myavailability inline-block">';
2409
-					$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>';
2409
+					$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>';
2410 2410
 					$out .= '</div>';
2411 2411
 				}
2412 2412
 			}
@@ -2423,11 +2423,11 @@  discard block
 block discarded – undo
2423 2423
 		// Method with no ajax
2424 2424
 		if ($action != 'view') {
2425 2425
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">';
2426
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2426
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2427 2427
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2428 2428
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2429
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2430
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2429
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2430
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2431 2431
 			$out .= '});';
2432 2432
 			$out .= '})</script>';
2433 2433
 
@@ -2435,7 +2435,7 @@  discard block
 block discarded – undo
2435 2435
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2436 2436
 			$out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, '', 2, 0);
2437 2437
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2438
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2438
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2439 2439
 			$out .= '<br>';
2440 2440
 		}
2441 2441
 
@@ -2496,7 +2496,7 @@  discard block
 block discarded – undo
2496 2496
 			$placeholder = '';
2497 2497
 
2498 2498
 			if ($selected && empty($selected_input_value)) {
2499
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2499
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2500 2500
 				$producttmpselect = new Product($this->db);
2501 2501
 				$producttmpselect->fetch($selected);
2502 2502
 				$selected_input_value = $producttmpselect->ref;
@@ -2511,17 +2511,17 @@  discard block
 block discarded – undo
2511 2511
 				}
2512 2512
 			}
2513 2513
 			// mode=1 means customers products
2514
-			$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;
2515
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2514
+			$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;
2515
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2516 2516
 
2517 2517
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2518 2518
 				// Code to automatically insert with javascript the select of attributes under the select of product
2519 2519
 				// when a parent of variant has been selected.
2520 2520
 				$out .= '
2521 2521
 				<!-- script to auto show attributes select tags if a variant was selected -->
2522
-				<script nonce="' . getNonce() . '">
2522
+				<script nonce="' . getNonce().'">
2523 2523
 					// auto show attributes fields
2524
-					selected = ' . json_encode($selected_combinations) . ';
2524
+					selected = ' . json_encode($selected_combinations).';
2525 2525
 					combvalues = {};
2526 2526
 
2527 2527
 					jQuery(document).ready(function () {
@@ -2532,7 +2532,7 @@  discard block
 block discarded – undo
2532 2532
 							}
2533 2533
 						});
2534 2534
 
2535
-						jQuery("input#' . $htmlname . '").change(function () {
2535
+						jQuery("input#' . $htmlname.'").change(function () {
2536 2536
 
2537 2537
 							if (!jQuery(this).val()) {
2538 2538
 								jQuery(\'div#attributes_box\').empty();
@@ -2541,7 +2541,7 @@  discard block
 block discarded – undo
2541 2541
 
2542 2542
 							console.log("A change has started. We get variants fields to inject html select");
2543 2543
 
2544
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2544
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2545 2545
 								id: jQuery(this).val()
2546 2546
 							}, function (data) {
2547 2547
 								jQuery(\'div#attributes_box\').empty();
@@ -2584,21 +2584,21 @@  discard block
 block discarded – undo
2584 2584
 							})
2585 2585
 						});
2586 2586
 
2587
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2587
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2588 2588
 					});
2589 2589
 				</script>
2590 2590
                 ';
2591 2591
 			}
2592 2592
 
2593 2593
 			if (empty($hidelabel)) {
2594
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2594
+				$out .= $langs->trans("RefOrLabel").' : ';
2595 2595
 			} elseif ($hidelabel > 1) {
2596
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2596
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2597 2597
 				if ($hidelabel == 2) {
2598 2598
 					$out .= img_picto($langs->trans("Search"), 'search');
2599 2599
 				}
2600 2600
 			}
2601
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2601
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2602 2602
 			if ($hidelabel == 3) {
2603 2603
 				$out .= img_picto($langs->trans("Search"), 'search');
2604 2604
 			}
@@ -2635,33 +2635,33 @@  discard block
 block discarded – undo
2635 2635
 		// phpcs:enable
2636 2636
 		global $conf, $user, $langs, $db;
2637 2637
 
2638
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2638
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2639 2639
 
2640 2640
 		$error = 0;
2641 2641
 		$out = '';
2642 2642
 
2643 2643
 		if (!$forcecombo) {
2644
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2644
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2645 2645
 			$events = array();
2646 2646
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2647 2647
 		}
2648 2648
 
2649
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2649
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2650 2650
 
2651 2651
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2652
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2653
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2652
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2653
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2654 2654
 		if (!empty($status)) {
2655
-			$sql .= ' AND status = ' . (int) $status;
2655
+			$sql .= ' AND status = '.(int) $status;
2656 2656
 		}
2657 2657
 		if (!empty($type)) {
2658
-			$sql .= ' AND bomtype = ' . (int) $type;
2658
+			$sql .= ' AND bomtype = '.(int) $type;
2659 2659
 		}
2660 2660
 		if (!empty($TProducts)) {
2661
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2661
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2662 2662
 		}
2663 2663
 		if (!empty($limit)) {
2664
-			$sql .= ' LIMIT ' . (int) $limit;
2664
+			$sql .= ' LIMIT '.(int) $limit;
2665 2665
 		}
2666 2666
 		$resql = $db->query($sql);
2667 2667
 		if ($resql) {
@@ -2675,11 +2675,11 @@  discard block
 block discarded – undo
2675 2675
 			while ($obj = $db->fetch_object($resql)) {
2676 2676
 				$product = new Product($db);
2677 2677
 				$res = $product->fetch($obj->fk_product);
2678
-				$out .= '<option value="' . $obj->rowid . '"';
2678
+				$out .= '<option value="'.$obj->rowid.'"';
2679 2679
 				if ($obj->rowid == $selected) {
2680 2680
 					$out .= 'selected';
2681 2681
 				}
2682
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2682
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2683 2683
 			}
2684 2684
 		} else {
2685 2685
 			$error++;
@@ -2736,7 +2736,7 @@  discard block
 block discarded – undo
2736 2736
 
2737 2737
 		$warehouseStatusArray = array();
2738 2738
 		if (!empty($warehouseStatus)) {
2739
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2739
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2740 2740
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2741 2741
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2742 2742
 			}
@@ -2750,9 +2750,9 @@  discard block
 block discarded – undo
2750 2750
 
2751 2751
 		$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";
2752 2752
 		if (count($warehouseStatusArray)) {
2753
-			$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
2753
+			$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
2754 2754
 		} else {
2755
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2755
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2756 2756
 		}
2757 2757
 
2758 2758
 		$sql = "SELECT ";
@@ -2768,9 +2768,9 @@  discard block
 block discarded – undo
2768 2768
 
2769 2769
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2770 2770
 			//Product category
2771
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2772
-						FROM " . $this->db->prefix() . "categorie_product
2773
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2771
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2772
+						FROM " . $this->db->prefix()."categorie_product
2773
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2774 2774
 						LIMIT 1
2775 2775
 				) AS categorie_product_id ";
2776 2776
 		}
@@ -2796,15 +2796,15 @@  discard block
 block discarded – undo
2796 2796
 		}
2797 2797
 		// Price by quantity
2798 2798
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2799
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2799
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2800 2800
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2801
-				$sql .= " AND price_level = " . ((int) $price_level);
2801
+				$sql .= " AND price_level = ".((int) $price_level);
2802 2802
 			}
2803 2803
 			$sql .= " ORDER BY date_price";
2804 2804
 			$sql .= " DESC LIMIT 1) as price_rowid";
2805
-			$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
2805
+			$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
2806 2806
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2807
-				$sql .= " AND price_level = " . ((int) $price_level);
2807
+				$sql .= " AND price_level = ".((int) $price_level);
2808 2808
 			}
2809 2809
 			$sql .= " ORDER BY date_price";
2810 2810
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -2818,53 +2818,53 @@  discard block
 block discarded – undo
2818 2818
 		$sql .= $hookmanager->resPrint;
2819 2819
 
2820 2820
 		if (count($warehouseStatusArray)) {
2821
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
2822
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
2823
-			$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.
2821
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
2822
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
2823
+			$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.
2824 2824
 		}
2825 2825
 
2826 2826
 		// include search in supplier ref
2827 2827
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2828
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2828
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2829 2829
 		}
2830 2830
 
2831 2831
 		//Price by customer
2832 2832
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2833
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
2833
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
2834 2834
 		}
2835 2835
 		// Units
2836 2836
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
2837
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
2837
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
2838 2838
 		}
2839 2839
 		// Multilang : we add translation
2840 2840
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
2841
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
2841
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
2842 2842
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
2843
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
2843
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
2844 2844
 				$soc = new Societe($this->db);
2845 2845
 				$result = $soc->fetch($socid);
2846 2846
 				if ($result > 0 && !empty($soc->default_lang)) {
2847
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
2847
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
2848 2848
 				} else {
2849
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2849
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2850 2850
 				}
2851 2851
 			} else {
2852
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2852
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2853 2853
 			}
2854 2854
 		}
2855 2855
 
2856 2856
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2857
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2857
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2858 2858
 		}
2859 2859
 
2860
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
2860
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
2861 2861
 
2862 2862
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2863 2863
 			$sql .= " AND pac.rowid IS NULL";
2864 2864
 		}
2865 2865
 
2866 2866
 		if ($finished == 0) {
2867
-			$sql .= " AND p.finished = " . ((int) $finished);
2867
+			$sql .= " AND p.finished = ".((int) $finished);
2868 2868
 		} elseif ($finished == 1) {
2869 2869
 			$sql .= " AND p.finished = ".((int) $finished);
2870 2870
 		}
@@ -2872,11 +2872,11 @@  discard block
 block discarded – undo
2872 2872
 			$sql .= " AND p.tosell = ".((int) $status);
2873 2873
 		}
2874 2874
 		if ($status_purchase >= 0) {
2875
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
2875
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
2876 2876
 		}
2877 2877
 		// Filter by product type
2878 2878
 		if (strval($filtertype) != '') {
2879
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
2879
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
2880 2880
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
2881 2881
 			$sql .= " AND p.fk_product_type = 1";
2882 2882
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
@@ -2900,21 +2900,21 @@  discard block
 block discarded – undo
2900 2900
 				if ($i > 0) {
2901 2901
 					$sql .= " AND ";
2902 2902
 				}
2903
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2903
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2904 2904
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
2905
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2905
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2906 2906
 				}
2907 2907
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2908
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2908
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
2909 2909
 				}
2910 2910
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
2911
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2911
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2912 2912
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
2913
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2913
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2914 2914
 					}
2915 2915
 				}
2916 2916
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2917
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2917
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
2918 2918
 				}
2919 2919
 				$sql .= ")";
2920 2920
 				$i++;
@@ -2923,12 +2923,12 @@  discard block
 block discarded – undo
2923 2923
 				$sql .= ")";
2924 2924
 			}
2925 2925
 			if (isModEnabled('barcode')) {
2926
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
2926
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
2927 2927
 			}
2928 2928
 			$sql .= ')';
2929 2929
 		}
2930 2930
 		if (count($warehouseStatusArray)) {
2931
-			$sql .= " GROUP BY " . $selectFields;
2931
+			$sql .= " GROUP BY ".$selectFields;
2932 2932
 		}
2933 2933
 
2934 2934
 		//Sort by category
@@ -2943,23 +2943,23 @@  discard block
 block discarded – undo
2943 2943
 		$sql .= $this->db->plimit($limit, 0);
2944 2944
 
2945 2945
 		// Build output string
2946
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
2946
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
2947 2947
 		$result = $this->db->query($sql);
2948 2948
 		if ($result) {
2949
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2950
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2951
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
2949
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2950
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2951
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
2952 2952
 
2953 2953
 			$num = $this->db->num_rows($result);
2954 2954
 
2955 2955
 			$events = null;
2956 2956
 
2957 2957
 			if (!$forcecombo) {
2958
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2958
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2959 2959
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2960 2960
 			}
2961 2961
 
2962
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2962
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2963 2963
 
2964 2964
 			$textifempty = '';
2965 2965
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -2976,7 +2976,7 @@  discard block
 block discarded – undo
2976 2976
 				}
2977 2977
 			}
2978 2978
 			if ($showempty) {
2979
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
2979
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
2980 2980
 			}
2981 2981
 
2982 2982
 			$i = 0;
@@ -2987,11 +2987,11 @@  discard block
 block discarded – undo
2987 2987
 
2988 2988
 				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
2989 2989
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
2990
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
2991
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
2990
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
2991
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
2992 2992
 					$sql .= " ORDER BY quantity ASC";
2993 2993
 
2994
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
2994
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
2995 2995
 					$result2 = $this->db->query($sql);
2996 2996
 					if ($result2) {
2997 2997
 						$nb_prices = $this->db->num_rows($result2);
@@ -3029,7 +3029,7 @@  discard block
 block discarded – undo
3029 3029
 						$price_product = new Product($this->db);
3030 3030
 						$price_product->fetch($objp->rowid, '', '', 1);
3031 3031
 
3032
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3032
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3033 3033
 						$priceparser = new PriceParser($this->db);
3034 3034
 						$price_result = $priceparser->parseProduct($price_product);
3035 3035
 						if ($price_result >= 0) {
@@ -3113,7 +3113,7 @@  discard block
 block discarded – undo
3113 3113
 			$label = $objp->label_translated;
3114 3114
 		}
3115 3115
 		if (!empty($filterkey) && $filterkey != '') {
3116
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3116
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3117 3117
 		}
3118 3118
 
3119 3119
 		$outkey = $objp->rowid;
@@ -3134,32 +3134,32 @@  discard block
 block discarded – undo
3134 3134
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3135 3135
 
3136 3136
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3137
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3137
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3138 3138
 		}
3139 3139
 
3140 3140
 		// Units
3141 3141
 		$outvalUnits = '';
3142 3142
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3143 3143
 			if (!empty($objp->unit_short)) {
3144
-				$outvalUnits .= ' - ' . $objp->unit_short;
3144
+				$outvalUnits .= ' - '.$objp->unit_short;
3145 3145
 			}
3146 3146
 		}
3147 3147
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3148 3148
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3149 3149
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3150
-				$outvalUnits .= ' - ' . $unitToShow;
3150
+				$outvalUnits .= ' - '.$unitToShow;
3151 3151
 			}
3152 3152
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3153
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3154
-				$outvalUnits .= ' - ' . $unitToShow;
3153
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3154
+				$outvalUnits .= ' - '.$unitToShow;
3155 3155
 			}
3156 3156
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3157 3157
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3158
-				$outvalUnits .= ' - ' . $unitToShow;
3158
+				$outvalUnits .= ' - '.$unitToShow;
3159 3159
 			}
3160 3160
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3161 3161
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3162
-				$outvalUnits .= ' - ' . $unitToShow;
3162
+				$outvalUnits .= ' - '.$unitToShow;
3163 3163
 			}
3164 3164
 		}
3165 3165
 		if ($outdurationvalue && $outdurationunit) {
@@ -3171,14 +3171,14 @@  discard block
 block discarded – undo
3171 3171
 				'y' => $langs->trans('Year')
3172 3172
 			);
3173 3173
 			if (isset($da[$outdurationunit])) {
3174
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3174
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3175 3175
 			}
3176 3176
 		}
3177 3177
 
3178
-		$opt = '<option value="' . $objp->rowid . '"';
3178
+		$opt = '<option value="'.$objp->rowid.'"';
3179 3179
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3180 3180
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3181
-			$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 . '"';
3181
+			$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.'"';
3182 3182
 		}
3183 3183
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3184 3184
 			if ($user->hasRight('stock', 'lire')) {
@@ -3190,36 +3190,36 @@  discard block
 block discarded – undo
3190 3190
 			}
3191 3191
 		}
3192 3192
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3193
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3194
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3193
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3194
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3195 3195
 		}
3196 3196
 		$opt .= '>';
3197 3197
 		$opt .= $objp->ref;
3198 3198
 		if (!empty($objp->custref)) {
3199
-			$opt .= ' (' . $objp->custref . ')';
3199
+			$opt .= ' ('.$objp->custref.')';
3200 3200
 		}
3201 3201
 		if ($outbarcode) {
3202
-			$opt .= ' (' . $outbarcode . ')';
3202
+			$opt .= ' ('.$outbarcode.')';
3203 3203
 		}
3204
-		$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
3204
+		$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
3205 3205
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3206
-			$opt .= ' (' . getCountry($outorigin, 1) . ')';
3206
+			$opt .= ' ('.getCountry($outorigin, 1).')';
3207 3207
 		}
3208 3208
 
3209 3209
 		$objRef = $objp->ref;
3210 3210
 		if (!empty($objp->custref)) {
3211
-			$objRef .= ' (' . $objp->custref . ')';
3211
+			$objRef .= ' ('.$objp->custref.')';
3212 3212
 		}
3213 3213
 		if (!empty($filterkey) && $filterkey != '') {
3214
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3214
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3215 3215
 		}
3216 3216
 		$outval .= $objRef;
3217 3217
 		if ($outbarcode) {
3218
-			$outval .= ' (' . $outbarcode . ')';
3218
+			$outval .= ' ('.$outbarcode.')';
3219 3219
 		}
3220
-		$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
3220
+		$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
3221 3221
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3222
-			$outval .= ' (' . getCountry($outorigin, 1) . ')';
3222
+			$outval .= ' ('.getCountry($outorigin, 1).')';
3223 3223
 		}
3224 3224
 
3225 3225
 		// Units
@@ -3232,35 +3232,35 @@  discard block
 block discarded – undo
3232 3232
 		// If we need a particular price level (from 1 to n)
3233 3233
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
3234 3234
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3235
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3236
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3237
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3238
-			$sql .= " AND price_level = " . ((int) $price_level);
3235
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3236
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3237
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3238
+			$sql .= " AND price_level = ".((int) $price_level);
3239 3239
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3240 3240
 			$sql .= " LIMIT 1";
3241 3241
 
3242
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3242
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3243 3243
 			$result2 = $this->db->query($sql);
3244 3244
 			if ($result2) {
3245 3245
 				$objp2 = $this->db->fetch_object($result2);
3246 3246
 				if ($objp2) {
3247 3247
 					$found = 1;
3248 3248
 					if ($objp2->price_base_type == 'HT') {
3249
-						$opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3250
-						$outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3249
+						$opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3250
+						$outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3251 3251
 					} else {
3252
-						$opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3253
-						$outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3252
+						$opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3253
+						$outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3254 3254
 					}
3255 3255
 					$outprice_ht = price($objp2->price);
3256 3256
 					$outprice_ttc = price($objp2->price_ttc);
3257 3257
 					$outpricebasetype = $objp2->price_base_type;
3258 3258
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3259
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3260
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3259
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3260
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3261 3261
 					} else {
3262
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3263
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3262
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3263
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3264 3264
 					}
3265 3265
 				}
3266 3266
 			} else {
@@ -3274,13 +3274,13 @@  discard block
 block discarded – undo
3274 3274
 			$outqty = $objp->quantity;
3275 3275
 			$outdiscount = $objp->remise_percent;
3276 3276
 			if ($objp->quantity == 1) {
3277
-				$opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3278
-				$outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3277
+				$opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3278
+				$outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3279 3279
 				$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3280 3280
 				$outval .= $langs->transnoentities("Unit");
3281 3281
 			} else {
3282
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3283
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3282
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3283
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3284 3284
 				$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3285 3285
 				$outval .= $langs->transnoentities("Units");
3286 3286
 			}
@@ -3288,16 +3288,16 @@  discard block
 block discarded – undo
3288 3288
 			$outprice_ht = price($objp->unitprice);
3289 3289
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3290 3290
 			$outpricebasetype = $objp->price_base_type;
3291
-			$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
3292
-			$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
3291
+			$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
3292
+			$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
3293 3293
 		}
3294 3294
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3295
-			$opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3296
-			$outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3295
+			$opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3296
+			$outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3297 3297
 		}
3298 3298
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3299
-			$opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3300
-			$outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3299
+			$opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3300
+			$outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3301 3301
 		}
3302 3302
 
3303 3303
 		// Price by customer
@@ -3306,11 +3306,11 @@  discard block
 block discarded – undo
3306 3306
 				$found = 1;
3307 3307
 
3308 3308
 				if ($objp->custprice_base_type == 'HT') {
3309
-					$opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3310
-					$outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3309
+					$opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3310
+					$outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3311 3311
 				} else {
3312
-					$opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3313
-					$outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3312
+					$opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3313
+					$outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3314 3314
 				}
3315 3315
 
3316 3316
 				$outprice_ht = price($objp->custprice);
@@ -3324,11 +3324,11 @@  discard block
 block discarded – undo
3324 3324
 		// If level no defined or multiprice not found, we used the default price
3325 3325
 		if (empty($hidepriceinlabel) && !$found) {
3326 3326
 			if ($objp->price_base_type == 'HT') {
3327
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3328
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3327
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3328
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3329 3329
 			} else {
3330
-				$opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3331
-				$outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3330
+				$opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3331
+				$outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3332 3332
 			}
3333 3333
 			$outprice_ht = price($objp->price);
3334 3334
 			$outprice_ttc = price($objp->price_ttc);
@@ -3339,14 +3339,14 @@  discard block
 block discarded – undo
3339 3339
 
3340 3340
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3341 3341
 			if ($user->hasRight('stock', 'lire')) {
3342
-				$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3342
+				$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3343 3343
 
3344 3344
 				if ($objp->stock > 0) {
3345 3345
 					$outval .= ' - <span class="product_line_stock_ok">';
3346 3346
 				} elseif ($objp->stock <= 0) {
3347 3347
 					$outval .= ' - <span class="product_line_stock_too_low">';
3348 3348
 				}
3349
-				$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3349
+				$outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3350 3350
 				$outval .= '</span>';
3351 3351
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3352 3352
 					$langs->load("stocks");
@@ -3356,9 +3356,9 @@  discard block
 block discarded – undo
3356 3356
 					$tmpproduct->load_virtual_stock();
3357 3357
 					$virtualstock = $tmpproduct->stock_theorique;
3358 3358
 
3359
-					$opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3359
+					$opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3360 3360
 
3361
-					$outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3361
+					$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
3362 3362
 					if ($virtualstock > 0) {
3363 3363
 						$outval .= '<span class="product_line_stock_ok">';
3364 3364
 					} elseif ($virtualstock <= 0) {
@@ -3436,7 +3436,7 @@  discard block
 block discarded – undo
3436 3436
 		$selected_input_value = '';
3437 3437
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3438 3438
 			if ($selected > 0) {
3439
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3439
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3440 3440
 				$producttmpselect = new Product($this->db);
3441 3441
 				$producttmpselect->fetch($selected);
3442 3442
 				$selected_input_value = $producttmpselect->ref;
@@ -3444,10 +3444,10 @@  discard block
 block discarded – undo
3444 3444
 			}
3445 3445
 
3446 3446
 			// mode=2 means suppliers products
3447
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3448
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3447
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3448
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3449 3449
 
3450
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3450
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3451 3451
 		} else {
3452 3452
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3453 3453
 		}
@@ -3510,25 +3510,25 @@  discard block
 block discarded – undo
3510 3510
 		if (isModEnabled('barcode')) {
3511 3511
 			$sql .= ", pfp.barcode";
3512 3512
 		}
3513
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3514
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3513
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3514
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3515 3515
 		if ($socid > 0) {
3516
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3516
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3517 3517
 		}
3518
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3518
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3519 3519
 		// Units
3520 3520
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3521
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3521
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3522 3522
 		}
3523
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3523
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3524 3524
 		if ($statut != -1) {
3525
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3525
+			$sql .= " AND p.tobuy = ".((int) $statut);
3526 3526
 		}
3527 3527
 		if (strval($filtertype) != '') {
3528
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3528
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3529 3529
 		}
3530 3530
 		if (!empty($filtre)) {
3531
-			$sql .= " " . $filtre;
3531
+			$sql .= " ".$filtre;
3532 3532
 		}
3533 3533
 		// Add where from hooks
3534 3534
 		$parameters = array();
@@ -3548,9 +3548,9 @@  discard block
 block discarded – undo
3548 3548
 				if ($i > 0) {
3549 3549
 					$sql .= " AND ";
3550 3550
 				}
3551
-				$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) . "%'";
3551
+				$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)."%'";
3552 3552
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3553
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3553
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3554 3554
 				}
3555 3555
 				$sql .= ")";
3556 3556
 				$i++;
@@ -3559,8 +3559,8 @@  discard block
 block discarded – undo
3559 3559
 				$sql .= ")";
3560 3560
 			}
3561 3561
 			if (isModEnabled('barcode')) {
3562
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3563
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3562
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3563
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3564 3564
 			}
3565 3565
 			$sql .= ')';
3566 3566
 		}
@@ -3569,20 +3569,20 @@  discard block
 block discarded – undo
3569 3569
 
3570 3570
 		// Build output string
3571 3571
 
3572
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3572
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3573 3573
 		$result = $this->db->query($sql);
3574 3574
 		if ($result) {
3575
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3576
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3575
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3576
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3577 3577
 
3578 3578
 			$num = $this->db->num_rows($result);
3579 3579
 
3580 3580
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3581
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3581
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3582 3582
 			if (!$selected) {
3583
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3583
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3584 3584
 			} else {
3585
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3585
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3586 3586
 			}
3587 3587
 
3588 3588
 			$i = 0;
@@ -3597,7 +3597,7 @@  discard block
 block discarded – undo
3597 3597
 
3598 3598
 				$outkey = $objp->idprodfournprice; // id in table of price
3599 3599
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3600
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3600
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3601 3601
 				}
3602 3602
 
3603 3603
 				$outref = $objp->ref;
@@ -3612,23 +3612,23 @@  discard block
 block discarded – undo
3612 3612
 				$outvalUnits = '';
3613 3613
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3614 3614
 					if (!empty($objp->unit_short)) {
3615
-						$outvalUnits .= ' - ' . $objp->unit_short;
3615
+						$outvalUnits .= ' - '.$objp->unit_short;
3616 3616
 					}
3617 3617
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3618 3618
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3619
-						$outvalUnits .= ' - ' . $unitToShow;
3619
+						$outvalUnits .= ' - '.$unitToShow;
3620 3620
 					}
3621 3621
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3622
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3623
-						$outvalUnits .= ' - ' . $unitToShow;
3622
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3623
+						$outvalUnits .= ' - '.$unitToShow;
3624 3624
 					}
3625 3625
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3626 3626
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3627
-						$outvalUnits .= ' - ' . $unitToShow;
3627
+						$outvalUnits .= ' - '.$unitToShow;
3628 3628
 					}
3629 3629
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3630 3630
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3631
-						$outvalUnits .= ' - ' . $unitToShow;
3631
+						$outvalUnits .= ' - '.$unitToShow;
3632 3632
 					}
3633 3633
 					if ($outdurationvalue && $outdurationunit) {
3634 3634
 						$da = array(
@@ -3639,22 +3639,22 @@  discard block
 block discarded – undo
3639 3639
 							'y' => $langs->trans('Year')
3640 3640
 						);
3641 3641
 						if (isset($da[$outdurationunit])) {
3642
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3642
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3643 3643
 						}
3644 3644
 					}
3645 3645
 				}
3646 3646
 
3647 3647
 				$objRef = $objp->ref;
3648 3648
 				if ($filterkey && $filterkey != '') {
3649
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3649
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3650 3650
 				}
3651 3651
 				$objRefFourn = $objp->ref_fourn;
3652 3652
 				if ($filterkey && $filterkey != '') {
3653
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3653
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3654 3654
 				}
3655 3655
 				$label = $objp->label;
3656 3656
 				if ($filterkey && $filterkey != '') {
3657
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3657
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3658 3658
 				}
3659 3659
 
3660 3660
 				switch ($objp->fk_product_type) {
@@ -3677,21 +3677,21 @@  discard block
 block discarded – undo
3677 3677
 
3678 3678
 				$optlabel .= $objp->ref;
3679 3679
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3680
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3680
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3681 3681
 				}
3682 3682
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3683
-					$optlabel .= ' (' . $outbarcode . ')';
3683
+					$optlabel .= ' ('.$outbarcode.')';
3684 3684
 				}
3685
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3685
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3686 3686
 
3687 3687
 				$outvallabel = $objRef;
3688 3688
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3689
-					$outvallabel .= ' (' . $objRefFourn . ')';
3689
+					$outvallabel .= ' ('.$objRefFourn.')';
3690 3690
 				}
3691 3691
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3692
-					$outvallabel .= ' (' . $outbarcode . ')';
3692
+					$outvallabel .= ' ('.$outbarcode.')';
3693 3693
 				}
3694
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3694
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3695 3695
 
3696 3696
 				// Units
3697 3697
 				$optlabel .= $outvalUnits;
@@ -3708,7 +3708,7 @@  discard block
 block discarded – undo
3708 3708
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3709 3709
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3710 3710
 
3711
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3711
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3712 3712
 						$priceparser = new PriceParser($this->db);
3713 3713
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3714 3714
 						if ($price_result >= 0) {
@@ -3719,57 +3719,57 @@  discard block
 block discarded – undo
3719 3719
 						}
3720 3720
 					}
3721 3721
 					if ($objp->quantity == 1) {
3722
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3723
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3722
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3723
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3724 3724
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3725 3725
 						$outvallabel .= $langs->transnoentities("Unit");
3726 3726
 					} else {
3727
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3728
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3729
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3730
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3727
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3728
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3729
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3730
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3731 3731
 					}
3732 3732
 
3733 3733
 					if ($objp->quantity > 1) {
3734
-						$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
3735
-						$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
3734
+						$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
3735
+						$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
3736 3736
 					}
3737 3737
 					if ($objp->remise_percent >= 1) {
3738
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3739
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3738
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3739
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3740 3740
 					}
3741 3741
 					if ($objp->duration) {
3742
-						$optlabel .= " - " . $objp->duration;
3743
-						$outvallabel .= " - " . $objp->duration;
3742
+						$optlabel .= " - ".$objp->duration;
3743
+						$outvallabel .= " - ".$objp->duration;
3744 3744
 					}
3745 3745
 					if (!$socid) {
3746
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3747
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3746
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3747
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3748 3748
 					}
3749 3749
 					if ($objp->supplier_reputation) {
3750 3750
 						//TODO dictionary
3751 3751
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3752 3752
 
3753
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3754
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3753
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3754
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3755 3755
 					}
3756 3756
 				} else {
3757
-					$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3758
-					$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3757
+					$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3758
+					$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3759 3759
 				}
3760 3760
 
3761 3761
 				if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3762 3762
 					$novirtualstock = ($showstockinlist == 2);
3763 3763
 
3764 3764
 					if ($user->hasRight('stock', 'lire')) {
3765
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3765
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3766 3766
 
3767 3767
 						if ($objp->stock > 0) {
3768 3768
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3769 3769
 						} elseif ($objp->stock <= 0) {
3770 3770
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3771 3771
 						}
3772
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3772
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3773 3773
 						$optlabel .= '</span>';
3774 3774
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3775 3775
 							$langs->load("stocks");
@@ -3779,9 +3779,9 @@  discard block
 block discarded – undo
3779 3779
 							$tmpproduct->load_virtual_stock();
3780 3780
 							$virtualstock = $tmpproduct->stock_theorique;
3781 3781
 
3782
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3782
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3783 3783
 
3784
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3784
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
3785 3785
 							if ($virtualstock > 0) {
3786 3786
 								$optlabel .= '<span class="product_line_stock_ok">';
3787 3787
 							} elseif ($virtualstock <= 0) {
@@ -3795,7 +3795,7 @@  discard block
 block discarded – undo
3795 3795
 					}
3796 3796
 				}
3797 3797
 
3798
-				$optstart = '<option value="' . $outkey . '"';
3798
+				$optstart = '<option value="'.$outkey.'"';
3799 3799
 				if ($selected && $selected == $objp->idprodfournprice) {
3800 3800
 					$optstart .= ' selected';
3801 3801
 				}
@@ -3804,31 +3804,31 @@  discard block
 block discarded – undo
3804 3804
 				}
3805 3805
 
3806 3806
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
3807
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
3808
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
3809
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
3810
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
3811
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
3812
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
3813
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
3814
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
3815
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
3816
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
3807
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
3808
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
3809
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
3810
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
3811
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
3812
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
3813
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
3814
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
3815
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
3816
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
3817 3817
 					if (isModEnabled('multicurrency')) {
3818
-						$optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"';
3819
-						$optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"';
3818
+						$optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"';
3819
+						$optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"';
3820 3820
 					}
3821 3821
 				}
3822
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
3822
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
3823 3823
 
3824 3824
 				$outarrayentry = array(
3825 3825
 					'key' => $outkey,
3826 3826
 					'value' => $outref,
3827 3827
 					'label' => $outvallabel,
3828 3828
 					'qty' => $outqty,
3829
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
3830
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3831
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3829
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3830
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3831
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3832 3832
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
3833 3833
 					'tva_tx' => price2num($objp->tva_tx),
3834 3834
 					'default_vat_code' => $objp->default_vat_code,
@@ -3857,17 +3857,17 @@  discard block
 block discarded – undo
3857 3857
 				// Add new entry
3858 3858
 				// "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
3859 3859
 				// "label" value of json key array is used by jQuery automatically as text for combo box
3860
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
3860
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
3861 3861
 				$outarraypush = array(
3862 3862
 					'key' => $outkey,
3863 3863
 					'value' => $outref,
3864 3864
 					'label' => $outvallabel,
3865 3865
 					'qty' => $outqty,
3866
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
3866
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3867 3867
 					'price_qty_ht_locale' => price($objp->fprice),
3868
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3868
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3869 3869
 					'price_unit_ht_locale' => price($objp->unitprice),
3870
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3870
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3871 3871
 					'tva_tx_formated' => price($objp->tva_tx),
3872 3872
 					'tva_tx' => price2num($objp->tva_tx),
3873 3873
 					'default_vat_code' => $objp->default_vat_code,
@@ -3899,7 +3899,7 @@  discard block
 block discarded – undo
3899 3899
 
3900 3900
 			$this->db->free($result);
3901 3901
 
3902
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3902
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3903 3903
 			$out .= ajax_combobox($htmlname);
3904 3904
 		} else {
3905 3905
 			dol_print_error($this->db);
@@ -3931,43 +3931,43 @@  discard block
 block discarded – undo
3931 3931
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
3932 3932
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
3933 3933
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
3934
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3935
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3936
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3937
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
3934
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3935
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3936
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3937
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
3938 3938
 		$sql .= " AND p.tobuy = 1";
3939 3939
 		$sql .= " AND s.fournisseur = 1";
3940
-		$sql .= " AND p.rowid = " . ((int) $productid);
3940
+		$sql .= " AND p.rowid = ".((int) $productid);
3941 3941
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
3942 3942
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
3943 3943
 		} else {
3944 3944
 			$sql .= " ORDER BY pfp.unitprice ASC";
3945 3945
 		}
3946 3946
 
3947
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
3947
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
3948 3948
 		$result = $this->db->query($sql);
3949 3949
 
3950 3950
 		if ($result) {
3951 3951
 			$num = $this->db->num_rows($result);
3952 3952
 
3953
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3953
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3954 3954
 
3955 3955
 			if (!$num) {
3956
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
3956
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
3957 3957
 			} else {
3958
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3958
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3959 3959
 				$form .= '<option value="0">&nbsp;</option>';
3960 3960
 
3961 3961
 				$i = 0;
3962 3962
 				while ($i < $num) {
3963 3963
 					$objp = $this->db->fetch_object($result);
3964 3964
 
3965
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
3965
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
3966 3966
 					//if there is only one supplier, preselect it
3967 3967
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
3968 3968
 						$opt .= ' selected';
3969 3969
 					}
3970
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
3970
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
3971 3971
 
3972 3972
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
3973 3973
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -3977,7 +3977,7 @@  discard block
 block discarded – undo
3977 3977
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3978 3978
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3979 3979
 
3980
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3980
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3981 3981
 						$priceparser = new PriceParser($this->db);
3982 3982
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3983 3983
 						if ($price_result >= 0) {
@@ -3988,10 +3988,10 @@  discard block
 block discarded – undo
3988 3988
 						}
3989 3989
 					}
3990 3990
 					if ($objp->quantity == 1) {
3991
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3991
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3992 3992
 					}
3993 3993
 
3994
-					$opt .= $objp->quantity . ' ';
3994
+					$opt .= $objp->quantity.' ';
3995 3995
 
3996 3996
 					if ($objp->quantity == 1) {
3997 3997
 						$opt .= $langs->trans("Unit");
@@ -4000,10 +4000,10 @@  discard block
 block discarded – undo
4000 4000
 					}
4001 4001
 					if ($objp->quantity > 1) {
4002 4002
 						$opt .= " - ";
4003
-						$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");
4003
+						$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");
4004 4004
 					}
4005 4005
 					if ($objp->duration) {
4006
-						$opt .= " - " . $objp->duration;
4006
+						$opt .= " - ".$objp->duration;
4007 4007
 					}
4008 4008
 					$opt .= "</option>\n";
4009 4009
 
@@ -4041,8 +4041,8 @@  discard block
 block discarded – undo
4041 4041
 		dol_syslog(__METHOD__, LOG_DEBUG);
4042 4042
 
4043 4043
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4044
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4045
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4044
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4045
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4046 4046
 		$sql .= " AND active > 0";
4047 4047
 		$sql .= " ORDER BY sortorder";
4048 4048
 
@@ -4054,7 +4054,7 @@  discard block
 block discarded – undo
4054 4054
 				$obj = $this->db->fetch_object($resql);
4055 4055
 
4056 4056
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4057
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4057
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4058 4058
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4059 4059
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4060 4060
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4082,7 +4082,7 @@  discard block
 block discarded – undo
4082 4082
 		// phpcs:enable
4083 4083
 		global $langs;
4084 4084
 
4085
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4085
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4086 4086
 		if ($num > 0) {
4087 4087
 			return 0; // Cache already loaded
4088 4088
 		}
@@ -4092,7 +4092,7 @@  discard block
 block discarded – undo
4092 4092
 		$langs->load('propal');
4093 4093
 
4094 4094
 		$sql = "SELECT rowid, code, label, position";
4095
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4095
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4096 4096
 		$sql .= " WHERE active > 0";
4097 4097
 
4098 4098
 		$resql = $this->db->query($sql);
@@ -4103,7 +4103,7 @@  discard block
 block discarded – undo
4103 4103
 				$obj = $this->db->fetch_object($resql);
4104 4104
 
4105 4105
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4106
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4106
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4107 4107
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4108 4108
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4109 4109
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4135,17 +4135,17 @@  discard block
 block discarded – undo
4135 4135
 
4136 4136
 		$this->load_cache_availability();
4137 4137
 
4138
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4138
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4139 4139
 
4140
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4140
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4141 4141
 		if ($addempty) {
4142 4142
 			print '<option value="0">&nbsp;</option>';
4143 4143
 		}
4144 4144
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4145 4145
 			if ($selected == $id) {
4146
-				print '<option value="' . $id . '" selected>';
4146
+				print '<option value="'.$id.'" selected>';
4147 4147
 			} else {
4148
-				print '<option value="' . $id . '">';
4148
+				print '<option value="'.$id.'">';
4149 4149
 			}
4150 4150
 			print dol_escape_htmltag($arrayavailability['label']);
4151 4151
 			print '</option>';
@@ -4166,13 +4166,13 @@  discard block
 block discarded – undo
4166 4166
 	{
4167 4167
 		global $langs;
4168 4168
 
4169
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4169
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4170 4170
 		if ($num > 0) {
4171 4171
 			return 0; // Cache already loaded
4172 4172
 		}
4173 4173
 
4174 4174
 		$sql = "SELECT rowid, code, label";
4175
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4175
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4176 4176
 		$sql .= " WHERE active > 0";
4177 4177
 
4178 4178
 		$resql = $this->db->query($sql);
@@ -4185,8 +4185,8 @@  discard block
 block discarded – undo
4185 4185
 
4186 4186
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4187 4187
 				$label = ($obj->label != '-' ? $obj->label : '');
4188
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4189
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4188
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4189
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4190 4190
 				}
4191 4191
 				if ($langs->trans($obj->code) != $obj->code) {
4192 4192
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4226,9 +4226,9 @@  discard block
 block discarded – undo
4226 4226
 
4227 4227
 		$this->loadCacheInputReason();
4228 4228
 
4229
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4229
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4230 4230
 		if ($addempty) {
4231
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4231
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4232 4232
 		}
4233 4233
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4234 4234
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4236,9 +4236,9 @@  discard block
 block discarded – undo
4236 4236
 			}
4237 4237
 
4238 4238
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4239
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4239
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4240 4240
 			} else {
4241
-				print '<option value="' . $arraydemandreason['id'] . '">';
4241
+				print '<option value="'.$arraydemandreason['id'].'">';
4242 4242
 			}
4243 4243
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4244 4244
 			print $langs->trans($label);
@@ -4248,7 +4248,7 @@  discard block
 block discarded – undo
4248 4248
 		if ($user->admin && empty($notooltip)) {
4249 4249
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4250 4250
 		}
4251
-		print ajax_combobox('select_' . $htmlname);
4251
+		print ajax_combobox('select_'.$htmlname);
4252 4252
 	}
4253 4253
 
4254 4254
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4263,7 +4263,7 @@  discard block
 block discarded – undo
4263 4263
 		// phpcs:enable
4264 4264
 		global $langs;
4265 4265
 
4266
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4266
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4267 4267
 		if ($num > 0) {
4268 4268
 			return $num; // Cache already loaded
4269 4269
 		}
@@ -4273,8 +4273,8 @@  discard block
 block discarded – undo
4273 4273
 		$this->cache_types_paiements = array();
4274 4274
 
4275 4275
 		$sql = "SELECT id, code, libelle as label, type, active";
4276
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4277
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4276
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4277
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4278 4278
 
4279 4279
 		$resql = $this->db->query($sql);
4280 4280
 		if ($resql) {
@@ -4284,7 +4284,7 @@  discard block
 block discarded – undo
4284 4284
 				$obj = $this->db->fetch_object($resql);
4285 4285
 
4286 4286
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4287
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4287
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4288 4288
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4289 4289
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4290 4290
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4356,17 +4356,17 @@  discard block
 block discarded – undo
4356 4356
 		global $langs, $user, $conf;
4357 4357
 
4358 4358
 		$out = '';
4359
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4359
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4360 4360
 
4361 4361
 		$this->load_cache_conditions_paiements();
4362 4362
 
4363 4363
 		// Set default value if not already set by caller
4364 4364
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4365
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4365
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4366 4366
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4367 4367
 		}
4368 4368
 
4369
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4369
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4370 4370
 		if ($addempty) {
4371 4371
 			$out .= '<option value="0">&nbsp;</option>';
4372 4372
 		}
@@ -4380,9 +4380,9 @@  discard block
 block discarded – undo
4380 4380
 
4381 4381
 			if ($selected == $id) {
4382 4382
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4383
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4383
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4384 4384
 			} else {
4385
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4385
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4386 4386
 			}
4387 4387
 			$label = $arrayconditions['label'];
4388 4388
 
@@ -4400,21 +4400,21 @@  discard block
 block discarded – undo
4400 4400
 		$out .= ajax_combobox($htmlname);
4401 4401
 
4402 4402
 		if ($deposit_percent >= 0) {
4403
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4404
-			$out .= $langs->trans('DepositPercent') . ' : ';
4405
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4403
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4404
+			$out .= $langs->trans('DepositPercent').' : ';
4405
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4406 4406
 			$out .= '</span>';
4407 4407
 			$out .= '
4408
-				<script nonce="' . getNonce() . '">
4408
+				<script nonce="' . getNonce().'">
4409 4409
 					$(document).ready(function () {
4410
-						$("#' . $htmlname . '").change(function () {
4410
+						$("#' . $htmlname.'").change(function () {
4411 4411
 							let $selected = $(this).find("option:selected");
4412 4412
 							let depositPercent = $selected.attr("data-deposit_percent");
4413 4413
 
4414 4414
 							if (depositPercent.length > 0) {
4415
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4415
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4416 4416
 							} else {
4417
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4417
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4418 4418
 							}
4419 4419
 
4420 4420
 							return true;
@@ -4452,7 +4452,7 @@  discard block
 block discarded – undo
4452 4452
 
4453 4453
 		$out = '';
4454 4454
 
4455
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4455
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4456 4456
 
4457 4457
 		$filterarray = array();
4458 4458
 		if ($filtertype == 'CRDT') {
@@ -4467,11 +4467,11 @@  discard block
 block discarded – undo
4467 4467
 
4468 4468
 		// Set default value if not already set by caller
4469 4469
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4470
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4470
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4471 4471
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4472 4472
 		}
4473 4473
 
4474
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4474
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4475 4475
 		if ($empty) {
4476 4476
 			$out .= '<option value="">&nbsp;</option>';
4477 4477
 		}
@@ -4492,13 +4492,13 @@  discard block
 block discarded – undo
4492 4492
 			}
4493 4493
 
4494 4494
 			if ($format == 0) {
4495
-				$out .= '<option value="' . $id . '"';
4495
+				$out .= '<option value="'.$id.'"';
4496 4496
 			} elseif ($format == 1) {
4497
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4497
+				$out .= '<option value="'.$arraytypes['code'].'"';
4498 4498
 			} elseif ($format == 2) {
4499
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4499
+				$out .= '<option value="'.$arraytypes['code'].'"';
4500 4500
 			} elseif ($format == 3) {
4501
-				$out .= '<option value="' . $id . '"';
4501
+				$out .= '<option value="'.$id.'"';
4502 4502
 			}
4503 4503
 			// Print attribute selected or not
4504 4504
 			if ($format == 1 || $format == 2) {
@@ -4528,7 +4528,7 @@  discard block
 block discarded – undo
4528 4528
 		if ($user->admin && !$noadmininfo) {
4529 4529
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4530 4530
 		}
4531
-		$out .= ajax_combobox('select' . $htmlname);
4531
+		$out .= ajax_combobox('select'.$htmlname);
4532 4532
 
4533 4533
 		if (empty($nooutput)) {
4534 4534
 			print $out;
@@ -4550,22 +4550,22 @@  discard block
 block discarded – undo
4550 4550
 	{
4551 4551
 		global $langs;
4552 4552
 
4553
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4553
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4554 4554
 		$options = array(
4555 4555
 			'HT' => $langs->trans("HT"),
4556 4556
 			'TTC' => $langs->trans("TTC")
4557 4557
 		);
4558 4558
 		foreach ($options as $id => $value) {
4559 4559
 			if ($selected == $id) {
4560
-				$return .= '<option value="' . $id . '" selected>' . $value;
4560
+				$return .= '<option value="'.$id.'" selected>'.$value;
4561 4561
 			} else {
4562
-				$return .= '<option value="' . $id . '">' . $value;
4562
+				$return .= '<option value="'.$id.'">'.$value;
4563 4563
 			}
4564 4564
 			$return .= '</option>';
4565 4565
 		}
4566 4566
 		$return .= '</select>';
4567 4567
 		if ($addjscombo) {
4568
-			$return .= ajax_combobox('select_' . $htmlname);
4568
+			$return .= ajax_combobox('select_'.$htmlname);
4569 4569
 		}
4570 4570
 
4571 4571
 		return $return;
@@ -4583,7 +4583,7 @@  discard block
 block discarded – undo
4583 4583
 		// phpcs:enable
4584 4584
 		global $langs;
4585 4585
 
4586
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4586
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4587 4587
 		if ($num > 0) {
4588 4588
 			return $num; // Cache already loaded
4589 4589
 		}
@@ -4593,8 +4593,8 @@  discard block
 block discarded – undo
4593 4593
 		$this->cache_transport_mode = array();
4594 4594
 
4595 4595
 		$sql = "SELECT rowid, code, label, active";
4596
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4597
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4596
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4597
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4598 4598
 
4599 4599
 		$resql = $this->db->query($sql);
4600 4600
 		if ($resql) {
@@ -4604,7 +4604,7 @@  discard block
 block discarded – undo
4604 4604
 				$obj = $this->db->fetch_object($resql);
4605 4605
 
4606 4606
 				// If traduction exist, we use it else we take the default label
4607
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4607
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4608 4608
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4609 4609
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4610 4610
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4638,11 +4638,11 @@  discard block
 block discarded – undo
4638 4638
 	{
4639 4639
 		global $langs, $user;
4640 4640
 
4641
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4641
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4642 4642
 
4643 4643
 		$this->load_cache_transport_mode();
4644 4644
 
4645
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4645
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4646 4646
 		if ($empty) {
4647 4647
 			print '<option value="">&nbsp;</option>';
4648 4648
 		}
@@ -4658,13 +4658,13 @@  discard block
 block discarded – undo
4658 4658
 			}
4659 4659
 
4660 4660
 			if ($format == 0) {
4661
-				print '<option value="' . $id . '"';
4661
+				print '<option value="'.$id.'"';
4662 4662
 			} elseif ($format == 1) {
4663
-				print '<option value="' . $arraytypes['code'] . '"';
4663
+				print '<option value="'.$arraytypes['code'].'"';
4664 4664
 			} elseif ($format == 2) {
4665
-				print '<option value="' . $arraytypes['code'] . '"';
4665
+				print '<option value="'.$arraytypes['code'].'"';
4666 4666
 			} elseif ($format == 3) {
4667
-				print '<option value="' . $id . '"';
4667
+				print '<option value="'.$id.'"';
4668 4668
 			}
4669 4669
 			// If text is selected, we compare with code, else with id
4670 4670
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4712,31 +4712,31 @@  discard block
 block discarded – undo
4712 4712
 		$langs->load("deliveries");
4713 4713
 
4714 4714
 		$sql = "SELECT rowid, code, libelle as label";
4715
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4715
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4716 4716
 		$sql .= " WHERE active > 0";
4717 4717
 		if ($filtre) {
4718
-			$sql .= " AND " . $filtre;
4718
+			$sql .= " AND ".$filtre;
4719 4719
 		}
4720 4720
 		$sql .= " ORDER BY libelle ASC";
4721 4721
 
4722
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4722
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4723 4723
 		$result = $this->db->query($sql);
4724 4724
 		if ($result) {
4725 4725
 			$num = $this->db->num_rows($result);
4726 4726
 			$i = 0;
4727 4727
 			if ($num) {
4728
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4728
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4729 4729
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4730 4730
 					print '<option value="-1">&nbsp;</option>';
4731 4731
 				}
4732 4732
 				while ($i < $num) {
4733 4733
 					$obj = $this->db->fetch_object($result);
4734 4734
 					if ($selected == $obj->rowid) {
4735
-						print '<option value="' . $obj->rowid . '" selected>';
4735
+						print '<option value="'.$obj->rowid.'" selected>';
4736 4736
 					} else {
4737
-						print '<option value="' . $obj->rowid . '">';
4737
+						print '<option value="'.$obj->rowid.'">';
4738 4738
 					}
4739
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4739
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4740 4740
 					print '</option>';
4741 4741
 					$i++;
4742 4742
 				}
@@ -4745,7 +4745,7 @@  discard block
 block discarded – undo
4745 4745
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4746 4746
 				}
4747 4747
 
4748
-				print ajax_combobox('select' . $htmlname);
4748
+				print ajax_combobox('select'.$htmlname);
4749 4749
 			} else {
4750 4750
 				print $langs->trans("NoShippingMethodDefined");
4751 4751
 			}
@@ -4770,16 +4770,16 @@  discard block
 block discarded – undo
4770 4770
 		$langs->load("deliveries");
4771 4771
 
4772 4772
 		if ($htmlname != "none") {
4773
-			print '<form method="POST" action="' . $page . '">';
4773
+			print '<form method="POST" action="'.$page.'">';
4774 4774
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4775
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4775
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4776 4776
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4777
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4777
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4778 4778
 			print '</form>';
4779 4779
 		} else {
4780 4780
 			if ($selected) {
4781 4781
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
4782
-				print $langs->trans("SendingMethod" . strtoupper($code));
4782
+				print $langs->trans("SendingMethod".strtoupper($code));
4783 4783
 			} else {
4784 4784
 				print "&nbsp;";
4785 4785
 			}
@@ -4802,10 +4802,10 @@  discard block
 block discarded – undo
4802 4802
 
4803 4803
 		$opt = '<option value="" selected></option>';
4804 4804
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
4805
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
4806
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
4805
+		$sql .= ' FROM '.$this->db->prefix().'facture';
4806
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
4807 4807
 		$sql .= ' AND situation_counter >= 1';
4808
-		$sql .= ' AND fk_soc = ' . (int) $socid;
4808
+		$sql .= ' AND fk_soc = '.(int) $socid;
4809 4809
 		$sql .= ' AND type <> 2';
4810 4810
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
4811 4811
 		$resql = $this->db->query($sql);
@@ -4823,19 +4823,19 @@  discard block
 block discarded – undo
4823 4823
 						//Not prov?
4824 4824
 						if (substr($obj->ref, 1, 4) != 'PROV') {
4825 4825
 							if ($selected == $obj->rowid) {
4826
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
4826
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
4827 4827
 							} else {
4828
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
4828
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
4829 4829
 							}
4830 4830
 						}
4831 4831
 					}
4832 4832
 				}
4833 4833
 			}
4834 4834
 		} else {
4835
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
4835
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
4836 4836
 		}
4837 4837
 		if ($opt == '<option value ="" selected></option>') {
4838
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
4838
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
4839 4839
 		}
4840 4840
 		return $opt;
4841 4841
 	}
@@ -4855,12 +4855,12 @@  discard block
 block discarded – undo
4855 4855
 
4856 4856
 		$langs->load('products');
4857 4857
 
4858
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
4858
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
4859 4859
 
4860
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
4860
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
4861 4861
 		$sql .= ' WHERE active > 0';
4862 4862
 		if (!empty($unit_type)) {
4863
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
4863
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
4864 4864
 		}
4865 4865
 		$sql .= " ORDER BY sortorder";
4866 4866
 
@@ -4872,14 +4872,14 @@  discard block
 block discarded – undo
4872 4872
 
4873 4873
 			while ($res = $this->db->fetch_object($resql)) {
4874 4874
 				$unitLabel = $res->label;
4875
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
4876
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
4875
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
4876
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
4877 4877
 				}
4878 4878
 
4879 4879
 				if ($selected == $res->rowid) {
4880
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
4880
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
4881 4881
 				} else {
4882
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
4882
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
4883 4883
 				}
4884 4884
 			}
4885 4885
 			$return .= '</select>';
@@ -4914,23 +4914,23 @@  discard block
 block discarded – undo
4914 4914
 		$num = 0;
4915 4915
 
4916 4916
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
4917
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
4918
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
4917
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
4918
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
4919 4919
 		if ($status != 2) {
4920
-			$sql .= " AND clos = " . (int) $status;
4920
+			$sql .= " AND clos = ".(int) $status;
4921 4921
 		}
4922 4922
 		if ($filtre) {
4923
-			$sql .= " AND " . $filtre;
4923
+			$sql .= " AND ".$filtre;
4924 4924
 		}
4925 4925
 		$sql .= " ORDER BY label";
4926 4926
 
4927
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
4927
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
4928 4928
 		$result = $this->db->query($sql);
4929 4929
 		if ($result) {
4930 4930
 			$num = $this->db->num_rows($result);
4931 4931
 			$i = 0;
4932 4932
 			if ($num) {
4933
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4933
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4934 4934
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4935 4935
 					$out .= '<option value="-1">&nbsp;</option>';
4936 4936
 				}
@@ -4938,27 +4938,27 @@  discard block
 block discarded – undo
4938 4938
 				while ($i < $num) {
4939 4939
 					$obj = $this->db->fetch_object($result);
4940 4940
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
4941
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
4941
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
4942 4942
 					} else {
4943
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
4943
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
4944 4944
 					}
4945 4945
 					$out .= trim($obj->label);
4946 4946
 					if ($showcurrency) {
4947
-						$out .= ' (' . $obj->currency_code . ')';
4947
+						$out .= ' ('.$obj->currency_code.')';
4948 4948
 					}
4949 4949
 					if ($status == 2 && $obj->status == 1) {
4950
-						$out .= ' (' . $langs->trans("Closed") . ')';
4950
+						$out .= ' ('.$langs->trans("Closed").')';
4951 4951
 					}
4952 4952
 					$out .= '</option>';
4953 4953
 					$i++;
4954 4954
 				}
4955 4955
 				$out .= "</select>";
4956
-				$out .= ajax_combobox('select' . $htmlname);
4956
+				$out .= ajax_combobox('select'.$htmlname);
4957 4957
 			} else {
4958 4958
 				if ($status == 0) {
4959
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
4959
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
4960 4960
 				} else {
4961
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
4961
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
4962 4962
 				}
4963 4963
 			}
4964 4964
 		} else {
@@ -4994,23 +4994,23 @@  discard block
 block discarded – undo
4994 4994
 		$num = 0;
4995 4995
 
4996 4996
 		$sql = "SELECT rowid, name, fk_country, status, entity";
4997
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
4997
+		$sql .= " FROM ".$this->db->prefix()."establishment";
4998 4998
 		$sql .= " WHERE 1=1";
4999 4999
 		if ($status != 2) {
5000
-			$sql .= " AND status = " . (int) $status;
5000
+			$sql .= " AND status = ".(int) $status;
5001 5001
 		}
5002 5002
 		if ($filtre) {
5003
-			$sql .= " AND " . $filtre;
5003
+			$sql .= " AND ".$filtre;
5004 5004
 		}
5005 5005
 		$sql .= " ORDER BY name";
5006 5006
 
5007
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
5007
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
5008 5008
 		$result = $this->db->query($sql);
5009 5009
 		if ($result) {
5010 5010
 			$num = $this->db->num_rows($result);
5011 5011
 			$i = 0;
5012 5012
 			if ($num) {
5013
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5013
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5014 5014
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5015 5015
 					print '<option value="-1">&nbsp;</option>';
5016 5016
 				}
@@ -5018,13 +5018,13 @@  discard block
 block discarded – undo
5018 5018
 				while ($i < $num) {
5019 5019
 					$obj = $this->db->fetch_object($result);
5020 5020
 					if ($selected == $obj->rowid) {
5021
-						print '<option value="' . $obj->rowid . '" selected>';
5021
+						print '<option value="'.$obj->rowid.'" selected>';
5022 5022
 					} else {
5023
-						print '<option value="' . $obj->rowid . '">';
5023
+						print '<option value="'.$obj->rowid.'">';
5024 5024
 					}
5025 5025
 					print trim($obj->name);
5026 5026
 					if ($status == 2 && $obj->status == 1) {
5027
-						print ' (' . $langs->trans("Closed") . ')';
5027
+						print ' ('.$langs->trans("Closed").')';
5028 5028
 					}
5029 5029
 					print '</option>';
5030 5030
 					$i++;
@@ -5032,9 +5032,9 @@  discard block
 block discarded – undo
5032 5032
 				print "</select>";
5033 5033
 			} else {
5034 5034
 				if ($status == 0) {
5035
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5035
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5036 5036
 				} else {
5037
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5037
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5038 5038
 				}
5039 5039
 			}
5040 5040
 
@@ -5058,20 +5058,20 @@  discard block
 block discarded – undo
5058 5058
 	{
5059 5059
 		global $langs;
5060 5060
 		if ($htmlname != "none") {
5061
-			print '<form method="POST" action="' . $page . '">';
5061
+			print '<form method="POST" action="'.$page.'">';
5062 5062
 			print '<input type="hidden" name="action" value="setbankaccount">';
5063
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5063
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5064 5064
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5065 5065
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5066 5066
 			if ($nbaccountfound > 0) {
5067
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5067
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5068 5068
 			}
5069 5069
 			print '</form>';
5070 5070
 		} else {
5071 5071
 			$langs->load('banks');
5072 5072
 
5073 5073
 			if ($selected) {
5074
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5074
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5075 5075
 				$bankstatic = new Account($this->db);
5076 5076
 				$result = $bankstatic->fetch($selected);
5077 5077
 				if ($result) {
@@ -5109,19 +5109,19 @@  discard block
 block discarded – undo
5109 5109
 		global $conf, $langs;
5110 5110
 		$langs->load("categories");
5111 5111
 
5112
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5112
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5113 5113
 
5114 5114
 		// For backward compatibility
5115 5115
 		if (is_numeric($type)) {
5116
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5116
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5117 5117
 		}
5118 5118
 
5119 5119
 		if ($type === Categorie::TYPE_BANK_LINE) {
5120 5120
 			// TODO Move this into common category feature
5121 5121
 			$cate_arbo = array();
5122 5122
 			$sql = "SELECT c.label, c.rowid";
5123
-			$sql .= " FROM " . $this->db->prefix() . "bank_categ as c";
5124
-			$sql .= " WHERE entity = " . $conf->entity;
5123
+			$sql .= " FROM ".$this->db->prefix()."bank_categ as c";
5124
+			$sql .= " WHERE entity = ".$conf->entity;
5125 5125
 			$sql .= " ORDER BY c.label";
5126 5126
 			$result = $this->db->query($sql);
5127 5127
 			if ($result) {
@@ -5146,10 +5146,10 @@  discard block
 block discarded – undo
5146 5146
 		$outarray = array();
5147 5147
 		$outarrayrichhtml = array();
5148 5148
 
5149
-		$output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5149
+		$output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5150 5150
 		if (is_array($cate_arbo)) {
5151 5151
 			if (!count($cate_arbo)) {
5152
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5152
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5153 5153
 			} else {
5154 5154
 				$output .= '<option value="-1">&nbsp;</option>';
5155 5155
 				foreach ($cate_arbo as $key => $value) {
@@ -5159,15 +5159,15 @@  discard block
 block discarded – undo
5159 5159
 						$add = '';
5160 5160
 					}
5161 5161
 
5162
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5162
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5163 5163
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5164 5164
 
5165 5165
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5166 5166
 
5167 5167
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5168 5168
 
5169
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5170
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5169
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5170
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5171 5171
 					$output .= '>';
5172 5172
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5173 5173
 					$output .= '</option>';
@@ -5208,7 +5208,7 @@  discard block
 block discarded – undo
5208 5208
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5209 5209
 	{
5210 5210
 		// phpcs:enable
5211
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5211
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5212 5212
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5213 5213
 	}
5214 5214
 
@@ -5243,7 +5243,7 @@  discard block
 block discarded – undo
5243 5243
 	{
5244 5244
 		global $langs, $conf;
5245 5245
 
5246
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5246
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5247 5247
 		$formconfirm = '';
5248 5248
 		$inputok = array();
5249 5249
 		$inputko = array();
@@ -5267,27 +5267,27 @@  discard block
 block discarded – undo
5267 5267
 			foreach ($formquestion as $key => $input) {
5268 5268
 				if (is_array($input) && !empty($input)) {
5269 5269
 					if ($input['type'] == 'hidden') {
5270
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5271
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5270
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5271
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5272 5272
 
5273
-						$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";
5273
+						$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";
5274 5274
 					}
5275 5275
 				}
5276 5276
 			}
5277 5277
 
5278 5278
 			// Now add questions
5279 5279
 			$moreonecolumn = '';
5280
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5280
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5281 5281
 			foreach ($formquestion as $key => $input) {
5282 5282
 				if (is_array($input) && !empty($input)) {
5283
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5284
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5285
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5283
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5284
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5285
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5286 5286
 
5287 5287
 					if ($input['type'] == 'text') {
5288
-						$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";
5288
+						$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";
5289 5289
 					} elseif ($input['type'] == 'password') {
5290
-						$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";
5290
+						$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";
5291 5291
 					} elseif ($input['type'] == 'textarea') {
5292 5292
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5293 5293
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5295,8 +5295,8 @@  discard block
 block discarded – undo
5295 5295
 						$more .= '</textarea>';
5296 5296
 						$more .= '</div></div>'."\n";*/
5297 5297
 						$moreonecolumn .= '<div class="margintoponly">';
5298
-						$moreonecolumn .= $input['label'] . '<br>';
5299
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5298
+						$moreonecolumn .= $input['label'].'<br>';
5299
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5300 5300
 						$moreonecolumn .= $input['value'];
5301 5301
 						$moreonecolumn .= '</textarea>';
5302 5302
 						$moreonecolumn .= '</div>';
@@ -5313,20 +5313,20 @@  discard block
 block discarded – undo
5313 5313
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5314 5314
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5315 5315
 
5316
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5316
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5317 5317
 						if (!empty($input['label'])) {
5318
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5318
+							$more .= $input['label'].'</div><div class="tagtd left">';
5319 5319
 						}
5320 5320
 						if ($input['type'] == 'select') {
5321 5321
 							$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);
5322 5322
 						} else {
5323 5323
 							$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);
5324 5324
 						}
5325
-						$more .= '</div></div>' . "\n";
5325
+						$more .= '</div></div>'."\n";
5326 5326
 					} elseif ($input['type'] == 'checkbox') {
5327 5327
 						$more .= '<div class="tagtr">';
5328
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5329
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5328
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5329
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5330 5330
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5331 5331
 							$more .= ' checked';
5332 5332
 						}
@@ -5337,19 +5337,19 @@  discard block
 block discarded – undo
5337 5337
 							$more .= ' disabled';
5338 5338
 						}
5339 5339
 						$more .= ' /></div>';
5340
-						$more .= '</div>' . "\n";
5340
+						$more .= '</div>'."\n";
5341 5341
 					} elseif ($input['type'] == 'radio') {
5342 5342
 						$i = 0;
5343 5343
 						foreach ($input['values'] as $selkey => $selval) {
5344 5344
 							$more .= '<div class="tagtr">';
5345 5345
 							if (isset($input['label'])) {
5346 5346
 								if ($i == 0) {
5347
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5347
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5348 5348
 								} else {
5349
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5349
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5350 5350
 								}
5351 5351
 							}
5352
-							$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;
5352
+							$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;
5353 5353
 							if (!empty($input['disabled'])) {
5354 5354
 								$more .= ' disabled';
5355 5355
 							}
@@ -5357,12 +5357,12 @@  discard block
 block discarded – undo
5357 5357
 								$more .= ' checked="checked"';
5358 5358
 							}
5359 5359
 							$more .= ' /> ';
5360
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5361
-							$more .= '</div></div>' . "\n";
5360
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5361
+							$more .= '</div></div>'."\n";
5362 5362
 							$i++;
5363 5363
 						}
5364 5364
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5365
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5365
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5366 5366
 						$more .= '<div class="tagtd">';
5367 5367
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5368 5368
 						$h = $m = 0;
@@ -5380,24 +5380,24 @@  discard block
 block discarded – undo
5380 5380
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5381 5381
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5382 5382
 						if (!empty($input['label'])) {
5383
-							$more .= $input['label'] . '</div><div class="tagtd">';
5383
+							$more .= $input['label'].'</div><div class="tagtd">';
5384 5384
 						}
5385 5385
 						$more .= $input['value'];
5386
-						$more .= '</div></div>' . "\n";
5386
+						$more .= '</div></div>'."\n";
5387 5387
 					} elseif ($input['type'] == 'onecolumn') {
5388 5388
 						$moreonecolumn .= '<div class="margintoponly">';
5389 5389
 						$moreonecolumn .= $input['value'];
5390
-						$moreonecolumn .= '</div>' . "\n";
5390
+						$moreonecolumn .= '</div>'."\n";
5391 5391
 					} elseif ($input['type'] == 'hidden') {
5392 5392
 						// Do nothing more, already added by a previous loop
5393 5393
 					} elseif ($input['type'] == 'separator') {
5394 5394
 						$more .= '<br>';
5395 5395
 					} else {
5396
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5396
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5397 5397
 					}
5398 5398
 				}
5399 5399
 			}
5400
-			$more .= '</div>' . "\n";
5400
+			$more .= '</div>'."\n";
5401 5401
 			$more .= $moreonecolumn;
5402 5402
 		}
5403 5403
 
@@ -5419,10 +5419,10 @@  discard block
 block discarded – undo
5419 5419
 				$button = $useajax;
5420 5420
 				$useajax = 1;
5421 5421
 				$autoOpen = false;
5422
-				$dialogconfirm .= '-' . $button;
5422
+				$dialogconfirm .= '-'.$button;
5423 5423
 			}
5424
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5425
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5424
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5425
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5426 5426
 
5427 5427
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5428 5428
 			if (is_array($formquestion)) {
@@ -5444,24 +5444,24 @@  discard block
 block discarded – undo
5444 5444
 			}
5445 5445
 
5446 5446
 			// Show JQuery confirm box.
5447
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5447
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5448 5448
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5449
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5449
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5450 5450
 			}
5451 5451
 			if (!empty($more)) {
5452
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5452
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5453 5453
 			}
5454
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : '');
5455
-			$formconfirm .= '</div>' . "\n";
5454
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : '');
5455
+			$formconfirm .= '</div>'."\n";
5456 5456
 
5457
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5458
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5457
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5458
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5459 5459
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5460 5460
 			$formconfirm .= 'jQuery(document).ready(function() {
5461 5461
             $(function() {
5462
-            	$( "#' . $dialogconfirm . '" ).dialog(
5462
+            	$( "#' . $dialogconfirm.'" ).dialog(
5463 5463
             	{
5464
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5464
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5465 5465
 			if ($newselectedchoice == 'no') {
5466 5466
 				$formconfirm .= '
5467 5467
 						open: function() {
@@ -5471,24 +5471,24 @@  discard block
 block discarded – undo
5471 5471
 
5472 5472
 			$jsforcursor = '';
5473 5473
 			if ($useajax == 1) {
5474
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5475
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5474
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5475
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5476 5476
 			}
5477 5477
 
5478 5478
 			$postconfirmas = 'GET';
5479 5479
 
5480 5480
 			$formconfirm .= '
5481 5481
                     resizable: false,
5482
-                    height: "' . $height . '",
5483
-                    width: "' . $width . '",
5482
+                    height: "' . $height.'",
5483
+                    width: "' . $width.'",
5484 5484
                     modal: true,
5485 5485
                     closeOnEscape: false,
5486 5486
                     buttons: {
5487
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5488
-							var options = "token=' . urlencode(newToken()) . '";
5489
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5490
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5491
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5487
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5488
+							var options = "token=' . urlencode(newToken()).'";
5489
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5490
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5491
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5492 5492
 
5493 5493
                          	if (inputok.length > 0) {
5494 5494
                          		$.each(inputok, function(i, inputname) {
@@ -5522,11 +5522,11 @@  discard block
 block discarded – undo
5522 5522
 							}
5523 5523
 	                        $(this).dialog("close");
5524 5524
                         },
5525
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5526
-                        	var options = "token=' . urlencode(newToken()) . '";
5527
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5528
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5529
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5525
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5526
+                        	var options = "token=' . urlencode(newToken()).'";
5527
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5528
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5529
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5530 5530
                          	if (inputko.length > 0) {
5531 5531
                          		$.each(inputko, function(i, inputname) {
5532 5532
                          			var more = "";
@@ -5558,10 +5558,10 @@  discard block
 block discarded – undo
5558 5558
                 }
5559 5559
                 );
5560 5560
 
5561
-            	var button = "' . $button . '";
5561
+            	var button = "' . $button.'";
5562 5562
             	if (button.length > 0) {
5563 5563
                 	$( "#" + button ).click(function() {
5564
-                		$("#' . $dialogconfirm . '").dialog("open");
5564
+                		$("#' . $dialogconfirm.'").dialog("open");
5565 5565
         			});
5566 5566
                 }
5567 5567
             });
@@ -5569,44 +5569,44 @@  discard block
 block discarded – undo
5569 5569
             </script>';
5570 5570
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5571 5571
 		} else {
5572
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5572
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5573 5573
 
5574 5574
 			if (empty($disableformtag)) {
5575
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n";
5575
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
5576 5576
 			}
5577 5577
 
5578
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5579
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5578
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5579
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5580 5580
 
5581
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5581
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5582 5582
 
5583 5583
 			// Line title
5584 5584
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5585
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5586
-			$formconfirm .= '</td></tr>' . "\n";
5585
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5586
+			$formconfirm .= '</td></tr>'."\n";
5587 5587
 
5588 5588
 			// Line text
5589 5589
 			if (is_array($formquestion) && !empty($formquestion['text'])) {
5590
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5590
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5591 5591
 			}
5592 5592
 
5593 5593
 			// Line form fields
5594 5594
 			if ($more) {
5595
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5595
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5596 5596
 				$formconfirm .= $more;
5597
-				$formconfirm .= '</td></tr>' . "\n";
5597
+				$formconfirm .= '</td></tr>'."\n";
5598 5598
 			}
5599 5599
 
5600 5600
 			// Line with question
5601 5601
 			$formconfirm .= '<tr class="valid">';
5602
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5602
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5603 5603
 			$formconfirm .= '<td class="valid center">';
5604 5604
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5605
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5605
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5606 5606
 			$formconfirm .= '</td>';
5607
-			$formconfirm .= '</tr>' . "\n";
5607
+			$formconfirm .= '</tr>'."\n";
5608 5608
 
5609
-			$formconfirm .= '</table>' . "\n";
5609
+			$formconfirm .= '</table>'."\n";
5610 5610
 
5611 5611
 			if (empty($disableformtag)) {
5612 5612
 				$formconfirm .= "</form>\n";
@@ -5615,7 +5615,7 @@  discard block
 block discarded – undo
5615 5615
 
5616 5616
 			if (!empty($conf->use_javascript_ajax)) {
5617 5617
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5618
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5618
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5619 5619
 				$formconfirm .= '
5620 5620
 				$(document).ready(function () {
5621 5621
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5627,7 +5627,7 @@  discard block
 block discarded – undo
5627 5627
 					});
5628 5628
 				});
5629 5629
 				';
5630
-				$formconfirm .= '</script>' . "\n";
5630
+				$formconfirm .= '</script>'."\n";
5631 5631
 			}
5632 5632
 
5633 5633
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5659,8 +5659,8 @@  discard block
 block discarded – undo
5659 5659
 		// phpcs:enable
5660 5660
 		global $langs;
5661 5661
 
5662
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5663
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5662
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5663
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5664 5664
 
5665 5665
 		$out = '';
5666 5666
 
@@ -5668,11 +5668,11 @@  discard block
 block discarded – undo
5668 5668
 
5669 5669
 		$langs->load("project");
5670 5670
 		if ($htmlname != "none") {
5671
-			$out .= '<form method="post" action="' . $page . '">';
5671
+			$out .= '<form method="post" action="'.$page.'">';
5672 5672
 			$out .= '<input type="hidden" name="action" value="classin">';
5673
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5673
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5674 5674
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5675
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5675
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5676 5676
 			$out .= '</form>';
5677 5677
 		} else {
5678 5678
 			$out .= '<span class="project_head_block">';
@@ -5681,7 +5681,7 @@  discard block
 block discarded – undo
5681 5681
 				$projet->fetch($selected);
5682 5682
 				$out .= $projet->getNomUrl(0, '', 1);
5683 5683
 			} else {
5684
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5684
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5685 5685
 			}
5686 5686
 			$out .= '</span>';
5687 5687
 		}
@@ -5718,14 +5718,14 @@  discard block
 block discarded – undo
5718 5718
 		$out = '';
5719 5719
 
5720 5720
 		if ($htmlname != "none") {
5721
-			$out .= '<form method="POST" action="' . $page . '">';
5721
+			$out .= '<form method="POST" action="'.$page.'">';
5722 5722
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5723
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5723
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5724 5724
 			if ($type) {
5725
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5725
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5726 5726
 			}
5727 5727
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5728
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5728
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5729 5729
 			$out .= '</form>';
5730 5730
 		} else {
5731 5731
 			if ($selected) {
@@ -5770,12 +5770,12 @@  discard block
 block discarded – undo
5770 5770
 		// phpcs:enable
5771 5771
 		global $langs;
5772 5772
 		if ($htmlname != "none") {
5773
-			print '<form method="post" action="' . $page . '">';
5773
+			print '<form method="post" action="'.$page.'">';
5774 5774
 			print '<input type="hidden" name="action" value="setavailability">';
5775
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5775
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5776 5776
 			$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
5777
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5778
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
5777
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5778
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
5779 5779
 			print '</form>';
5780 5780
 		} else {
5781 5781
 			if ($selected) {
@@ -5801,11 +5801,11 @@  discard block
 block discarded – undo
5801 5801
 	{
5802 5802
 		global $langs;
5803 5803
 		if ($htmlname != "none") {
5804
-			print '<form method="post" action="' . $page . '">';
5804
+			print '<form method="post" action="'.$page.'">';
5805 5805
 			print '<input type="hidden" name="action" value="setdemandreason">';
5806
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5806
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5807 5807
 			$this->selectInputReason($selected, $htmlname, -1, $addempty);
5808
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5808
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5809 5809
 			print '</form>';
5810 5810
 		} else {
5811 5811
 			if ($selected) {
@@ -5845,17 +5845,17 @@  discard block
 block discarded – undo
5845 5845
 		$ret = '';
5846 5846
 
5847 5847
 		if ($htmlname != "none") {
5848
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5849
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
5850
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
5848
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5849
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
5850
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
5851 5851
 			if ($type) {
5852
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5852
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5853 5853
 			}
5854 5854
 			$ret .= '<table class="nobordernopadding">';
5855 5855
 			$ret .= '<tr><td>';
5856
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
5856
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
5857 5857
 			$ret .= '</td>';
5858
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
5858
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
5859 5859
 			$ret .= '</tr></table></form>';
5860 5860
 		} else {
5861 5861
 			if ($displayhour) {
@@ -5890,15 +5890,15 @@  discard block
 block discarded – undo
5890 5890
 		global $langs;
5891 5891
 
5892 5892
 		if ($htmlname != "none") {
5893
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5894
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
5895
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5893
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5894
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
5895
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5896 5896
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
5897
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5897
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5898 5898
 			print '</form>';
5899 5899
 		} else {
5900 5900
 			if ($selected) {
5901
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
5901
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
5902 5902
 				$theuser = new User($this->db);
5903 5903
 				$theuser->fetch($selected);
5904 5904
 				print $theuser->getNomUrl(1);
@@ -5931,14 +5931,14 @@  discard block
 block discarded – undo
5931 5931
 
5932 5932
 		$out = '';
5933 5933
 		if ($htmlname != "none") {
5934
-			$out .= '<form method="POST" action="' . $page . '">';
5934
+			$out .= '<form method="POST" action="'.$page.'">';
5935 5935
 			$out .= '<input type="hidden" name="action" value="setmode">';
5936
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5936
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5937 5937
 			if ($type) {
5938
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5938
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5939 5939
 			}
5940 5940
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
5941
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5941
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5942 5942
 			$out .= '</form>';
5943 5943
 		} else {
5944 5944
 			if ($selected) {
@@ -5971,11 +5971,11 @@  discard block
 block discarded – undo
5971 5971
 	{
5972 5972
 		global $langs;
5973 5973
 		if ($htmlname != "none") {
5974
-			print '<form method="POST" action="' . $page . '">';
5974
+			print '<form method="POST" action="'.$page.'">';
5975 5975
 			print '<input type="hidden" name="action" value="settransportmode">';
5976
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5976
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5977 5977
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
5978
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5978
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5979 5979
 			print '</form>';
5980 5980
 		} else {
5981 5981
 			if ($selected) {
@@ -6002,11 +6002,11 @@  discard block
 block discarded – undo
6002 6002
 		// phpcs:enable
6003 6003
 		global $langs;
6004 6004
 		if ($htmlname != "none") {
6005
-			print '<form method="POST" action="' . $page . '">';
6005
+			print '<form method="POST" action="'.$page.'">';
6006 6006
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
6007
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6007
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6008 6008
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
6009
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6009
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6010 6010
 			print '</form>';
6011 6011
 		} else {
6012 6012
 			dol_include_once('/core/lib/company.lib.php');
@@ -6031,21 +6031,21 @@  discard block
 block discarded – undo
6031 6031
 		global $langs, $mysoc, $conf;
6032 6032
 
6033 6033
 		if ($htmlname != "none") {
6034
-			print '<form method="POST" action="' . $page . '">';
6034
+			print '<form method="POST" action="'.$page.'">';
6035 6035
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6036
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6037
-			print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6036
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6037
+			print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6038 6038
 			print '<select name="calculation_mode">';
6039
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6040
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6039
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6040
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6041 6041
 			print '</select> ';
6042
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6042
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6043 6043
 			print '</form>';
6044 6044
 		} else {
6045 6045
 			if (!empty($rate)) {
6046 6046
 				print price($rate, 1, $langs, 0, 0);
6047 6047
 				if ($currency && $rate != 1) {
6048
-					print ' &nbsp; (' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')';
6048
+					print ' &nbsp; ('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')';
6049 6049
 				}
6050 6050
 			} else {
6051 6051
 				print 1;
@@ -6076,9 +6076,9 @@  discard block
 block discarded – undo
6076 6076
 		// phpcs:enable
6077 6077
 		global $conf, $langs;
6078 6078
 		if ($htmlname != "none") {
6079
-			print '<form method="post" action="' . $page . '">';
6079
+			print '<form method="post" action="'.$page.'">';
6080 6080
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6081
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6081
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6082 6082
 			print '<div class="inline-block">';
6083 6083
 			if (!empty($discount_type)) {
6084 6084
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6116,24 +6116,24 @@  discard block
 block discarded – undo
6116 6116
 			print '</div>';
6117 6117
 			if (empty($hidelist)) {
6118 6118
 				print '<div class="inline-block" style="padding-right: 10px">';
6119
-				$newfilter = 'discount_type=' . intval($discount_type);
6119
+				$newfilter = 'discount_type='.intval($discount_type);
6120 6120
 				if (!empty($discount_type)) {
6121 6121
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6122 6122
 				} else {
6123 6123
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6124 6124
 				}
6125 6125
 				if ($filter) {
6126
-					$newfilter .= ' AND (' . $filter . ')';
6126
+					$newfilter .= ' AND ('.$filter.')';
6127 6127
 				}
6128 6128
 				// output the combo of discounts
6129 6129
 				$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
6130 6130
 				if ($nbqualifiedlines > 0) {
6131
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6131
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6132 6132
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6133
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6133
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6134 6134
 					}
6135 6135
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6136
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6136
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6137 6137
 					}
6138 6138
 
6139 6139
 					print '>';
@@ -6173,23 +6173,23 @@  discard block
 block discarded – undo
6173 6173
 		global $langs, $conf;
6174 6174
 
6175 6175
 		if ($htmlname != "none") {
6176
-			print '<form method="post" action="' . $page . '">';
6176
+			print '<form method="post" action="'.$page.'">';
6177 6177
 			print '<input type="hidden" name="action" value="set_contact">';
6178
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6178
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6179 6179
 			print '<table class="nobordernopadding">';
6180 6180
 			print '<tr><td>';
6181 6181
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6182 6182
 			$num = $this->num;
6183 6183
 			if ($num == 0) {
6184 6184
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6185
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6185
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6186 6186
 			}
6187 6187
 			print '</td>';
6188
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6188
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6189 6189
 			print '</tr></table></form>';
6190 6190
 		} else {
6191 6191
 			if ($selected) {
6192
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6192
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6193 6193
 				$contact = new Contact($this->db);
6194 6194
 				$contact->fetch($selected);
6195 6195
 				print $contact->getFullName($langs);
@@ -6224,20 +6224,20 @@  discard block
 block discarded – undo
6224 6224
 
6225 6225
 		$out = '';
6226 6226
 		if ($htmlname != "none") {
6227
-			$out .= '<form method="post" action="' . $page . '">';
6227
+			$out .= '<form method="post" action="'.$page.'">';
6228 6228
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6229
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6229
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6230 6230
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6231
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6231
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6232 6232
 			$out .= '</form>';
6233 6233
 		} else {
6234 6234
 			if ($selected) {
6235
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6235
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6236 6236
 				$soc = new Societe($this->db);
6237 6237
 				$soc->fetch($selected);
6238 6238
 				$out .= $soc->getNomUrl(0, '');
6239 6239
 			} else {
6240
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6240
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6241 6241
 			}
6242 6242
 		}
6243 6243
 
@@ -6287,22 +6287,22 @@  discard block
 block discarded – undo
6287 6287
 			$selected = 'EUR'; // Pour compatibilite
6288 6288
 		}
6289 6289
 
6290
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6290
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6291 6291
 		if ($useempty) {
6292 6292
 			$out .= '<option value="-1" selected></option>';
6293 6293
 		}
6294 6294
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6295 6295
 			$labeltoshow = $currency['label'];
6296 6296
 			if ($mode == 1) {
6297
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6297
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6298 6298
 			} else {
6299
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6299
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6300 6300
 			}
6301 6301
 
6302 6302
 			if ($selected && $selected == $code_iso) {
6303
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6303
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6304 6304
 			} else {
6305
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6305
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6306 6306
 			}
6307 6307
 			$out .= $labeltoshow;
6308 6308
 			$out .= '</option>';
@@ -6313,7 +6313,7 @@  discard block
 block discarded – undo
6313 6313
 		}
6314 6314
 
6315 6315
 		// Make select dynamic
6316
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6316
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6317 6317
 		$out .= ajax_combobox($htmlname);
6318 6318
 
6319 6319
 		return $out;
@@ -6339,10 +6339,10 @@  discard block
 block discarded – undo
6339 6339
 
6340 6340
 		$TCurrency = array();
6341 6341
 
6342
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6343
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6342
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6343
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6344 6344
 		if ($filter) {
6345
-			$sql .= " AND " . $filter;
6345
+			$sql .= " AND ".$filter;
6346 6346
 		}
6347 6347
 		$resql = $this->db->query($sql);
6348 6348
 		if ($resql) {
@@ -6352,7 +6352,7 @@  discard block
 block discarded – undo
6352 6352
 		}
6353 6353
 
6354 6354
 		$out = '';
6355
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6355
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6356 6356
 		if ($useempty) {
6357 6357
 			$out .= '<option value="">&nbsp;</option>';
6358 6358
 		}
@@ -6364,13 +6364,13 @@  discard block
 block discarded – undo
6364 6364
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6365 6365
 				if (isset($TCurrency[$code_iso])) {
6366 6366
 					if (!empty($selected) && $selected == $code_iso) {
6367
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6367
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6368 6368
 					} else {
6369
-						$out .= '<option value="' . $code_iso . '">';
6369
+						$out .= '<option value="'.$code_iso.'">';
6370 6370
 					}
6371 6371
 
6372 6372
 					$out .= $currency['label'];
6373
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6373
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6374 6374
 					$out .= '</option>';
6375 6375
 				}
6376 6376
 			}
@@ -6379,7 +6379,7 @@  discard block
 block discarded – undo
6379 6379
 		$out .= '</select>';
6380 6380
 
6381 6381
 		// Make select dynamic
6382
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6382
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6383 6383
 		$out .= ajax_combobox($htmlname);
6384 6384
 
6385 6385
 		return $out;
@@ -6410,7 +6410,7 @@  discard block
 block discarded – undo
6410 6410
 		$sql .= " WHERE t.fk_pays = c.rowid";
6411 6411
 		$sql .= " AND t.active > 0";
6412 6412
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6413
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6413
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6414 6414
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6415 6415
 
6416 6416
 		$resql = $this->db->query($sql);
@@ -6422,30 +6422,30 @@  discard block
 block discarded – undo
6422 6422
 
6423 6423
 					$tmparray = array();
6424 6424
 					$tmparray['rowid']			= $obj->rowid;
6425
-					$tmparray['type_vat']		= $obj->type_vat;
6426
-					$tmparray['code']			= $obj->code;
6425
+					$tmparray['type_vat'] = $obj->type_vat;
6426
+					$tmparray['code'] = $obj->code;
6427 6427
 					$tmparray['txtva']			= $obj->taux;
6428
-					$tmparray['nprtva']			= $obj->recuperableonly;
6428
+					$tmparray['nprtva'] = $obj->recuperableonly;
6429 6429
 					$tmparray['localtax1']	    = $obj->localtax1;
6430 6430
 					$tmparray['localtax1_type']	= $obj->localtax1_type;
6431 6431
 					$tmparray['localtax2']	    = $obj->localtax2;
6432 6432
 					$tmparray['localtax2_type']	= $obj->localtax1_type;
6433
-					$tmparray['label']			= $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6434
-					$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
6433
+					$tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6434
+					$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
6435 6435
 					$positiverates = '';
6436 6436
 					if ($obj->taux) {
6437
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6437
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6438 6438
 					}
6439 6439
 					if ($obj->localtax1) {
6440
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6440
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6441 6441
 					}
6442 6442
 					if ($obj->localtax2) {
6443
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6443
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6444 6444
 					}
6445 6445
 					if (empty($positiverates)) {
6446 6446
 						$positiverates = '0';
6447 6447
 					}
6448
-					$tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6448
+					$tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6449 6449
 
6450 6450
 					$this->cache_vatrates[$obj->rowid] = $tmparray;
6451 6451
 				}
@@ -6465,7 +6465,7 @@  discard block
 block discarded – undo
6465 6465
 				return -1;
6466 6466
 			}
6467 6467
 		} else {
6468
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6468
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6469 6469
 			return -2;
6470 6470
 		}
6471 6471
 	}
@@ -6518,9 +6518,9 @@  discard block
 block discarded – undo
6518 6518
 		// Check parameters
6519 6519
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6520 6520
 			if ($societe_vendeuse->id == $mysoc->id) {
6521
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6521
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6522 6522
 			} else {
6523
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6523
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6524 6524
 			}
6525 6525
 			return $return;
6526 6526
 		}
@@ -6532,12 +6532,12 @@  discard block
 block discarded – undo
6532 6532
 		// Define list of countries to use to search VAT rates to show
6533 6533
 		// First we defined code_country to use to find list
6534 6534
 		if (is_object($societe_vendeuse)) {
6535
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6535
+			$code_country = "'".$societe_vendeuse->country_code."'";
6536 6536
 		} else {
6537
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6537
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6538 6538
 		}
6539 6539
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6540
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6540
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6541 6541
 			// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
6542 6542
 			// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
6543 6543
 			$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
@@ -6547,27 +6547,27 @@  discard block
 block discarded – undo
6547 6547
 					if ($type == 1) { // We know product is a service
6548 6548
 						switch ($selectVatComboMode) {
6549 6549
 							case '1':
6550
-								$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6550
+								$code_country .= ",'".$societe_acheteuse->country_code."'";
6551 6551
 								break;
6552 6552
 							case '2':
6553
-								$code_country = "'" . $societe_acheteuse->country_code . "'";
6553
+								$code_country = "'".$societe_acheteuse->country_code."'";
6554 6554
 								break;
6555 6555
 						}
6556 6556
 					}
6557 6557
 				} elseif (!$idprod) {  // We don't know type of product
6558 6558
 					switch ($selectVatComboMode) {
6559 6559
 						case '1':
6560
-							$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6560
+							$code_country .= ",'".$societe_acheteuse->country_code."'";
6561 6561
 							break;
6562 6562
 						case '2':
6563
-							$code_country = "'" . $societe_acheteuse->country_code . "'";
6563
+							$code_country = "'".$societe_acheteuse->country_code."'";
6564 6564
 							break;
6565 6565
 					}
6566 6566
 				} else {
6567 6567
 					$prodstatic = new Product($this->db);
6568 6568
 					$prodstatic->fetch($idprod);
6569 6569
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6570
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6570
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6571 6571
 					}
6572 6572
 				}
6573 6573
 			}
@@ -6629,13 +6629,13 @@  discard block
 block discarded – undo
6629 6629
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6630 6630
 				// of using supplier invoices (this is a very bad idea !)
6631 6631
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
6632
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6632
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6633 6633
 					$disabled = true;
6634 6634
 				}
6635 6635
 			}
6636 6636
 
6637 6637
 			if (!$options_only) {
6638
-				$return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6638
+				$return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6639 6639
 			}
6640 6640
 
6641 6641
 			$selectedfound = false;
@@ -6649,13 +6649,13 @@  discard block
 block discarded – undo
6649 6649
 				$key = $rate['txtva'];
6650 6650
 				$key .= $rate['nprtva'] ? '*' : '';
6651 6651
 				if ($mode > 0 && $rate['code']) {
6652
-					$key .= ' (' . $rate['code'] . ')';
6652
+					$key .= ' ('.$rate['code'].')';
6653 6653
 				}
6654 6654
 				if ($mode < 0) {
6655 6655
 					$key = $rate['rowid'];
6656 6656
 				}
6657 6657
 
6658
-				$return .= '<option value="' . $key . '"';
6658
+				$return .= '<option value="'.$key.'"';
6659 6659
 				if (!$selectedfound) {
6660 6660
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6661 6661
 						if ($defaultcode == $rate['code']) {
@@ -6726,7 +6726,7 @@  discard block
 block discarded – undo
6726 6726
 	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 = '')
6727 6727
 	{
6728 6728
 		// phpcs:enable
6729
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6729
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6730 6730
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
6731 6731
 		if (!empty($nooutput)) {
6732 6732
 			return $retstring;
@@ -6755,11 +6755,11 @@  discard block
 block discarded – undo
6755 6755
 	{
6756 6756
 		global $langs;
6757 6757
 
6758
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6758
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6759 6759
 		if ($forcenewline) {
6760 6760
 			$ret .= '<br>';
6761 6761
 		}
6762
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6762
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6763 6763
 		return $ret;
6764 6764
 	}
6765 6765
 
@@ -6825,7 +6825,7 @@  discard block
 block discarded – undo
6825 6825
 		$orig_set_time = $set_time;
6826 6826
 
6827 6827
 		if ($set_time === '' && $emptydate == 0) {
6828
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
6828
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
6829 6829
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
6830 6830
 				$set_time = dol_now($gm);
6831 6831
 			} else {
@@ -6897,38 +6897,38 @@  discard block
 block discarded – undo
6897 6897
 				// Calendrier popup version eldy
6898 6898
 				if ($usecalendar == "eldy") {
6899 6899
 					// Input area to enter date manually
6900
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
6900
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6901 6901
 					$retstring .= ($disabled ? ' disabled' : '');
6902
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6902
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6903 6903
 					$retstring .= ' autocomplete="off">';
6904 6904
 
6905 6905
 					// Icon calendar
6906 6906
 					$retstringbuttom = '';
6907 6907
 					if (!$disabled) {
6908
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
6909
-						$base = DOL_URL_ROOT . '/core/';
6910
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
6911
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
6908
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
6909
+						$base = DOL_URL_ROOT.'/core/';
6910
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
6911
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
6912 6912
 					} else {
6913
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6913
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6914 6914
 					}
6915
-					$retstring = $retstringbuttom . $retstring;
6915
+					$retstring = $retstringbuttom.$retstring;
6916 6916
 
6917
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6918
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6919
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6917
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6918
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6919
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6920 6920
 				} elseif ($usecalendar == 'jquery' || $usecalendar == 'html') {
6921 6921
 					if (!$disabled && $usecalendar != 'html') {
6922 6922
 						// Output javascript for datepicker
6923 6923
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100));
6924 6924
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100));
6925 6925
 
6926
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
6927
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
6928
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
6926
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
6927
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
6928
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
6929 6929
 							autoclose: true,
6930 6930
 							todayHighlight: true,
6931
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
6931
+							yearRange: '" . $minYear.":".$maxYear."',";
6932 6932
 						if (!empty($conf->dol_use_jmobile)) {
6933 6933
 							$retstring .= "
6934 6934
 								beforeShow: function (input, datePicker) {
@@ -6943,7 +6943,7 @@  discard block
 block discarded – undo
6943 6943
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
6944 6944
 							$retstring .= "
6945 6945
 								showOn: 'button',	/* both has problem with autocompletion */
6946
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
6946
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
6947 6947
 								buttonImageOnly: true";
6948 6948
 						}
6949 6949
 						$retstring .= "
@@ -6955,46 +6955,46 @@  discard block
 block discarded – undo
6955 6955
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
6956 6956
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6957 6957
 					$retstring .= ($disabled ? ' disabled' : '');
6958
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
6959
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6958
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
6959
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6960 6960
 					$retstring .= ' autocomplete="off">';
6961 6961
 
6962 6962
 					// Icone calendrier
6963 6963
 					if ($disabled) {
6964
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6965
-						$retstring = $retstringbutton . $retstring;
6964
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6965
+						$retstring = $retstringbutton.$retstring;
6966 6966
 					}
6967 6967
 
6968 6968
 					$retstring .= '</div>';
6969
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6970
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6971
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6969
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6970
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6971
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6972 6972
 				} else {
6973 6973
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
6974 6974
 				}
6975 6975
 			} else {
6976 6976
 				// Show date with combo selects
6977 6977
 				// Day
6978
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
6978
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
6979 6979
 
6980 6980
 				if ($emptydate || $set_time == -1) {
6981 6981
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6982 6982
 				}
6983 6983
 
6984 6984
 				for ($day = 1; $day <= 31; $day++) {
6985
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
6985
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
6986 6986
 				}
6987 6987
 
6988 6988
 				$retstring .= "</select>";
6989 6989
 
6990
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
6990
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
6991 6991
 				if ($emptydate || $set_time == -1) {
6992 6992
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
6993 6993
 				}
6994 6994
 
6995 6995
 				// Month
6996 6996
 				for ($month = 1; $month <= 12; $month++) {
6997
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
6997
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
6998 6998
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
6999 6999
 					$retstring .= "</option>";
7000 7000
 				}
@@ -7002,12 +7002,12 @@  discard block
 block discarded – undo
7002 7002
 
7003 7003
 				// Year
7004 7004
 				if ($emptydate || $set_time == -1) {
7005
-					$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 . '">';
7005
+					$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.'">';
7006 7006
 				} else {
7007
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
7007
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
7008 7008
 
7009 7009
 					for ($year = $syear - 10; $year < $syear + 10; $year++) {
7010
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
7010
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
7011 7011
 					}
7012 7012
 					$retstring .= "</select>\n";
7013 7013
 				}
@@ -7031,15 +7031,15 @@  discard block
 block discarded – undo
7031 7031
 				}
7032 7032
 			}
7033 7033
 			// Show hour
7034
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
7034
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
7035 7035
 			if ($emptyhours) {
7036 7036
 				$retstring .= '<option value="-1">&nbsp;</option>';
7037 7037
 			}
7038 7038
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
7039 7039
 				if (strlen($hour) < 2) {
7040
-					$hour = "0" . $hour;
7040
+					$hour = "0".$hour;
7041 7041
 				}
7042
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7042
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7043 7043
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7044 7044
 				$retstring .= '</option>';
7045 7045
 			}
@@ -7052,19 +7052,19 @@  discard block
 block discarded – undo
7052 7052
 
7053 7053
 		if ($m) {
7054 7054
 			// Show minutes
7055
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7055
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7056 7056
 			if ($emptyhours) {
7057 7057
 				$retstring .= '<option value="-1">&nbsp;</option>';
7058 7058
 			}
7059 7059
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7060 7060
 				if (strlen($min) < 2) {
7061
-					$min = "0" . $min;
7061
+					$min = "0".$min;
7062 7062
 				}
7063
-				$retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>';
7063
+				$retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>';
7064 7064
 			}
7065 7065
 			$retstring .= '</select>';
7066 7066
 
7067
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7067
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7068 7068
 		}
7069 7069
 
7070 7070
 		if ($d && $h) {
@@ -7087,10 +7087,10 @@  discard block
 block discarded – undo
7087 7087
 
7088 7088
 			// Generate the date part, depending on the use or not of the javascript calendar
7089 7089
 			if ($addnowlink == 1) { // server time expressed in user time setup
7090
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7091
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7092
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7093
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7090
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7091
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7092
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7093
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7094 7094
 			} elseif ($addnowlink == 2) {
7095 7095
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7096 7096
 				 * This break application for foreign languages.
@@ -7099,10 +7099,10 @@  discard block
 block discarded – undo
7099 7099
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7100 7100
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7101 7101
 				*/
7102
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7103
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7104
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7105
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7102
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7103
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7104
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7105
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7106 7106
 			}
7107 7107
 			/*if ($usecalendar == "eldy")
7108 7108
 			{
@@ -7122,11 +7122,11 @@  discard block
 block discarded – undo
7122 7122
 				}
7123 7123
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7124 7124
 				if ($addnowlink == 1) {
7125
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7126
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7125
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7126
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7127 7127
 				} elseif ($addnowlink == 2) {
7128
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7129
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7128
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7129
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7130 7130
 				}
7131 7131
 
7132 7132
 				if ($fullday) {
@@ -7140,11 +7140,11 @@  discard block
 block discarded – undo
7140 7140
 				}
7141 7141
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7142 7142
 				if ($addnowlink == 1) {
7143
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7144
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7143
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7144
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7145 7145
 				} elseif ($addnowlink == 2) {
7146
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7147
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7146
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7147
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7148 7148
 				}
7149 7149
 				if ($fullday) {
7150 7150
 					$reset_scripts .= ' } ';
@@ -7152,7 +7152,7 @@  discard block
 block discarded – undo
7152 7152
 			}
7153 7153
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7154 7154
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7155
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7155
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7156 7156
 				$retstring .= $langs->trans("Now");
7157 7157
 				$retstring .= '</button> ';
7158 7158
 			}
@@ -7164,16 +7164,16 @@  discard block
 block discarded – undo
7164 7164
 			$reset_scripts = "";
7165 7165
 
7166 7166
 			// Generate the date part, depending on the use or not of the javascript calendar
7167
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7168
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7169
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7170
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7167
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7168
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7169
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7170
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7171 7171
 			// Update the hour part
7172 7172
 			if ($h) {
7173 7173
 				if ($fullday) {
7174 7174
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7175 7175
 				}
7176
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7176
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7177 7177
 				if ($fullday) {
7178 7178
 					$reset_scripts .= ' } ';
7179 7179
 				}
@@ -7183,14 +7183,14 @@  discard block
 block discarded – undo
7183 7183
 				if ($fullday) {
7184 7184
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7185 7185
 				}
7186
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7186
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7187 7187
 				if ($fullday) {
7188 7188
 					$reset_scripts .= ' } ';
7189 7189
 				}
7190 7190
 			}
7191 7191
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7192 7192
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7193
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7193
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7194 7194
 				$retstring .= $langs->trans("DateStartPlusOne");
7195 7195
 				$retstring .= '</button> ';
7196 7196
 			}
@@ -7248,17 +7248,17 @@  discard block
 block discarded – undo
7248 7248
 			unset($TDurationTypes[$value]);
7249 7249
 		}
7250 7250
 
7251
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7251
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7252 7252
 		foreach ($TDurationTypes as $key => $typeduration) {
7253
-			$retstring .= '<option value="' . $key . '"';
7253
+			$retstring .= '<option value="'.$key.'"';
7254 7254
 			if ($key == $selected) {
7255 7255
 				$retstring .= " selected";
7256 7256
 			}
7257
-			$retstring .= ">" . $typeduration . "</option>";
7257
+			$retstring .= ">".$typeduration."</option>";
7258 7258
 		}
7259 7259
 		$retstring .= "</select>";
7260 7260
 
7261
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7261
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7262 7262
 
7263 7263
 		return $retstring;
7264 7264
 	}
@@ -7290,30 +7290,30 @@  discard block
 block discarded – undo
7290 7290
 
7291 7291
 		// Hours
7292 7292
 		if ($iSecond != '') {
7293
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7293
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7294 7294
 
7295 7295
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7296 7296
 			$minSelected = convertSecondToTime($iSecond, 'min');
7297 7297
 		}
7298 7298
 
7299 7299
 		if ($typehour == 'select') {
7300
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7300
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7301 7301
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7302
-				$retstring .= '<option value="' . $hour . '"';
7302
+				$retstring .= '<option value="'.$hour.'"';
7303 7303
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7304 7304
 					$retstring .= " selected";
7305 7305
 				}
7306
-				$retstring .= ">" . $hour . "</option>";
7306
+				$retstring .= ">".$hour."</option>";
7307 7307
 			}
7308 7308
 			$retstring .= "</select>";
7309 7309
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7310
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7310
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7311 7311
 		} else {
7312 7312
 			return 'BadValueForParameterTypeHour';
7313 7313
 		}
7314 7314
 
7315 7315
 		if ($typehour != 'text') {
7316
-			$retstring .= ' ' . $langs->trans('HourShort');
7316
+			$retstring .= ' '.$langs->trans('HourShort');
7317 7317
 		} else {
7318 7318
 			$retstring .= '<span class="">:</span>';
7319 7319
 		}
@@ -7328,21 +7328,21 @@  discard block
 block discarded – undo
7328 7328
 		}
7329 7329
 
7330 7330
 		if ($typehour == 'select' || $typehour == 'textselect') {
7331
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7331
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7332 7332
 			for ($min = 0; $min <= 55; $min = $min + 5) {
7333
-				$retstring .= '<option value="' . $min . '"';
7333
+				$retstring .= '<option value="'.$min.'"';
7334 7334
 				if (is_numeric($minSelected) && $minSelected == $min) {
7335 7335
 					$retstring .= ' selected';
7336 7336
 				}
7337
-				$retstring .= '>' . $min . '</option>';
7337
+				$retstring .= '>'.$min.'</option>';
7338 7338
 			}
7339 7339
 			$retstring .= "</select>";
7340 7340
 		} elseif ($typehour == 'text') {
7341
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7341
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7342 7342
 		}
7343 7343
 
7344 7344
 		if ($typehour != 'text') {
7345
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7345
+			$retstring .= ' '.$langs->trans('MinuteShort');
7346 7346
 		}
7347 7347
 
7348 7348
 		$retstring .= "</span>";
@@ -7390,7 +7390,7 @@  discard block
 block discarded – undo
7390 7390
 			$placeholder = '';
7391 7391
 
7392 7392
 			if ($selected && empty($selected_input_value)) {
7393
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7393
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7394 7394
 				$tickettmpselect = new Ticket($this->db);
7395 7395
 				$tickettmpselect->fetch($selected);
7396 7396
 				$selected_input_value = $tickettmpselect->ref;
@@ -7398,17 +7398,17 @@  discard block
 block discarded – undo
7398 7398
 			}
7399 7399
 
7400 7400
 			$urloption = '';
7401
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7401
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7402 7402
 
7403 7403
 			if (empty($hidelabel)) {
7404
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7404
+				$out .= $langs->trans("RefOrLabel").' : ';
7405 7405
 			} elseif ($hidelabel > 1) {
7406
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7406
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7407 7407
 				if ($hidelabel == 2) {
7408 7408
 					$out .= img_picto($langs->trans("Search"), 'search');
7409 7409
 				}
7410 7410
 			}
7411
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7411
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7412 7412
 			if ($hidelabel == 3) {
7413 7413
 				$out .= img_picto($langs->trans("Search"), 'search');
7414 7414
 			}
@@ -7452,8 +7452,8 @@  discard block
 block discarded – undo
7452 7452
 
7453 7453
 		$sql = "SELECT ";
7454 7454
 		$sql .= $selectFields;
7455
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7456
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7455
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7456
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7457 7457
 
7458 7458
 		// Add criteria on ref/label
7459 7459
 		if ($filterkey != '') {
@@ -7469,7 +7469,7 @@  discard block
 block discarded – undo
7469 7469
 				if ($i > 0) {
7470 7470
 					$sql .= " AND ";
7471 7471
 				}
7472
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7472
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7473 7473
 				$sql .= ")";
7474 7474
 				$i++;
7475 7475
 			}
@@ -7482,22 +7482,22 @@  discard block
 block discarded – undo
7482 7482
 		$sql .= $this->db->plimit($limit, 0);
7483 7483
 
7484 7484
 		// Build output string
7485
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7485
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7486 7486
 		$result = $this->db->query($sql);
7487 7487
 		if ($result) {
7488
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7489
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7488
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7489
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7490 7490
 
7491 7491
 			$num = $this->db->num_rows($result);
7492 7492
 
7493 7493
 			$events = null;
7494 7494
 
7495 7495
 			if (!$forcecombo) {
7496
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7496
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7497 7497
 				$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT);
7498 7498
 			}
7499 7499
 
7500
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7500
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7501 7501
 
7502 7502
 			$textifempty = '';
7503 7503
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7514,7 +7514,7 @@  discard block
 block discarded – undo
7514 7514
 				}
7515 7515
 			}
7516 7516
 			if ($showempty) {
7517
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7517
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7518 7518
 			}
7519 7519
 
7520 7520
 			$i = 0;
@@ -7569,13 +7569,13 @@  discard block
 block discarded – undo
7569 7569
 		$outref = $objp->ref;
7570 7570
 		$outtype = $objp->fk_product_type;
7571 7571
 
7572
-		$opt = '<option value="' . $objp->rowid . '"';
7572
+		$opt = '<option value="'.$objp->rowid.'"';
7573 7573
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7574 7574
 		$opt .= '>';
7575 7575
 		$opt .= $objp->ref;
7576 7576
 		$objRef = $objp->ref;
7577 7577
 		if (!empty($filterkey) && $filterkey != '') {
7578
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7578
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7579 7579
 		}
7580 7580
 
7581 7581
 		$opt .= "</option>\n";
@@ -7616,7 +7616,7 @@  discard block
 block discarded – undo
7616 7616
 			$placeholder = '';
7617 7617
 
7618 7618
 			if ($selected && empty($selected_input_value)) {
7619
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7619
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7620 7620
 				$projecttmpselect = new Project($this->db);
7621 7621
 				$projecttmpselect->fetch($selected);
7622 7622
 				$selected_input_value = $projecttmpselect->ref;
@@ -7624,17 +7624,17 @@  discard block
 block discarded – undo
7624 7624
 			}
7625 7625
 
7626 7626
 			$urloption = '';
7627
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7627
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7628 7628
 
7629 7629
 			if (empty($hidelabel)) {
7630
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7630
+				$out .= $langs->trans("RefOrLabel").' : ';
7631 7631
 			} elseif ($hidelabel > 1) {
7632
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7632
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7633 7633
 				if ($hidelabel == 2) {
7634 7634
 					$out .= img_picto($langs->trans("Search"), 'search');
7635 7635
 				}
7636 7636
 			}
7637
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7637
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7638 7638
 			if ($hidelabel == 3) {
7639 7639
 				$out .= img_picto($langs->trans("Search"), 'search');
7640 7640
 			}
@@ -7677,8 +7677,8 @@  discard block
 block discarded – undo
7677 7677
 
7678 7678
 		$sql = "SELECT ";
7679 7679
 		$sql .= $selectFields;
7680
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7681
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7680
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7681
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7682 7682
 
7683 7683
 		// Add criteria on ref/label
7684 7684
 		if ($filterkey != '') {
@@ -7694,7 +7694,7 @@  discard block
 block discarded – undo
7694 7694
 				if ($i > 0) {
7695 7695
 					$sql .= " AND ";
7696 7696
 				}
7697
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7697
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7698 7698
 				$sql .= "";
7699 7699
 				$i++;
7700 7700
 			}
@@ -7707,22 +7707,22 @@  discard block
 block discarded – undo
7707 7707
 		$sql .= $this->db->plimit($limit, 0);
7708 7708
 
7709 7709
 		// Build output string
7710
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7710
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7711 7711
 		$result = $this->db->query($sql);
7712 7712
 		if ($result) {
7713
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7714
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7713
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7714
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7715 7715
 
7716 7716
 			$num = $this->db->num_rows($result);
7717 7717
 
7718 7718
 			$events = null;
7719 7719
 
7720 7720
 			if (!$forcecombo) {
7721
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7721
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7722 7722
 				$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
7723 7723
 			}
7724 7724
 
7725
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7725
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7726 7726
 
7727 7727
 			$textifempty = '';
7728 7728
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7739,7 +7739,7 @@  discard block
 block discarded – undo
7739 7739
 				}
7740 7740
 			}
7741 7741
 			if ($showempty) {
7742
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7742
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7743 7743
 			}
7744 7744
 
7745 7745
 			$i = 0;
@@ -7797,13 +7797,13 @@  discard block
 block discarded – undo
7797 7797
 		$outlabel = $objp->label;
7798 7798
 		$outtype = $objp->fk_product_type;
7799 7799
 
7800
-		$opt = '<option value="' . $objp->rowid . '"';
7800
+		$opt = '<option value="'.$objp->rowid.'"';
7801 7801
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7802 7802
 		$opt .= '>';
7803 7803
 		$opt .= $objp->ref;
7804 7804
 		$objRef = $objp->ref;
7805 7805
 		if (!empty($filterkey) && $filterkey != '') {
7806
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7806
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7807 7807
 		}
7808 7808
 
7809 7809
 		$opt .= "</option>\n";
@@ -7846,7 +7846,7 @@  discard block
 block discarded – undo
7846 7846
 			$urloption = '';
7847 7847
 
7848 7848
 			if ($selected && empty($selected_input_value)) {
7849
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7849
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7850 7850
 				$adherenttmpselect = new Adherent($this->db);
7851 7851
 				$adherenttmpselect->fetch($selected);
7852 7852
 				$selected_input_value = $adherenttmpselect->ref;
@@ -7855,17 +7855,17 @@  discard block
 block discarded – undo
7855 7855
 
7856 7856
 			$urloption = '';
7857 7857
 
7858
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7858
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7859 7859
 
7860 7860
 			if (empty($hidelabel)) {
7861
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7861
+				$out .= $langs->trans("RefOrLabel").' : ';
7862 7862
 			} elseif ($hidelabel > 1) {
7863
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7863
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7864 7864
 				if ($hidelabel == 2) {
7865 7865
 					$out .= img_picto($langs->trans("Search"), 'search');
7866 7866
 				}
7867 7867
 			}
7868
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7868
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7869 7869
 			if ($hidelabel == 3) {
7870 7870
 				$out .= img_picto($langs->trans("Search"), 'search');
7871 7871
 			}
@@ -7910,8 +7910,8 @@  discard block
 block discarded – undo
7910 7910
 
7911 7911
 		$sql = "SELECT ";
7912 7912
 		$sql .= $selectFields;
7913
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
7914
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
7913
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
7914
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
7915 7915
 
7916 7916
 		// Add criteria on ref/label
7917 7917
 		if ($filterkey != '') {
@@ -7927,8 +7927,8 @@  discard block
 block discarded – undo
7927 7927
 				if ($i > 0) {
7928 7928
 					$sql .= " AND ";
7929 7929
 				}
7930
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7931
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
7930
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
7931
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
7932 7932
 				$i++;
7933 7933
 			}
7934 7934
 			if (count($search_crit) > 1) {
@@ -7937,27 +7937,27 @@  discard block
 block discarded – undo
7937 7937
 			$sql .= ')';
7938 7938
 		}
7939 7939
 		if ($status != -1) {
7940
-			$sql .= ' AND statut = ' . ((int) $status);
7940
+			$sql .= ' AND statut = '.((int) $status);
7941 7941
 		}
7942 7942
 		$sql .= $this->db->plimit($limit, 0);
7943 7943
 
7944 7944
 		// Build output string
7945
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
7945
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
7946 7946
 		$result = $this->db->query($sql);
7947 7947
 		if ($result) {
7948
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7949
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
7948
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7949
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
7950 7950
 
7951 7951
 			$num = $this->db->num_rows($result);
7952 7952
 
7953 7953
 			$events = null;
7954 7954
 
7955 7955
 			if (!$forcecombo) {
7956
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7956
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7957 7957
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
7958 7958
 			}
7959 7959
 
7960
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7960
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7961 7961
 
7962 7962
 			$textifempty = '';
7963 7963
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7974,7 +7974,7 @@  discard block
 block discarded – undo
7974 7974
 				}
7975 7975
 			}
7976 7976
 			if ($showempty) {
7977
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
7977
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
7978 7978
 			}
7979 7979
 
7980 7980
 			$i = 0;
@@ -8030,11 +8030,11 @@  discard block
 block discarded – undo
8030 8030
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
8031 8031
 		$outtype = $objp->fk_adherent_type;
8032 8032
 
8033
-		$opt = '<option value="' . $objp->rowid . '"';
8033
+		$opt = '<option value="'.$objp->rowid.'"';
8034 8034
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8035 8035
 		$opt .= '>';
8036 8036
 		if (!empty($filterkey) && $filterkey != '') {
8037
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
8037
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
8038 8038
 		}
8039 8039
 		$opt .= $outlabel;
8040 8040
 		$opt .= "</option>\n";
@@ -8107,9 +8107,9 @@  discard block
 block discarded – undo
8107 8107
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8108 8108
 			$reg = array();
8109 8109
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8110
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8110
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8111 8111
 			}
8112
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8112
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8113 8113
 
8114 8114
 			$classname = $InfoFieldList[0];
8115 8115
 			$classpath = $InfoFieldList[1];
@@ -8140,8 +8140,8 @@  discard block
 block discarded – undo
8140 8140
 		);
8141 8141
 
8142 8142
 		if (!is_object($objecttmp)) {
8143
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield, LOG_WARNING);
8144
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield;
8143
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield, LOG_WARNING);
8144
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield;
8145 8145
 		}
8146 8146
 
8147 8147
 		//var_dump($filter);
@@ -8152,9 +8152,9 @@  discard block
 block discarded – undo
8152 8152
 		if ($prefixforautocompletemode == 'product') {
8153 8153
 			$prefixforautocompletemode = 'produit';
8154 8154
 		}
8155
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8155
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8156 8156
 
8157
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8157
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8158 8158
 
8159 8159
 		// Generate the combo HTML component
8160 8160
 		$out = '';
@@ -8183,13 +8183,13 @@  discard block
 block discarded – undo
8183 8183
 			}
8184 8184
 
8185 8185
 			// Set url and param to call to get json of the search results
8186
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8187
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8186
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8187
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8188 8188
 
8189 8189
 			// Activate the auto complete using ajax call.
8190 8190
 			$out .= ajax_autocompleter($preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0);
8191 8191
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8192
-			$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) . '"' : '') . ' />';
8192
+			$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).'"' : '').' />';
8193 8193
 		} else {
8194 8194
 			// Immediate load of table record.
8195 8195
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8229,16 +8229,16 @@  discard block
 block discarded – undo
8229 8229
 		if ($prefixforautocompletemode == 'societe') {
8230 8230
 			$prefixforautocompletemode = 'company';
8231 8231
 		}
8232
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8232
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8233 8233
 
8234 8234
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8235 8235
 			$tmpfieldstoshow = '';
8236 8236
 			foreach ($objecttmp->fields as $key => $val) {
8237
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
8237
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
8238 8238
 					continue;
8239 8239
 				}
8240 8240
 				if (!empty($val['showoncombobox'])) {
8241
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8241
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8242 8242
 				}
8243 8243
 			}
8244 8244
 			if ($tmpfieldstoshow) {
@@ -8266,18 +8266,18 @@  discard block
 block discarded – undo
8266 8266
 		$num = 0;
8267 8267
 
8268 8268
 		// Search data
8269
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8269
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8270 8270
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8271
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object";
8271
+			$sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object";
8272 8272
 		}
8273 8273
 		if (isset($objecttmp->ismultientitymanaged)) {
8274 8274
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8275 8275
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8276
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8276
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8277 8277
 			}
8278 8278
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8279 8279
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8280
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8280
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8281 8281
 				}
8282 8282
 			}
8283 8283
 		}
@@ -8297,21 +8297,21 @@  discard block
 block discarded – undo
8297 8297
 			$sql .= " WHERE 1=1";
8298 8298
 			if (isset($objecttmp->ismultientitymanaged)) {
8299 8299
 				if ($objecttmp->ismultientitymanaged == 1) {
8300
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8300
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8301 8301
 				}
8302 8302
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8303
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8303
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8304 8304
 				}
8305 8305
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8306 8306
 					if ($objecttmp->element == 'societe') {
8307
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8307
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8308 8308
 					} else {
8309
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8309
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8310 8310
 					}
8311 8311
 				}
8312 8312
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8313 8313
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8314
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8314
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8315 8315
 					}
8316 8316
 				}
8317 8317
 			}
@@ -8323,7 +8323,7 @@  discard block
 block discarded – undo
8323 8323
 				$errormessage = '';
8324 8324
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8325 8325
 				if ($errormessage) {
8326
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8326
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8327 8327
 				}
8328 8328
 			}
8329 8329
 		}
@@ -8335,7 +8335,7 @@  discard block
 block discarded – undo
8335 8335
 		$resql = $this->db->query($sql);
8336 8336
 		if ($resql) {
8337 8337
 			// Construct $out and $outarray
8338
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8338
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8339 8339
 
8340 8340
 			// 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
8341 8341
 			$textifempty = '&nbsp;';
@@ -8349,7 +8349,7 @@  discard block
 block discarded – undo
8349 8349
 				}
8350 8350
 			}
8351 8351
 			if ($showempty) {
8352
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8352
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8353 8353
 			}
8354 8354
 
8355 8355
 			$num = $this->db->num_rows($resql);
@@ -8372,9 +8372,9 @@  discard block
 block discarded – undo
8372 8372
 					}
8373 8373
 					if (empty($outputmode)) {
8374 8374
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8375
-							$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>';
8375
+							$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>';
8376 8376
 						} else {
8377
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8377
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8378 8378
 						}
8379 8379
 					} else {
8380 8380
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8387,10 +8387,10 @@  discard block
 block discarded – undo
8387 8387
 				}
8388 8388
 			}
8389 8389
 
8390
-			$out .= '</select>' . "\n";
8390
+			$out .= '</select>'."\n";
8391 8391
 
8392 8392
 			if (!$forcecombo) {
8393
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8393
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8394 8394
 				$out .= ajax_combobox($htmlname, null, getDolGlobalInt($confkeyforautocompletemode, 0));
8395 8395
 			}
8396 8396
 		} else {
@@ -8452,8 +8452,8 @@  discard block
 block discarded – undo
8452 8452
 			}
8453 8453
 		}
8454 8454
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8455
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8456
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8455
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8456
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8457 8457
 		$out .= '>'."\n";
8458 8458
 
8459 8459
 		if ($show_empty) {
@@ -8464,7 +8464,7 @@  discard block
 block discarded – undo
8464 8464
 			if (!is_numeric($show_empty)) {
8465 8465
 				$textforempty = $show_empty;
8466 8466
 			}
8467
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8467
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8468 8468
 		}
8469 8469
 		if (is_array($array)) {
8470 8470
 			// Translate
@@ -8487,7 +8487,7 @@  discard block
 block discarded – undo
8487 8487
 				if (is_array($tmpvalue)) {
8488 8488
 					$value = $tmpvalue['label'];
8489 8489
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8490
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8490
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8491 8491
 				} else {
8492 8492
 					$value = $tmpvalue;
8493 8493
 					$disabled = '';
@@ -8502,9 +8502,9 @@  discard block
 block discarded – undo
8502 8502
 				}
8503 8503
 				if ($key_in_label) {
8504 8504
 					if (empty($nohtmlescape)) {
8505
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8505
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8506 8506
 					} else {
8507
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8507
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8508 8508
 					}
8509 8509
 				} else {
8510 8510
 					if (empty($nohtmlescape)) {
@@ -8516,8 +8516,8 @@  discard block
 block discarded – undo
8516 8516
 						$selectOptionValue = '&nbsp;';
8517 8517
 					}
8518 8518
 				}
8519
-				$out .= '<option value="' . $key . '"';
8520
-				$out .= $style . $disabled;
8519
+				$out .= '<option value="'.$key.'"';
8520
+				$out .= $style.$disabled;
8521 8521
 				if (is_array($id)) {
8522 8522
 					if (in_array($key, $id) && !$disabled) {
8523 8523
 						$out .= ' selected'; // To preselect a value
@@ -8529,7 +8529,7 @@  discard block
 block discarded – undo
8529 8529
 					}
8530 8530
 				}
8531 8531
 				if (!empty($nohtmlescape)) {
8532
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8532
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8533 8533
 				}
8534 8534
 				if (is_array($tmpvalue)) {
8535 8535
 					foreach ($tmpvalue as $keyforvalue => $valueforvalue) {
@@ -8547,7 +8547,7 @@  discard block
 block discarded – undo
8547 8547
 		// Add code for jquery to use multiselect
8548 8548
 		if ($addjscombo && $jsbeautify) {
8549 8549
 			// Enhance with select2
8550
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8550
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8551 8551
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
8552 8552
 		}
8553 8553
 
@@ -8575,28 +8575,28 @@  discard block
 block discarded – undo
8575 8575
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8576 8576
 	{
8577 8577
 		global $conf, $langs;
8578
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8578
+		global $delayedhtmlcontent; // Will be used later outside of this function
8579 8579
 
8580 8580
 		// TODO Use an internal dolibarr component instead of select2
8581 8581
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8582 8582
 			return '';
8583 8583
 		}
8584 8584
 
8585
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8585
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8586 8586
 
8587 8587
 		$outdelayed = '';
8588 8588
 		if (!empty($conf->use_javascript_ajax)) {
8589 8589
 			$tmpplugin = 'select2';
8590
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8591
-		    	<script nonce="' . getNonce() . '">
8590
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8591
+		    	<script nonce="' . getNonce().'">
8592 8592
 		    	$(document).ready(function () {
8593 8593
 
8594
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8594
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8595 8595
 
8596
-	                $(".' . $htmlname . '").select2({
8596
+	                $(".' . $htmlname.'").select2({
8597 8597
 				    	ajax: {
8598 8598
 					    	dir: "ltr",
8599
-					    	url: "' . $url . '",
8599
+					    	url: "' . $url.'",
8600 8600
 					    	dataType: \'json\',
8601 8601
 					    	delay: 250,
8602 8602
 					    	data: function (params) {
@@ -8623,9 +8623,9 @@  discard block
 block discarded – undo
8623 8623
 				    	},
8624 8624
 		 				language: select2arrayoflanguage,
8625 8625
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8626
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8626
+					    placeholder: "' . dol_escape_js($placeholder).'",
8627 8627
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8628
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8628
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8629 8629
 				        formatResult: function (result, container, query, escapeMarkup) {
8630 8630
 	                        return escapeMarkup(result.text);
8631 8631
 	                    },
@@ -8633,10 +8633,10 @@  discard block
 block discarded – undo
8633 8633
 
8634 8634
 	                ' . ($callurlonselect ? '
8635 8635
 	                /* Code to execute a GET when we select a value */
8636
-	                $(".' . $htmlname . '").change(function() {
8637
-				    	var selected = $(".' . $htmlname . '").val();
8636
+	                $(".' . $htmlname.'").change(function() {
8637
+				    	var selected = $(".' . $htmlname.'").val();
8638 8638
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8639
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8639
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8640 8640
 	    			    $.each( saveRemoteData, function( key, value ) {
8641 8641
 	    				        if (key == selected)
8642 8642
 	    			            {
@@ -8644,7 +8644,7 @@  discard block
 block discarded – undo
8644 8644
 	    			                 location.assign(value.url);
8645 8645
 	    			            }
8646 8646
 	                    });
8647
-	    			});' : '') . '
8647
+	    			});' : '').'
8648 8648
 
8649 8649
 	    	   });
8650 8650
 		       </script>';
@@ -8680,14 +8680,14 @@  discard block
 block discarded – undo
8680 8680
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8681 8681
 	{
8682 8682
 		global $conf, $langs;
8683
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8683
+		global $delayedhtmlcontent; // Will be used later outside of this function
8684 8684
 
8685 8685
 		// TODO Use an internal dolibarr component instead of select2
8686 8686
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8687 8687
 			return '';
8688 8688
 		}
8689 8689
 
8690
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8690
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8691 8691
 
8692 8692
 		$formattedarrayresult = array();
8693 8693
 
@@ -8702,20 +8702,20 @@  discard block
 block discarded – undo
8702 8702
 		$outdelayed = '';
8703 8703
 		if (!empty($conf->use_javascript_ajax)) {
8704 8704
 			$tmpplugin = 'select2';
8705
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8706
-				<script nonce="' . getNonce() . '">
8705
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8706
+				<script nonce="' . getNonce().'">
8707 8707
 				$(document).ready(function () {
8708
-					var data = ' . json_encode($formattedarrayresult) . ';
8708
+					var data = ' . json_encode($formattedarrayresult).';
8709 8709
 
8710
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8710
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8711 8711
 
8712
-					$(".' . $htmlname . '").select2({
8712
+					$(".' . $htmlname.'").select2({
8713 8713
 						data: data,
8714 8714
 						language: select2arrayoflanguage,
8715 8715
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8716
-						placeholder: "' . dol_escape_js($placeholder) . '",
8716
+						placeholder: "' . dol_escape_js($placeholder).'",
8717 8717
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8718
-						minimumInputLength: ' . $minimumInputLength . ',
8718
+						minimumInputLength: ' . $minimumInputLength.',
8719 8719
 						formatResult: function (result, container, query, escapeMarkup) {
8720 8720
 							return escapeMarkup(result.text);
8721 8721
 						},
@@ -8754,11 +8754,11 @@  discard block
 block discarded – undo
8754 8754
 
8755 8755
 					' . ($callurlonselect ? '
8756 8756
 					/* Code to execute a GET when we select a value */
8757
-					$(".' . $htmlname . '").change(function() {
8758
-						var selected = $(".' . $htmlname . '").val();
8757
+					$(".' . $htmlname.'").change(function() {
8758
+						var selected = $(".' . $htmlname.'").val();
8759 8759
 						console.log("We select "+selected)
8760 8760
 
8761
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
8761
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
8762 8762
 						$.each( saveRemoteData, function( key, value ) {
8763 8763
 							if (key == selected)
8764 8764
 							{
@@ -8766,7 +8766,7 @@  discard block
 block discarded – undo
8766 8766
 								location.assign(value.url);
8767 8767
 							}
8768 8768
 						});
8769
-					});' : '') . '
8769
+					});' : '').'
8770 8770
 
8771 8771
 				});
8772 8772
 				</script>';
@@ -8815,7 +8815,7 @@  discard block
 block discarded – undo
8815 8815
 		$useenhancedmultiselect = 0;
8816 8816
 		if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
8817 8817
 			if ($addjscombo) {
8818
-				$useenhancedmultiselect = 1;	// Use the js multiselect in one line. Possible only if $addjscombo not 0.
8818
+				$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
8819 8819
 			}
8820 8820
 		}
8821 8821
 
@@ -8824,7 +8824,7 @@  discard block
 block discarded – undo
8824 8824
 		// submitted to nothing.
8825 8825
 		$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
8826 8826
 		// Output select component
8827
-		$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
8827
+		$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n";
8828 8828
 		if (is_array($array) && !empty($array)) {
8829 8829
 			if ($value_as_key) {
8830 8830
 				$array = array_combine($array, $array);
@@ -8845,33 +8845,33 @@  discard block
 block discarded – undo
8845 8845
 						$tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml'];
8846 8846
 					}
8847 8847
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
8848
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
8848
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
8849 8849
 
8850
-					$out .= '<option value="' . $tmpkey . '"';
8850
+					$out .= '<option value="'.$tmpkey.'"';
8851 8851
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
8852 8852
 						$out .= ' selected';
8853 8853
 					}
8854 8854
 					if (!empty($tmplabelhtml)) {
8855
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8855
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8856 8856
 					} else {
8857
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
8858
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8857
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
8858
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8859 8859
 					}
8860 8860
 					$out .= '>';
8861 8861
 					$out .= dol_htmlentitiesbr($newval);
8862
-					$out .= '</option>' . "\n";
8862
+					$out .= '</option>'."\n";
8863 8863
 				}
8864 8864
 			}
8865 8865
 		}
8866
-		$out .= '</select>' . "\n";
8866
+		$out .= '</select>'."\n";
8867 8867
 
8868 8868
 		// Add code for jquery to use multiselect
8869 8869
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
8870
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
8871
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
8870
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
8871
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
8872 8872
 			if ($addjscombo == 1) {
8873 8873
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
8874
-				$out .= 'function formatResult(record, container) {' . "\n";
8874
+				$out .= 'function formatResult(record, container) {'."\n";
8875 8875
 				// If property data-html set, we decode html entities and use this.
8876 8876
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
8877 8877
 				$out .= '	if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {';
@@ -8879,26 +8879,26 @@  discard block
 block discarded – undo
8879 8879
 				$out .= '		return htmlEntityDecodeJs($(record.element).attr("data-html"));';
8880 8880
 				$out .= '	}'."\n";
8881 8881
 				$out .= '	return record.text;';
8882
-				$out .= '}' . "\n";
8883
-				$out .= 'function formatSelection(record) {' . "\n";
8882
+				$out .= '}'."\n";
8883
+				$out .= 'function formatSelection(record) {'."\n";
8884 8884
 				if ($elemtype == 'category') {
8885
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8885
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8886 8886
 				} else {
8887 8887
 					$out .= 'return record.text;';
8888 8888
 				}
8889
-				$out .= '}' . "\n";
8889
+				$out .= '}'."\n";
8890 8890
 				$out .= '$(document).ready(function () {
8891
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
8891
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
8892 8892
 				if ($placeholder) {
8893 8893
 					$out .= '
8894 8894
 								placeholder: {
8895 8895
 								    id: \'-1\',
8896
-								    text: \'' . dol_escape_js($placeholder) . '\'
8896
+								    text: \'' . dol_escape_js($placeholder).'\'
8897 8897
 								  },';
8898 8898
 				}
8899 8899
 				$out .= '		dir: \'ltr\',
8900 8900
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
8901
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
8901
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
8902 8902
 								// Specify format function for dropdown item
8903 8903
 								formatResult: formatResult,
8904 8904
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -8910,21 +8910,21 @@  discard block
 block discarded – undo
8910 8910
 
8911 8911
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
8912 8912
 								 the size only if component is not hidden by default on load */
8913
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
8913
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
8914 8914
 						});' . "\n";
8915 8915
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
8916 8916
 				// Add other js lib
8917 8917
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
8918 8918
 				// ...
8919
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
8919
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
8920 8920
 				$out .= '$(document).ready(function () {
8921
-							$(\'#' . $htmlname . '\').multiSelect({
8921
+							$(\'#' . $htmlname.'\').multiSelect({
8922 8922
 								containerHTML: \'<div class="multi-select-container">\',
8923 8923
 								menuHTML: \'<div class="multi-select-menu">\',
8924
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
8924
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
8925 8925
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
8926 8926
 								activeClass: \'multi-select-container--open\',
8927
-								noneText: \'' . $placeholder . '\'
8927
+								noneText: \'' . $placeholder.'\'
8928 8928
 							});
8929 8929
 						})';
8930 8930
 			}
@@ -8956,7 +8956,7 @@  discard block
 block discarded – undo
8956 8956
 			return '';
8957 8957
 		}
8958 8958
 
8959
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
8959
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
8960 8960
 
8961 8961
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
8962 8962
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -8999,19 +8999,19 @@  discard block
 block discarded – undo
8999 8999
 				}
9000 9000
 
9001 9001
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list
9002
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
9003
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
9002
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
9003
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
9004 9004
 			}
9005 9005
 		}
9006 9006
 
9007
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
9007
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
9008 9008
 
9009 9009
         <dl class="dropdown">
9010 9010
             <dt>
9011
-            <a href="#' . $htmlname . '">
9012
-              ' . img_picto('', 'list') . '
9011
+            <a href="#' . $htmlname.'">
9012
+              ' . img_picto('', 'list').'
9013 9013
             </a>
9014
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
9014
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
9015 9015
             </dt>
9016 9016
             <dd class="dropdowndd">
9017 9017
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -9023,19 +9023,19 @@  discard block
 block discarded – undo
9023 9023
             </dd>
9024 9024
         </dl>
9025 9025
 
9026
-        <script nonce="' . getNonce() . '" type="text/javascript">
9026
+        <script nonce="' . getNonce().'" type="text/javascript">
9027 9027
           jQuery(document).ready(function () {
9028
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
9028
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
9029 9029
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
9030 9030
 
9031 9031
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
9032 9032
 
9033 9033
                   var title = $(this).val() + ",";
9034 9034
                   if ($(this).is(\':checked\')) {
9035
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
9035
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
9036 9036
                   }
9037 9037
                   else {
9038
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
9038
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
9039 9039
                   }
9040 9040
                   // Now, we submit page
9041 9041
                   //$(this).parents(\'form:first\').submit();
@@ -9066,7 +9066,7 @@  discard block
 block discarded – undo
9066 9066
 	 */
9067 9067
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9068 9068
 	{
9069
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9069
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9070 9070
 
9071 9071
 		$cat = new Categorie($this->db);
9072 9072
 		$categories = $cat->containing($id, $type);
@@ -9076,10 +9076,10 @@  discard block
 block discarded – undo
9076 9076
 			foreach ($categories as $c) {
9077 9077
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
9078 9078
 				foreach ($ways as $way) {
9079
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9079
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9080 9080
 				}
9081 9081
 			}
9082
-			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9082
+			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9083 9083
 		}
9084 9084
 
9085 9085
 		if ($rendermode == 0) {
@@ -9127,15 +9127,15 @@  discard block
 block discarded – undo
9127 9127
 
9128 9128
 
9129 9129
 			print '<div class="div-table-responsive-no-min">';
9130
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9130
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9131 9131
 
9132 9132
 			print '<tr class="liste_titre">';
9133
-			print '<td>' . $langs->trans("Type") . '</td>';
9134
-			print '<td>' . $langs->trans("Ref") . '</td>';
9133
+			print '<td>'.$langs->trans("Type").'</td>';
9134
+			print '<td>'.$langs->trans("Ref").'</td>';
9135 9135
 			print '<td class="center"></td>';
9136
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9137
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9138
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9136
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9137
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9138
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9139 9139
 			print '<td></td>';
9140 9140
 			print '</tr>';
9141 9141
 
@@ -9154,13 +9154,13 @@  discard block
 block discarded – undo
9154 9154
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9155 9155
 					$element = $regs[1];
9156 9156
 					$subelement = $regs[2];
9157
-					$tplpath = $element . '/' . $subelement;
9157
+					$tplpath = $element.'/'.$subelement;
9158 9158
 				}
9159 9159
 				$tplname = 'linkedobjectblock';
9160 9160
 
9161 9161
 				// To work with non standard path
9162 9162
 				if ($objecttype == 'facture') {
9163
-					$tplpath = 'compta/' . $element;
9163
+					$tplpath = 'compta/'.$element;
9164 9164
 					if (!isModEnabled('invoice')) {
9165 9165
 						continue; // Do not show if module disabled
9166 9166
 					}
@@ -9171,7 +9171,7 @@  discard block
 block discarded – undo
9171 9171
 						continue; // Do not show if module disabled
9172 9172
 					}
9173 9173
 				} elseif ($objecttype == 'propal') {
9174
-					$tplpath = 'comm/' . $element;
9174
+					$tplpath = 'comm/'.$element;
9175 9175
 					if (!isModEnabled('propal')) {
9176 9176
 						continue; // Do not show if module disabled
9177 9177
 					}
@@ -9222,7 +9222,7 @@  discard block
 block discarded – undo
9222 9222
 				$linkedObjectBlock = $objects;
9223 9223
 
9224 9224
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9225
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9225
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9226 9226
 				foreach ($dirtpls as $reldir) {
9227 9227
 					$reldir = rtrim($reldir, '/');
9228 9228
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
@@ -9230,7 +9230,7 @@  discard block
 block discarded – undo
9230 9230
 						$noMoreLinkedObjectBlockAfter = 1;
9231 9231
 					}
9232 9232
 
9233
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9233
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9234 9234
 					if ($res) {
9235 9235
 						$nboftypesoutput++;
9236 9236
 						break;
@@ -9239,7 +9239,7 @@  discard block
 block discarded – undo
9239 9239
 			}
9240 9240
 
9241 9241
 			if (!$nboftypesoutput) {
9242
-				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9242
+				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9243 9243
 			}
9244 9244
 
9245 9245
 			print '</table>';
@@ -9279,14 +9279,14 @@  discard block
 block discarded – undo
9279 9279
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9280 9280
 			$listofidcompanytoscan = $object->thirdparty->id;
9281 9281
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9282
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9282
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9283 9283
 			}
9284 9284
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9285
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9285
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9286 9286
 				$tmpproject = new Project($this->db);
9287 9287
 				$tmpproject->fetch($object->fk_project);
9288 9288
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9289
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9289
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9290 9290
 				}
9291 9291
 				unset($tmpproject);
9292 9292
 			}
@@ -9296,63 +9296,63 @@  discard block
 block discarded – undo
9296 9296
 					'enabled' => isModEnabled('propal'),
9297 9297
 					'perms' => 1,
9298 9298
 					'label' => 'LinkToProposal',
9299
-					'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') . ')'),
9299
+					'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').')'),
9300 9300
 				'shipping' => array(
9301 9301
 					'enabled' => isModEnabled('shipping'),
9302 9302
 					'perms' => 1,
9303 9303
 					'label' => 'LinkToExpedition',
9304
-					'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') . ')'),
9304
+					'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').')'),
9305 9305
 				'order' => array(
9306 9306
 					'enabled' => isModEnabled('order'),
9307 9307
 					'perms' => 1,
9308 9308
 					'label' => 'LinkToOrder',
9309
-					'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') . ')'),
9309
+					'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').')'),
9310 9310
 				'invoice' => array(
9311 9311
 					'enabled' => isModEnabled('invoice'),
9312 9312
 					'perms' => 1,
9313 9313
 					'label' => 'LinkToInvoice',
9314
-					'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') . ')'),
9314
+					'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').')'),
9315 9315
 				'invoice_template' => array(
9316 9316
 					'enabled' => isModEnabled('invoice'),
9317 9317
 					'perms' => 1,
9318 9318
 					'label' => 'LinkToTemplateInvoice',
9319
-					'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') . ')'),
9319
+					'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').')'),
9320 9320
 				'contrat' => array(
9321 9321
 					'enabled' => isModEnabled('contract'),
9322 9322
 					'perms' => 1,
9323 9323
 					'label' => 'LinkToContract',
9324 9324
 					'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
9325
-							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'
9325
+							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'
9326 9326
 				),
9327 9327
 				'fichinter' => array(
9328 9328
 					'enabled' => isModEnabled('intervention'),
9329 9329
 					'perms' => 1,
9330 9330
 					'label' => 'LinkToIntervention',
9331
-					'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') . ')'),
9331
+					'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').')'),
9332 9332
 				'supplier_proposal' => array(
9333 9333
 					'enabled' => isModEnabled('supplier_proposal'),
9334 9334
 					'perms' => 1,
9335 9335
 					'label' => 'LinkToSupplierProposal',
9336
-					'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') . ')'),
9336
+					'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').')'),
9337 9337
 				'order_supplier' => array(
9338 9338
 					'enabled' => isModEnabled("supplier_order"),
9339 9339
 					'perms' => 1,
9340 9340
 					'label' => 'LinkToSupplierOrder',
9341
-					'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') . ')'),
9341
+					'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').')'),
9342 9342
 				'invoice_supplier' => array(
9343 9343
 					'enabled' => isModEnabled("supplier_invoice"),
9344 9344
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9345
-					'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') . ')'),
9345
+					'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').')'),
9346 9346
 				'ticket' => array(
9347 9347
 					'enabled' => isModEnabled('ticket'),
9348 9348
 					'perms' => 1,
9349 9349
 					'label' => 'LinkToTicket',
9350
-					'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') . ')'),
9350
+					'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').')'),
9351 9351
 				'mo' => array(
9352 9352
 					'enabled' => isModEnabled('mrp'),
9353 9353
 					'perms' => 1,
9354 9354
 					'label' => 'LinkToMo',
9355
-					'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') . ')')
9355
+					'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').')')
9356 9356
 			);
9357 9357
 		}
9358 9358
 
@@ -9387,22 +9387,22 @@  discard block
 block discarded – undo
9387 9387
 			}
9388 9388
 
9389 9389
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9390
-				print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9390
+				print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9391 9391
 
9392 9392
 				if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9393 9393
 					print '<br>'."\n";
9394 9394
 					print '<!-- form to add a link from anywhere -->'."\n";
9395
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9396
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9395
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9396
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9397 9397
 					print '<input type="hidden" name="action" value="addlinkbyref">';
9398
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9399
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9398
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9399
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9400 9400
 					print '<table class="noborder">';
9401 9401
 					print '<tr>';
9402 9402
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9403
-					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9404
-					print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9405
-					print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9403
+					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9404
+					print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9405
+					print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9406 9406
 					print '</tr>';
9407 9407
 					print '</table>';
9408 9408
 					print '</form>';
@@ -9417,48 +9417,48 @@  discard block
 block discarded – undo
9417 9417
 
9418 9418
 					print '<br>';
9419 9419
 					print '<!-- form to add a link from object to same thirdparty -->'."\n";
9420
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9420
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9421 9421
 					print '<input type="hidden" name="action" value="addlink">';
9422
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9423
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9424
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9422
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9423
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9424
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9425 9425
 					print '<table class="noborder">';
9426 9426
 					print '<tr class="liste_titre">';
9427 9427
 					print '<td class="nowrap"></td>';
9428
-					print '<td class="center">' . $langs->trans("Ref") . '</td>';
9429
-					print '<td class="left">' . $langs->trans("RefCustomer") . '</td>';
9430
-					print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9431
-					print '<td class="left">' . $langs->trans("Company") . '</td>';
9428
+					print '<td class="center">'.$langs->trans("Ref").'</td>';
9429
+					print '<td class="left">'.$langs->trans("RefCustomer").'</td>';
9430
+					print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9431
+					print '<td class="left">'.$langs->trans("Company").'</td>';
9432 9432
 					print '</tr>';
9433 9433
 					while ($i < $num) {
9434 9434
 						$objp = $this->db->fetch_object($resqllist);
9435 9435
 
9436 9436
 						print '<tr class="oddeven">';
9437 9437
 						print '<td class="left">';
9438
-						print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9438
+						print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9439 9439
 						print '</td>';
9440
-						print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9441
-						print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9440
+						print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9441
+						print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9442 9442
 						print '<td class="right">';
9443 9443
 						if ($possiblelink['label'] == 'LinkToContract') {
9444 9444
 							$form = new Form($this->db);
9445
-							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9445
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9446 9446
 						}
9447
-						print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9447
+						print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9448 9448
 						print '</td>';
9449
-						print '<td>' . $objp->name . '</td>';
9449
+						print '<td>'.$objp->name.'</td>';
9450 9450
 						print '</tr>';
9451 9451
 						$i++;
9452 9452
 					}
9453 9453
 					print '</table>';
9454 9454
 					print '<div class="center">';
9455 9455
 					if ($num) {
9456
-						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9456
+						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9457 9457
 					}
9458 9458
 					if (empty($conf->use_javascript_ajax)) {
9459
-						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9459
+						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9460 9460
 					} else {
9461
-						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>';
9461
+						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>';
9462 9462
 					}
9463 9463
 					print '</form>';
9464 9464
 					$this->db->free($resqllist);
@@ -9469,10 +9469,10 @@  discard block
 block discarded – undo
9469 9469
 
9470 9470
 				//$linktoelem.=($linktoelem?' &nbsp; ':'');
9471 9471
 				if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9472
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9472
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9473 9473
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9474 9474
 				} else {
9475
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9475
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9476 9476
 				}
9477 9477
 			}
9478 9478
 		}
@@ -9482,11 +9482,11 @@  discard block
 block discarded – undo
9482 9482
     		<dl class="dropdown" id="linktoobjectname">
9483 9483
     		';
9484 9484
 			if (!empty($conf->use_javascript_ajax)) {
9485
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9485
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9486 9486
 			}
9487 9487
 			$linktoelem .= '<dd>
9488 9488
     		<div class="multiselectlinkto">
9489
-    		<ul class="ulselectedfields">' . $linktoelemlist . '
9489
+    		<ul class="ulselectedfields">' . $linktoelemlist.'
9490 9490
     		</ul>
9491 9491
     		</div>
9492 9492
     		</dd>
@@ -9497,7 +9497,7 @@  discard block
 block discarded – undo
9497 9497
 
9498 9498
 		if (!empty($conf->use_javascript_ajax)) {
9499 9499
 			print '<!-- Add js to show linkto box -->
9500
-				<script nonce="' . getNonce() . '">
9500
+				<script nonce="' . getNonce().'">
9501 9501
 				jQuery(document).ready(function() {
9502 9502
 					jQuery(".linkto").click(function() {
9503 9503
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9538,19 +9538,19 @@  discard block
 block discarded – undo
9538 9538
 
9539 9539
 		$disabled = ($disabled ? ' disabled' : '');
9540 9540
 
9541
-		$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9541
+		$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9542 9542
 		if ($useempty) {
9543
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9543
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9544 9544
 		}
9545 9545
 		if (("$value" == 'yes') || ($value == 1)) {
9546
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9547
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9546
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9547
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9548 9548
 		} else {
9549 9549
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9550
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9551
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9550
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9551
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9552 9552
 		}
9553
-		$resultyesno .= '</select>' . "\n";
9553
+		$resultyesno .= '</select>'."\n";
9554 9554
 
9555 9555
 		if ($addjscombo) {
9556 9556
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9574,12 +9574,12 @@  discard block
 block discarded – undo
9574 9574
 	{
9575 9575
 		// phpcs:enable
9576 9576
 		$sql = "SELECT rowid, label";
9577
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9578
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9577
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9578
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9579 9579
 		$sql .= " ORDER BY rowid";
9580 9580
 		$result = $this->db->query($sql);
9581 9581
 		if ($result) {
9582
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9582
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9583 9583
 			if ($useempty) {
9584 9584
 				print '<option value="-1">&nbsp;</option>';
9585 9585
 			}
@@ -9589,9 +9589,9 @@  discard block
 block discarded – undo
9589 9589
 			while ($i < $num) {
9590 9590
 				$obj = $this->db->fetch_object($result);
9591 9591
 				if ($selected == $obj->rowid) {
9592
-					print '<option value="' . $obj->rowid . '" selected>';
9592
+					print '<option value="'.$obj->rowid.'" selected>';
9593 9593
 				} else {
9594
-					print '<option value="' . $obj->rowid . '">';
9594
+					print '<option value="'.$obj->rowid.'">';
9595 9595
 				}
9596 9596
 				print $obj->label;
9597 9597
 				print '</option>';
@@ -9681,8 +9681,8 @@  discard block
 block discarded – undo
9681 9681
 				$stringforfirstkey .= ' CTL +';
9682 9682
 			}
9683 9683
 
9684
-			$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>';
9685
-			$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>';
9684
+			$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>';
9685
+			$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>';
9686 9686
 		}
9687 9687
 
9688 9688
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9690,18 +9690,18 @@  discard block
 block discarded – undo
9690 9690
 
9691 9691
 		// Right part of banner
9692 9692
 		if ($morehtmlright) {
9693
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9693
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9694 9694
 		}
9695 9695
 
9696 9696
 		if ($previous_ref || $next_ref || $morehtml) {
9697 9697
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9698 9698
 		}
9699 9699
 		if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) {
9700
-			$ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9700
+			$ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9701 9701
 		}
9702 9702
 		if ($shownav && ($previous_ref || $next_ref)) {
9703
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
9704
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
9703
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
9704
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
9705 9705
 		}
9706 9706
 		if ($previous_ref || $next_ref || $morehtml) {
9707 9707
 			$ret .= '</ul></div>';
@@ -9716,7 +9716,7 @@  discard block
 block discarded – undo
9716 9716
 			$morehtmlstatus = $hookmanager->resPrint;
9717 9717
 		}
9718 9718
 		if ($morehtmlstatus) {
9719
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
9719
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
9720 9720
 		}
9721 9721
 
9722 9722
 		$parameters = array();
@@ -9730,14 +9730,14 @@  discard block
 block discarded – undo
9730 9730
 		// Left part of banner
9731 9731
 		if ($morehtmlleft) {
9732 9732
 			if ($conf->browser->layout == 'phone') {
9733
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
9733
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
9734 9734
 			} else {
9735
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
9735
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
9736 9736
 			}
9737 9737
 		}
9738 9738
 
9739 9739
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
9740
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
9740
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
9741 9741
 
9742 9742
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
9743 9743
 		if ($object->element == 'societe') {
@@ -9751,7 +9751,7 @@  discard block
 block discarded – undo
9751 9751
 
9752 9752
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
9753 9753
 				if (!is_object($extralanguages)) {
9754
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
9754
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
9755 9755
 					$extralanguages = new ExtraLanguages($this->db);
9756 9756
 				}
9757 9757
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -9766,27 +9766,27 @@  discard block
 block discarded – undo
9766 9766
 						if ($object->array_languages['name'][$extralangcode]) {
9767 9767
 							$htmltext .= $object->array_languages['name'][$extralangcode];
9768 9768
 						} else {
9769
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
9769
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
9770 9770
 						}
9771 9771
 					}
9772
-					$ret .= '<!-- Show translations of name -->' . "\n";
9772
+					$ret .= '<!-- Show translations of name -->'."\n";
9773 9773
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
9774 9774
 				}
9775 9775
 			}
9776 9776
 		} elseif ($object->element == 'member') {
9777
-			$ret .= $object->ref . '<br>';
9777
+			$ret .= $object->ref.'<br>';
9778 9778
 			$fullname = $object->getFullName($langs);
9779 9779
 			if ($object->morphy == 'mor' && $object->societe) {
9780
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
9780
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
9781 9781
 			} else {
9782
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
9782
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
9783 9783
 			}
9784 9784
 		} elseif (in_array($object->element, array('contact', 'user'))) {
9785
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
9785
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
9786 9786
 		} elseif ($object->element == 'usergroup') {
9787 9787
 			$ret .= dol_htmlentities($object->name);
9788 9788
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
9789
-			$ret .= $object->ref . '<br>' . $object->label;
9789
+			$ret .= $object->ref.'<br>'.$object->label;
9790 9790
 		} elseif (in_array($object->element, array('adherent_type'))) {
9791 9791
 			$ret .= $object->label;
9792 9792
 		} elseif ($object->element == 'ecm_directories') {
@@ -9838,9 +9838,9 @@  discard block
 block discarded – undo
9838 9838
 		}
9839 9839
 
9840 9840
 		// Barcode image
9841
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
9842
-		$out = '<!-- url barcode = ' . $url . ' -->';
9843
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
9841
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
9842
+		$out = '<!-- url barcode = '.$url.' -->';
9843
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
9844 9844
 
9845 9845
 		return $out;
9846 9846
 	}
@@ -9880,28 +9880,28 @@  discard block
 block discarded – undo
9880 9880
 			if (!empty($object->logo)) {
9881 9881
 				if (dolIsAllowedForPreview($object->logo)) {
9882 9882
 					if ((string) $imagesize == 'mini') {
9883
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9883
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9884 9884
 					} elseif ((string) $imagesize == 'small') {
9885
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
9885
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
9886 9886
 					} else {
9887
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9887
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9888 9888
 					}
9889
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9889
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9890 9890
 				}
9891 9891
 			}
9892 9892
 			$email = $object->email;
9893 9893
 		} elseif ($modulepart == 'contact') {
9894
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
9894
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
9895 9895
 			if (!empty($object->photo)) {
9896 9896
 				if (dolIsAllowedForPreview($object->photo)) {
9897 9897
 					if ((string) $imagesize == 'mini') {
9898
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9898
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9899 9899
 					} elseif ((string) $imagesize == 'small') {
9900
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9900
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
9901 9901
 					} else {
9902
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9902
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9903 9903
 					}
9904
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9904
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9905 9905
 				}
9906 9906
 			}
9907 9907
 			$email = $object->email;
@@ -9911,17 +9911,17 @@  discard block
 block discarded – undo
9911 9911
 			if (!empty($object->photo)) {
9912 9912
 				if (dolIsAllowedForPreview($object->photo)) {
9913 9913
 					if ((string) $imagesize == 'mini') {
9914
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9914
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9915 9915
 					} elseif ((string) $imagesize == 'small') {
9916
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9916
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
9917 9917
 					} else {
9918
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9918
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9919 9919
 					}
9920
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9920
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9921 9921
 				}
9922 9922
 			}
9923 9923
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9924
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9924
+				$altfile = $object->id.".jpg"; // For backward compatibility
9925 9925
 			}
9926 9926
 			$email = $object->email;
9927 9927
 			$capture = 'user';
@@ -9930,17 +9930,17 @@  discard block
 block discarded – undo
9930 9930
 			if (!empty($object->photo)) {
9931 9931
 				if (dolIsAllowedForPreview($object->photo)) {
9932 9932
 					if ((string) $imagesize == 'mini') {
9933
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9933
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9934 9934
 					} elseif ((string) $imagesize == 'small') {
9935
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9935
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
9936 9936
 					} else {
9937
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9937
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9938 9938
 					}
9939
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9939
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9940 9940
 				}
9941 9941
 			}
9942 9942
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9943
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9943
+				$altfile = $object->id.".jpg"; // For backward compatibility
9944 9944
 			}
9945 9945
 			$email = $object->email;
9946 9946
 			$capture = 'user';
@@ -9966,35 +9966,35 @@  discard block
 block discarded – undo
9966 9966
 		$ret = '';
9967 9967
 
9968 9968
 		if ($dir) {
9969
-			if ($file && file_exists($dir . "/" . $file)) {
9969
+			if ($file && file_exists($dir."/".$file)) {
9970 9970
 				if ($addlinktofullsize) {
9971
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9971
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9972 9972
 					if ($urladvanced) {
9973
-						$ret .= '<a href="' . $urladvanced . '">';
9973
+						$ret .= '<a href="'.$urladvanced.'">';
9974 9974
 					} else {
9975
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9975
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9976 9976
 					}
9977 9977
 				}
9978
-				$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 . '">';
9978
+				$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.'">';
9979 9979
 				if ($addlinktofullsize) {
9980 9980
 					$ret .= '</a>';
9981 9981
 				}
9982
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
9982
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
9983 9983
 				if ($addlinktofullsize) {
9984
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
9984
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
9985 9985
 					if ($urladvanced) {
9986
-						$ret .= '<a href="' . $urladvanced . '">';
9986
+						$ret .= '<a href="'.$urladvanced.'">';
9987 9987
 					} else {
9988
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
9988
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
9989 9989
 					}
9990 9990
 				}
9991
-				$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 . '">';
9991
+				$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.'">';
9992 9992
 				if ($addlinktofullsize) {
9993 9993
 					$ret .= '</a>';
9994 9994
 				}
9995 9995
 			} else {
9996 9996
 				$nophoto = '/public/theme/common/nophoto.png';
9997
-				$defaultimg = 'identicon';        // For gravatar
9997
+				$defaultimg = 'identicon'; // For gravatar
9998 9998
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
9999 9999
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) {
10000 10000
 						$nophoto = 'company';
@@ -10012,13 +10012,13 @@  discard block
 block discarded – undo
10012 10012
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
10013 10013
 					// see https://gravatar.com/site/implement/images/php/
10014 10014
 					$ret .= '<!-- Put link to gravatar -->';
10015
-					$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
10015
+					$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
10016 10016
 				} else {
10017 10017
 					if ($nophoto == 'company') {
10018
-						$ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
10018
+						$ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
10019 10019
 						$ret .= '<div class="difforspanimgright"></div>';
10020 10020
 					} else {
10021
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
10021
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
10022 10022
 					}
10023 10023
 				}
10024 10024
 			}
@@ -10029,15 +10029,15 @@  discard block
 block discarded – undo
10029 10029
 				}
10030 10030
 				$ret .= '<table class="nobordernopadding centpercent">';
10031 10031
 				if ($object->photo) {
10032
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
10032
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
10033 10033
 				}
10034 10034
 				$ret .= '<tr><td class="tdoverflow">';
10035 10035
 				$maxfilesizearray = getMaxFileSizeArray();
10036 10036
 				$maxmin = $maxfilesizearray['maxmin'];
10037 10037
 				if ($maxmin > 0) {
10038
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
10038
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
10039 10039
 				}
10040
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
10040
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
10041 10041
 				$ret .= '</td></tr>';
10042 10042
 				$ret .= '</table>';
10043 10043
 			}
@@ -10091,38 +10091,38 @@  discard block
 block discarded – undo
10091 10091
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10092 10092
 			$sql .= ", e.label";
10093 10093
 		}
10094
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10094
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10095 10095
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10096
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10096
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10097 10097
 			if ($force_entity) {
10098
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10098
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10099 10099
 			} else {
10100 10100
 				$sql .= " WHERE ug.entity IS NOT NULL";
10101 10101
 			}
10102 10102
 		} else {
10103
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10103
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10104 10104
 		}
10105 10105
 		if (is_array($exclude) && $excludeGroups) {
10106
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10106
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10107 10107
 		}
10108 10108
 		if (is_array($include) && $includeGroups) {
10109
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10109
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10110 10110
 		}
10111 10111
 		$sql .= " ORDER BY ug.nom ASC";
10112 10112
 
10113
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10113
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10114 10114
 		$resql = $this->db->query($sql);
10115 10115
 		if ($resql) {
10116 10116
 			// Enhance with select2
10117
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10117
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10118 10118
 
10119
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10119
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10120 10120
 
10121 10121
 			$num = $this->db->num_rows($resql);
10122 10122
 			$i = 0;
10123 10123
 			if ($num) {
10124 10124
 				if ($show_empty && !$multiple) {
10125
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10125
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10126 10126
 				}
10127 10127
 
10128 10128
 				while ($i < $num) {
@@ -10135,11 +10135,11 @@  discard block
 block discarded – undo
10135 10135
 					$label = $obj->name;
10136 10136
 					$labelhtml = $obj->name;
10137 10137
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10138
-						$label .= " (" . $obj->label . ")";
10139
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10138
+						$label .= " (".$obj->label.")";
10139
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10140 10140
 					}
10141 10141
 
10142
-					$out .= '<option value="' . $obj->rowid . '"';
10142
+					$out .= '<option value="'.$obj->rowid.'"';
10143 10143
 					if ($disableline) {
10144 10144
 						$out .= ' disabled';
10145 10145
 					}
@@ -10155,9 +10155,9 @@  discard block
 block discarded – undo
10155 10155
 				}
10156 10156
 			} else {
10157 10157
 				if ($show_empty) {
10158
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10158
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10159 10159
 				}
10160
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10160
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10161 10161
 			}
10162 10162
 			$out .= '</select>';
10163 10163
 
@@ -10201,25 +10201,25 @@  discard block
 block discarded – undo
10201 10201
 		$out = '';
10202 10202
 
10203 10203
 		if (!empty($conf->use_javascript_ajax)) {
10204
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10204
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10205 10205
 		}
10206
-		$out .= '<script nonce="' . getNonce() . '">
10206
+		$out .= '<script nonce="'.getNonce().'">
10207 10207
             $(document).ready(function() {
10208
-                $("#' . $cssclass . 's").click(function() {
10208
+                $("#' . $cssclass.'s").click(function() {
10209 10209
                     if($(this).is(\':checked\')){
10210
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10211
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10210
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10211
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10212 10212
                     }
10213 10213
                     else
10214 10214
                     {
10215 10215
                         console.log("We uncheck all");
10216
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10216
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10217 10217
                     }' . "\n";
10218 10218
 		if ($calljsfunction) {
10219
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10219
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10220 10220
 		}
10221 10221
 		$out .= '         });
10222
-        	        $(".' . $cssclass . '").change(function() {
10222
+        	        $(".' . $cssclass.'").change(function() {
10223 10223
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10224 10224
 				});
10225 10225
 		 	});
@@ -10264,67 +10264,67 @@  discard block
 block discarded – undo
10264 10264
 		global $langs, $user;
10265 10265
 
10266 10266
 		$out = '';
10267
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10268
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10267
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10268
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10269 10269
 		if (!empty($excludeid)) {
10270
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10270
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10271 10271
 		}
10272 10272
 		$sql .= " ORDER BY label";
10273 10273
 
10274 10274
 		$resql = $this->db->query($sql);
10275 10275
 		if ($resql) {
10276
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10276
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10277 10277
 			if ($useempty) {
10278 10278
 				$out .= '<option value="0">&nbsp;</option>';
10279 10279
 			}
10280 10280
 
10281 10281
 			while ($obj = $this->db->fetch_object($resql)) {
10282
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10282
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10283 10283
 			}
10284 10284
 			$out .= '</select>';
10285
-			$out .= ajax_combobox('select_' . $htmlname);
10285
+			$out .= ajax_combobox('select_'.$htmlname);
10286 10286
 
10287 10287
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10288
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10288
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10289 10289
 			}
10290 10290
 
10291 10291
 			if (!empty($target)) {
10292
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10292
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10293 10293
 				$resql = $this->db->query($sql);
10294 10294
 				if ($resql) {
10295 10295
 					if ($this->db->num_rows($resql) > 0) {
10296 10296
 						$obj = $this->db->fetch_object($resql);
10297
-						$out .= '<script nonce="' . getNonce() . '">
10297
+						$out .= '<script nonce="'.getNonce().'">
10298 10298
 							$(function() {
10299
-								$("select[name=' . $target . ']").on("change", function() {
10299
+								$("select[name=' . $target.']").on("change", function() {
10300 10300
 									var current_val = $(this).val();
10301
-									if (current_val == ' . $obj->id . ') {';
10301
+									if (current_val == ' . $obj->id.') {';
10302 10302
 						if (!empty($default_selected) || !empty($selected)) {
10303
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10303
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10304 10304
 						}
10305 10305
 
10306 10306
 						$out .= '
10307
-										$("select[name=' . $htmlname . ']").change();
10307
+										$("select[name=' . $htmlname.']").change();
10308 10308
 									}
10309 10309
 								});
10310 10310
 
10311
-								$("select[name=' . $htmlname . ']").change(function() {
10311
+								$("select[name=' . $htmlname.']").change(function() {
10312 10312
 
10313
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10313
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10314 10314
 										// get price of kilometer to fill the unit price
10315 10315
 										$.ajax({
10316 10316
 											method: "POST",
10317 10317
 											dataType: "json",
10318
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10319
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '",
10318
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10319
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'",
10320 10320
 										}).done(function( data, textStatus, jqXHR ) {
10321 10321
 											console.log(data);
10322 10322
 											if (typeof data.up != "undefined") {
10323 10323
 												$("input[name=value_unit]").val(data.up);
10324
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10324
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10325 10325
 											} else {
10326 10326
 												$("input[name=value_unit]").val("");
10327
-												$("select[name=' . $htmlname . ']").attr("title", "");
10327
+												$("select[name=' . $htmlname.']").attr("title", "");
10328 10328
 											}
10329 10329
 										});
10330 10330
 									}
@@ -10354,18 +10354,18 @@  discard block
 block discarded – undo
10354 10354
 		global $conf, $langs;
10355 10355
 
10356 10356
 		$out = '';
10357
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10358
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10357
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10358
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
10359 10359
 
10360 10360
 		$resql = $this->db->query($sql);
10361 10361
 		if ($resql) {
10362
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10362
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10363 10363
 			if ($useempty) {
10364 10364
 				$out .= '<option value="0"></option>';
10365 10365
 			}
10366 10366
 
10367 10367
 			while ($obj = $this->db->fetch_object($resql)) {
10368
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10368
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10369 10369
 			}
10370 10370
 			$out .= '</select>';
10371 10371
 		} else {
@@ -10396,12 +10396,12 @@  discard block
 block discarded – undo
10396 10396
 
10397 10397
 		$resql = $this->db->query($sql);
10398 10398
 		if ($resql) {
10399
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10399
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10400 10400
 			if ($useempty) {
10401 10401
 				$out .= '<option value="0"></option>';
10402 10402
 			}
10403 10403
 			if ($allchoice) {
10404
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10404
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10405 10405
 			}
10406 10406
 
10407 10407
 			$field = 'code';
@@ -10411,7 +10411,7 @@  discard block
 block discarded – undo
10411 10411
 
10412 10412
 			while ($obj = $this->db->fetch_object($resql)) {
10413 10413
 				$key = $langs->trans($obj->code);
10414
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10414
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10415 10415
 			}
10416 10416
 			$out .= '</select>';
10417 10417
 
@@ -10445,7 +10445,7 @@  discard block
 block discarded – undo
10445 10445
 	{
10446 10446
 		global $user, $conf, $langs;
10447 10447
 
10448
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10448
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10449 10449
 
10450 10450
 		if (is_null($usertofilter)) {
10451 10451
 			$usertofilter = $user;
@@ -10469,10 +10469,10 @@  discard block
 block discarded – undo
10469 10469
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10470 10470
             p.title, p.fk_soc, p.fk_statut, p.public,";
10471 10471
 		$sql .= ' s.nom as name';
10472
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10473
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10474
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10475
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10472
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10473
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10474
+		$sql .= ' '.$this->db->prefix().'facture as f';
10475
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10476 10476
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10477 10477
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10478 10478
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10483,14 +10483,14 @@  discard block
 block discarded – undo
10483 10483
 		if ($resql) {
10484 10484
 			// Use select2 selector
10485 10485
 			if (!empty($conf->use_javascript_ajax)) {
10486
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10486
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10487 10487
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10488 10488
 				$out .= $comboenhancement;
10489 10489
 				$morecss = 'minwidth200imp maxwidth500';
10490 10490
 			}
10491 10491
 
10492 10492
 			if (empty($option_only)) {
10493
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10493
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10494 10494
 			}
10495 10495
 			if (!empty($show_empty)) {
10496 10496
 				$out .= '<option value="0" class="optiongrey">';
@@ -10520,33 +10520,33 @@  discard block
 block discarded – undo
10520 10520
 						if ($showproject == 'all') {
10521 10521
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10522 10522
 							if ($obj->name) {
10523
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10523
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10524 10524
 							}
10525 10525
 
10526 10526
 							$disabled = 0;
10527 10527
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10528 10528
 								$disabled = 1;
10529
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10529
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10530 10530
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10531 10531
 								if ($discard_closed == 2) {
10532 10532
 									$disabled = 1;
10533 10533
 								}
10534
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10534
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10535 10535
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10536 10536
 								$disabled = 1;
10537
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10537
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10538 10538
 							}
10539 10539
 						}
10540 10540
 
10541 10541
 						if (!empty($selected) && $selected == $obj->rowid) {
10542
-							$out .= '<option value="' . $obj->rowid . '" selected';
10542
+							$out .= '<option value="'.$obj->rowid.'" selected';
10543 10543
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10544
-							$out .= '>' . $labeltoshow . '</option>';
10544
+							$out .= '>'.$labeltoshow.'</option>';
10545 10545
 						} else {
10546 10546
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10547 10547
 								$resultat = '';
10548 10548
 							} else {
10549
-								$resultat = '<option value="' . $obj->rowid . '"';
10549
+								$resultat = '<option value="'.$obj->rowid.'"';
10550 10550
 								if ($disabled) {
10551 10551
 									$resultat .= ' disabled';
10552 10552
 								}
@@ -10598,22 +10598,22 @@  discard block
 block discarded – undo
10598 10598
 
10599 10599
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10600 10600
 		//$sql.= ', el.fk_source';
10601
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10602
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10601
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10602
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10603 10603
 		$sql .= " ORDER BY f.titre ASC";
10604 10604
 
10605 10605
 		$resql = $this->db->query($sql);
10606 10606
 		if ($resql) {
10607 10607
 			// Use select2 selector
10608 10608
 			if (!empty($conf->use_javascript_ajax)) {
10609
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10609
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10610 10610
 				$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
10611 10611
 				$out .= $comboenhancement;
10612 10612
 				$morecss = 'minwidth200imp maxwidth500';
10613 10613
 			}
10614 10614
 
10615 10615
 			if (empty($option_only)) {
10616
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10616
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10617 10617
 			}
10618 10618
 			if (!empty($show_empty)) {
10619 10619
 				$out .= '<option value="0" class="optiongrey">';
@@ -10632,19 +10632,19 @@  discard block
 block discarded – undo
10632 10632
 					$disabled = 0;
10633 10633
 					if (!empty($obj->suspended)) {
10634 10634
 						$disabled = 1;
10635
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10635
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10636 10636
 					}
10637 10637
 
10638 10638
 
10639 10639
 					if (!empty($selected) && $selected == $obj->rowid) {
10640
-						$out .= '<option value="' . $obj->rowid . '" selected';
10640
+						$out .= '<option value="'.$obj->rowid.'" selected';
10641 10641
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10642
-						$out .= '>' . $labeltoshow . '</option>';
10642
+						$out .= '>'.$labeltoshow.'</option>';
10643 10643
 					} else {
10644 10644
 						if ($disabled && ($selected != $obj->rowid)) {
10645 10645
 							$resultat = '';
10646 10646
 						} else {
10647
-							$resultat = '<option value="' . $obj->rowid . '"';
10647
+							$resultat = '<option value="'.$obj->rowid.'"';
10648 10648
 							if ($disabled) {
10649 10649
 								$resultat .= ' disabled';
10650 10650
 							}
@@ -10684,14 +10684,14 @@  discard block
 block discarded – undo
10684 10684
 		global $langs;
10685 10685
 
10686 10686
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10687
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10687
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10688 10688
 		}
10689 10689
 
10690 10690
 		$ret = '';
10691 10691
 
10692 10692
 		$ret .= '<div class="divadvancedsearchfieldcomp inline-block">';
10693 10693
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10694
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10694
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10695 10695
 		$ret .= '</a>';
10696 10696
 
10697 10697
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -10735,29 +10735,29 @@  discard block
 block discarded – undo
10735 10735
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
10736 10736
 		}
10737 10737
 		$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%')) -->";
10738
-		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
10738
+		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
10739 10739
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
10740 10740
 
10741 10741
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
10742 10742
 		foreach ($arrayofcriterias as $criteria) {
10743 10743
 			foreach ($criteria as $criteriafamilykey => $criteriafamilyval) {
10744
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10744
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10745 10745
 					continue;
10746 10746
 				}
10747 10747
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
10748 10748
 					continue;
10749 10749
 				}
10750 10750
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
10751
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
10752
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
10753
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
10754
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
10755
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
10756
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
10757
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
10758
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
10751
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
10752
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
10753
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
10754
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
10755
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
10756
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
10757
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
10758
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
10759 10759
 				} else {
10760
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
10760
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
10761 10761
 				}
10762 10762
 			}
10763 10763
 		}
@@ -10765,7 +10765,7 @@  discard block
 block discarded – undo
10765 10765
 		$ret .= '</div>';
10766 10766
 
10767 10767
 		$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";
10768
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10768
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10769 10769
 
10770 10770
 		$ret .= '</div>';
10771 10771
 		$ret .= '</div>';
@@ -10839,7 +10839,7 @@  discard block
 block discarded – undo
10839 10839
 
10840 10840
 		$TModels = array();
10841 10841
 
10842
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
10842
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
10843 10843
 		$formmail = new FormMail($this->db);
10844 10844
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
10845 10845
 
@@ -10852,17 +10852,17 @@  discard block
 block discarded – undo
10852 10852
 			}
10853 10853
 		}
10854 10854
 
10855
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
10855
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
10856 10856
 
10857 10857
 		foreach ($TModels as $id_model => $label_model) {
10858
-			$retstring .= '<option value="' . $id_model . '"';
10859
-			$retstring .= ">" . $label_model . "</option>";
10858
+			$retstring .= '<option value="'.$id_model.'"';
10859
+			$retstring .= ">".$label_model."</option>";
10860 10860
 		}
10861 10861
 
10862 10862
 		$retstring .= "</select>";
10863 10863
 
10864 10864
 		if ($addjscombo) {
10865
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
10865
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
10866 10866
 		}
10867 10867
 
10868 10868
 		return $retstring;
@@ -10913,16 +10913,16 @@  discard block
 block discarded – undo
10913 10913
 
10914 10914
 		foreach ($buttons as $button) {
10915 10915
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
10916
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
10916
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
10917 10917
 		}
10918 10918
 		$retstring .= $withoutdiv ? '' : '</div>';
10919 10919
 
10920 10920
 		if ($dol_openinpopup) {
10921
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n";
10922
-			$retstring .= '<script nonce="' . getNonce() . '">';
10921
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n";
10922
+			$retstring .= '<script nonce="'.getNonce().'">';
10923 10923
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
10924
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\');
10925
-				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\');
10924
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\');
10925
+				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\');
10926 10926
 				 });';
10927 10927
 			$retstring .= '</script>';
10928 10928
 		}
@@ -10951,7 +10951,7 @@  discard block
 block discarded – undo
10951 10951
 		dol_syslog(__METHOD__, LOG_DEBUG);
10952 10952
 
10953 10953
 		$sql = "SELECT rowid, code, label as label";
10954
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
10954
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
10955 10955
 		$sql .= " WHERE active = 1";
10956 10956
 
10957 10957
 		$resql = $this->db->query($sql);
@@ -10962,7 +10962,7 @@  discard block
 block discarded – undo
10962 10962
 				$obj = $this->db->fetch_object($resql);
10963 10963
 
10964 10964
 				// If translation exists, we use it, otherwise we take the default wording
10965
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
10965
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
10966 10966
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
10967 10967
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
10968 10968
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -10994,18 +10994,18 @@  discard block
 block discarded – undo
10994 10994
 		global $langs, $user;
10995 10995
 
10996 10996
 		$out = '';
10997
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
10997
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
10998 10998
 
10999 10999
 		$this->load_cache_invoice_subtype();
11000 11000
 
11001
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
11001
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
11002 11002
 		if ($addempty) {
11003 11003
 			$out .= '<option value="0">&nbsp;</option>';
11004 11004
 		}
11005 11005
 
11006 11006
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
11007 11007
 			$label = $subtype['label'];
11008
-			$out .= '<option value="' . $subtype['rowid'] . '"';
11008
+			$out .= '<option value="'.$subtype['rowid'].'"';
11009 11009
 			if ($selected == $subtype['rowid']) {
11010 11010
 				$out .= ' selected="selected"';
11011 11011
 			}
Please login to merge, or discard this patch.
htdocs/core/class/CMailFile.class.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 					}
345 345
 				}
346 346
 				if ($emailtoadd && preg_match('/'.preg_quote($emailtoadd, '/').'/i', $to)) {
347
-					$emailtoadd = '';	// Email already in the "To"
347
+					$emailtoadd = ''; // Email already in the "To"
348 348
 				}
349 349
 				if ($emailtoadd) {
350 350
 					$listofemailstoadd[$key] = $emailtoadd;
@@ -1072,19 +1072,19 @@  discard block
 block discarded – undo
1072 1072
 				$res = true;
1073 1073
 				$from = $this->smtps->getFrom('org');
1074 1074
 				if ($res && !$from) {
1075
-					$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - Sender address '$from' invalid";
1075
+					$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - Sender address '$from' invalid";
1076 1076
 					dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
1077 1077
 					$res = false;
1078 1078
 				}
1079 1079
 				$dest = $this->smtps->getTo();
1080 1080
 				if ($res && !$dest) {
1081
-					$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - Recipient address '$dest' invalid";
1081
+					$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - Recipient address '$dest' invalid";
1082 1082
 					dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
1083 1083
 					$res = false;
1084 1084
 				}
1085 1085
 
1086 1086
 				if ($res) {
1087
-					dol_syslog("CMailFile::sendfile: sendMsg, HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport), LOG_DEBUG);
1087
+					dol_syslog("CMailFile::sendfile: sendMsg, HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport), LOG_DEBUG);
1088 1088
 
1089 1089
 					if (getDolGlobalString('MAIN_MAIL_DEBUG')) {
1090 1090
 						$this->smtps->setDebug(true);
@@ -1097,8 +1097,8 @@  discard block
 block discarded – undo
1097 1097
 					}
1098 1098
 
1099 1099
 					$smtperrorcode = 0;
1100
-					if (! $result) {
1101
-						$smtperrorcode = $this->smtps->lastretval;	// SMTP error code
1100
+					if (!$result) {
1101
+						$smtperrorcode = $this->smtps->lastretval; // SMTP error code
1102 1102
 						dol_syslog("CMailFile::sendfile: mail SMTP error code ".$smtperrorcode, LOG_WARNING);
1103 1103
 
1104 1104
 						if ($smtperrorcode == '421') {	// Try later
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
 						}
1117 1117
 					}
1118 1118
 
1119
-					$result = $this->smtps->getErrors();	// applicative error code (not SMTP error code)
1119
+					$result = $this->smtps->getErrors(); // applicative error code (not SMTP error code)
1120 1120
 					if (empty($this->error) && empty($result)) {
1121 1121
 						dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG);
1122 1122
 						$res = true;
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
 						if (empty($this->error)) {
1125 1125
 							$this->error = $result;
1126 1126
 						}
1127
-						dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - ".$this->error, LOG_ERR);
1127
+						dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - ".$this->error, LOG_ERR);
1128 1128
 						$res = false;
1129 1129
 
1130 1130
 						if (getDolGlobalString('MAIN_MAIL_DEBUG')) {
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
 					$this->mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($this->logger));
1254 1254
 				}
1255 1255
 
1256
-				dol_syslog("CMailFile::sendfile: mailer->send, HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport), LOG_DEBUG);
1256
+				dol_syslog("CMailFile::sendfile: mailer->send, HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport), LOG_DEBUG);
1257 1257
 
1258 1258
 				// send mail
1259 1259
 				$failedRecipients = array();
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
 				$res = true;
1270 1270
 				if (!empty($this->error) || !empty($this->errors) || !$result) {
1271 1271
 					if (!empty($failedRecipients)) {
1272
-						$this->errors[] = 'Transport failed for the following addresses: "' . implode('", "', $failedRecipients) . '".';
1272
+						$this->errors[] = 'Transport failed for the following addresses: "'.implode('", "', $failedRecipients).'".';
1273 1273
 					}
1274 1274
 					dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
1275 1275
 					$res = false;
@@ -1364,7 +1364,7 @@  discard block
 block discarded – undo
1364 1364
 
1365 1365
 		if (@is_writable($dolibarr_main_data_root)) {	// Avoid fatal error on fopen with open_basedir
1366 1366
 			$outputfile = $dolibarr_main_data_root."/dolibarr_mail.log";
1367
-			$fp = fopen($outputfile, "w");	// overwrite
1367
+			$fp = fopen($outputfile, "w"); // overwrite
1368 1368
 
1369 1369
 			if ($this->sendmode == 'mail') {
1370 1370
 				fwrite($fp, $this->headers);
@@ -1622,7 +1622,7 @@  discard block
 block discarded – undo
1622 1622
 			// Similar code to forge a text from html is also in smtps.class.php
1623 1623
 			$strContentAltText = preg_replace("/<br\s*[^>]*>/", " ", $strContent);
1624 1624
 			// TODO We could replace <img ...> with [Filename.ext] like Gmail do.
1625
-			$strContentAltText = html_entity_decode(strip_tags($strContentAltText));	// Remove any HTML tags
1625
+			$strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags
1626 1626
 			$strContentAltText = trim(wordwrap($strContentAltText, 75, !getDolGlobalString('MAIN_FIX_FOR_BUGGED_MTA') ? "\r\n" : "\n"));
1627 1627
 
1628 1628
 			// Check if html header already in message, if not complete the message
@@ -2005,7 +2005,7 @@  discard block
 block discarded – undo
2005 2005
 				// We save the image to send in disk
2006 2006
 				$filecontent = $matches[2][$key];
2007 2007
 
2008
-				$cid = 'cid000'.dol_hash($filecontent, 'md5');		// The id must not change if image is same
2008
+				$cid = 'cid000'.dol_hash($filecontent, 'md5'); // The id must not change if image is same
2009 2009
 
2010 2010
 				$destfiletmp = $images_dir.'/'.$cid.'.'.$ext;
2011 2011
 
Please login to merge, or discard this patch.
htdocs/core/lib/invoice.lib.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 			} else {
141 141
 				dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
142 142
 			}
143
-			dol_setcache($cachekey, $nbEvent, 120);		// If setting cache fails, this is not a problem, so we do not test result.
143
+			dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
144 144
 		}
145 145
 
146 146
 		$head[$h][1] .= '/';
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	$h = 0;
256 256
 	$head = array();
257 257
 
258
-	$head[$h][0] = DOL_URL_ROOT . '/compta/facture/card-rec.php?id=' . $object->id;
258
+	$head[$h][0] = DOL_URL_ROOT.'/compta/facture/card-rec.php?id='.$object->id;
259 259
 	$head[$h][1] = $langs->trans("RepeatableInvoice");
260 260
 	$head[$h][2] = 'card';
261 261
 	$h++;
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 			} else {
283 283
 				dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
284 284
 			}
285
-			dol_setcache($cachekey, $nbEvent, 120);		// If setting cache fails, this is not a problem, so we do not test result.
285
+			dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
286 286
 		}
287 287
 
288 288
 		$head[$h][1] .= '/';
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	$h = 0;
319 319
 	$head = array();
320 320
 
321
-	$head[$h][0] = DOL_URL_ROOT . '/fourn/facture/card-rec.php?id=' . $object->id;
321
+	$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/card-rec.php?id='.$object->id;
322 322
 	$head[$h][1] = $langs->trans("RepeatableSupplierInvoice");
323 323
 	$head[$h][2] = 'card';
324 324
 	$h++;
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 				$dolgraph->setShowPercent(1);
450 450
 				$dolgraph->SetType(array('bars', 'bars', 'bars', 'bars', 'bars', 'bars'));
451 451
 				//$dolgraph->SetType(array('pie'));
452
-				$dolgraph->setHeight('160');	/* 160 min is required to show the 6 lines of legend */
452
+				$dolgraph->setHeight('160'); /* 160 min is required to show the 6 lines of legend */
453 453
 				$dolgraph->setWidth('450');
454 454
 				$dolgraph->setHideXValues(true);
455 455
 				if ($mode == 'customers') {
Please login to merge, or discard this patch.
htdocs/core/lib/company.lib.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 					$nbContact = $obj->nb;
83 83
 				}
84 84
 
85
-				dol_setcache($cachekey, $nbContact, 120);	// If setting cache fails, this is not a problem, so we do not test result.
85
+				dol_setcache($cachekey, $nbContact, 120); // If setting cache fails, this is not a problem, so we do not test result.
86 86
 			}
87 87
 
88 88
 			$head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id;
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			} else {
161 161
 				dol_print_error($db);
162 162
 			}
163
-			dol_setcache($cachekey, $nbProject, 120);	// If setting cache fails, this is not a problem, so we do not test result.
163
+			dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result.
164 164
 		}
165 165
 		$head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id;
166 166
 		$head[$h][1] = $langs->trans("Projects");
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 				} else {
331 331
 					dol_print_error($db);
332 332
 				}
333
-				dol_setcache($cachekey, $nbNotif, 120);		// If setting cache fails, this is not a problem, so we do not test result.
333
+				dol_setcache($cachekey, $nbNotif, 120); // If setting cache fails, this is not a problem, so we do not test result.
334 334
 			}
335 335
 
336 336
 			$head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.urlencode((string) ($object->id));
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 			$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
374 374
 			$nbLinks = Link::count($db, $object->element, $object->id);
375 375
 			$totalAttached = $nbFiles + $nbLinks;
376
-			dol_setcache($cachekey, $totalAttached, 120);		// If setting cache fails, this is not a problem, so we do not test result.
376
+			dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result.
377 377
 		}
378 378
 
379 379
 		$head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id;
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 			} else {
408 408
 				dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
409 409
 			}
410
-			dol_setcache($cachekey, $nbEvent, 120);		// If setting cache fails, this is not a problem, so we do not test result.
410
+			dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
411 411
 		}
412 412
 
413 413
 		$head[$h][1] .= '/';
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 		return false;
802 802
 	}
803 803
 
804
-	$country_code_in_EEC = getCountriesInEEC();		// This make a database call but there is a cache done into $conf->cache['country_code_in_EEC']
804
+	$country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC']
805 805
 
806 806
 	//print "dd".$object->country_code;
807 807
 	return in_array($object->country_code, $country_code_in_EEC);
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
 	$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
1199 1199
 	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
1200 1200
 	$sql .= " WHERE t.fk_soc = ".((int) $object->id);
1201
-	$sql .= " AND t.entity IN (" .getEntity('socpeople') .")";
1201
+	$sql .= " AND t.entity IN (".getEntity('socpeople').")";
1202 1202
 	$sql .= " AND ((t.fk_user_creat = ".((int) $user->id)." AND t.priv = 1) OR t.priv = 0)";
1203 1203
 	if ($search_rowid) {
1204 1204
 		$sql .= natural_search('t.rowid', $search_rowid);
@@ -1682,7 +1682,7 @@  discard block
 block discarded – undo
1682 1682
 
1683 1683
 		// Fields from hook
1684 1684
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon);
1685
-		$reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters);    // Note that $action and $object may have been modified by hook
1685
+		$reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook
1686 1686
 		if (!empty($hookmanager->resPrint)) {
1687 1687
 			$sql .= $hookmanager->resPrint;
1688 1688
 		}
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
 
1705 1705
 		// Fields from hook
1706 1706
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon);
1707
-		$reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters);    // Note that $action and $object may have been modified by hook
1707
+		$reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook
1708 1708
 		if (!empty($hookmanager->resPrint)) {
1709 1709
 			$sql .= $hookmanager->resPrint;
1710 1710
 		}
@@ -1795,7 +1795,7 @@  discard block
 block discarded – undo
1795 1795
 				return 'Bad value for $filterobj';
1796 1796
 			}
1797 1797
 		} else {
1798
-			$sql .= " AND u.rowid = ". ((int) $filterobj->id);
1798
+			$sql .= " AND u.rowid = ".((int) $filterobj->id);
1799 1799
 		}
1800 1800
 
1801 1801
 		if (!empty($tms_start) && !empty($tms_end)) {
@@ -1825,7 +1825,7 @@  discard block
 block discarded – undo
1825 1825
 
1826 1826
 		// Fields from hook
1827 1827
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon, 'module' => $module);
1828
-		$reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters);    // Note that $action and $object may have been modified by hook
1828
+		$reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook
1829 1829
 		if (!empty($hookmanager->resPrint)) {
1830 1830
 			$sql .= $hookmanager->resPrint;
1831 1831
 		}
@@ -2518,14 +2518,14 @@  discard block
 block discarded – undo
2518 2518
 		$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix;
2519 2519
 		if (getDolGlobalString($parammessageform) !== '') {
2520 2520
 			print $langs->transnoentities(getDolGlobalString($parammessageform));
2521
-		} elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM')  !== '') {
2521
+		} elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM') !== '') {
2522 2522
 			print $langs->transnoentities(getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM'));
2523 2523
 		}
2524 2524
 
2525 2525
 		// Add other message if VAT exists
2526 2526
 		if (!empty($object->total_vat) || !empty($object->total_tva)) {
2527 2527
 			$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix;
2528
-			if (getDolGlobalString($parammessageform)  !== '') {
2528
+			if (getDolGlobalString($parammessageform) !== '') {
2529 2529
 				print $langs->transnoentities(getDolGlobalString($parammessageform));
2530 2530
 			} elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORMIFVAT') !== '') {
2531 2531
 				print $langs->transnoentities(getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORMIFVAT'));
Please login to merge, or discard this patch.
htdocs/core/modules/societe/doc/doc_generic_odt.modules.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		$maxfilesizearray = getMaxFileSizeArray();
168 168
 		$maxmin = $maxfilesizearray['maxmin'];
169 169
 		if ($maxmin > 0) {
170
-			$texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
170
+			$texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
171 171
 		}
172 172
 		$texte .= ' <input type="file" name="uploadfile">';
173 173
 		$texte .= '<input type="hidden" value="COMPANY_ADDON_PDF_ODT_PATH" name="keyforuploaddir">';
@@ -245,19 +245,19 @@  discard block
 block discarded – undo
245 245
 				// Get extension (ods or odt)
246 246
 				$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
247 247
 				if (getDolGlobalString('MAIN_DOC_USE_OBJECT_THIRDPARTY_NAME')) {
248
-					$newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)) . '-' . $newfiletmp;
249
-					$newfiletmp = preg_replace('/__+/', '_', $newfiletmp);	// Replace repeated _ into one _ (to avoid string with substitution syntax)
248
+					$newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)).'-'.$newfiletmp;
249
+					$newfiletmp = preg_replace('/__+/', '_', $newfiletmp); // Replace repeated _ into one _ (to avoid string with substitution syntax)
250 250
 				}
251 251
 				if (getDolGlobalString('MAIN_DOC_USE_TIMING')) {
252 252
 					$format = getDolGlobalString('MAIN_DOC_USE_TIMING');
253 253
 					if ($format == '1') {
254 254
 						$format = '%Y%m%d%H%M%S';
255 255
 					}
256
-					$filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat;
256
+					$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
257 257
 				} else {
258
-					$filename = $newfiletmp . '.' . $newfileformat;
258
+					$filename = $newfiletmp.'.'.$newfileformat;
259 259
 				}
260
-				$file = $dir . '/' . $filename;
260
+				$file = $dir.'/'.$filename;
261 261
 				$object->builddoc_filename = $filename; // For triggers
262 262
 				//print "newfileformat=".$newfileformat;
263 263
 				//print "newdir=".$dir;
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 				dol_mkdir($conf->societe->multidir_temp[$object->entity]);
270 270
 				if (!is_writable($conf->societe->multidir_temp[$object->entity])) {
271 271
 					$this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->societe->multidir_temp[$object->entity]);
272
-					dol_syslog('Error in write_file: ' . $this->error, LOG_ERR);
272
+					dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
273 273
 					return -1;
274 274
 				}
275 275
 
Please login to merge, or discard this patch.
htdocs/core/modules/barcode/mod_barcode_product_standard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@
 block discarded – undo
200 200
 		//Begin barcode with key: for barcode with key (EAN13...) calculate and substitute the last  character (* or ?) used in the mask by the key
201 201
 		if ((substr($numFinal, -1) == '*') or (substr($numFinal, -1) == '?')) { // if last mask character is * or ? a joker, probably we have to calculate a key as last character (EAN13...)
202 202
 			$literaltype = '';
203
-			$literaltype = $this->literalBarcodeType($db, $type);//get literal_Barcode_Type
203
+			$literaltype = $this->literalBarcodeType($db, $type); //get literal_Barcode_Type
204 204
 			switch ($literaltype) {
205 205
 				case 'EAN13': //EAN13 rowid = 2
206 206
 					if (strlen($numFinal) == 13) {// be sure that the mask length is correct for EAN13
Please login to merge, or discard this patch.
htdocs/ecm/class/ecmfiles.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -162,16 +162,16 @@  discard block
 block discarded – undo
162 162
 		'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash of file content"),
163 163
 		'share' => array('type' => 'varchar(128)', 'label' => 'Share', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash for file sharing"),
164 164
 		'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 50, 'index' => 1),
165
-		'filepath' => array('type' => 'varchar(255)', 'label' => 'FilePath', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "relative to dolibarr document dir. Example module/def"),
166
-		'filename' => array('type' => 'varchar(255)', 'label' => 'FileName', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "file name only without any directory"),
167
-		'src_object_type' => array('type' => 'varchar(64)', 'label' => 'SourceType', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "Source object type ('proposal', 'invoice', ...)"),
165
+		'filepath' => array('type' => 'varchar(255)', 'label' => 'FilePath', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "relative to dolibarr document dir. Example module/def"),
166
+		'filename' => array('type' => 'varchar(255)', 'label' => 'FileName', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "file name only without any directory"),
167
+		'src_object_type' => array('type' => 'varchar(64)', 'label' => 'SourceType', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "Source object type ('proposal', 'invoice', ...)"),
168 168
 		'src_object_id' => array('type' => 'integer', 'label' => 'SourceID', 'default' => '1', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 90, 'index' => 1, 'comment' => "Source object id"),
169
-		'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "full path of original filename, when file is uploaded from a local computer"),
169
+		'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "full path of original filename, when file is uploaded from a local computer"),
170 170
 		'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => 0, 'position' => 110),
171
-		'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."),
171
+		'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."),
172 172
 		'cover' => array('type' => 'text', 'label' => 'Cover', 'enabled' => 1, 'visible' => 0, 'position' => 130, 'comment' => "is this file a file to use for a cover"),
173 173
 		'position' => array('type' => 'integer', 'label' => 'Position', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 140, 'index' => 1, 'comment' => "position of file among others"),
174
-		'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "'generated' or 'uploaded'"),
174
+		'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "'generated' or 'uploaded'"),
175 175
 		'extraparams' => array('type' => 'varchar(255)', 'label' => 'ExtraParams', 'enabled' => 1, 'position' => 160, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "for stocking other parameters with json format"),
176 176
 		'date_c' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170),
177 177
 		'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175),
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
 		$result .= $linkstart.$this->ref.$linkend;
930 930
 
931 931
 		global $action;
932
-		$hookmanager->initHooks(array($this->element . 'dao'));
932
+		$hookmanager->initHooks(array($this->element.'dao'));
933 933
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
934 934
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
935 935
 		if ($reshook > 0) {
Please login to merge, or discard this patch.
htdocs/contrat/class/contrat.class.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		if (getDolGlobalString('CONTRACT_ADDON')) {
302 302
 			$mybool = false;
303 303
 
304
-			$file = getDolGlobalString('CONTRACT_ADDON') . ".php";
304
+			$file = getDolGlobalString('CONTRACT_ADDON').".php";
305 305
 			$classname = getDolGlobalString('CONTRACT_ADDON');
306 306
 
307 307
 			// Include file with class
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 			if ($contratline->statut != ContratLigne::STATUS_OPEN) {
411 411
 				$contratline->context = $this->context;
412 412
 
413
-				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment);	// This call trigger LINECONTRACT_ACTIVATE
413
+				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE
414 414
 				if ($result < 0) {
415 415
 					$error++;
416 416
 					$this->error = $contratline->error;
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 			// Close lines not already closed
461 461
 			if ($contratline->statut != ContratLigne::STATUS_CLOSED) {
462 462
 				$contratline->date_end_real = $now;
463
-				$contratline->date_cloture = $now;	// For backward compatibility
463
+				$contratline->date_cloture = $now; // For backward compatibility
464 464
 				$contratline->user_closing_id = $user->id;
465 465
 				$contratline->statut = ContratLigne::STATUS_CLOSED;
466 466
 				$result = $contratline->close_line($user, $now, $comment, $notrigger);
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 			if (!$error) {
600 600
 				$this->ref = $num;
601 601
 				$this->status = self::STATUS_VALIDATED;
602
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
602
+				$this->statut = self::STATUS_VALIDATED; // deprecated
603 603
 				$this->date_validation = $now;
604 604
 			}
605 605
 		} else {
@@ -869,10 +869,10 @@  discard block
 block discarded – undo
869 869
 				$line->localtax2_tx		= $objp->localtax2_tx;
870 870
 				$line->localtax1_type	= $objp->localtax1_type;
871 871
 				$line->localtax2_type	= $objp->localtax2_type;
872
-				$line->subprice			= $objp->subprice;
872
+				$line->subprice = $objp->subprice;
873 873
 				$line->statut = $objp->status;
874 874
 				$line->status = $objp->status;
875
-				$line->remise_percent	= $objp->remise_percent;
875
+				$line->remise_percent = $objp->remise_percent;
876 876
 				$line->price_ht			= $objp->price_ht;
877 877
 				$line->price = $objp->price_ht; // For backward compatibility
878 878
 				$line->total_ht			= $objp->total_ht;
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
 				//$line->date_fin_prevue   = $this->db->jdate($objp->date_fin_validite);
916 916
 				//$line->date_fin_reel     = $this->db->jdate($objp->date_cloture);
917 917
 
918
-				$line->rang     = $objp->rang;
918
+				$line->rang = $objp->rang;
919 919
 
920 920
 				// Retrieve all extrafields for contract line
921 921
 				// fetch optionals attributes and labels
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
 		}
1428 1428
 
1429 1429
 		if (!$error) {
1430
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
1430
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
1431 1431
 			if ($result < 0) {
1432 1432
 				$error++;
1433 1433
 			}
@@ -2063,7 +2063,7 @@  discard block
 block discarded – undo
2063 2063
 				}
2064 2064
 				$datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
2065 2065
 			}
2066
-			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer;
2066
+			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_customer;
2067 2067
 			if (!$nofetch) {
2068 2068
 				$langs->load('project');
2069 2069
 				if (empty($this->project)) {
@@ -2531,7 +2531,7 @@  discard block
 block discarded – undo
2531 2531
 		global $user;
2532 2532
 
2533 2533
 		$ticket = new Ticket($this->db);
2534
-		$nbTicket =  $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id));
2534
+		$nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id));
2535 2535
 
2536 2536
 		return ($nbTicket < 0 ? $nbTicket : $ticket->lines);
2537 2537
 	}
@@ -2553,7 +2553,7 @@  discard block
 block discarded – undo
2553 2553
 		global $conf, $langs;
2554 2554
 
2555 2555
 		if (!dol_strlen($modele)) {
2556
-			$modele = '';	// No doc template/generation by default
2556
+			$modele = ''; // No doc template/generation by default
2557 2557
 
2558 2558
 			if (!empty($this->model_pdf)) {
2559 2559
 				$modele = $this->model_pdf;
@@ -2650,14 +2650,14 @@  discard block
 block discarded – undo
2650 2650
 			}
2651 2651
 		}
2652 2652
 
2653
-		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').".php")) {
2653
+		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').".php")) {
2654 2654
 			$this->error = 'ErrorSetupNotComplete';
2655 2655
 			dol_syslog($this->error);
2656 2656
 			return -1;
2657 2657
 		}
2658 2658
 
2659 2659
 		// Set ref
2660
-		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').'.php';
2660
+		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').'.php';
2661 2661
 		$obj = getDolGlobalString('CONTRACT_ADDON');
2662 2662
 		$modContract = new $obj();
2663 2663
 		$clonedObj->ref = $modContract->getNextValue($objsoc, $clonedObj);
@@ -2779,7 +2779,7 @@  discard block
 block discarded – undo
2779 2779
 
2780 2780
 					// Load contract
2781 2781
 					$object = new Contrat($this->db);
2782
-					$object->fetch($obj->rowid);		// fetch also lines
2782
+					$object->fetch($obj->rowid); // fetch also lines
2783 2783
 					//$object->fetch_thirdparty();
2784 2784
 
2785 2785
 					if ($object->id <= 0) {
@@ -2826,7 +2826,7 @@  discard block
 block discarded – undo
2826 2826
 					if ($expirationdate && $expirationdate < $enddatetoscan) {
2827 2827
 						dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate);
2828 2828
 						$newdate = $expirationdate;
2829
-						$protecti = 0;	//$protecti is to avoid infinite loop
2829
+						$protecti = 0; //$protecti is to avoid infinite loop
2830 2830
 						while ($newdate < $enddatetoscan && $protecti < 1000) {
2831 2831
 							$newdate = dol_time_plus_duree($newdate, $duration_value, $duration_unit);
2832 2832
 							$protecti++;
@@ -2854,20 +2854,20 @@  discard block
 block discarded – undo
2854 2854
 
2855 2855
 								// Create an event
2856 2856
 								$actioncomm = new ActionComm($this->db);
2857
-								$actioncomm->type_code    = 'AC_OTH_AUTO';		// Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2857
+								$actioncomm->type_code    = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2858 2858
 								$actioncomm->code         = 'AC_'.$actioncode;
2859 2859
 								$actioncomm->label        = $label;
2860 2860
 								$actioncomm->datep        = $now;
2861 2861
 								$actioncomm->datef        = $now;
2862
-								$actioncomm->percentage   = -1;   // Not applicable
2862
+								$actioncomm->percentage   = -1; // Not applicable
2863 2863
 								$actioncomm->socid        = $object->socid;
2864
-								$actioncomm->authorid     = $user->id;   // User saving action
2865
-								$actioncomm->userownerid  = $user->id;	// Owner of action
2864
+								$actioncomm->authorid     = $user->id; // User saving action
2865
+								$actioncomm->userownerid  = $user->id; // Owner of action
2866 2866
 								$actioncomm->fk_element   = $object->id;
2867 2867
 								$actioncomm->elementtype  = 'contract';
2868 2868
 								$actioncomm->note_private = $comment;
2869 2869
 
2870
-								$ret = $actioncomm->create($user);       // User creating action
2870
+								$ret = $actioncomm->create($user); // User creating action
2871 2871
 							} else {
2872 2872
 								$contracterror[$object->id] = $object->ref;
2873 2873
 
@@ -2876,7 +2876,7 @@  discard block
 block discarded – undo
2876 2876
 								$this->error = $this->db->lasterror();
2877 2877
 							}
2878 2878
 
2879
-							if (! $errorforlocaltransaction) {
2879
+							if (!$errorforlocaltransaction) {
2880 2880
 								$this->db->commit();
2881 2881
 							} else {
2882 2882
 								$this->db->rollback();
Please login to merge, or discard this patch.