Completed
Branch develop (e414f0)
by
unknown
18:13
created
htdocs/contact/list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 $object->fields = dol_sort_array($object->fields, 'position');
271 271
 //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
272 272
 $arrayfields = dol_sort_array($arrayfields, 'position');
273
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
273
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
274 274
 
275 275
 
276 276
 if (($id > 0 || !empty($ref)) && $action != 'add') {
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 
511 511
 // Add fields from hooks - ListFrom
512 512
 $parameters = array();
513
-$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action);    // Note that $action and $object may have been modified by hook
513
+$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
514 514
 $sql .= $hookmanager->resPrint;
515 515
 $sql .= ' WHERE p.entity IN ('.getEntity('contact').')';
516 516
 if (!empty($userid)) {    // propre au commercial
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 			if ($searchCategoryContactOperator == 0) {
559 559
 				$searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE p.rowid = ck.fk_socpeople AND ck.fk_categorie = ".((int) $searchCategoryContact).")";
560 560
 			} else {
561
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact);
561
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryContact);
562 562
 			}
563 563
 		}
564 564
 	}
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 			if ($searchCategoryCustomerOperator == 0) {
591 591
 				$searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")";
592 592
 			} else {
593
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
593
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer);
594 594
 			}
595 595
 		}
596 596
 	}
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 			if ($searchCategorySupplierOperator == 0) {
623 623
 				$searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")";
624 624
 			} else {
625
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier);
625
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategorySupplier);
626 626
 			}
627 627
 		}
628 628
 	}
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 if (isModEnabled('category') && $user->hasRight('societe', 'creer')) {
942 942
 	$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
943 943
 }
944
-if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
944
+if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
945 945
 	$arrayofmassactions = array();
946 946
 }
947 947
 
@@ -973,7 +973,7 @@  discard block
 block discarded – undo
973 973
 if ($contextpage != 'poslist') {
974 974
 	$newcardbutton .= dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create', '', $permissiontoadd);
975 975
 } elseif ($user->hasRight('societe', 'contact', 'creer')) {
976
-	$url = DOL_URL_ROOT . '/contact/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?token=' . newToken() . 'type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place);
976
+	$url = DOL_URL_ROOT.'/contact/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage='.urlencode($_SERVER["PHP_SELF"].'?token='.newToken().'type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place);
977 977
 	$label = 'MenuNewCustomer';
978 978
 	$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url);
979 979
 }
Please login to merge, or discard this patch.
htdocs/core/class/html.form.class.php 1 patch
Spacing   +1223 added lines, -1223 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
123 123
 			if (!empty($perm)) {
124 124
 				$tmp = explode(':', $typeofdata);
125
-				$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
125
+				$ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
126 126
 				if ($fieldrequired) {
127 127
 					$ret .= '<span class="fieldrequired">';
128 128
 				}
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 				if ($fieldrequired) {
135 135
 					$ret .= '</span>';
136 136
 				}
137
-				$ret .= '</div>' . "\n";
137
+				$ret .= '</div>'."\n";
138 138
 			} else {
139 139
 				if ($fieldrequired) {
140 140
 					$ret .= '<span class="fieldrequired">';
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 			if (empty($notabletag) && $perm) {
173 173
 				$ret .= '<td class="right">';
174 174
 			}
175
-			if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) {
176
-				$ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>';
175
+			if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) {
176
+				$ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>';
177 177
 			}
178 178
 			if (!empty($notabletag) && $notabletag == 1) {
179 179
 				if ($text) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 			} elseif ($reg[1] == 'int') {
241 241
 				$typeofdata = 'numeric';
242 242
 			} else {
243
-				return 'ErrorBadParameter ' . $typeofdata;
243
+				return 'ErrorBadParameter '.$typeofdata;
244 244
 			}
245 245
 		}
246 246
 
@@ -251,13 +251,13 @@  discard block
 block discarded – undo
251 251
 			if ($editaction == '') {
252 252
 				$editaction = GETPOST('action', 'aZ09');
253 253
 			}
254
-			$editmode = ($editaction == 'edit' . $htmlname);
254
+			$editmode = ($editaction == 'edit'.$htmlname);
255 255
 			if ($editmode) {	// edit mode
256 256
 				$ret .= "\n";
257
-				$ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
258
-				$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
259
-				$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
260
-				$ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">';
257
+				$ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">';
258
+				$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
259
+				$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
260
+				$ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
261 261
 				if (empty($notabletag)) {
262 262
 					$ret .= '<table class="nobordernopadding centpercent">';
263 263
 				}
@@ -266,28 +266,28 @@  discard block
 block discarded – undo
266 266
 				}
267 267
 				if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
268 268
 					$tmp = explode(':', $typeofdata);
269
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
269
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
270 270
 				} elseif (preg_match('/^(integer)/', $typeofdata)) {
271 271
 					$tmp = explode(':', $typeofdata);
272 272
 					$valuetoshow = price2num($editvalue ? $editvalue : $value, 0);
273
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
273
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
274 274
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
275 275
 					$tmp = explode(':', $typeofdata);
276 276
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
277
-					$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
277
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>';
278 278
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
279 279
 					$tmp = explode(':', $typeofdata);
280
-					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>';
280
+					$ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>';
281 281
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {    // if wysiwyg is enabled $typeofdata = 'ckeditor'
282 282
 					$tmp = explode(':', $typeofdata);
283 283
 					$cols = (empty($tmp[2]) ? '' : $tmp[2]);
284 284
 					$morealt = '';
285 285
 					if (preg_match('/%/', $cols)) {
286
-						$morealt = ' style="width: ' . $cols . '"';
286
+						$morealt = ' style="width: '.$cols.'"';
287 287
 						$cols = '';
288 288
 					}
289 289
 					$valuetoshow = ($editvalue ? $editvalue : $value);
290
-					$ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>';
290
+					$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
291 291
 					// textarea convert automatically entities chars into simple chars.
292 292
 					// So we convert & into &amp; so a string like 'a &lt; <b>b</b><br>é<br>&lt;script&gt;alert('X');&lt;script&gt;' stay a correct html and is not converted by textarea component when wysiwig is off.
293 293
 					$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@@ -297,12 +297,12 @@  discard block
 block discarded – undo
297 297
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
298 298
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
299 299
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
300
-					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
300
+					$ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
301 301
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
302 302
 					$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink'];
303 303
 					$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof'];
304 304
 					$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof'];
305
-					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
305
+					$ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm);
306 306
 				} elseif (preg_match('/^select;/', $typeofdata)) {
307 307
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
308 308
 					$arraylist = array();
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 					// TODO Not yet implemented. See code for extrafields
317 317
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
318 318
 					$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser
319
-					require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
319
+					require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
320 320
 					$doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7]));
321 321
 					$ret .= $doleditor->Create(1);
322 322
 				} elseif ($typeofdata == 'asis') {
@@ -331,19 +331,19 @@  discard block
 block discarded – undo
331 331
 					$ret .= '<td>';
332 332
 				}
333 333
 				//else $ret.='<div class="clearboth"></div>';
334
-				$ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">';
334
+				$ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">';
335 335
 				if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) {
336
-					$ret .= '<br>' . "\n";
336
+					$ret .= '<br>'."\n";
337 337
 				}
338
-				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">';
338
+				$ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">';
339 339
 				if (empty($notabletag)) {
340 340
 					$ret .= '</td>';
341 341
 				}
342 342
 
343 343
 				if (empty($notabletag)) {
344
-					$ret .= '</tr></table>' . "\n";
344
+					$ret .= '</tr></table>'."\n";
345 345
 				}
346
-				$ret .= '</form>' . "\n";
346
+				$ret .= '</form>'."\n";
347 347
 			} else {		// view mode
348 348
 				if (preg_match('/^email/', $typeofdata)) {
349 349
 					$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
@@ -355,15 +355,15 @@  discard block
 block discarded – undo
355 355
 					$ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : '');
356 356
 				} elseif (preg_match('/^checkbox/', $typeofdata)) {
357 357
 					$tmp = explode(':', $typeofdata);
358
-					$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
358
+					$ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>';
359 359
 				} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
360 360
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1));
361 361
 				} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) {	// 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring'
362 362
 					$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value));
363 363
 				} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
364
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>';
364
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>';
365 365
 				} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') {
366
-					$ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>';
366
+					$ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>';
367 367
 				} elseif (preg_match('/^select;/', $typeofdata)) {
368 368
 					$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
369 369
 					$arraylist = array();
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
 					$ret .= $arraylist[$value];
375 375
 					if ($htmlname == 'fk_product_type') {
376 376
 						if ($value == 0) {
377
-							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
377
+							$ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
378 378
 						} else {
379
-							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret;
379
+							$ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret;
380 380
 						}
381 381
 					}
382 382
 				} elseif (preg_match('/^ckeditor/', $typeofdata)) {
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 					if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
385 385
 						$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
386 386
 						$firstline = preg_replace('/[\n\r].*/', '', $firstline);
387
-						$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
387
+						$tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
388 388
 					}
389 389
 					// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also
390 390
 					// clean data from some dangerous html
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 					if (empty($moreoptions['valuealreadyhtmlescaped'])) {
394 394
 						$ret .= dol_escape_htmltag($value);
395 395
 					} else {
396
-						$ret .= $value;        // $value must be already html escaped.
396
+						$ret .= $value; // $value must be already html escaped.
397 397
 					}
398 398
 				}
399 399
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 
432 432
 		if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
433 433
 			if (!is_object($extralanguages)) {
434
-				include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
434
+				include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
435 435
 				$extralanguages = new ExtraLanguages($this->db);
436 436
 			}
437 437
 			$extralanguages->fetch_name_extralanguages('societe');
@@ -440,17 +440,17 @@  discard block
 block discarded – undo
440 440
 				return ''; // No extralang field to show
441 441
 			}
442 442
 
443
-			$result .= '<!-- Widget for translation -->' . "\n";
444
-			$result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">';
443
+			$result .= '<!-- Widget for translation -->'."\n";
444
+			$result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
445 445
 			$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
446 446
 			$result .= $s;
447 447
 			$result .= '</div>';
448 448
 
449
-			$result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">';
449
+			$result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
450 450
 
451 451
 			$resultforextrlang = '';
452 452
 			foreach ($arrayoflangcode as $langcode) {
453
-				$valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : '';
453
+				$valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : '';
454 454
 				if (empty($valuetoshow)) {
455 455
 					$object->fetchValuesForExtraLanguages();
456 456
 					//var_dump($object->array_languages);
@@ -462,17 +462,17 @@  discard block
 block discarded – undo
462 462
 
463 463
 				// TODO Use the showInputField() method of ExtraLanguages object
464 464
 				if ($typeofdata == 'textarea') {
465
-					$resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">';
465
+					$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
466 466
 					$resultforextrlang .= $valuetoshow;
467 467
 					$resultforextrlang .= '</textarea>';
468 468
 				} else {
469
-					$resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">';
469
+					$resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">';
470 470
 				}
471 471
 			}
472 472
 			$result .= $resultforextrlang;
473 473
 
474 474
 			$result .= '</div>';
475
-			$result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>';
475
+			$result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
476 476
 		}
477 477
 
478 478
 		return $result;
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 				if (!empty($tmp[2])) {
536 536
 					$savemethod = $tmp[2];
537 537
 				}
538
-				$out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n";
538
+				$out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n";
539 539
 			} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) {
540 540
 				$tmp = explode(':', $inputType);
541 541
 				$inputType = $tmp[0];
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 					$savemethod = $tmp[2];
547 547
 				}
548 548
 
549
-				$out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format
549
+				$out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
550 550
 			} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
551 551
 				$tmp = explode(':', $inputType);
552 552
 				$inputType = $tmp[0];
@@ -577,40 +577,40 @@  discard block
 block discarded – undo
577 577
 				}
578 578
 
579 579
 				if (isModEnabled('fckeditor')) {
580
-					$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
580
+					$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
581 581
 				} else {
582 582
 					$inputType = 'textarea';
583 583
 				}
584 584
 			}
585 585
 
586
-			$out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n";
587
-			$out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n";
588
-			$out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n";
589
-			$out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n";
586
+			$out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
587
+			$out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
588
+			$out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
589
+			$out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
590 590
 			if (!empty($savemethod)) {
591
-				$out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n";
591
+				$out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
592 592
 			}
593 593
 			if (!empty($ext_element)) {
594
-				$out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n";
594
+				$out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
595 595
 			}
596 596
 			if (!empty($custommsg)) {
597 597
 				if (is_array($custommsg)) {
598 598
 					if (!empty($custommsg['success'])) {
599
-						$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n";
599
+						$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
600 600
 					}
601 601
 					if (!empty($custommsg['error'])) {
602
-						$out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n";
602
+						$out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
603 603
 					}
604 604
 				} else {
605
-					$out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n";
605
+					$out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
606 606
 				}
607 607
 			}
608 608
 			if ($inputType == 'textarea') {
609
-				$out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n";
610
-				$out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n";
609
+				$out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
610
+				$out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
611 611
 			}
612
-			$out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n";
613
-			$out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n";
612
+			$out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n";
613
+			$out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n";
614 614
 		} else {
615 615
 			$out = $value;
616 616
 		}
@@ -639,12 +639,12 @@  discard block
 block discarded – undo
639 639
 	public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
640 640
 	{
641 641
 		if ($incbefore) {
642
-			$text = $incbefore . $text;
642
+			$text = $incbefore.$text;
643 643
 		}
644 644
 		if (!$htmltext) {
645 645
 			return $text;
646 646
 		}
647
-		$direction = (int) $direction;    // For backward compatibility when $direction was set to '' instead of 0
647
+		$direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0
648 648
 
649 649
 		$tag = 'td';
650 650
 		if ($notabs == 2) {
@@ -658,11 +658,11 @@  discard block
 block discarded – undo
658 658
 
659 659
 		$extrastyle = '';
660 660
 		if ($direction < 0) {
661
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
661
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
662 662
 			$extrastyle = 'padding: 0px; padding-left: 3px;';
663 663
 		}
664 664
 		if ($direction > 0) {
665
-			$extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : '');
665
+			$extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
666 666
 			$extrastyle = 'padding: 0px; padding-right: 3px;';
667 667
 		}
668 668
 
@@ -675,53 +675,53 @@  discard block
 block discarded – undo
675 675
 			$htmltext = str_replace('"', '&quot;', $htmltext);
676 676
 		} else {
677 677
 			$classfortooltip = 'classfortooltiponclick';
678
-			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>';
678
+			$textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
679 679
 		}
680 680
 		if ($tooltipon == 2 || $tooltipon == 3) {
681
-			$paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"';
681
+			$paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"';
682 682
 			if ($tooltiptrigger == '') {
683
-				$paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip
683
+				$paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip
684 684
 			} else {
685
-				$paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"';
685
+				$paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"';
686 686
 			}
687 687
 		} else {
688
-			$paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
688
+			$paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
689 689
 		}
690 690
 		if ($tooltipon == 1 || $tooltipon == 3) {
691
-			$paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" ';
691
+			$paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" ';
692 692
 			if ($tooltiptrigger == '') {
693
-				$paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip
693
+				$paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip
694 694
 			} else {
695
-				$paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"';
695
+				$paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"';
696 696
 			}
697 697
 		} else {
698
-			$paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag
698
+			$paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag
699 699
 		}
700 700
 		if (empty($notabs)) {
701 701
 			$s .= '<table class="nobordernopadding"><tr style="height: auto;">';
702 702
 		} elseif ($notabs == 2) {
703
-			$s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">';
703
+			$s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">';
704 704
 		}
705 705
 		// Define value if value is before
706 706
 		if ($direction < 0) {
707
-			$s .= '<' . $tag . $paramfortooltipimg;
707
+			$s .= '<'.$tag.$paramfortooltipimg;
708 708
 			if ($tag == 'td') {
709 709
 				$s .= ' class="valigntop" width="14"';
710 710
 			}
711
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
711
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
712 712
 		}
713 713
 		// Use another method to help avoid having a space in value in order to use this value with jquery
714 714
 		// Define label
715 715
 		if ((string) $text != '') {
716
-			$s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>';
716
+			$s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
717 717
 		}
718 718
 		// Define value if value is after
719 719
 		if ($direction > 0) {
720
-			$s .= '<' . $tag . $paramfortooltipimg;
720
+			$s .= '<'.$tag.$paramfortooltipimg;
721 721
 			if ($tag == 'td') {
722 722
 				$s .= ' class="valignmiddle" width="14"';
723 723
 			}
724
-			$s .= '>' . $textfordialog . $img . '</' . $tag . '>';
724
+			$s .= '>'.$textfordialog.$img.'</'.$tag.'>';
725 725
 		}
726 726
 		if (empty($notabs)) {
727 727
 			$s .= '</tr></table>';
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 
829 829
 		$disabled = 0;
830 830
 		$ret = '<div class="centpercent center">';
831
-		$ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>';
831
+		$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>';
832 832
 
833 833
 		// Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks.
834 834
 		$parameters = array();
@@ -838,9 +838,9 @@  discard block
 block discarded – undo
838 838
 			return;
839 839
 		}
840 840
 		if (empty($reshook)) {
841
-			$ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>';
841
+			$ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>';
842 842
 			foreach ($arrayofaction as $code => $label) {
843
-				$ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>';
843
+				$ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>';
844 844
 			}
845 845
 		}
846 846
 		$ret .= $hookmanager->resPrint;
@@ -848,17 +848,17 @@  discard block
 block discarded – undo
848 848
 		$ret .= '</select>';
849 849
 
850 850
 		if (empty($conf->dol_optimize_smallscreen)) {
851
-			$ret .= ajax_combobox('.' . $name . 'select');
851
+			$ret .= ajax_combobox('.'.$name.'select');
852 852
 		}
853 853
 
854 854
 		// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
855 855
 		$ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER.
856
-		$ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">';
856
+		$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
857 857
 		$ret .= '</div>';
858 858
 
859 859
 		if (!empty($conf->use_javascript_ajax)) {
860 860
 			$ret .= '<!-- JS CODE TO ENABLE mass action select -->
861
-    		<script nonce="' . getNonce() . '">
861
+    		<script nonce="' . getNonce().'">
862 862
                         function initCheckForSelect(mode, name, cssclass)	/* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */
863 863
         		{
864 864
         			atleastoneselected=0;
@@ -869,11 +869,11 @@  discard block
 block discarded – undo
869 869
 
870 870
 					console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
871 871
 
872
-    	  			if (atleastoneselected || ' . $alwaysvisible . ')
872
+    	  			if (atleastoneselected || ' . $alwaysvisible.')
873 873
     	  			{
874 874
                                     jQuery("."+name).show();
875
-        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . '
876
-        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . '
875
+        			    ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
876
+        			    ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
877 877
     	  			}
878 878
     	  			else
879 879
     	  			{
@@ -883,11 +883,11 @@  discard block
 block discarded – undo
883 883
         		}
884 884
 
885 885
         	jQuery(document).ready(function () {
886
-                    initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
887
-                    jQuery(".' . $cssclass . '").click(function() {
888
-                        initCheckForSelect(1, "' . $name . '", "' . $cssclass . '");
886
+                    initCheckForSelect(0, "' . $name.'", "'.$cssclass.'");
887
+                    jQuery(".' . $cssclass.'").click(function() {
888
+                        initCheckForSelect(1, "' . $name.'", "'.$cssclass.'");
889 889
                     });
890
-                        jQuery(".' . $name . 'select").change(function() {
890
+                        jQuery(".' . $name.'select").change(function() {
891 891
         			var massaction = $( this ).val();
892 892
         			var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
893 893
         			if (massaction == "builddoc")
@@ -895,18 +895,18 @@  discard block
 block discarded – undo
895 895
                         urlform = urlform + "#show_files";
896 896
     	            }
897 897
         			$( this ).closest("form").attr("action", urlform);
898
-                    console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform);
898
+                    console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform);
899 899
         	        /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
900 900
         			if ($(this).val() != \'0\')
901 901
     	  			{
902
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
903
-										jQuery(".' . $name . 'other").hide();	/* To disable if another div was open */
904
-                                        jQuery(".' . $name . '"+massaction).show();
902
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', false);
903
+										jQuery(".' . $name.'other").hide();	/* To disable if another div was open */
904
+                                        jQuery(".' . $name.'"+massaction).show();
905 905
     	  			}
906 906
     	  			else
907 907
     	  			{
908
-                                        jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
909
-										jQuery(".' . $name . 'other").hide();	/* To disable any div open */
908
+                                        jQuery(".' . $name.'confirmed").prop(\'disabled\', true);
909
+										jQuery(".' . $name.'other").hide();	/* To disable any div open */
910 910
     	  			}
911 911
     	        });
912 912
         	});
@@ -949,14 +949,14 @@  discard block
 block discarded – undo
949 949
 		$atleastonefavorite = 0;
950 950
 
951 951
 		$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec";
952
-		$sql .= " FROM " . $this->db->prefix() . "c_country";
952
+		$sql .= " FROM ".$this->db->prefix()."c_country";
953 953
 		$sql .= " WHERE active > 0";
954 954
 		//$sql.= " ORDER BY code ASC";
955 955
 
956
-		dol_syslog(get_class($this) . "::select_country", LOG_DEBUG);
956
+		dol_syslog(get_class($this)."::select_country", LOG_DEBUG);
957 957
 		$resql = $this->db->query($sql);
958 958
 		if ($resql) {
959
-			$out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>';
959
+			$out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>';
960 960
 			$num = $this->db->num_rows($resql);
961 961
 			$i = 0;
962 962
 			if ($num) {
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 					$countryArray[$i]['rowid'] = $obj->rowid;
967 967
 					$countryArray[$i]['code_iso'] = $obj->code_iso;
968 968
 					$countryArray[$i]['code_iso3'] = $obj->code_iso3;
969
-					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
969
+					$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
970 970
 					$countryArray[$i]['favorite'] = $obj->favorite;
971 971
 					$countryArray[$i]['eec'] = $obj->eec;
972 972
 					$favorite[$i] = $obj->favorite;
@@ -984,20 +984,20 @@  discard block
 block discarded – undo
984 984
 
985 985
 				if ($showempty) {
986 986
 					if (is_numeric($showempty)) {
987
-						$out .= '<option value="">&nbsp;</option>' . "\n";
987
+						$out .= '<option value="">&nbsp;</option>'."\n";
988 988
 					} else {
989
-						$out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n";
989
+						$out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n";
990 990
 					}
991 991
 				}
992 992
 
993 993
 				if ($addspecialentries) {    // Add dedicated entries for groups of countries
994 994
 					//if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>';
995
-					$out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
996
-					$out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>';
995
+					$out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
996
+					$out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>';
997 997
 					if ($mysoc->isInEEC()) {
998
-						$out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>';
998
+						$out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>';
999 999
 					}
1000
-					$out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>';
1000
+					$out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>';
1001 1001
 					$out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>';
1002 1002
 				}
1003 1003
 
@@ -1025,20 +1025,20 @@  discard block
 block discarded – undo
1025 1025
 						$labeltoshow .= '&nbsp;';
1026 1026
 					}
1027 1027
 					if ($row['code_iso']) {
1028
-						$labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>';
1028
+						$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
1029 1029
 						if (empty($hideflags)) {
1030 1030
 							$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1);
1031
-							$labeltoshow = $tmpflag . ' ' . $labeltoshow;
1031
+							$labeltoshow = $tmpflag.' '.$labeltoshow;
1032 1032
 						}
1033 1033
 					}
1034 1034
 
1035 1035
 					if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
1036
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1036
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1037 1037
 					} else {
1038
-						$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
1038
+						$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
1039 1039
 					}
1040 1040
 					$out .= $labeltoshow;
1041
-					$out .= '</option>' . "\n";
1041
+					$out .= '</option>'."\n";
1042 1042
 				}
1043 1043
 			}
1044 1044
 			$out .= '</select>';
@@ -1047,8 +1047,8 @@  discard block
 block discarded – undo
1047 1047
 		}
1048 1048
 
1049 1049
 		// Make select dynamic
1050
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1051
-		$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
1050
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1051
+		$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
1052 1052
 
1053 1053
 		return $out;
1054 1054
 	}
@@ -1080,25 +1080,25 @@  discard block
 block discarded – undo
1080 1080
 		$incotermArray = array();
1081 1081
 
1082 1082
 		$sql = "SELECT rowid, code";
1083
-		$sql .= " FROM " . $this->db->prefix() . "c_incoterms";
1083
+		$sql .= " FROM ".$this->db->prefix()."c_incoterms";
1084 1084
 		$sql .= " WHERE active > 0";
1085 1085
 		$sql .= " ORDER BY code ASC";
1086 1086
 
1087
-		dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG);
1087
+		dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
1088 1088
 		$resql = $this->db->query($sql);
1089 1089
 		if ($resql) {
1090 1090
 			if ($conf->use_javascript_ajax && !$forcecombo) {
1091
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1091
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1092 1092
 				$out .= ajax_combobox($htmlname, $events);
1093 1093
 			}
1094 1094
 
1095 1095
 			if (!empty($page)) {
1096
-				$out .= '<form method="post" action="' . $page . '">';
1096
+				$out .= '<form method="post" action="'.$page.'">';
1097 1097
 				$out .= '<input type="hidden" name="action" value="set_incoterms">';
1098
-				$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
1098
+				$out .= '<input type="hidden" name="token" value="'.newToken().'">';
1099 1099
 			}
1100 1100
 
1101
-			$out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>';
1101
+			$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
1102 1102
 			$out .= '<option value="0">&nbsp;</option>';
1103 1103
 			$num = $this->db->num_rows($resql);
1104 1104
 			$i = 0;
@@ -1112,9 +1112,9 @@  discard block
 block discarded – undo
1112 1112
 
1113 1113
 				foreach ($incotermArray as $row) {
1114 1114
 					if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) {
1115
-						$out .= '<option value="' . $row['rowid'] . '" selected>';
1115
+						$out .= '<option value="'.$row['rowid'].'" selected>';
1116 1116
 					} else {
1117
-						$out .= '<option value="' . $row['rowid'] . '">';
1117
+						$out .= '<option value="'.$row['rowid'].'">';
1118 1118
 					}
1119 1119
 
1120 1120
 					if ($row['code']) {
@@ -1127,13 +1127,13 @@  discard block
 block discarded – undo
1127 1127
 			$out .= '</select>';
1128 1128
 
1129 1129
 			if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
1130
-				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
1130
+				$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n";
1131 1131
 				$moreattrib .= ' autocomplete="off"';
1132 1132
 			}
1133
-			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
1133
+			$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n";
1134 1134
 
1135 1135
 			if (!empty($page)) {
1136
-				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>';
1136
+				$out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>';
1137 1137
 			}
1138 1138
 		} else {
1139 1139
 			dol_print_error($this->db);
@@ -1164,9 +1164,9 @@  discard block
 block discarded – undo
1164 1164
 		if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service"))
1165 1165
 			|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) {
1166 1166
 			if (empty($hidetext)) {
1167
-				print $langs->trans("Type") . ': ';
1167
+				print $langs->trans("Type").': ';
1168 1168
 			}
1169
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
1169
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
1170 1170
 			if ($showempty) {
1171 1171
 				print '<option value="-1"';
1172 1172
 				if ($selected == -1) {
@@ -1179,28 +1179,28 @@  discard block
 block discarded – undo
1179 1179
 			if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) {
1180 1180
 				print ' selected';
1181 1181
 			}
1182
-			print '>' . $langs->trans("Product");
1182
+			print '>'.$langs->trans("Product");
1183 1183
 
1184 1184
 			print '<option value="1"';
1185 1185
 			if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) {
1186 1186
 				print ' selected';
1187 1187
 			}
1188
-			print '>' . $langs->trans("Service");
1188
+			print '>'.$langs->trans("Service");
1189 1189
 
1190 1190
 			print '</select>';
1191
-			print ajax_combobox('select_' . $htmlname);
1191
+			print ajax_combobox('select_'.$htmlname);
1192 1192
 			//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
1193 1193
 		}
1194 1194
 		if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) {
1195 1195
 			print $langs->trans("Service");
1196
-			print '<input type="hidden" name="' . $htmlname . '" value="1">';
1196
+			print '<input type="hidden" name="'.$htmlname.'" value="1">';
1197 1197
 		}
1198 1198
 		if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) {
1199 1199
 			print $langs->trans("Product");
1200
-			print '<input type="hidden" name="' . $htmlname . '" value="0">';
1200
+			print '<input type="hidden" name="'.$htmlname.'" value="0">';
1201 1201
 		}
1202 1202
 		if ($forceall < 0) {    // This should happened only for contracts when both predefined product and service are disabled.
1203
-			print '<input type="hidden" name="' . $htmlname . '" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1
1203
+			print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1
1204 1204
 		}
1205 1205
 	}
1206 1206
 
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 		$langs->load("trips");
1227 1227
 
1228 1228
 		$sql = "SELECT c.code, c.label";
1229
-		$sql .= " FROM " . $this->db->prefix() . "c_type_fees as c";
1229
+		$sql .= " FROM ".$this->db->prefix()."c_type_fees as c";
1230 1230
 		$sql .= " WHERE active > 0";
1231 1231
 
1232 1232
 		$resql = $this->db->query($sql);
@@ -1267,11 +1267,11 @@  discard block
 block discarded – undo
1267 1267
 		// phpcs:enable
1268 1268
 		global $user, $langs;
1269 1269
 
1270
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
1270
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
1271 1271
 
1272 1272
 		$this->load_cache_types_fees();
1273 1273
 
1274
-		print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">';
1274
+		print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
1275 1275
 		if ($showempty) {
1276 1276
 			print '<option value="-1"';
1277 1277
 			if ($selected == -1) {
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
 		}
1282 1282
 
1283 1283
 		foreach ($this->cache_types_fees as $key => $value) {
1284
-			print '<option value="' . $key . '"';
1284
+			print '<option value="'.$key.'"';
1285 1285
 			if ($key == $selected) {
1286 1286
 				print ' selected';
1287 1287
 			}
@@ -1332,12 +1332,12 @@  discard block
 block discarded – undo
1332 1332
 				$ajaxoptions = array();
1333 1333
 			}
1334 1334
 
1335
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1335
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1336 1336
 
1337 1337
 			// No immediate load of all database
1338 1338
 			$placeholder = '';
1339 1339
 			if ($selected && empty($selected_input_value)) {
1340
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1340
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1341 1341
 				$societetmp = new Societe($this->db);
1342 1342
 				$societetmp->fetch($selected);
1343 1343
 				$selected_input_value = $societetmp->name;
@@ -1345,25 +1345,25 @@  discard block
 block discarded – undo
1345 1345
 			}
1346 1346
 
1347 1347
 			// mode 1
1348
-			$urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : '');
1348
+			$urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode((string) ($showtype)) : '').($showcode ? '&showcode='.urlencode((string) ($showcode)) : '');
1349 1349
 
1350 1350
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
1351 1351
 			if (empty($hidelabel)) {
1352
-				print $langs->trans("RefOrLabel") . ' : ';
1352
+				print $langs->trans("RefOrLabel").' : ';
1353 1353
 			} elseif ($hidelabel > 1) {
1354 1354
 				$placeholder = $langs->trans("RefOrLabel");
1355 1355
 				if ($hidelabel == 2) {
1356 1356
 					$out .= img_picto($langs->trans("Search"), 'search');
1357 1357
 				}
1358 1358
 			}
1359
-			$out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
1359
+			$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
1360 1360
 			if ($hidelabel == 3) {
1361 1361
 				$out .= img_picto($langs->trans("Search"), 'search');
1362 1362
 			}
1363 1363
 
1364 1364
 			$out .= ajax_event($htmlname, $events);
1365 1365
 
1366
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1366
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
1367 1367
 		} else {
1368 1368
 			// Immediate load of all database
1369 1369
 			$out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode);
@@ -1447,30 +1447,30 @@  discard block
 block discarded – undo
1447 1447
 			$sql .= ", s.address, s.zip, s.town";
1448 1448
 			$sql .= ", dictp.code as country_code";
1449 1449
 		}
1450
-		$sql .= " FROM " . $this->db->prefix() . "societe as s";
1450
+		$sql .= " FROM ".$this->db->prefix()."societe as s";
1451 1451
 		if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1452
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
1452
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays";
1453 1453
 		}
1454 1454
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1455
-			$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
1455
+			$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
1456 1456
 		}
1457
-		$sql .= " WHERE s.entity IN (" . getEntity('societe') . ")";
1457
+		$sql .= " WHERE s.entity IN (".getEntity('societe').")";
1458 1458
 		if (!empty($user->socid)) {
1459
-			$sql .= " AND s.rowid = " . ((int) $user->socid);
1459
+			$sql .= " AND s.rowid = ".((int) $user->socid);
1460 1460
 		}
1461 1461
 		if ($filter) {
1462 1462
 			// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria()
1463 1463
 			// if not, by testSqlAndScriptInject() only.
1464
-			$sql .= " AND (" . $filter . ")";
1464
+			$sql .= " AND (".$filter.")";
1465 1465
 		}
1466 1466
 		if (!$user->hasRight('societe', 'client', 'voir')) {
1467
-			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
1467
+			$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
1468 1468
 		}
1469 1469
 		if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
1470 1470
 			$sql .= " AND s.status <> 0";
1471 1471
 		}
1472 1472
 		if (!empty($excludeids)) {
1473
-			$sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")";
1473
+			$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")";
1474 1474
 		}
1475 1475
 		// Add where from hooks
1476 1476
 		$parameters = array();
@@ -1490,17 +1490,17 @@  discard block
 block discarded – undo
1490 1490
 				if ($i > 0) {
1491 1491
 					$sql .= " AND ";
1492 1492
 				}
1493
-				$sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')";
1493
+				$sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
1494 1494
 				$i++;
1495 1495
 			}
1496 1496
 			if (count($search_crit) > 1) {
1497 1497
 				$sql .= ")";
1498 1498
 			}
1499 1499
 			if (isModEnabled('barcode')) {
1500
-				$sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1500
+				$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1501 1501
 			}
1502
-			$sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1503
-			$sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
1502
+			$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1503
+			$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
1504 1504
 			$sql .= ")";
1505 1505
 		}
1506 1506
 		$sql .= $this->db->order("nom", "ASC");
@@ -1511,12 +1511,12 @@  discard block
 block discarded – undo
1511 1511
 		$resql = $this->db->query($sql);
1512 1512
 		if ($resql) {
1513 1513
 			if (!$forcecombo) {
1514
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1514
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1515 1515
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT"));
1516 1516
 			}
1517 1517
 
1518 1518
 			// Construct $out and $outarray
1519
-			$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
1519
+			$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n";
1520 1520
 
1521 1521
 			$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
1522 1522
 			if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
 				}
1530 1530
 			}
1531 1531
 			if ($showempty) {
1532
-				$out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : '&nbsp;') . '</span>') . '">' . $textifempty . '</option>' . "\n";
1532
+				$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
1533 1533
 			}
1534 1534
 
1535 1535
 			$companytemp = new Societe($this->db);
@@ -1542,18 +1542,18 @@  discard block
 block discarded – undo
1542 1542
 					$label = '';
1543 1543
 					if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
1544 1544
 						if (($obj->client) && (!empty($obj->code_client))) {
1545
-							$label = $obj->code_client . ' - ';
1545
+							$label = $obj->code_client.' - ';
1546 1546
 						}
1547 1547
 						if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
1548
-							$label .= $obj->code_fournisseur . ' - ';
1548
+							$label .= $obj->code_fournisseur.' - ';
1549 1549
 						}
1550
-						$label .= ' ' . $obj->name;
1550
+						$label .= ' '.$obj->name;
1551 1551
 					} else {
1552 1552
 						$label = $obj->name;
1553 1553
 					}
1554 1554
 
1555 1555
 					if (!empty($obj->name_alias)) {
1556
-						$label .= ' (' . $obj->name_alias . ')';
1556
+						$label .= ' ('.$obj->name_alias.')';
1557 1557
 					}
1558 1558
 
1559 1559
 					if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 						$companytemp->fournisseur = $obj->fournisseur;
1569 1569
 						$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span');
1570 1570
 						if ($tmptype) {
1571
-							$labelhtml .= ' ' . $tmptype;
1571
+							$labelhtml .= ' '.$tmptype;
1572 1572
 						}
1573 1573
 
1574 1574
 						if ($obj->client || $obj->fournisseur) {
@@ -1578,10 +1578,10 @@  discard block
 block discarded – undo
1578 1578
 							$label .= $langs->trans("Customer");
1579 1579
 						}
1580 1580
 						if ($obj->client == 2 || $obj->client == 3) {
1581
-							$label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect");
1581
+							$label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect");
1582 1582
 						}
1583 1583
 						if ($obj->fournisseur) {
1584
-							$label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier");
1584
+							$label .= ($obj->client ? ', ' : '').$langs->trans("Supplier");
1585 1585
 						}
1586 1586
 						if ($obj->client || $obj->fournisseur) {
1587 1587
 							$label .= ')';
@@ -1589,9 +1589,9 @@  discard block
 block discarded – undo
1589 1589
 					}
1590 1590
 
1591 1591
 					if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
1592
-						$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
1592
+						$s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : '');
1593 1593
 						if (!empty($obj->country_code)) {
1594
-							$s .= ', ' . $langs->trans('Country' . $obj->country_code);
1594
+							$s .= ', '.$langs->trans('Country'.$obj->country_code);
1595 1595
 						}
1596 1596
 						$label .= $s;
1597 1597
 						$labelhtml .= $s;
@@ -1599,9 +1599,9 @@  discard block
 block discarded – undo
1599 1599
 
1600 1600
 					if (empty($outputmode)) {
1601 1601
 						if (in_array($obj->rowid, $selected)) {
1602
-							$out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1602
+							$out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1603 1603
 						} else {
1604
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
1604
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
1605 1605
 						}
1606 1606
 					} else {
1607 1607
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml));
@@ -1613,7 +1613,7 @@  discard block
 block discarded – undo
1613 1613
 					}
1614 1614
 				}
1615 1615
 			}
1616
-			$out .= '</select>' . "\n";
1616
+			$out .= '</select>'."\n";
1617 1617
 		} else {
1618 1618
 			dol_print_error($this->db);
1619 1619
 		}
@@ -1647,18 +1647,18 @@  discard block
 block discarded – undo
1647 1647
 		// On recherche les remises
1648 1648
 		$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
1649 1649
 		$sql .= " re.description, re.fk_facture_source";
1650
-		$sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re";
1651
-		$sql .= " WHERE re.fk_soc = " . (int) $socid;
1652
-		$sql .= " AND re.entity = " . $conf->entity;
1650
+		$sql .= " FROM ".$this->db->prefix()."societe_remise_except as re";
1651
+		$sql .= " WHERE re.fk_soc = ".(int) $socid;
1652
+		$sql .= " AND re.entity = ".$conf->entity;
1653 1653
 		if ($filter) {
1654
-			$sql .= " AND " . $filter;
1654
+			$sql .= " AND ".$filter;
1655 1655
 		}
1656 1656
 		$sql .= " ORDER BY re.description ASC";
1657 1657
 
1658
-		dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG);
1658
+		dol_syslog(get_class($this)."::select_remises", LOG_DEBUG);
1659 1659
 		$resql = $this->db->query($sql);
1660 1660
 		if ($resql) {
1661
-			print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">';
1661
+			print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
1662 1662
 			$num = $this->db->num_rows($resql);
1663 1663
 
1664 1664
 			$qualifiedlines = $num;
@@ -1696,16 +1696,16 @@  discard block
 block discarded – undo
1696 1696
 					if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
1697 1697
 						$tmpfac = new Facture($this->db);
1698 1698
 						if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
1699
-							$desc = $desc . ' - ' . $tmpfac->ref;
1699
+							$desc = $desc.' - '.$tmpfac->ref;
1700 1700
 						}
1701 1701
 					}
1702 1702
 
1703
-					print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
1703
+					print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>';
1704 1704
 					$i++;
1705 1705
 				}
1706 1706
 			}
1707 1707
 			print '</select>';
1708
-			print ajax_combobox('select_' . $htmlname);
1708
+			print ajax_combobox('select_'.$htmlname);
1709 1709
 
1710 1710
 			return $qualifiedlines;
1711 1711
 		} else {
@@ -1786,7 +1786,7 @@  discard block
 block discarded – undo
1786 1786
 		$out = '';
1787 1787
 
1788 1788
 		if (!is_object($hookmanager)) {
1789
-			include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1789
+			include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1790 1790
 			$hookmanager = new HookManager($this->db);
1791 1791
 		}
1792 1792
 
@@ -1795,13 +1795,13 @@  discard block
 block discarded – undo
1795 1795
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1796 1796
 			$sql .= ", s.nom as company, s.town AS company_town";
1797 1797
 		}
1798
-		$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
1798
+		$sql .= " FROM ".$this->db->prefix()."socpeople as sp";
1799 1799
 		if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
1800
-			$sql .= " LEFT OUTER JOIN  " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
1800
+			$sql .= " LEFT OUTER JOIN  ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc";
1801 1801
 		}
1802
-		$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
1802
+		$sql .= " WHERE sp.entity IN (".getEntity('contact').")";
1803 1803
 		if ($socid > 0 || $socid == -1) {
1804
-			$sql .= " AND sp.fk_soc = " . ((int) $socid);
1804
+			$sql .= " AND sp.fk_soc = ".((int) $socid);
1805 1805
 		}
1806 1806
 		if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
1807 1807
 			$sql .= " AND sp.statut <> 0";
@@ -1812,30 +1812,30 @@  discard block
 block discarded – undo
1812 1812
 		$sql .= $hookmanager->resPrint;
1813 1813
 		$sql .= " ORDER BY sp.lastname ASC";
1814 1814
 
1815
-		dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG);
1815
+		dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
1816 1816
 		$resql = $this->db->query($sql);
1817 1817
 		if ($resql) {
1818 1818
 			$num = $this->db->num_rows($resql);
1819 1819
 
1820 1820
 			if ($htmlname != 'none' && !$options_only) {
1821
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>';
1821
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
1822 1822
 			}
1823 1823
 
1824 1824
 			if ($showempty && !is_numeric($showempty)) {
1825 1825
 				$textforempty = $showempty;
1826
-				$out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>';
1826
+				$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
1827 1827
 			} else {
1828 1828
 				if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) {
1829
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>&nbsp;</option>';
1829
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
1830 1830
 				}
1831 1831
 				if ($showempty == 2) {
1832
-					$out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>';
1832
+					$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
1833 1833
 				}
1834 1834
 			}
1835 1835
 
1836 1836
 			$i = 0;
1837 1837
 			if ($num) {
1838
-				include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
1838
+				include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
1839 1839
 				$contactstatic = new Contact($this->db);
1840 1840
 
1841 1841
 				while ($i < $num) {
@@ -1871,7 +1871,7 @@  discard block
 block discarded – undo
1871 1871
 						}
1872 1872
 						$extendedInfos = implode(' - ', $extendedInfos);
1873 1873
 						if (!empty($extendedInfos)) {
1874
-							$extendedInfos = ' - ' . $extendedInfos;
1874
+							$extendedInfos = ' - '.$extendedInfos;
1875 1875
 						}
1876 1876
 					}
1877 1877
 
@@ -1888,42 +1888,42 @@  discard block
 block discarded – undo
1888 1888
 								$disabled = 1;
1889 1889
 							}
1890 1890
 							if (!empty($selected) && in_array($obj->rowid, $selected)) {
1891
-								$out .= '<option value="' . $obj->rowid . '"';
1891
+								$out .= '<option value="'.$obj->rowid.'"';
1892 1892
 								if ($disabled) {
1893 1893
 									$out .= ' disabled';
1894 1894
 								}
1895 1895
 								$out .= ' selected>';
1896
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1896
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1897 1897
 								if ($showfunction && $obj->poste) {
1898
-									$out .= ' (' . $obj->poste . ')';
1898
+									$out .= ' ('.$obj->poste.')';
1899 1899
 								}
1900 1900
 								if (($showsoc > 0) && $obj->company) {
1901
-									$out .= ' - (' . $obj->company . ')';
1901
+									$out .= ' - ('.$obj->company.')';
1902 1902
 								}
1903 1903
 								$out .= '</option>';
1904 1904
 							} else {
1905
-								$out .= '<option value="' . $obj->rowid . '"';
1905
+								$out .= '<option value="'.$obj->rowid.'"';
1906 1906
 								if ($disabled) {
1907 1907
 									$out .= ' disabled';
1908 1908
 								}
1909 1909
 								$out .= '>';
1910
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1910
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1911 1911
 								if ($showfunction && $obj->poste) {
1912
-									$out .= ' (' . $obj->poste . ')';
1912
+									$out .= ' ('.$obj->poste.')';
1913 1913
 								}
1914 1914
 								if (($showsoc > 0) && $obj->company) {
1915
-									$out .= ' - (' . $obj->company . ')';
1915
+									$out .= ' - ('.$obj->company.')';
1916 1916
 								}
1917 1917
 								$out .= '</option>';
1918 1918
 							}
1919 1919
 						} else {
1920 1920
 							if (in_array($obj->rowid, $selected)) {
1921
-								$out .= $contactstatic->getFullName($langs) . $extendedInfos;
1921
+								$out .= $contactstatic->getFullName($langs).$extendedInfos;
1922 1922
 								if ($showfunction && $obj->poste) {
1923
-									$out .= ' (' . $obj->poste . ')';
1923
+									$out .= ' ('.$obj->poste.')';
1924 1924
 								}
1925 1925
 								if (($showsoc > 0) && $obj->company) {
1926
-									$out .= ' - (' . $obj->company . ')';
1926
+									$out .= ' - ('.$obj->company.')';
1927 1927
 								}
1928 1928
 							}
1929 1929
 						}
@@ -1932,7 +1932,7 @@  discard block
 block discarded – undo
1932 1932
 				}
1933 1933
 			} else {
1934 1934
 				$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
1935
-				$out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">';
1935
+				$out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">';
1936 1936
 				$out .= $labeltoshow;
1937 1937
 				$out .= '</option>';
1938 1938
 			}
@@ -1953,7 +1953,7 @@  discard block
 block discarded – undo
1953 1953
 			}
1954 1954
 
1955 1955
 			if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
1956
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1956
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1957 1957
 				$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
1958 1958
 			}
1959 1959
 
@@ -2062,14 +2062,14 @@  discard block
 block discarded – undo
2062 2062
 		if ($showlabelofentity) {
2063 2063
 			$sql .= ", e.label";
2064 2064
 		}
2065
-		$sql .= " FROM " . $this->db->prefix() . "user as u";
2065
+		$sql .= " FROM ".$this->db->prefix()."user as u";
2066 2066
 		if ($showlabelofentity) {
2067
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
2067
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
2068 2068
 		}
2069 2069
 		// Condition here should be the same than into societe->getSalesRepresentatives().
2070 2070
 		if ($userissuperadminentityone && $force_entity != 'default') {
2071 2071
 			if (!empty($force_entity)) {
2072
-				$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
2072
+				$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
2073 2073
 			} else {
2074 2074
 				$sql .= " WHERE u.entity IS NOT NULL";
2075 2075
 			}
@@ -2077,18 +2077,18 @@  discard block
 block discarded – undo
2077 2077
 			if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) {
2078 2078
 				$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))";
2079 2079
 			} else {
2080
-				$sql .= " WHERE u.entity IN (" . getEntity('user') . ")";
2080
+				$sql .= " WHERE u.entity IN (".getEntity('user').")";
2081 2081
 			}
2082 2082
 		}
2083 2083
 
2084 2084
 		if (!empty($user->socid)) {
2085
-			$sql .= " AND u.fk_soc = " . ((int) $user->socid);
2085
+			$sql .= " AND u.fk_soc = ".((int) $user->socid);
2086 2086
 		}
2087 2087
 		if (is_array($exclude) && $excludeUsers) {
2088
-			$sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")";
2088
+			$sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")";
2089 2089
 		}
2090 2090
 		if ($includeUsers) {
2091
-			$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
2091
+			$sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")";
2092 2092
 		}
2093 2093
 		if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
2094 2094
 			$sql .= " AND u.statut <> 0";
@@ -2100,7 +2100,7 @@  discard block
 block discarded – undo
2100 2100
 			$sql .= " AND u.fk_soc IS NULL";
2101 2101
 		}
2102 2102
 		if (!empty($morefilter)) {
2103
-			$sql .= " " . $morefilter;
2103
+			$sql .= " ".$morefilter;
2104 2104
 		}
2105 2105
 
2106 2106
 		//Add hook to filter on user (for example on usergroup define in custom modules)
@@ -2115,7 +2115,7 @@  discard block
 block discarded – undo
2115 2115
 			$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
2116 2116
 		}
2117 2117
 
2118
-		dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG);
2118
+		dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
2119 2119
 
2120 2120
 		$resql = $this->db->query($sql);
2121 2121
 		if ($resql) {
@@ -2123,7 +2123,7 @@  discard block
 block discarded – undo
2123 2123
 			$i = 0;
2124 2124
 			if ($num) {
2125 2125
 				// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
2126
-				$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
2126
+				$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
2127 2127
 				if ($show_empty && !$multiple) {
2128 2128
 					$textforempty = ' ';
2129 2129
 					if (!empty($conf->use_javascript_ajax)) {
@@ -2132,10 +2132,10 @@  discard block
 block discarded – undo
2132 2132
 					if (!is_numeric($show_empty)) {
2133 2133
 						$textforempty = $show_empty;
2134 2134
 					}
2135
-					$out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
2135
+					$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
2136 2136
 				}
2137 2137
 				if ($show_every) {
2138
-					$out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n";
2138
+					$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";
2139 2139
 				}
2140 2140
 
2141 2141
 				$userstatic = new User($this->db);
@@ -2182,21 +2182,21 @@  discard block
 block discarded – undo
2182 2182
 					}
2183 2183
 					if ($showstatus >= 0) {
2184 2184
 						if ($obj->status == 1 && $showstatus == 1) {
2185
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
2186
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled');
2185
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled');
2186
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled');
2187 2187
 						}
2188 2188
 						if ($obj->status == 0 && $showstatus == 1) {
2189
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
2190
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled');
2189
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
2190
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled');
2191 2191
 						}
2192 2192
 					}
2193 2193
 					if ($showlabelofentity) {
2194 2194
 						if (empty($obj->entity)) {
2195
-							$moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities");
2196
-							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities");
2195
+							$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
2196
+							$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities");
2197 2197
 						} else {
2198 2198
 							if ($obj->entity != $conf->entity) {
2199
-								$moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2199
+								$moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2200 2200
 								$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined"));
2201 2201
 							}
2202 2202
 						}
@@ -2205,13 +2205,13 @@  discard block
 block discarded – undo
2205 2205
 					$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : '');
2206 2206
 					if (!empty($disableline) && $disableline != '1') {
2207 2207
 						// Add text from $enableonlytext parameter
2208
-						$moreinfo .= ' - ' . $disableline;
2209
-						$moreinfohtml .= ' - ' . $disableline;
2208
+						$moreinfo .= ' - '.$disableline;
2209
+						$moreinfohtml .= ' - '.$disableline;
2210 2210
 					}
2211 2211
 					$labeltoshow .= $moreinfo;
2212 2212
 					$labeltoshowhtml .= $moreinfohtml;
2213 2213
 
2214
-					$out .= '<option value="' . $obj->rowid . '"';
2214
+					$out .= '<option value="'.$obj->rowid.'"';
2215 2215
 					if (!empty($disableline)) {
2216 2216
 						$out .= ' disabled';
2217 2217
 					}
@@ -2219,7 +2219,7 @@  discard block
 block discarded – undo
2219 2219
 						$out .= ' selected';
2220 2220
 					}
2221 2221
 					$out .= ' data-html="';
2222
-					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' ';
2222
+					$outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
2223 2223
 					if ($showstatus >= 0 && $obj->status == 0) {
2224 2224
 						$outhtml .= '<strike class="opacitymediumxxx">';
2225 2225
 					}
@@ -2232,7 +2232,7 @@  discard block
 block discarded – undo
2232 2232
 					$out .= $labeltoshow;
2233 2233
 					$out .= '</option>';
2234 2234
 
2235
-					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo;
2235
+					$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo;
2236 2236
 					$outarray2[$userstatic->id] = array(
2237 2237
 						'id' => $userstatic->id,
2238 2238
 						'label' => $labeltoshow,
@@ -2244,14 +2244,14 @@  discard block
 block discarded – undo
2244 2244
 					$i++;
2245 2245
 				}
2246 2246
 			} else {
2247
-				$out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>';
2248
-				$out .= '<option value="">' . $langs->trans("None") . '</option>';
2247
+				$out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>';
2248
+				$out .= '<option value="">'.$langs->trans("None").'</option>';
2249 2249
 			}
2250 2250
 			$out .= '</select>';
2251 2251
 
2252 2252
 			if ($num && !$forcecombo) {
2253 2253
 				// Enhance with select2
2254
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2254
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2255 2255
 				$out .= ajax_combobox($htmlname);
2256 2256
 			}
2257 2257
 		} else {
@@ -2325,16 +2325,16 @@  discard block
 block discarded – undo
2325 2325
 			$out .= $userstatic->getNomUrl(-1);
2326 2326
 			if ($i == 0) {
2327 2327
 				$ownerid = $value['id'];
2328
-				$out .= ' (' . $langs->trans("Owner") . ')';
2328
+				$out .= ' ('.$langs->trans("Owner").')';
2329 2329
 			}
2330 2330
 			if ($nbassignetouser > 1 && $action != 'view') {
2331
-				$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 . '">';
2331
+				$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.'">';
2332 2332
 			}
2333 2333
 			// Show my availability
2334 2334
 			if ($showproperties) {
2335 2335
 				if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) {
2336 2336
 					$out .= '<div class="myavailability inline-block">';
2337
-					$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>';
2337
+					$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>';
2338 2338
 					$out .= '</div>';
2339 2339
 				}
2340 2340
 			}
@@ -2351,15 +2351,15 @@  discard block
 block discarded – undo
2351 2351
 		// Method with no ajax
2352 2352
 		if ($action != 'view') {
2353 2353
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
2354
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2354
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2355 2355
 			$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
2356 2356
 			$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
2357
-			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }';
2358
-			$out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }';
2357
+			$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
2358
+			$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
2359 2359
 			$out .= '});';
2360 2360
 			$out .= '})</script>';
2361 2361
 			$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2362
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2362
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2363 2363
 			$out .= '<br>';
2364 2364
 		}
2365 2365
 
@@ -2418,13 +2418,13 @@  discard block
 block discarded – undo
2418 2418
 			$resourcestatic->fetch($value['id']);
2419 2419
 			$out .= $resourcestatic->getNomUrl(-1);
2420 2420
 			if ($nbassignetoresource > 1 && $action != 'view') {
2421
-				$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 . '">';
2421
+				$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.'">';
2422 2422
 			}
2423 2423
 			// Show my availability
2424 2424
 			if ($showproperties) {
2425 2425
 				if (is_array($listofresourceid) && count($listofresourceid)) {
2426 2426
 					$out .= '<div class="myavailability inline-block">';
2427
-					$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>';
2427
+					$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>';
2428 2428
 					$out .= '</div>';
2429 2429
 				}
2430 2430
 			}
@@ -2441,11 +2441,11 @@  discard block
 block discarded – undo
2441 2441
 		// Method with no ajax
2442 2442
 		if ($action != 'view') {
2443 2443
 			$out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">';
2444
-			$out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {';
2444
+			$out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {';
2445 2445
 			$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });';
2446 2446
 			$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());';
2447
-			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }';
2448
-			$out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }';
2447
+			$out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }';
2448
+			$out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }';
2449 2449
 			$out .= '});';
2450 2450
 			$out .= '})</script>';
2451 2451
 
@@ -2453,7 +2453,7 @@  discard block
 block discarded – undo
2453 2453
 			$out .= img_picto('', 'resource', 'class="pictofixedwidth"');
2454 2454
 			$out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0);
2455 2455
 			//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
2456
-			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">';
2456
+			$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
2457 2457
 			$out .= '<br>';
2458 2458
 		}
2459 2459
 
@@ -2514,7 +2514,7 @@  discard block
 block discarded – undo
2514 2514
 			$placeholder = '';
2515 2515
 
2516 2516
 			if ($selected && empty($selected_input_value)) {
2517
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2517
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2518 2518
 				$producttmpselect = new Product($this->db);
2519 2519
 				$producttmpselect->fetch($selected);
2520 2520
 				$selected_input_value = $producttmpselect->ref;
@@ -2529,17 +2529,17 @@  discard block
 block discarded – undo
2529 2529
 				}
2530 2530
 			}
2531 2531
 			// mode=1 means customers products
2532
-			$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;
2533
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2532
+			$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;
2533
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
2534 2534
 
2535 2535
 			if (isModEnabled('variants') && is_array($selected_combinations)) {
2536 2536
 				// Code to automatically insert with javascript the select of attributes under the select of product
2537 2537
 				// when a parent of variant has been selected.
2538 2538
 				$out .= '
2539 2539
 				<!-- script to auto show attributes select tags if a variant was selected -->
2540
-				<script nonce="' . getNonce() . '">
2540
+				<script nonce="' . getNonce().'">
2541 2541
 					// auto show attributes fields
2542
-					selected = ' . json_encode($selected_combinations) . ';
2542
+					selected = ' . json_encode($selected_combinations).';
2543 2543
 					combvalues = {};
2544 2544
 
2545 2545
 					jQuery(document).ready(function () {
@@ -2550,7 +2550,7 @@  discard block
 block discarded – undo
2550 2550
 							}
2551 2551
 						});
2552 2552
 
2553
-						jQuery("input#' . $htmlname . '").change(function () {
2553
+						jQuery("input#' . $htmlname.'").change(function () {
2554 2554
 
2555 2555
 							if (!jQuery(this).val()) {
2556 2556
 								jQuery(\'div#attributes_box\').empty();
@@ -2559,7 +2559,7 @@  discard block
 block discarded – undo
2559 2559
 
2560 2560
 							console.log("A change has started. We get variants fields to inject html select");
2561 2561
 
2562
-							jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", {
2562
+							jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", {
2563 2563
 								id: jQuery(this).val()
2564 2564
 							}, function (data) {
2565 2565
 								jQuery(\'div#attributes_box\').empty();
@@ -2602,21 +2602,21 @@  discard block
 block discarded – undo
2602 2602
 							})
2603 2603
 						});
2604 2604
 
2605
-						' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . '
2605
+						' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').'
2606 2606
 					});
2607 2607
 				</script>
2608 2608
                 ';
2609 2609
 			}
2610 2610
 
2611 2611
 			if (empty($hidelabel)) {
2612
-				$out .= $langs->trans("RefOrLabel") . ' : ';
2612
+				$out .= $langs->trans("RefOrLabel").' : ';
2613 2613
 			} elseif ($hidelabel > 1) {
2614
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
2614
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
2615 2615
 				if ($hidelabel == 2) {
2616 2616
 					$out .= img_picto($langs->trans("Search"), 'search');
2617 2617
 				}
2618 2618
 			}
2619
-			$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
2619
+			$out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
2620 2620
 			if ($hidelabel == 3) {
2621 2621
 				$out .= img_picto($langs->trans("Search"), 'search');
2622 2622
 			}
@@ -2653,33 +2653,33 @@  discard block
 block discarded – undo
2653 2653
 		// phpcs:enable
2654 2654
 		global $conf, $user, $langs, $db;
2655 2655
 
2656
-		require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2656
+		require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2657 2657
 
2658 2658
 		$error = 0;
2659 2659
 		$out = '';
2660 2660
 
2661 2661
 		if (!$forcecombo) {
2662
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2662
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2663 2663
 			$events = array();
2664 2664
 			$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2665 2665
 		}
2666 2666
 
2667
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2667
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2668 2668
 
2669 2669
 		$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product';
2670
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b';
2671
-		$sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')';
2670
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b';
2671
+		$sql .= ' WHERE b.entity IN ('.getEntity('bom').')';
2672 2672
 		if (!empty($status)) {
2673
-			$sql .= ' AND status = ' . (int) $status;
2673
+			$sql .= ' AND status = '.(int) $status;
2674 2674
 		}
2675 2675
 		if (!empty($type)) {
2676
-			$sql .= ' AND bomtype = ' . (int) $type;
2676
+			$sql .= ' AND bomtype = '.(int) $type;
2677 2677
 		}
2678 2678
 		if (!empty($TProducts)) {
2679
-			$sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')';
2679
+			$sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')';
2680 2680
 		}
2681 2681
 		if (!empty($limit)) {
2682
-			$sql .= ' LIMIT ' . (int) $limit;
2682
+			$sql .= ' LIMIT '.(int) $limit;
2683 2683
 		}
2684 2684
 		$resql = $db->query($sql);
2685 2685
 		if ($resql) {
@@ -2693,11 +2693,11 @@  discard block
 block discarded – undo
2693 2693
 			while ($obj = $db->fetch_object($resql)) {
2694 2694
 				$product = new Product($db);
2695 2695
 				$res = $product->fetch($obj->fk_product);
2696
-				$out .= '<option value="' . $obj->rowid . '"';
2696
+				$out .= '<option value="'.$obj->rowid.'"';
2697 2697
 				if ($obj->rowid == $selected) {
2698 2698
 					$out .= 'selected';
2699 2699
 				}
2700
-				$out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>';
2700
+				$out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>';
2701 2701
 			}
2702 2702
 		} else {
2703 2703
 			$error++;
@@ -2754,7 +2754,7 @@  discard block
 block discarded – undo
2754 2754
 
2755 2755
 		$warehouseStatusArray = array();
2756 2756
 		if (!empty($warehouseStatus)) {
2757
-			require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
2757
+			require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
2758 2758
 			if (preg_match('/warehouseclosed/', $warehouseStatus)) {
2759 2759
 				$warehouseStatusArray[] = Entrepot::STATUS_CLOSED;
2760 2760
 			}
@@ -2768,9 +2768,9 @@  discard block
 block discarded – undo
2768 2768
 
2769 2769
 		$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";
2770 2770
 		if (count($warehouseStatusArray)) {
2771
-			$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
2771
+			$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
2772 2772
 		} else {
2773
-			$selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock";
2773
+			$selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock";
2774 2774
 		}
2775 2775
 
2776 2776
 		$sql = "SELECT ";
@@ -2786,9 +2786,9 @@  discard block
 block discarded – undo
2786 2786
 
2787 2787
 		if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
2788 2788
 			//Product category
2789
-			$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
2790
-						FROM " . $this->db->prefix() . "categorie_product
2791
-						WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid
2789
+			$sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie
2790
+						FROM " . $this->db->prefix()."categorie_product
2791
+						WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid
2792 2792
 						LIMIT 1
2793 2793
 				) AS categorie_product_id ";
2794 2794
 		}
@@ -2814,15 +2814,15 @@  discard block
 block discarded – undo
2814 2814
 		}
2815 2815
 		// Price by quantity
2816 2816
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2817
-			$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
2817
+			$sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid";
2818 2818
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2819
-				$sql .= " AND price_level = " . ((int) $price_level);
2819
+				$sql .= " AND price_level = ".((int) $price_level);
2820 2820
 			}
2821 2821
 			$sql .= " ORDER BY date_price";
2822 2822
 			$sql .= " DESC LIMIT 1) as price_rowid";
2823
-			$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
2823
+			$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
2824 2824
 			if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
2825
-				$sql .= " AND price_level = " . ((int) $price_level);
2825
+				$sql .= " AND price_level = ".((int) $price_level);
2826 2826
 			}
2827 2827
 			$sql .= " ORDER BY date_price";
2828 2828
 			$sql .= " DESC LIMIT 1) as price_by_qty";
@@ -2831,58 +2831,58 @@  discard block
 block discarded – undo
2831 2831
 
2832 2832
 		$sql .= " FROM ".$this->db->prefix()."product as p";
2833 2833
 		// Add from (left join) from hooks
2834
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
2834
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
2835 2835
 		$reshook = $hookmanager->executeHooks('selectProductsListFrom', $parameters); // Note that $action and $object may have been modified by hook
2836 2836
 		$sql .= $hookmanager->resPrint;
2837 2837
 
2838 2838
 		if (count($warehouseStatusArray)) {
2839
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid";
2840
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")";
2841
-			$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.
2839
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid";
2840
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
2841
+			$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.
2842 2842
 		}
2843 2843
 
2844 2844
 		// include search in supplier ref
2845 2845
 		if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2846
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2846
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
2847 2847
 		}
2848 2848
 
2849 2849
 		//Price by customer
2850 2850
 		if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2851
-			$sql .= " LEFT JOIN  " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
2851
+			$sql .= " LEFT JOIN  ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
2852 2852
 		}
2853 2853
 		// Units
2854 2854
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
2855
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
2855
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
2856 2856
 		}
2857 2857
 		// Multilang : we add translation
2858 2858
 		if (getDolGlobalInt('MAIN_MULTILANGS')) {
2859
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
2859
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
2860 2860
 			if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
2861
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
2861
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
2862 2862
 				$soc = new Societe($this->db);
2863 2863
 				$result = $soc->fetch($socid);
2864 2864
 				if ($result > 0 && !empty($soc->default_lang)) {
2865
-					$sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'";
2865
+					$sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'";
2866 2866
 				} else {
2867
-					$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2867
+					$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2868 2868
 				}
2869 2869
 			} else {
2870
-				$sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'";
2870
+				$sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'";
2871 2871
 			}
2872 2872
 		}
2873 2873
 
2874 2874
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2875
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2875
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
2876 2876
 		}
2877 2877
 
2878
-		$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
2878
+		$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
2879 2879
 
2880 2880
 		if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
2881 2881
 			$sql .= " AND pac.rowid IS NULL";
2882 2882
 		}
2883 2883
 
2884 2884
 		if ($finished == 0) {
2885
-			$sql .= " AND p.finished = " . ((int) $finished);
2885
+			$sql .= " AND p.finished = ".((int) $finished);
2886 2886
 		} elseif ($finished == 1) {
2887 2887
 			$sql .= " AND p.finished = ".((int) $finished);
2888 2888
 		}
@@ -2890,18 +2890,18 @@  discard block
 block discarded – undo
2890 2890
 			$sql .= " AND p.tosell = ".((int) $status);
2891 2891
 		}
2892 2892
 		if ($status_purchase >= 0) {
2893
-			$sql .= " AND p.tobuy = " . ((int) $status_purchase);
2893
+			$sql .= " AND p.tobuy = ".((int) $status_purchase);
2894 2894
 		}
2895 2895
 		// Filter by product type
2896 2896
 		if (strval($filtertype) != '') {
2897
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
2897
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
2898 2898
 		} elseif (!isModEnabled('product')) { // when product module is disabled, show services only
2899 2899
 			$sql .= " AND p.fk_product_type = 1";
2900 2900
 		} elseif (!isModEnabled('service')) { // when service module is disabled, show products only
2901 2901
 			$sql .= " AND p.fk_product_type = 0";
2902 2902
 		}
2903 2903
 		// Add where from hooks
2904
-		$parameters = array();  // @phan-suppress-current-line PhanPluginRedundantAssignment
2904
+		$parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment
2905 2905
 		$reshook = $hookmanager->executeHooks('selectProductsListWhere', $parameters); // Note that $action and $object may have been modified by hook
2906 2906
 		$sql .= $hookmanager->resPrint;
2907 2907
 		// Add criteria on ref/label
@@ -2918,21 +2918,21 @@  discard block
 block discarded – undo
2918 2918
 				if ($i > 0) {
2919 2919
 					$sql .= " AND ";
2920 2920
 				}
2921
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2921
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2922 2922
 				if (getDolGlobalInt('MAIN_MULTILANGS')) {
2923
-					$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2923
+					$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
2924 2924
 				}
2925 2925
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
2926
-					$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2926
+					$sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'";
2927 2927
 				}
2928 2928
 				if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
2929
-					$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2929
+					$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2930 2930
 					if (getDolGlobalInt('MAIN_MULTILANGS')) {
2931
-						$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2931
+						$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
2932 2932
 					}
2933 2933
 				}
2934 2934
 				if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
2935
-					$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
2935
+					$sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
2936 2936
 				}
2937 2937
 				$sql .= ")";
2938 2938
 				$i++;
@@ -2941,12 +2941,12 @@  discard block
 block discarded – undo
2941 2941
 				$sql .= ")";
2942 2942
 			}
2943 2943
 			if (isModEnabled('barcode')) {
2944
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
2944
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
2945 2945
 			}
2946 2946
 			$sql .= ')';
2947 2947
 		}
2948 2948
 		if (count($warehouseStatusArray)) {
2949
-			$sql .= " GROUP BY " . $selectFields;
2949
+			$sql .= " GROUP BY ".$selectFields;
2950 2950
 		}
2951 2951
 
2952 2952
 		//Sort by category
@@ -2961,23 +2961,23 @@  discard block
 block discarded – undo
2961 2961
 		$sql .= $this->db->plimit($limit, 0);
2962 2962
 
2963 2963
 		// Build output string
2964
-		dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG);
2964
+		dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG);
2965 2965
 		$result = $this->db->query($sql);
2966 2966
 		if ($result) {
2967
-			require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
2968
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
2969
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
2967
+			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
2968
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
2969
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
2970 2970
 
2971 2971
 			$num = $this->db->num_rows($result);
2972 2972
 
2973 2973
 			$events = array();
2974 2974
 
2975 2975
 			if (!$forcecombo) {
2976
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
2976
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
2977 2977
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
2978 2978
 			}
2979 2979
 
2980
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
2980
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
2981 2981
 
2982 2982
 			$textifempty = '';
2983 2983
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -2994,7 +2994,7 @@  discard block
 block discarded – undo
2994 2994
 				}
2995 2995
 			}
2996 2996
 			if ($showempty) {
2997
-				$out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : '&nbsp;') . '</option>';
2997
+				$out .= '<option value="-1" selected>'.($textifempty ? $textifempty : '&nbsp;').'</option>';
2998 2998
 			}
2999 2999
 
3000 3000
 			$i = 0;
@@ -3005,11 +3005,11 @@  discard block
 block discarded – undo
3005 3005
 
3006 3006
 				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
3007 3007
 					$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
3008
-					$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
3009
-					$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
3008
+					$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
3009
+					$sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid);
3010 3010
 					$sql .= " ORDER BY quantity ASC";
3011 3011
 
3012
-					dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG);
3012
+					dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG);
3013 3013
 					$result2 = $this->db->query($sql);
3014 3014
 					if ($result2) {
3015 3015
 						$nb_prices = $this->db->num_rows($result2);
@@ -3047,7 +3047,7 @@  discard block
 block discarded – undo
3047 3047
 						$price_product = new Product($this->db);
3048 3048
 						$price_product->fetch($objp->rowid, '', '', 1);
3049 3049
 
3050
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3050
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3051 3051
 						$priceparser = new PriceParser($this->db);
3052 3052
 						$price_result = $priceparser->parseProduct($price_product);
3053 3053
 						if ($price_result >= 0) {
@@ -3131,7 +3131,7 @@  discard block
 block discarded – undo
3131 3131
 			$label = $objp->label_translated;
3132 3132
 		}
3133 3133
 		if (!empty($filterkey) && $filterkey != '') {
3134
-			$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3134
+			$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3135 3135
 		}
3136 3136
 
3137 3137
 		$outkey = $objp->rowid;
@@ -3152,32 +3152,32 @@  discard block
 block discarded – undo
3152 3152
 		$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
3153 3153
 
3154 3154
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3155
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
3155
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
3156 3156
 		}
3157 3157
 
3158 3158
 		// Units
3159 3159
 		$outvalUnits = '';
3160 3160
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3161 3161
 			if (!empty($objp->unit_short)) {
3162
-				$outvalUnits .= ' - ' . $objp->unit_short;
3162
+				$outvalUnits .= ' - '.$objp->unit_short;
3163 3163
 			}
3164 3164
 		}
3165 3165
 		if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
3166 3166
 			if (!empty($objp->weight) && $objp->weight_units !== null) {
3167 3167
 				$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3168
-				$outvalUnits .= ' - ' . $unitToShow;
3168
+				$outvalUnits .= ' - '.$unitToShow;
3169 3169
 			}
3170 3170
 			if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3171
-				$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3172
-				$outvalUnits .= ' - ' . $unitToShow;
3171
+				$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3172
+				$outvalUnits .= ' - '.$unitToShow;
3173 3173
 			}
3174 3174
 			if (!empty($objp->surface) && $objp->surface_units !== null) {
3175 3175
 				$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3176
-				$outvalUnits .= ' - ' . $unitToShow;
3176
+				$outvalUnits .= ' - '.$unitToShow;
3177 3177
 			}
3178 3178
 			if (!empty($objp->volume) && $objp->volume_units !== null) {
3179 3179
 				$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3180
-				$outvalUnits .= ' - ' . $unitToShow;
3180
+				$outvalUnits .= ' - '.$unitToShow;
3181 3181
 			}
3182 3182
 		}
3183 3183
 		if ($outdurationvalue && $outdurationunit) {
@@ -3189,14 +3189,14 @@  discard block
 block discarded – undo
3189 3189
 				'y' => $langs->trans('Year')
3190 3190
 			);
3191 3191
 			if (isset($da[$outdurationunit])) {
3192
-				$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3192
+				$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3193 3193
 			}
3194 3194
 		}
3195 3195
 
3196
-		$opt = '<option value="' . $objp->rowid . '"';
3196
+		$opt = '<option value="'.$objp->rowid.'"';
3197 3197
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
3198 3198
 		if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
3199
-			$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 . '"';
3199
+			$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.'"';
3200 3200
 		}
3201 3201
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3202 3202
 			if ($user->hasRight('stock', 'lire')) {
@@ -3208,36 +3208,36 @@  discard block
 block discarded – undo
3208 3208
 			}
3209 3209
 		}
3210 3210
 		if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
3211
-			$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
3212
-			$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
3211
+			$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
3212
+			$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
3213 3213
 		}
3214 3214
 		$opt .= '>';
3215 3215
 		$opt .= $objp->ref;
3216 3216
 		if (!empty($objp->custref)) {
3217
-			$opt .= ' (' . $objp->custref . ')';
3217
+			$opt .= ' ('.$objp->custref.')';
3218 3218
 		}
3219 3219
 		if ($outbarcode) {
3220
-			$opt .= ' (' . $outbarcode . ')';
3220
+			$opt .= ' ('.$outbarcode.')';
3221 3221
 		}
3222
-		$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
3222
+		$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
3223 3223
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3224
-			$opt .= ' (' . getCountry($outorigin, 1) . ')';
3224
+			$opt .= ' ('.getCountry($outorigin, 1).')';
3225 3225
 		}
3226 3226
 
3227 3227
 		$objRef = $objp->ref;
3228 3228
 		if (!empty($objp->custref)) {
3229
-			$objRef .= ' (' . $objp->custref . ')';
3229
+			$objRef .= ' ('.$objp->custref.')';
3230 3230
 		}
3231 3231
 		if (!empty($filterkey) && $filterkey != '') {
3232
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3232
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3233 3233
 		}
3234 3234
 		$outval .= $objRef;
3235 3235
 		if ($outbarcode) {
3236
-			$outval .= ' (' . $outbarcode . ')';
3236
+			$outval .= ' ('.$outbarcode.')';
3237 3237
 		}
3238
-		$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
3238
+		$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
3239 3239
 		if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
3240
-			$outval .= ' (' . getCountry($outorigin, 1) . ')';
3240
+			$outval .= ' ('.getCountry($outorigin, 1).')';
3241 3241
 		}
3242 3242
 
3243 3243
 		// Units
@@ -3250,35 +3250,35 @@  discard block
 block discarded – undo
3250 3250
 		// If we need a particular price level (from 1 to n)
3251 3251
 		if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
3252 3252
 			$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
3253
-			$sql .= " FROM " . $this->db->prefix() . "product_price";
3254
-			$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
3255
-			$sql .= " AND entity IN (" . getEntity('productprice') . ")";
3256
-			$sql .= " AND price_level = " . ((int) $price_level);
3253
+			$sql .= " FROM ".$this->db->prefix()."product_price";
3254
+			$sql .= " WHERE fk_product = ".((int) $objp->rowid);
3255
+			$sql .= " AND entity IN (".getEntity('productprice').")";
3256
+			$sql .= " AND price_level = ".((int) $price_level);
3257 3257
 			$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
3258 3258
 			$sql .= " LIMIT 1";
3259 3259
 
3260
-			dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG);
3260
+			dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG);
3261 3261
 			$result2 = $this->db->query($sql);
3262 3262
 			if ($result2) {
3263 3263
 				$objp2 = $this->db->fetch_object($result2);
3264 3264
 				if ($objp2) {
3265 3265
 					$found = 1;
3266 3266
 					if ($objp2->price_base_type == 'HT') {
3267
-						$opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3268
-						$outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3267
+						$opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3268
+						$outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3269 3269
 					} else {
3270
-						$opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3271
-						$outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3270
+						$opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3271
+						$outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3272 3272
 					}
3273 3273
 					$outprice_ht = price($objp2->price);
3274 3274
 					$outprice_ttc = price($objp2->price_ttc);
3275 3275
 					$outpricebasetype = $objp2->price_base_type;
3276 3276
 					if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {  // using this option is a bug. kept for backward compatibility
3277
-						$outtva_tx = $objp2->tva_tx;                        // We use the vat rate on line of multiprice
3278
-						$outdefault_vat_code = $objp2->default_vat_code;    // We use the vat code on line of multiprice
3277
+						$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
3278
+						$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
3279 3279
 					} else {
3280
-						$outtva_tx = $objp->tva_tx;                            // We use the vat rate of product, not the one on line of multiprice
3281
-						$outdefault_vat_code = $objp->default_vat_code;        // We use the vat code or product, not the one on line of multiprice
3280
+						$outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice
3281
+						$outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice
3282 3282
 					}
3283 3283
 				}
3284 3284
 			} else {
@@ -3292,13 +3292,13 @@  discard block
 block discarded – undo
3292 3292
 			$outqty = $objp->quantity;
3293 3293
 			$outdiscount = $objp->remise_percent;
3294 3294
 			if ($objp->quantity == 1) {
3295
-				$opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/";
3296
-				$outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/";
3295
+				$opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/";
3296
+				$outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/";
3297 3297
 				$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3298 3298
 				$outval .= $langs->transnoentities("Unit");
3299 3299
 			} else {
3300
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3301
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3300
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3301
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3302 3302
 				$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3303 3303
 				$outval .= $langs->transnoentities("Units");
3304 3304
 			}
@@ -3306,16 +3306,16 @@  discard block
 block discarded – undo
3306 3306
 			$outprice_ht = price($objp->unitprice);
3307 3307
 			$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100)));
3308 3308
 			$outpricebasetype = $objp->price_base_type;
3309
-			$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
3310
-			$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
3309
+			$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
3310
+			$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
3311 3311
 		}
3312 3312
 		if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) {
3313
-			$opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3314
-			$outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
3313
+			$opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3314
+			$outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
3315 3315
 		}
3316 3316
 		if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) {
3317
-			$opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3318
-			$outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3317
+			$opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3318
+			$outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3319 3319
 		}
3320 3320
 
3321 3321
 		// Price by customer
@@ -3324,11 +3324,11 @@  discard block
 block discarded – undo
3324 3324
 				$found = 1;
3325 3325
 
3326 3326
 				if ($objp->custprice_base_type == 'HT') {
3327
-					$opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3328
-					$outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3327
+					$opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3328
+					$outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3329 3329
 				} else {
3330
-					$opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3331
-					$outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3330
+					$opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3331
+					$outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3332 3332
 				}
3333 3333
 
3334 3334
 				$outprice_ht = price($objp->custprice);
@@ -3342,11 +3342,11 @@  discard block
 block discarded – undo
3342 3342
 		// If level no defined or multiprice not found, we used the default price
3343 3343
 		if (empty($hidepriceinlabel) && !$found) {
3344 3344
 			if ($objp->price_base_type == 'HT') {
3345
-				$opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT");
3346
-				$outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT");
3345
+				$opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT");
3346
+				$outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT");
3347 3347
 			} else {
3348
-				$opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC");
3349
-				$outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC");
3348
+				$opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC");
3349
+				$outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC");
3350 3350
 			}
3351 3351
 			$outprice_ht = price($objp->price);
3352 3352
 			$outprice_ttc = price($objp->price_ttc);
@@ -3357,14 +3357,14 @@  discard block
 block discarded – undo
3357 3357
 
3358 3358
 		if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3359 3359
 			if ($user->hasRight('stock', 'lire')) {
3360
-				$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3360
+				$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3361 3361
 
3362 3362
 				if ($objp->stock > 0) {
3363 3363
 					$outval .= ' - <span class="product_line_stock_ok">';
3364 3364
 				} elseif ($objp->stock <= 0) {
3365 3365
 					$outval .= ' - <span class="product_line_stock_too_low">';
3366 3366
 				}
3367
-				$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3367
+				$outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'));
3368 3368
 				$outval .= '</span>';
3369 3369
 				if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3370 3370
 					$langs->load("stocks");
@@ -3374,9 +3374,9 @@  discard block
 block discarded – undo
3374 3374
 					$tmpproduct->load_virtual_stock();
3375 3375
 					$virtualstock = $tmpproduct->stock_theorique;
3376 3376
 
3377
-					$opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3377
+					$opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3378 3378
 
3379
-					$outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3379
+					$outval .= ' - '.$langs->transnoentities("VirtualStock").':';
3380 3380
 					if ($virtualstock > 0) {
3381 3381
 						$outval .= '<span class="product_line_stock_ok">';
3382 3382
 					} elseif ($virtualstock <= 0) {
@@ -3454,7 +3454,7 @@  discard block
 block discarded – undo
3454 3454
 		$selected_input_value = '';
3455 3455
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
3456 3456
 			if ($selected > 0) {
3457
-				require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
3457
+				require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
3458 3458
 				$producttmpselect = new Product($this->db);
3459 3459
 				$producttmpselect->fetch($selected);
3460 3460
 				$selected_input_value = $producttmpselect->ref;
@@ -3462,10 +3462,10 @@  discard block
 block discarded – undo
3462 3462
 			}
3463 3463
 
3464 3464
 			// mode=2 means suppliers products
3465
-			$urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice;
3466
-			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3465
+			$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
3466
+			print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
3467 3467
 
3468
-			print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>';
3468
+			print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
3469 3469
 		} else {
3470 3470
 			print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
3471 3471
 		}
@@ -3525,25 +3525,25 @@  discard block
 block discarded – undo
3525 3525
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3526 3526
 			$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
3527 3527
 		}
3528
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3529
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )";
3528
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3529
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
3530 3530
 		if ($socid > 0) {
3531
-			$sql .= " AND pfp.fk_soc = " . ((int) $socid);
3531
+			$sql .= " AND pfp.fk_soc = ".((int) $socid);
3532 3532
 		}
3533
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3533
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3534 3534
 		// Units
3535 3535
 		if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3536
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit";
3536
+			$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
3537 3537
 		}
3538
-		$sql .= " WHERE p.entity IN (" . getEntity('product') . ")";
3538
+		$sql .= " WHERE p.entity IN (".getEntity('product').")";
3539 3539
 		if ($statut != -1) {
3540
-			$sql .= " AND p.tobuy = " . ((int) $statut);
3540
+			$sql .= " AND p.tobuy = ".((int) $statut);
3541 3541
 		}
3542 3542
 		if (strval($filtertype) != '') {
3543
-			$sql .= " AND p.fk_product_type = " . ((int) $filtertype);
3543
+			$sql .= " AND p.fk_product_type = ".((int) $filtertype);
3544 3544
 		}
3545 3545
 		if (!empty($filtre)) {
3546
-			$sql .= " " . $filtre;
3546
+			$sql .= " ".$filtre;
3547 3547
 		}
3548 3548
 		// Add where from hooks
3549 3549
 		$parameters = array();
@@ -3563,9 +3563,9 @@  discard block
 block discarded – undo
3563 3563
 				if ($i > 0) {
3564 3564
 					$sql .= " AND ";
3565 3565
 				}
3566
-				$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) . "%'";
3566
+				$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)."%'";
3567 3567
 				if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
3568
-					$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
3568
+					$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
3569 3569
 				}
3570 3570
 				$sql .= ")";
3571 3571
 				$i++;
@@ -3574,8 +3574,8 @@  discard block
 block discarded – undo
3574 3574
 				$sql .= ")";
3575 3575
 			}
3576 3576
 			if (isModEnabled('barcode')) {
3577
-				$sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3578
-				$sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'";
3577
+				$sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3578
+				$sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
3579 3579
 			}
3580 3580
 			$sql .= ')';
3581 3581
 		}
@@ -3584,20 +3584,20 @@  discard block
 block discarded – undo
3584 3584
 
3585 3585
 		// Build output string
3586 3586
 
3587
-		dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG);
3587
+		dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG);
3588 3588
 		$result = $this->db->query($sql);
3589 3589
 		if ($result) {
3590
-			require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3591
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php';
3590
+			require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3591
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
3592 3592
 
3593 3593
 			$num = $this->db->num_rows($result);
3594 3594
 
3595 3595
 			//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';	// remove select to have id same with combo and ajax
3596
-			$out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">';
3596
+			$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
3597 3597
 			if (!$selected) {
3598
-				$out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3598
+				$out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3599 3599
 			} else {
3600
-				$out .= '<option value="-1">' . ($placeholder ? $placeholder : '&nbsp;') . '</option>';
3600
+				$out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
3601 3601
 			}
3602 3602
 
3603 3603
 			$i = 0;
@@ -3612,7 +3612,7 @@  discard block
 block discarded – undo
3612 3612
 
3613 3613
 				$outkey = $objp->idprodfournprice; // id in table of price
3614 3614
 				if (!$outkey && $alsoproductwithnosupplierprice) {
3615
-					$outkey = 'idprod_' . $objp->rowid; // id of product
3615
+					$outkey = 'idprod_'.$objp->rowid; // id of product
3616 3616
 				}
3617 3617
 
3618 3618
 				$outref = $objp->ref;
@@ -3627,23 +3627,23 @@  discard block
 block discarded – undo
3627 3627
 				$outvalUnits = '';
3628 3628
 				if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
3629 3629
 					if (!empty($objp->unit_short)) {
3630
-						$outvalUnits .= ' - ' . $objp->unit_short;
3630
+						$outvalUnits .= ' - '.$objp->unit_short;
3631 3631
 					}
3632 3632
 					if (!empty($objp->weight) && $objp->weight_units !== null) {
3633 3633
 						$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
3634
-						$outvalUnits .= ' - ' . $unitToShow;
3634
+						$outvalUnits .= ' - '.$unitToShow;
3635 3635
 					}
3636 3636
 					if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) {
3637
-						$unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units);
3638
-						$outvalUnits .= ' - ' . $unitToShow;
3637
+						$unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units);
3638
+						$outvalUnits .= ' - '.$unitToShow;
3639 3639
 					}
3640 3640
 					if (!empty($objp->surface) && $objp->surface_units !== null) {
3641 3641
 						$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs);
3642
-						$outvalUnits .= ' - ' . $unitToShow;
3642
+						$outvalUnits .= ' - '.$unitToShow;
3643 3643
 					}
3644 3644
 					if (!empty($objp->volume) && $objp->volume_units !== null) {
3645 3645
 						$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs);
3646
-						$outvalUnits .= ' - ' . $unitToShow;
3646
+						$outvalUnits .= ' - '.$unitToShow;
3647 3647
 					}
3648 3648
 					if ($outdurationvalue && $outdurationunit) {
3649 3649
 						$da = array(
@@ -3654,22 +3654,22 @@  discard block
 block discarded – undo
3654 3654
 							'y' => $langs->trans('Year')
3655 3655
 						);
3656 3656
 						if (isset($da[$outdurationunit])) {
3657
-							$outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : ''));
3657
+							$outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : ''));
3658 3658
 						}
3659 3659
 					}
3660 3660
 				}
3661 3661
 
3662 3662
 				$objRef = $objp->ref;
3663 3663
 				if ($filterkey && $filterkey != '') {
3664
-					$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
3664
+					$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
3665 3665
 				}
3666 3666
 				$objRefFourn = $objp->ref_fourn;
3667 3667
 				if ($filterkey && $filterkey != '') {
3668
-					$objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1);
3668
+					$objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
3669 3669
 				}
3670 3670
 				$label = $objp->label;
3671 3671
 				if ($filterkey && $filterkey != '') {
3672
-					$label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1);
3672
+					$label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
3673 3673
 				}
3674 3674
 
3675 3675
 				switch ($objp->fk_product_type) {
@@ -3692,21 +3692,21 @@  discard block
 block discarded – undo
3692 3692
 
3693 3693
 				$optlabel .= $objp->ref;
3694 3694
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3695
-					$optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>';
3695
+					$optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>';
3696 3696
 				}
3697 3697
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3698
-					$optlabel .= ' (' . $outbarcode . ')';
3698
+					$optlabel .= ' ('.$outbarcode.')';
3699 3699
 				}
3700
-				$optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3700
+				$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3701 3701
 
3702 3702
 				$outvallabel = $objRef;
3703 3703
 				if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
3704
-					$outvallabel .= ' (' . $objRefFourn . ')';
3704
+					$outvallabel .= ' ('.$objRefFourn.')';
3705 3705
 				}
3706 3706
 				if (isModEnabled('barcode') && !empty($objp->barcode)) {
3707
-					$outvallabel .= ' (' . $outbarcode . ')';
3707
+					$outvallabel .= ' ('.$outbarcode.')';
3708 3708
 				}
3709
-				$outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle);
3709
+				$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
3710 3710
 
3711 3711
 				// Units
3712 3712
 				$optlabel .= $outvalUnits;
@@ -3723,7 +3723,7 @@  discard block
 block discarded – undo
3723 3723
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3724 3724
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3725 3725
 
3726
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3726
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3727 3727
 						$priceparser = new PriceParser($this->db);
3728 3728
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3729 3729
 						if ($price_result >= 0) {
@@ -3734,57 +3734,57 @@  discard block
 block discarded – undo
3734 3734
 						}
3735 3735
 					}
3736 3736
 					if ($objp->quantity == 1) {
3737
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
3738
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
3737
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
3738
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/";
3739 3739
 						$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
3740 3740
 						$outvallabel .= $langs->transnoentities("Unit");
3741 3741
 					} else {
3742
-						$optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3743
-						$outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
3744
-						$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3745
-						$outvallabel .= ' ' . $langs->transnoentities("Units");
3742
+						$optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3743
+						$outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity;
3744
+						$optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
3745
+						$outvallabel .= ' '.$langs->transnoentities("Units");
3746 3746
 					}
3747 3747
 
3748 3748
 					if ($objp->quantity > 1) {
3749
-						$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
3750
-						$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
3749
+						$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
3750
+						$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
3751 3751
 					}
3752 3752
 					if ($objp->remise_percent >= 1) {
3753
-						$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3754
-						$outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
3753
+						$optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
3754
+						$outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
3755 3755
 					}
3756 3756
 					if ($objp->duration) {
3757
-						$optlabel .= " - " . $objp->duration;
3758
-						$outvallabel .= " - " . $objp->duration;
3757
+						$optlabel .= " - ".$objp->duration;
3758
+						$outvallabel .= " - ".$objp->duration;
3759 3759
 					}
3760 3760
 					if (!$socid) {
3761
-						$optlabel .= " - " . dol_trunc($objp->name, 8);
3762
-						$outvallabel .= " - " . dol_trunc($objp->name, 8);
3761
+						$optlabel .= " - ".dol_trunc($objp->name, 8);
3762
+						$outvallabel .= " - ".dol_trunc($objp->name, 8);
3763 3763
 					}
3764 3764
 					if ($objp->supplier_reputation) {
3765 3765
 						//TODO dictionary
3766 3766
 						$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier'));
3767 3767
 
3768
-						$optlabel .= " - " . $reputations[$objp->supplier_reputation];
3769
-						$outvallabel .= " - " . $reputations[$objp->supplier_reputation];
3768
+						$optlabel .= " - ".$reputations[$objp->supplier_reputation];
3769
+						$outvallabel .= " - ".$reputations[$objp->supplier_reputation];
3770 3770
 					}
3771 3771
 				} else {
3772
-					$optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>';
3773
-					$outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier");
3772
+					$optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>';
3773
+					$outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier");
3774 3774
 				}
3775 3775
 
3776 3776
 				if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
3777 3777
 					$novirtualstock = ($showstockinlist == 2);
3778 3778
 
3779 3779
 					if ($user->hasRight('stock', 'lire')) {
3780
-						$outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
3780
+						$outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
3781 3781
 
3782 3782
 						if ($objp->stock > 0) {
3783 3783
 							$optlabel .= ' - <span class="product_line_stock_ok">';
3784 3784
 						} elseif ($objp->stock <= 0) {
3785 3785
 							$optlabel .= ' - <span class="product_line_stock_too_low">';
3786 3786
 						}
3787
-						$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
3787
+						$optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS'));
3788 3788
 						$optlabel .= '</span>';
3789 3789
 						if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) {  // Warning, this option may slow down combo list generation
3790 3790
 							$langs->load("stocks");
@@ -3794,9 +3794,9 @@  discard block
 block discarded – undo
3794 3794
 							$tmpproduct->load_virtual_stock();
3795 3795
 							$virtualstock = $tmpproduct->stock_theorique;
3796 3796
 
3797
-							$outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock;
3797
+							$outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
3798 3798
 
3799
-							$optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':';
3799
+							$optlabel .= ' - '.$langs->transnoentities("VirtualStock").':';
3800 3800
 							if ($virtualstock > 0) {
3801 3801
 								$optlabel .= '<span class="product_line_stock_ok">';
3802 3802
 							} elseif ($virtualstock <= 0) {
@@ -3810,7 +3810,7 @@  discard block
 block discarded – undo
3810 3810
 					}
3811 3811
 				}
3812 3812
 
3813
-				$optstart = '<option value="' . $outkey . '"';
3813
+				$optstart = '<option value="'.$outkey.'"';
3814 3814
 				if ($selected && $selected == $objp->idprodfournprice) {
3815 3815
 					$optstart .= ' selected';
3816 3816
 				}
@@ -3819,31 +3819,31 @@  discard block
 block discarded – undo
3819 3819
 				}
3820 3820
 
3821 3821
 				if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
3822
-					$optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"';
3823
-					$optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"';
3824
-					$optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"';
3825
-					$optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"';
3826
-					$optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"';
3827
-					$optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"';
3828
-					$optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"';
3829
-					$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
3830
-					$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
3831
-					$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
3822
+					$optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"';
3823
+					$optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"';
3824
+					$optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"';
3825
+					$optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"';
3826
+					$optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"';
3827
+					$optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"';
3828
+					$optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"';
3829
+					$optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"';
3830
+					$optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"';
3831
+					$optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"';
3832 3832
 					if (isModEnabled('multicurrency')) {
3833
-						$optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"';
3834
-						$optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"';
3833
+						$optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"';
3834
+						$optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"';
3835 3835
 					}
3836 3836
 				}
3837
-				$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
3837
+				$optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
3838 3838
 
3839 3839
 				$outarrayentry = array(
3840 3840
 					'key' => $outkey,
3841 3841
 					'value' => $outref,
3842 3842
 					'label' => $outvallabel,
3843 3843
 					'qty' => $outqty,
3844
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),    // Keep higher resolution for price for the min qty
3845
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3846
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3844
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3845
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3846
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3847 3847
 					'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2),
3848 3848
 					'tva_tx' => price2num($objp->tva_tx),
3849 3849
 					'default_vat_code' => $objp->default_vat_code,
@@ -3872,17 +3872,17 @@  discard block
 block discarded – undo
3872 3872
 				// Add new entry
3873 3873
 				// "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
3874 3874
 				// "label" value of json key array is used by jQuery automatically as text for combo box
3875
-				$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
3875
+				$out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n";
3876 3876
 				$outarraypush = array(
3877 3877
 					'key' => $outkey,
3878 3878
 					'value' => $outref,
3879 3879
 					'label' => $outvallabel,
3880 3880
 					'qty' => $outqty,
3881
-					'price_qty_ht' => price2num($objp->fprice, 'MU'),        // Keep higher resolution for price for the min qty
3881
+					'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
3882 3882
 					'price_qty_ht_locale' => price($objp->fprice),
3883
-					'price_unit_ht' => price2num($objp->unitprice, 'MU'),    // This is used to fill the Unit Price
3883
+					'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
3884 3884
 					'price_unit_ht_locale' => price($objp->unitprice),
3885
-					'price_ht' => price2num($objp->unitprice, 'MU'),        // This is used to fill the Unit Price (for compatibility)
3885
+					'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
3886 3886
 					'tva_tx_formated' => price($objp->tva_tx),
3887 3887
 					'tva_tx' => price2num($objp->tva_tx),
3888 3888
 					'default_vat_code' => $objp->default_vat_code,
@@ -3914,7 +3914,7 @@  discard block
 block discarded – undo
3914 3914
 
3915 3915
 			$this->db->free($result);
3916 3916
 
3917
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
3917
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
3918 3918
 			$out .= ajax_combobox($htmlname);
3919 3919
 		} else {
3920 3920
 			dol_print_error($this->db);
@@ -3946,43 +3946,43 @@  discard block
 block discarded – undo
3946 3946
 		$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
3947 3947
 		$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
3948 3948
 		$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
3949
-		$sql .= " FROM " . $this->db->prefix() . "product as p";
3950
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3951
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid";
3952
-		$sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")";
3949
+		$sql .= " FROM ".$this->db->prefix()."product as p";
3950
+		$sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
3951
+		$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
3952
+		$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
3953 3953
 		$sql .= " AND p.tobuy = 1";
3954 3954
 		$sql .= " AND s.fournisseur = 1";
3955
-		$sql .= " AND p.rowid = " . ((int) $productid);
3955
+		$sql .= " AND p.rowid = ".((int) $productid);
3956 3956
 		if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
3957 3957
 			$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
3958 3958
 		} else {
3959 3959
 			$sql .= " ORDER BY pfp.unitprice ASC";
3960 3960
 		}
3961 3961
 
3962
-		dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG);
3962
+		dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG);
3963 3963
 		$result = $this->db->query($sql);
3964 3964
 
3965 3965
 		if ($result) {
3966 3966
 			$num = $this->db->num_rows($result);
3967 3967
 
3968
-			$form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
3968
+			$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
3969 3969
 
3970 3970
 			if (!$num) {
3971
-				$form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>';
3971
+				$form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>';
3972 3972
 			} else {
3973
-				require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3973
+				require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3974 3974
 				$form .= '<option value="0">&nbsp;</option>';
3975 3975
 
3976 3976
 				$i = 0;
3977 3977
 				while ($i < $num) {
3978 3978
 					$objp = $this->db->fetch_object($result);
3979 3979
 
3980
-					$opt = '<option value="' . $objp->idprodfournprice . '"';
3980
+					$opt = '<option value="'.$objp->idprodfournprice.'"';
3981 3981
 					//if there is only one supplier, preselect it
3982 3982
 					if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
3983 3983
 						$opt .= ' selected';
3984 3984
 					}
3985
-					$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
3985
+					$opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
3986 3986
 
3987 3987
 					if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) {
3988 3988
 						$prod_supplier = new ProductFournisseur($this->db);
@@ -3992,7 +3992,7 @@  discard block
 block discarded – undo
3992 3992
 						$prod_supplier->fourn_tva_tx = $objp->tva_tx;
3993 3993
 						$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression;
3994 3994
 
3995
-						require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php';
3995
+						require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
3996 3996
 						$priceparser = new PriceParser($this->db);
3997 3997
 						$price_result = $priceparser->parseProductSupplier($prod_supplier);
3998 3998
 						if ($price_result >= 0) {
@@ -4003,10 +4003,10 @@  discard block
 block discarded – undo
4003 4003
 						}
4004 4004
 					}
4005 4005
 					if ($objp->quantity == 1) {
4006
-						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
4006
+						$opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/";
4007 4007
 					}
4008 4008
 
4009
-					$opt .= $objp->quantity . ' ';
4009
+					$opt .= $objp->quantity.' ';
4010 4010
 
4011 4011
 					if ($objp->quantity == 1) {
4012 4012
 						$opt .= $langs->trans("Unit");
@@ -4015,10 +4015,10 @@  discard block
 block discarded – undo
4015 4015
 					}
4016 4016
 					if ($objp->quantity > 1) {
4017 4017
 						$opt .= " - ";
4018
-						$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");
4018
+						$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");
4019 4019
 					}
4020 4020
 					if ($objp->duration) {
4021
-						$opt .= " - " . $objp->duration;
4021
+						$opt .= " - ".$objp->duration;
4022 4022
 					}
4023 4023
 					$opt .= "</option>\n";
4024 4024
 
@@ -4056,8 +4056,8 @@  discard block
 block discarded – undo
4056 4056
 		dol_syslog(__METHOD__, LOG_DEBUG);
4057 4057
 
4058 4058
 		$sql = "SELECT rowid, code, libelle as label, deposit_percent";
4059
-		$sql .= " FROM " . $this->db->prefix() . 'c_payment_term';
4060
-		$sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")";
4059
+		$sql .= " FROM ".$this->db->prefix().'c_payment_term';
4060
+		$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
4061 4061
 		$sql .= " AND active > 0";
4062 4062
 		$sql .= " ORDER BY sortorder";
4063 4063
 
@@ -4069,7 +4069,7 @@  discard block
 block discarded – undo
4069 4069
 				$obj = $this->db->fetch_object($resql);
4070 4070
 
4071 4071
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4072
-				$label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4072
+				$label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4073 4073
 				$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
4074 4074
 				$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
4075 4075
 				$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
@@ -4097,7 +4097,7 @@  discard block
 block discarded – undo
4097 4097
 		// phpcs:enable
4098 4098
 		global $langs;
4099 4099
 
4100
-		$num = count($this->cache_availability);    // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4100
+		$num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability
4101 4101
 		if ($num > 0) {
4102 4102
 			return 0; // Cache already loaded
4103 4103
 		}
@@ -4107,7 +4107,7 @@  discard block
 block discarded – undo
4107 4107
 		$langs->load('propal');
4108 4108
 
4109 4109
 		$sql = "SELECT rowid, code, label, position";
4110
-		$sql .= " FROM " . $this->db->prefix() . 'c_availability';
4110
+		$sql .= " FROM ".$this->db->prefix().'c_availability';
4111 4111
 		$sql .= " WHERE active > 0";
4112 4112
 
4113 4113
 		$resql = $this->db->query($sql);
@@ -4118,7 +4118,7 @@  discard block
 block discarded – undo
4118 4118
 				$obj = $this->db->fetch_object($resql);
4119 4119
 
4120 4120
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4121
-				$label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4121
+				$label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4122 4122
 				$this->cache_availability[$obj->rowid]['code'] = $obj->code;
4123 4123
 				$this->cache_availability[$obj->rowid]['label'] = $label;
4124 4124
 				$this->cache_availability[$obj->rowid]['position'] = $obj->position;
@@ -4150,17 +4150,17 @@  discard block
 block discarded – undo
4150 4150
 
4151 4151
 		$this->load_cache_availability();
4152 4152
 
4153
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4153
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4154 4154
 
4155
-		print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4155
+		print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4156 4156
 		if ($addempty) {
4157 4157
 			print '<option value="0">&nbsp;</option>';
4158 4158
 		}
4159 4159
 		foreach ($this->cache_availability as $id => $arrayavailability) {
4160 4160
 			if ($selected == $id) {
4161
-				print '<option value="' . $id . '" selected>';
4161
+				print '<option value="'.$id.'" selected>';
4162 4162
 			} else {
4163
-				print '<option value="' . $id . '">';
4163
+				print '<option value="'.$id.'">';
4164 4164
 			}
4165 4165
 			print dol_escape_htmltag($arrayavailability['label']);
4166 4166
 			print '</option>';
@@ -4181,13 +4181,13 @@  discard block
 block discarded – undo
4181 4181
 	{
4182 4182
 		global $langs;
4183 4183
 
4184
-		$num = count($this->cache_demand_reason);    // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4184
+		$num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason
4185 4185
 		if ($num > 0) {
4186 4186
 			return 0; // Cache already loaded
4187 4187
 		}
4188 4188
 
4189 4189
 		$sql = "SELECT rowid, code, label";
4190
-		$sql .= " FROM " . $this->db->prefix() . 'c_input_reason';
4190
+		$sql .= " FROM ".$this->db->prefix().'c_input_reason';
4191 4191
 		$sql .= " WHERE active > 0";
4192 4192
 
4193 4193
 		$resql = $this->db->query($sql);
@@ -4200,8 +4200,8 @@  discard block
 block discarded – undo
4200 4200
 
4201 4201
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4202 4202
 				$label = ($obj->label != '-' ? $obj->label : '');
4203
-				if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) {
4204
-					$label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4203
+				if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) {
4204
+					$label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work
4205 4205
 				}
4206 4206
 				if ($langs->trans($obj->code) != $obj->code) {
4207 4207
 					$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
@@ -4241,9 +4241,9 @@  discard block
 block discarded – undo
4241 4241
 
4242 4242
 		$this->loadCacheInputReason();
4243 4243
 
4244
-		print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4244
+		print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4245 4245
 		if ($addempty) {
4246
-			print '<option value="0"' . (empty($selected) ? ' selected' : '') . '>&nbsp;</option>';
4246
+			print '<option value="0"'.(empty($selected) ? ' selected' : '').'>&nbsp;</option>';
4247 4247
 		}
4248 4248
 		foreach ($this->cache_demand_reason as $id => $arraydemandreason) {
4249 4249
 			if ($arraydemandreason['code'] == $exclude) {
@@ -4251,9 +4251,9 @@  discard block
 block discarded – undo
4251 4251
 			}
4252 4252
 
4253 4253
 			if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) {
4254
-				print '<option value="' . $arraydemandreason['id'] . '" selected>';
4254
+				print '<option value="'.$arraydemandreason['id'].'" selected>';
4255 4255
 			} else {
4256
-				print '<option value="' . $arraydemandreason['id'] . '">';
4256
+				print '<option value="'.$arraydemandreason['id'].'">';
4257 4257
 			}
4258 4258
 			$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason
4259 4259
 			print $langs->trans($label);
@@ -4263,7 +4263,7 @@  discard block
 block discarded – undo
4263 4263
 		if ($user->admin && empty($notooltip)) {
4264 4264
 			print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4265 4265
 		}
4266
-		print ajax_combobox('select_' . $htmlname);
4266
+		print ajax_combobox('select_'.$htmlname);
4267 4267
 	}
4268 4268
 
4269 4269
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -4278,7 +4278,7 @@  discard block
 block discarded – undo
4278 4278
 		// phpcs:enable
4279 4279
 		global $langs;
4280 4280
 
4281
-		$num = count($this->cache_types_paiements);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4281
+		$num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements
4282 4282
 		if ($num > 0) {
4283 4283
 			return $num; // Cache already loaded
4284 4284
 		}
@@ -4288,8 +4288,8 @@  discard block
 block discarded – undo
4288 4288
 		$this->cache_types_paiements = array();
4289 4289
 
4290 4290
 		$sql = "SELECT id, code, libelle as label, type, active";
4291
-		$sql .= " FROM " . $this->db->prefix() . "c_paiement";
4292
-		$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
4291
+		$sql .= " FROM ".$this->db->prefix()."c_paiement";
4292
+		$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
4293 4293
 
4294 4294
 		$resql = $this->db->query($sql);
4295 4295
 		if ($resql) {
@@ -4299,7 +4299,7 @@  discard block
 block discarded – undo
4299 4299
 				$obj = $this->db->fetch_object($resql);
4300 4300
 
4301 4301
 				// Si traduction existe, on l'utilise, sinon on prend le libelle par default
4302
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4302
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4303 4303
 				$this->cache_types_paiements[$obj->id]['id'] = $obj->id;
4304 4304
 				$this->cache_types_paiements[$obj->id]['code'] = $obj->code;
4305 4305
 				$this->cache_types_paiements[$obj->id]['label'] = $label;
@@ -4371,17 +4371,17 @@  discard block
 block discarded – undo
4371 4371
 		global $langs, $user, $conf;
4372 4372
 
4373 4373
 		$out = '';
4374
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
4374
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
4375 4375
 
4376 4376
 		$this->load_cache_conditions_paiements();
4377 4377
 
4378 4378
 		// Set default value if not already set by caller
4379 4379
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
4380
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4380
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
4381 4381
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
4382 4382
 		}
4383 4383
 
4384
-		$out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4384
+		$out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4385 4385
 		if ($addempty) {
4386 4386
 			$out .= '<option value="0">&nbsp;</option>';
4387 4387
 		}
@@ -4395,9 +4395,9 @@  discard block
 block discarded – undo
4395 4395
 
4396 4396
 			if ($selected == $id) {
4397 4397
 				$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
4398
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>';
4398
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>';
4399 4399
 			} else {
4400
-				$out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">';
4400
+				$out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">';
4401 4401
 			}
4402 4402
 			$label = $arrayconditions['label'];
4403 4403
 
@@ -4415,21 +4415,21 @@  discard block
 block discarded – undo
4415 4415
 		$out .= ajax_combobox($htmlname);
4416 4416
 
4417 4417
 		if ($deposit_percent >= 0) {
4418
-			$out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>';
4419
-			$out .= $langs->trans('DepositPercent') . ' : ';
4420
-			$out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />';
4418
+			$out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>';
4419
+			$out .= $langs->trans('DepositPercent').' : ';
4420
+			$out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />';
4421 4421
 			$out .= '</span>';
4422 4422
 			$out .= '
4423
-				<script nonce="' . getNonce() . '">
4423
+				<script nonce="' . getNonce().'">
4424 4424
 					$(document).ready(function () {
4425
-						$("#' . $htmlname . '").change(function () {
4425
+						$("#' . $htmlname.'").change(function () {
4426 4426
 							let $selected = $(this).find("option:selected");
4427 4427
 							let depositPercent = $selected.attr("data-deposit_percent");
4428 4428
 
4429 4429
 							if (depositPercent.length > 0) {
4430
-								$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
4430
+								$("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent);
4431 4431
 							} else {
4432
-								$("#' . $htmlname . '_deposit_percent_container").hide();
4432
+								$("#' . $htmlname.'_deposit_percent_container").hide();
4433 4433
 							}
4434 4434
 
4435 4435
 							return true;
@@ -4467,7 +4467,7 @@  discard block
 block discarded – undo
4467 4467
 
4468 4468
 		$out = '';
4469 4469
 
4470
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG);
4470
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
4471 4471
 
4472 4472
 		$filterarray = array();
4473 4473
 		if ($filtertype == 'CRDT') {
@@ -4482,11 +4482,11 @@  discard block
 block discarded – undo
4482 4482
 
4483 4483
 		// Set default value if not already set by caller
4484 4484
 		if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
4485
-			dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4485
+			dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
4486 4486
 			$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
4487 4487
 		}
4488 4488
 
4489
-		$out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4489
+		$out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4490 4490
 		if ($empty) {
4491 4491
 			$out .= '<option value="">&nbsp;</option>';
4492 4492
 		}
@@ -4507,13 +4507,13 @@  discard block
 block discarded – undo
4507 4507
 			}
4508 4508
 
4509 4509
 			if ($format == 0) {
4510
-				$out .= '<option value="' . $id . '"';
4510
+				$out .= '<option value="'.$id.'"';
4511 4511
 			} elseif ($format == 1) {
4512
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4512
+				$out .= '<option value="'.$arraytypes['code'].'"';
4513 4513
 			} elseif ($format == 2) {
4514
-				$out .= '<option value="' . $arraytypes['code'] . '"';
4514
+				$out .= '<option value="'.$arraytypes['code'].'"';
4515 4515
 			} elseif ($format == 3) {
4516
-				$out .= '<option value="' . $id . '"';
4516
+				$out .= '<option value="'.$id.'"';
4517 4517
 			}
4518 4518
 			// Print attribute selected or not
4519 4519
 			if ($format == 1 || $format == 2) {
@@ -4543,7 +4543,7 @@  discard block
 block discarded – undo
4543 4543
 		if ($user->admin && !$noadmininfo) {
4544 4544
 			$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4545 4545
 		}
4546
-		$out .= ajax_combobox('select' . $htmlname);
4546
+		$out .= ajax_combobox('select'.$htmlname);
4547 4547
 
4548 4548
 		if (empty($nooutput)) {
4549 4549
 			print $out;
@@ -4565,22 +4565,22 @@  discard block
 block discarded – undo
4565 4565
 	{
4566 4566
 		global $langs;
4567 4567
 
4568
-		$return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">';
4568
+		$return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">';
4569 4569
 		$options = array(
4570 4570
 			'HT' => $langs->trans("HT"),
4571 4571
 			'TTC' => $langs->trans("TTC")
4572 4572
 		);
4573 4573
 		foreach ($options as $id => $value) {
4574 4574
 			if ($selected == $id) {
4575
-				$return .= '<option value="' . $id . '" selected>' . $value;
4575
+				$return .= '<option value="'.$id.'" selected>'.$value;
4576 4576
 			} else {
4577
-				$return .= '<option value="' . $id . '">' . $value;
4577
+				$return .= '<option value="'.$id.'">'.$value;
4578 4578
 			}
4579 4579
 			$return .= '</option>';
4580 4580
 		}
4581 4581
 		$return .= '</select>';
4582 4582
 		if ($addjscombo) {
4583
-			$return .= ajax_combobox('select_' . $htmlname);
4583
+			$return .= ajax_combobox('select_'.$htmlname);
4584 4584
 		}
4585 4585
 
4586 4586
 		return $return;
@@ -4598,7 +4598,7 @@  discard block
 block discarded – undo
4598 4598
 		// phpcs:enable
4599 4599
 		global $langs;
4600 4600
 
4601
-		$num = count($this->cache_transport_mode);        // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4601
+		$num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode
4602 4602
 		if ($num > 0) {
4603 4603
 			return $num; // Cache already loaded
4604 4604
 		}
@@ -4608,8 +4608,8 @@  discard block
 block discarded – undo
4608 4608
 		$this->cache_transport_mode = array();
4609 4609
 
4610 4610
 		$sql = "SELECT rowid, code, label, active";
4611
-		$sql .= " FROM " . $this->db->prefix() . "c_transport_mode";
4612
-		$sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")";
4611
+		$sql .= " FROM ".$this->db->prefix()."c_transport_mode";
4612
+		$sql .= " WHERE entity IN (".getEntity('c_transport_mode').")";
4613 4613
 
4614 4614
 		$resql = $this->db->query($sql);
4615 4615
 		if ($resql) {
@@ -4619,7 +4619,7 @@  discard block
 block discarded – undo
4619 4619
 				$obj = $this->db->fetch_object($resql);
4620 4620
 
4621 4621
 				// If traduction exist, we use it else we take the default label
4622
-				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : ''));
4622
+				$label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
4623 4623
 				$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid;
4624 4624
 				$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code;
4625 4625
 				$this->cache_transport_mode[$obj->rowid]['label'] = $label;
@@ -4653,11 +4653,11 @@  discard block
 block discarded – undo
4653 4653
 	{
4654 4654
 		global $langs, $user;
4655 4655
 
4656
-		dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG);
4656
+		dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG);
4657 4657
 
4658 4658
 		$this->load_cache_transport_mode();
4659 4659
 
4660
-		print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
4660
+		print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
4661 4661
 		if ($empty) {
4662 4662
 			print '<option value="">&nbsp;</option>';
4663 4663
 		}
@@ -4673,13 +4673,13 @@  discard block
 block discarded – undo
4673 4673
 			}
4674 4674
 
4675 4675
 			if ($format == 0) {
4676
-				print '<option value="' . $id . '"';
4676
+				print '<option value="'.$id.'"';
4677 4677
 			} elseif ($format == 1) {
4678
-				print '<option value="' . $arraytypes['code'] . '"';
4678
+				print '<option value="'.$arraytypes['code'].'"';
4679 4679
 			} elseif ($format == 2) {
4680
-				print '<option value="' . $arraytypes['code'] . '"';
4680
+				print '<option value="'.$arraytypes['code'].'"';
4681 4681
 			} elseif ($format == 3) {
4682
-				print '<option value="' . $id . '"';
4682
+				print '<option value="'.$id.'"';
4683 4683
 			}
4684 4684
 			// If text is selected, we compare with code, else with id
4685 4685
 			if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
@@ -4727,31 +4727,31 @@  discard block
 block discarded – undo
4727 4727
 		$langs->load("deliveries");
4728 4728
 
4729 4729
 		$sql = "SELECT rowid, code, libelle as label";
4730
-		$sql .= " FROM " . $this->db->prefix() . "c_shipment_mode";
4730
+		$sql .= " FROM ".$this->db->prefix()."c_shipment_mode";
4731 4731
 		$sql .= " WHERE active > 0";
4732 4732
 		if ($filtre) {
4733
-			$sql .= " AND " . $filtre;
4733
+			$sql .= " AND ".$filtre;
4734 4734
 		}
4735 4735
 		$sql .= " ORDER BY libelle ASC";
4736 4736
 
4737
-		dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG);
4737
+		dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
4738 4738
 		$result = $this->db->query($sql);
4739 4739
 		if ($result) {
4740 4740
 			$num = $this->db->num_rows($result);
4741 4741
 			$i = 0;
4742 4742
 			if ($num) {
4743
-				print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4743
+				print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4744 4744
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4745 4745
 					print '<option value="-1">&nbsp;</option>';
4746 4746
 				}
4747 4747
 				while ($i < $num) {
4748 4748
 					$obj = $this->db->fetch_object($result);
4749 4749
 					if ($selected == $obj->rowid) {
4750
-						print '<option value="' . $obj->rowid . '" selected>';
4750
+						print '<option value="'.$obj->rowid.'" selected>';
4751 4751
 					} else {
4752
-						print '<option value="' . $obj->rowid . '">';
4752
+						print '<option value="'.$obj->rowid.'">';
4753 4753
 					}
4754
-					print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label;
4754
+					print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label;
4755 4755
 					print '</option>';
4756 4756
 					$i++;
4757 4757
 				}
@@ -4760,7 +4760,7 @@  discard block
 block discarded – undo
4760 4760
 					print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
4761 4761
 				}
4762 4762
 
4763
-				print ajax_combobox('select' . $htmlname);
4763
+				print ajax_combobox('select'.$htmlname);
4764 4764
 			} else {
4765 4765
 				print $langs->trans("NoShippingMethodDefined");
4766 4766
 			}
@@ -4785,16 +4785,16 @@  discard block
 block discarded – undo
4785 4785
 		$langs->load("deliveries");
4786 4786
 
4787 4787
 		if ($htmlname != "none") {
4788
-			print '<form method="POST" action="' . $page . '">';
4788
+			print '<form method="POST" action="'.$page.'">';
4789 4789
 			print '<input type="hidden" name="action" value="setshippingmethod">';
4790
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
4790
+			print '<input type="hidden" name="token" value="'.newToken().'">';
4791 4791
 			$this->selectShippingMethod($selected, $htmlname, '', $addempty);
4792
-			print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
4792
+			print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
4793 4793
 			print '</form>';
4794 4794
 		} else {
4795 4795
 			if ($selected) {
4796 4796
 				$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code');
4797
-				print $langs->trans("SendingMethod" . strtoupper($code));
4797
+				print $langs->trans("SendingMethod".strtoupper($code));
4798 4798
 			} else {
4799 4799
 				print "&nbsp;";
4800 4800
 			}
@@ -4817,10 +4817,10 @@  discard block
 block discarded – undo
4817 4817
 
4818 4818
 		$opt = '<option value="" selected></option>';
4819 4819
 		$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc";
4820
-		$sql .= ' FROM ' . $this->db->prefix() . 'facture';
4821
-		$sql .= ' WHERE entity IN (' . getEntity('invoice') . ')';
4820
+		$sql .= ' FROM '.$this->db->prefix().'facture';
4821
+		$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
4822 4822
 		$sql .= ' AND situation_counter >= 1';
4823
-		$sql .= ' AND fk_soc = ' . (int) $socid;
4823
+		$sql .= ' AND fk_soc = '.(int) $socid;
4824 4824
 		$sql .= ' AND type <> 2';
4825 4825
 		$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
4826 4826
 		$resql = $this->db->query($sql);
@@ -4838,19 +4838,19 @@  discard block
 block discarded – undo
4838 4838
 						//Not prov?
4839 4839
 						if (substr($obj->ref, 1, 4) != 'PROV') {
4840 4840
 							if ($selected == $obj->rowid) {
4841
-								$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
4841
+								$opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>';
4842 4842
 							} else {
4843
-								$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
4843
+								$opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>';
4844 4844
 							}
4845 4845
 						}
4846 4846
 					}
4847 4847
 				}
4848 4848
 			}
4849 4849
 		} else {
4850
-			dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR);
4850
+			dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR);
4851 4851
 		}
4852 4852
 		if ($opt == '<option value ="" selected></option>') {
4853
-			$opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>';
4853
+			$opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>';
4854 4854
 		}
4855 4855
 		return $opt;
4856 4856
 	}
@@ -4870,12 +4870,12 @@  discard block
 block discarded – undo
4870 4870
 
4871 4871
 		$langs->load('products');
4872 4872
 
4873
-		$return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">';
4873
+		$return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
4874 4874
 
4875
-		$sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units";
4875
+		$sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units";
4876 4876
 		$sql .= ' WHERE active > 0';
4877 4877
 		if (!empty($unit_type)) {
4878
-			$sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'";
4878
+			$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
4879 4879
 		}
4880 4880
 		$sql .= " ORDER BY sortorder";
4881 4881
 
@@ -4887,14 +4887,14 @@  discard block
 block discarded – undo
4887 4887
 
4888 4888
 			while ($res = $this->db->fetch_object($resql)) {
4889 4889
 				$unitLabel = $res->label;
4890
-				if (!empty($langs->tab_translate['unit' . $res->code])) {    // check if Translation is available before
4891
-					$unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label;
4890
+				if (!empty($langs->tab_translate['unit'.$res->code])) {    // check if Translation is available before
4891
+					$unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label;
4892 4892
 				}
4893 4893
 
4894 4894
 				if ($selected == $res->rowid) {
4895
-					$return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>';
4895
+					$return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
4896 4896
 				} else {
4897
-					$return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>';
4897
+					$return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
4898 4898
 				}
4899 4899
 			}
4900 4900
 			$return .= '</select>';
@@ -4929,23 +4929,23 @@  discard block
 block discarded – undo
4929 4929
 		$num = 0;
4930 4930
 
4931 4931
 		$sql = "SELECT rowid, label, bank, clos as status, currency_code";
4932
-		$sql .= " FROM " . $this->db->prefix() . "bank_account";
4933
-		$sql .= " WHERE entity IN (" . getEntity('bank_account') . ")";
4932
+		$sql .= " FROM ".$this->db->prefix()."bank_account";
4933
+		$sql .= " WHERE entity IN (".getEntity('bank_account').")";
4934 4934
 		if ($status != 2) {
4935
-			$sql .= " AND clos = " . (int) $status;
4935
+			$sql .= " AND clos = ".(int) $status;
4936 4936
 		}
4937 4937
 		if ($filtre) {	// TODO Support USF
4938
-			$sql .= " AND " . $filtre;
4938
+			$sql .= " AND ".$filtre;
4939 4939
 		}
4940 4940
 		$sql .= " ORDER BY label";
4941 4941
 
4942
-		dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG);
4942
+		dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG);
4943 4943
 		$result = $this->db->query($sql);
4944 4944
 		if ($result) {
4945 4945
 			$num = $this->db->num_rows($result);
4946 4946
 			$i = 0;
4947 4947
 			if ($num) {
4948
-				$out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
4948
+				$out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
4949 4949
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
4950 4950
 					$out .= '<option value="-1">&nbsp;</option>';
4951 4951
 				}
@@ -4953,27 +4953,27 @@  discard block
 block discarded – undo
4953 4953
 				while ($i < $num) {
4954 4954
 					$obj = $this->db->fetch_object($result);
4955 4955
 					if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
4956
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>';
4956
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
4957 4957
 					} else {
4958
-						$out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">';
4958
+						$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
4959 4959
 					}
4960 4960
 					$out .= trim($obj->label);
4961 4961
 					if ($showcurrency) {
4962
-						$out .= ' (' . $obj->currency_code . ')';
4962
+						$out .= ' ('.$obj->currency_code.')';
4963 4963
 					}
4964 4964
 					if ($status == 2 && $obj->status == 1) {
4965
-						$out .= ' (' . $langs->trans("Closed") . ')';
4965
+						$out .= ' ('.$langs->trans("Closed").')';
4966 4966
 					}
4967 4967
 					$out .= '</option>';
4968 4968
 					$i++;
4969 4969
 				}
4970 4970
 				$out .= "</select>";
4971
-				$out .= ajax_combobox('select' . $htmlname);
4971
+				$out .= ajax_combobox('select'.$htmlname);
4972 4972
 			} else {
4973 4973
 				if ($status == 0) {
4974
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>';
4974
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
4975 4975
 				} else {
4976
-					$out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>';
4976
+					$out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>';
4977 4977
 				}
4978 4978
 			}
4979 4979
 		} else {
@@ -5009,23 +5009,23 @@  discard block
 block discarded – undo
5009 5009
 		$num = 0;
5010 5010
 
5011 5011
 		$sql = "SELECT rowid, name, fk_country, status, entity";
5012
-		$sql .= " FROM " . $this->db->prefix() . "establishment";
5012
+		$sql .= " FROM ".$this->db->prefix()."establishment";
5013 5013
 		$sql .= " WHERE 1=1";
5014 5014
 		if ($status != 2) {
5015
-			$sql .= " AND status = " . (int) $status;
5015
+			$sql .= " AND status = ".(int) $status;
5016 5016
 		}
5017 5017
 		if ($filtre) {	// TODO Support USF
5018
-			$sql .= " AND " . $filtre;
5018
+			$sql .= " AND ".$filtre;
5019 5019
 		}
5020 5020
 		$sql .= " ORDER BY name";
5021 5021
 
5022
-		dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG);
5022
+		dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
5023 5023
 		$result = $this->db->query($sql);
5024 5024
 		if ($result) {
5025 5025
 			$num = $this->db->num_rows($result);
5026 5026
 			$i = 0;
5027 5027
 			if ($num) {
5028
-				print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>';
5028
+				print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
5029 5029
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5030 5030
 					print '<option value="-1">&nbsp;</option>';
5031 5031
 				}
@@ -5033,13 +5033,13 @@  discard block
 block discarded – undo
5033 5033
 				while ($i < $num) {
5034 5034
 					$obj = $this->db->fetch_object($result);
5035 5035
 					if ($selected == $obj->rowid) {
5036
-						print '<option value="' . $obj->rowid . '" selected>';
5036
+						print '<option value="'.$obj->rowid.'" selected>';
5037 5037
 					} else {
5038
-						print '<option value="' . $obj->rowid . '">';
5038
+						print '<option value="'.$obj->rowid.'">';
5039 5039
 					}
5040 5040
 					print trim($obj->name);
5041 5041
 					if ($status == 2 && $obj->status == 1) {
5042
-						print ' (' . $langs->trans("Closed") . ')';
5042
+						print ' ('.$langs->trans("Closed").')';
5043 5043
 					}
5044 5044
 					print '</option>';
5045 5045
 					$i++;
@@ -5047,9 +5047,9 @@  discard block
 block discarded – undo
5047 5047
 				print "</select>";
5048 5048
 			} else {
5049 5049
 				if ($status == 0) {
5050
-					print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>';
5050
+					print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
5051 5051
 				} else {
5052
-					print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>';
5052
+					print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
5053 5053
 				}
5054 5054
 			}
5055 5055
 
@@ -5073,20 +5073,20 @@  discard block
 block discarded – undo
5073 5073
 	{
5074 5074
 		global $langs;
5075 5075
 		if ($htmlname != "none") {
5076
-			print '<form method="POST" action="' . $page . '">';
5076
+			print '<form method="POST" action="'.$page.'">';
5077 5077
 			print '<input type="hidden" name="action" value="setbankaccount">';
5078
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5078
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5079 5079
 			print img_picto('', 'bank_account', 'class="pictofixedwidth"');
5080 5080
 			$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
5081 5081
 			if ($nbaccountfound > 0) {
5082
-				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5082
+				print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5083 5083
 			}
5084 5084
 			print '</form>';
5085 5085
 		} else {
5086 5086
 			$langs->load('banks');
5087 5087
 
5088 5088
 			if ($selected) {
5089
-				require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
5089
+				require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
5090 5090
 				$bankstatic = new Account($this->db);
5091 5091
 				$result = $bankstatic->fetch($selected);
5092 5092
 				if ($result) {
@@ -5125,19 +5125,19 @@  discard block
 block discarded – undo
5125 5125
 		global $conf, $langs;
5126 5126
 		$langs->load("categories");
5127 5127
 
5128
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5128
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5129 5129
 
5130 5130
 		// For backward compatibility
5131 5131
 		if (is_numeric($type)) {
5132
-			dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5132
+			dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
5133 5133
 		}
5134 5134
 
5135 5135
 		if ($type === Categorie::TYPE_BANK_LINE) {
5136 5136
 			// TODO Move this into common category feature
5137 5137
 			$cate_arbo = array();
5138 5138
 			$sql = "SELECT c.label, c.rowid";
5139
-			$sql .= " FROM " . $this->db->prefix() . "bank_categ as c";
5140
-			$sql .= " WHERE entity = " . $conf->entity;
5139
+			$sql .= " FROM ".$this->db->prefix()."bank_categ as c";
5140
+			$sql .= " WHERE entity = ".$conf->entity;
5141 5141
 			$sql .= " ORDER BY c.label";
5142 5142
 			$result = $this->db->query($sql);
5143 5143
 			if ($result) {
@@ -5163,12 +5163,12 @@  discard block
 block discarded – undo
5163 5163
 		$outarrayrichhtml = array();
5164 5164
 
5165 5165
 
5166
-		$output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
5166
+		$output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
5167 5167
 		if (is_array($cate_arbo)) {
5168 5168
 			$num = count($cate_arbo);
5169 5169
 
5170 5170
 			if (!$num) {
5171
-				$output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>';
5171
+				$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
5172 5172
 			} else {
5173 5173
 				if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
5174 5174
 					$output .= '<option value="-1">&nbsp;</option>';
@@ -5180,15 +5180,15 @@  discard block
 block discarded – undo
5180 5180
 						$add = '';
5181 5181
 					}
5182 5182
 
5183
-					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"');
5183
+					$labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"');
5184 5184
 					$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5185 5185
 
5186 5186
 					$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
5187 5187
 
5188 5188
 					$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow;
5189 5189
 
5190
-					$output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"';
5191
-					$output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"';
5190
+					$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
5191
+					$output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
5192 5192
 					$output .= '>';
5193 5193
 					$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
5194 5194
 					$output .= '</option>';
@@ -5230,7 +5230,7 @@  discard block
 block discarded – undo
5230 5230
 	public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500)
5231 5231
 	{
5232 5232
 		// phpcs:enable
5233
-		dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5233
+		dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING);
5234 5234
 		print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
5235 5235
 	}
5236 5236
 
@@ -5265,7 +5265,7 @@  discard block
 block discarded – undo
5265 5265
 	{
5266 5266
 		global $langs, $conf;
5267 5267
 
5268
-		$more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->';
5268
+		$more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->';
5269 5269
 		$formconfirm = '';
5270 5270
 		$inputok = array();
5271 5271
 		$inputko = array();
@@ -5289,27 +5289,27 @@  discard block
 block discarded – undo
5289 5289
 			foreach ($formquestion as $key => $input) {
5290 5290
 				if (is_array($input) && !empty($input)) {
5291 5291
 					if ($input['type'] == 'hidden') {
5292
-						$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5293
-						$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5292
+						$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5293
+						$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5294 5294
 
5295
-						$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";
5295
+						$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";
5296 5296
 					}
5297 5297
 				}
5298 5298
 			}
5299 5299
 
5300 5300
 			// Now add questions
5301 5301
 			$moreonecolumn = '';
5302
-			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n";
5302
+			$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
5303 5303
 			foreach ($formquestion as $key => $input) {
5304 5304
 				if (is_array($input) && !empty($input)) {
5305
-					$size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : '');    // deprecated. Use morecss instead.
5306
-					$moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : '');
5307
-					$morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : '');
5305
+					$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
5306
+					$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
5307
+					$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
5308 5308
 
5309 5309
 					if ($input['type'] == 'text') {
5310
-						$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";
5310
+						$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";
5311 5311
 					} elseif ($input['type'] == 'password') {
5312
-						$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";
5312
+						$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";
5313 5313
 					} elseif ($input['type'] == 'textarea') {
5314 5314
 						/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
5315 5315
 						$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@@ -5317,8 +5317,8 @@  discard block
 block discarded – undo
5317 5317
 						$more .= '</textarea>';
5318 5318
 						$more .= '</div></div>'."\n";*/
5319 5319
 						$moreonecolumn .= '<div class="margintoponly">';
5320
-						$moreonecolumn .= $input['label'] . '<br>';
5321
-						$moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>';
5320
+						$moreonecolumn .= $input['label'].'<br>';
5321
+						$moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
5322 5322
 						$moreonecolumn .= $input['value'];
5323 5323
 						$moreonecolumn .= '</textarea>';
5324 5324
 						$moreonecolumn .= '</div>';
@@ -5335,20 +5335,20 @@  discard block
 block discarded – undo
5335 5335
 						$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
5336 5336
 						$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
5337 5337
 
5338
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">';
5338
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5339 5339
 						if (!empty($input['label'])) {
5340
-							$more .= $input['label'] . '</div><div class="tagtd left">';
5340
+							$more .= $input['label'].'</div><div class="tagtd left">';
5341 5341
 						}
5342 5342
 						if ($input['type'] == 'select') {
5343 5343
 							$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);
5344 5344
 						} else {
5345 5345
 							$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);
5346 5346
 						}
5347
-						$more .= '</div></div>' . "\n";
5347
+						$more .= '</div></div>'."\n";
5348 5348
 					} elseif ($input['type'] == 'checkbox') {
5349 5349
 						$more .= '<div class="tagtr">';
5350
-						$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">';
5351
-						$more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr;
5350
+						$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">';
5351
+						$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
5352 5352
 						if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
5353 5353
 							$more .= ' checked';
5354 5354
 						}
@@ -5359,19 +5359,19 @@  discard block
 block discarded – undo
5359 5359
 							$more .= ' disabled';
5360 5360
 						}
5361 5361
 						$more .= ' /></div>';
5362
-						$more .= '</div>' . "\n";
5362
+						$more .= '</div>'."\n";
5363 5363
 					} elseif ($input['type'] == 'radio') {
5364 5364
 						$i = 0;
5365 5365
 						foreach ($input['values'] as $selkey => $selval) {
5366 5366
 							$more .= '<div class="tagtr">';
5367 5367
 							if (isset($input['label'])) {
5368 5368
 								if ($i == 0) {
5369
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5369
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
5370 5370
 								} else {
5371
-									$more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '">&nbsp;</div>';
5371
+									$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
5372 5372
 								}
5373 5373
 							}
5374
-							$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;
5374
+							$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;
5375 5375
 							if (!empty($input['disabled'])) {
5376 5376
 								$more .= ' disabled';
5377 5377
 							}
@@ -5379,12 +5379,12 @@  discard block
 block discarded – undo
5379 5379
 								$more .= ' checked="checked"';
5380 5380
 							}
5381 5381
 							$more .= ' /> ';
5382
-							$more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>';
5383
-							$more .= '</div></div>' . "\n";
5382
+							$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
5383
+							$more .= '</div></div>'."\n";
5384 5384
 							$i++;
5385 5385
 						}
5386 5386
 					} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') {
5387
-						$more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>';
5387
+						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
5388 5388
 						$more .= '<div class="tagtd">';
5389 5389
 						$addnowlink = (empty($input['datenow']) ? 0 : 1);
5390 5390
 						$h = $m = 0;
@@ -5402,24 +5402,24 @@  discard block
 block discarded – undo
5402 5402
 					} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
5403 5403
 						$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
5404 5404
 						if (!empty($input['label'])) {
5405
-							$more .= $input['label'] . '</div><div class="tagtd">';
5405
+							$more .= $input['label'].'</div><div class="tagtd">';
5406 5406
 						}
5407 5407
 						$more .= $input['value'];
5408
-						$more .= '</div></div>' . "\n";
5408
+						$more .= '</div></div>'."\n";
5409 5409
 					} elseif ($input['type'] == 'onecolumn') {
5410 5410
 						$moreonecolumn .= '<div class="margintoponly">';
5411 5411
 						$moreonecolumn .= $input['value'];
5412
-						$moreonecolumn .= '</div>' . "\n";
5412
+						$moreonecolumn .= '</div>'."\n";
5413 5413
 					} elseif ($input['type'] == 'hidden') {
5414 5414
 						// Do nothing more, already added by a previous loop
5415 5415
 					} elseif ($input['type'] == 'separator') {
5416 5416
 						$more .= '<br>';
5417 5417
 					} else {
5418
-						$more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type';
5418
+						$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
5419 5419
 					}
5420 5420
 				}
5421 5421
 			}
5422
-			$more .= '</div>' . "\n";
5422
+			$more .= '</div>'."\n";
5423 5423
 			$more .= $moreonecolumn;
5424 5424
 		}
5425 5425
 
@@ -5441,10 +5441,10 @@  discard block
 block discarded – undo
5441 5441
 				$button = $useajax;
5442 5442
 				$useajax = 1;
5443 5443
 				$autoOpen = false;
5444
-				$dialogconfirm .= '-' . $button;
5444
+				$dialogconfirm .= '-'.$button;
5445 5445
 			}
5446
-			$pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes';
5447
-			$pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : '');
5446
+			$pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
5447
+			$pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
5448 5448
 
5449 5449
 			// Add input fields into list of fields to read during submit (inputok and inputko)
5450 5450
 			if (is_array($formquestion)) {
@@ -5467,24 +5467,24 @@  discard block
 block discarded – undo
5467 5467
 			}
5468 5468
 
5469 5469
 			// Show JQuery confirm box.
5470
-			$formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">';
5470
+			$formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
5471 5471
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5472
-				$formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n";
5472
+				$formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n";
5473 5473
 			}
5474 5474
 			if (!empty($more)) {
5475
-				$formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n";
5475
+				$formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n";
5476 5476
 			}
5477
-			$formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : '');
5478
-			$formconfirm .= '</div>' . "\n";
5477
+			$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : '');
5478
+			$formconfirm .= '</div>'."\n";
5479 5479
 
5480
-			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n";
5481
-			$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5480
+			$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
5481
+			$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5482 5482
 			$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
5483 5483
 			$formconfirm .= 'jQuery(document).ready(function() {
5484 5484
             $(function() {
5485
-            	$( "#' . $dialogconfirm . '" ).dialog(
5485
+            	$( "#' . $dialogconfirm.'" ).dialog(
5486 5486
             	{
5487
-                    autoOpen: ' . ($autoOpen ? "true" : "false") . ',';
5487
+                    autoOpen: ' . ($autoOpen ? "true" : "false").',';
5488 5488
 			if ($newselectedchoice == 'no') {
5489 5489
 				$formconfirm .= '
5490 5490
 						open: function() {
@@ -5494,24 +5494,24 @@  discard block
 block discarded – undo
5494 5494
 
5495 5495
 			$jsforcursor = '';
5496 5496
 			if ($useajax == 1) {
5497
-				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n";
5498
-				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n";
5497
+				$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
5498
+				$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
5499 5499
 			}
5500 5500
 
5501 5501
 			$postconfirmas = 'GET';
5502 5502
 
5503 5503
 			$formconfirm .= '
5504 5504
                     resizable: false,
5505
-                    height: "' . $height . '",
5506
-                    width: "' . $width . '",
5505
+                    height: "' . $height.'",
5506
+                    width: "' . $width.'",
5507 5507
                     modal: true,
5508 5508
                     closeOnEscape: false,
5509 5509
                     buttons: {
5510
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() {
5511
-							var options = "token=' . urlencode(newToken()) . '";
5512
-                        	var inputok = ' . json_encode($inputok) . ';	/* List of fields into form */
5513
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5514
-                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '";
5510
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
5511
+							var options = "token=' . urlencode(newToken()).'";
5512
+                        	var inputok = ' . json_encode($inputok).';	/* List of fields into form */
5513
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5514
+                         	var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
5515 5515
 
5516 5516
                          	if (inputok.length > 0) {
5517 5517
                          		$.each(inputok, function(i, inputname) {
@@ -5545,11 +5545,11 @@  discard block
 block discarded – undo
5545 5545
 							}
5546 5546
 	                        $(this).dialog("close");
5547 5547
                         },
5548
-                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() {
5549
-                        	var options = "token=' . urlencode(newToken()) . '";
5550
-                         	var inputko = ' . json_encode($inputko) . ';	/* List of fields into form */
5551
-							var page = "' . dol_escape_js(!empty($page) ? $page : '') . '";
5552
-                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '";
5548
+                        "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
5549
+                        	var options = "token=' . urlencode(newToken()).'";
5550
+                         	var inputko = ' . json_encode($inputko).';	/* List of fields into form */
5551
+							var page = "' . dol_escape_js(!empty($page) ? $page : '').'";
5552
+                         	var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'";
5553 5553
                          	if (inputko.length > 0) {
5554 5554
                          		$.each(inputko, function(i, inputname) {
5555 5555
                          			var more = "";
@@ -5581,10 +5581,10 @@  discard block
 block discarded – undo
5581 5581
                 }
5582 5582
                 );
5583 5583
 
5584
-            	var button = "' . $button . '";
5584
+            	var button = "' . $button.'";
5585 5585
             	if (button.length > 0) {
5586 5586
                 	$( "#" + button ).click(function() {
5587
-                		$("#' . $dialogconfirm . '").dialog("open");
5587
+                		$("#' . $dialogconfirm.'").dialog("open");
5588 5588
         			});
5589 5589
                 }
5590 5590
             });
@@ -5592,44 +5592,44 @@  discard block
 block discarded – undo
5592 5592
             </script>';
5593 5593
 			$formconfirm .= "<!-- end ajax formconfirm -->\n";
5594 5594
 		} else {
5595
-			$formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n";
5595
+			$formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n";
5596 5596
 
5597 5597
 			if (empty($disableformtag)) {
5598
-				$formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n";
5598
+				$formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n";
5599 5599
 			}
5600 5600
 
5601
-			$formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n";
5602
-			$formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n";
5601
+			$formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n";
5602
+			$formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
5603 5603
 
5604
-			$formconfirm .= '<table class="valid centpercent">' . "\n";
5604
+			$formconfirm .= '<table class="valid centpercent">'."\n";
5605 5605
 
5606 5606
 			// Line title
5607 5607
 			$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
5608
-			$formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title;
5609
-			$formconfirm .= '</td></tr>' . "\n";
5608
+			$formconfirm .= img_picto('', 'pictoconfirm').' '.$title;
5609
+			$formconfirm .= '</td></tr>'."\n";
5610 5610
 
5611 5611
 			// Line text
5612 5612
 			if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) {
5613
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n";
5613
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
5614 5614
 			}
5615 5615
 
5616 5616
 			// Line form fields
5617 5617
 			if ($more) {
5618
-				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n";
5618
+				$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
5619 5619
 				$formconfirm .= $more;
5620
-				$formconfirm .= '</td></tr>' . "\n";
5620
+				$formconfirm .= '</td></tr>'."\n";
5621 5621
 			}
5622 5622
 
5623 5623
 			// Line with question
5624 5624
 			$formconfirm .= '<tr class="valid">';
5625
-			$formconfirm .= '<td class="valid">' . $question . '</td>';
5625
+			$formconfirm .= '<td class="valid">'.$question.'</td>';
5626 5626
 			$formconfirm .= '<td class="valid center">';
5627 5627
 			$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
5628
-			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">';
5628
+			$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
5629 5629
 			$formconfirm .= '</td>';
5630
-			$formconfirm .= '</tr>' . "\n";
5630
+			$formconfirm .= '</tr>'."\n";
5631 5631
 
5632
-			$formconfirm .= '</table>' . "\n";
5632
+			$formconfirm .= '</table>'."\n";
5633 5633
 
5634 5634
 			if (empty($disableformtag)) {
5635 5635
 				$formconfirm .= "</form>\n";
@@ -5638,7 +5638,7 @@  discard block
 block discarded – undo
5638 5638
 
5639 5639
 			if (!empty($conf->use_javascript_ajax)) {
5640 5640
 				$formconfirm .= '<!-- code to disable button to avoid double clic -->';
5641
-				$formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n";
5641
+				$formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
5642 5642
 				$formconfirm .= '
5643 5643
 				$(document).ready(function () {
5644 5644
 					$(".confirmvalidatebutton").on("click", function() {
@@ -5650,7 +5650,7 @@  discard block
 block discarded – undo
5650 5650
 					});
5651 5651
 				});
5652 5652
 				';
5653
-				$formconfirm .= '</script>' . "\n";
5653
+				$formconfirm .= '</script>'."\n";
5654 5654
 			}
5655 5655
 
5656 5656
 			$formconfirm .= "<!-- end formconfirm -->\n";
@@ -5682,8 +5682,8 @@  discard block
 block discarded – undo
5682 5682
 		// phpcs:enable
5683 5683
 		global $langs;
5684 5684
 
5685
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
5686
-		require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
5685
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
5686
+		require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
5687 5687
 
5688 5688
 		$out = '';
5689 5689
 
@@ -5691,11 +5691,11 @@  discard block
 block discarded – undo
5691 5691
 
5692 5692
 		$langs->load("project");
5693 5693
 		if ($htmlname != "none") {
5694
-			$out .= '<form method="post" action="' . $page . '">';
5694
+			$out .= '<form method="post" action="'.$page.'">';
5695 5695
 			$out .= '<input type="hidden" name="action" value="classin">';
5696
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5696
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5697 5697
 			$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss);
5698
-			$out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5698
+			$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5699 5699
 			$out .= '</form>';
5700 5700
 		} else {
5701 5701
 			$out .= '<span class="project_head_block">';
@@ -5704,7 +5704,7 @@  discard block
 block discarded – undo
5704 5704
 				$projet->fetch($selected);
5705 5705
 				$out .= $projet->getNomUrl(0, '', 1);
5706 5706
 			} else {
5707
-				$out .= '<span class="opacitymedium">' . $textifnoproject . '</span>';
5707
+				$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
5708 5708
 			}
5709 5709
 			$out .= '</span>';
5710 5710
 		}
@@ -5741,14 +5741,14 @@  discard block
 block discarded – undo
5741 5741
 		$out = '';
5742 5742
 
5743 5743
 		if ($htmlname != "none") {
5744
-			$out .= '<form method="POST" action="' . $page . '">';
5744
+			$out .= '<form method="POST" action="'.$page.'">';
5745 5745
 			$out .= '<input type="hidden" name="action" value="setconditions">';
5746
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5746
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5747 5747
 			if ($type) {
5748
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5748
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5749 5749
 			}
5750 5750
 			$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
5751
-			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5751
+			$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
5752 5752
 			$out .= '</form>';
5753 5753
 		} else {
5754 5754
 			if ($selected) {
@@ -5793,12 +5793,12 @@  discard block
 block discarded – undo
5793 5793
 		// phpcs:enable
5794 5794
 		global $langs;
5795 5795
 		if ($htmlname != "none") {
5796
-			print '<form method="post" action="' . $page . '">';
5796
+			print '<form method="post" action="'.$page.'">';
5797 5797
 			print '<input type="hidden" name="action" value="setavailability">';
5798
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5798
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5799 5799
 			$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
5800
-			print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5801
-			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">';
5800
+			print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5801
+			print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
5802 5802
 			print '</form>';
5803 5803
 		} else {
5804 5804
 			if ($selected) {
@@ -5824,11 +5824,11 @@  discard block
 block discarded – undo
5824 5824
 	{
5825 5825
 		global $langs;
5826 5826
 		if ($htmlname != "none") {
5827
-			print '<form method="post" action="' . $page . '">';
5827
+			print '<form method="post" action="'.$page.'">';
5828 5828
 			print '<input type="hidden" name="action" value="setdemandreason">';
5829
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5829
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5830 5830
 			$this->selectInputReason($selected, $htmlname, -1, $addempty);
5831
-			print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">';
5831
+			print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
5832 5832
 			print '</form>';
5833 5833
 		} else {
5834 5834
 			if ($selected) {
@@ -5868,17 +5868,17 @@  discard block
 block discarded – undo
5868 5868
 		$ret = '';
5869 5869
 
5870 5870
 		if ($htmlname != "none") {
5871
-			$ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5872
-			$ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
5873
-			$ret .= '<input type="hidden" name="token" value="' . newToken() . '">';
5871
+			$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5872
+			$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
5873
+			$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
5874 5874
 			if ($type) {
5875
-				$ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5875
+				$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5876 5876
 			}
5877 5877
 			$ret .= '<table class="nobordernopadding">';
5878 5878
 			$ret .= '<tr><td>';
5879
-			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0);
5879
+			$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
5880 5880
 			$ret .= '</td>';
5881
-			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
5881
+			$ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
5882 5882
 			$ret .= '</tr></table></form>';
5883 5883
 		} else {
5884 5884
 			if ($displayhour) {
@@ -5913,15 +5913,15 @@  discard block
 block discarded – undo
5913 5913
 		global $langs;
5914 5914
 
5915 5915
 		if ($htmlname != "none") {
5916
-			print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">';
5917
-			print '<input type="hidden" name="action" value="set' . $htmlname . '">';
5918
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5916
+			print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
5917
+			print '<input type="hidden" name="action" value="set'.$htmlname.'">';
5918
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5919 5919
 			print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
5920
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5920
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5921 5921
 			print '</form>';
5922 5922
 		} else {
5923 5923
 			if ($selected) {
5924
-				require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
5924
+				require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
5925 5925
 				$theuser = new User($this->db);
5926 5926
 				$theuser->fetch($selected);
5927 5927
 				print $theuser->getNomUrl(1);
@@ -5954,14 +5954,14 @@  discard block
 block discarded – undo
5954 5954
 
5955 5955
 		$out = '';
5956 5956
 		if ($htmlname != "none") {
5957
-			$out .= '<form method="POST" action="' . $page . '">';
5957
+			$out .= '<form method="POST" action="'.$page.'">';
5958 5958
 			$out .= '<input type="hidden" name="action" value="setmode">';
5959
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
5959
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
5960 5960
 			if ($type) {
5961
-				$out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">';
5961
+				$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
5962 5962
 			}
5963 5963
 			$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
5964
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
5964
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
5965 5965
 			$out .= '</form>';
5966 5966
 		} else {
5967 5967
 			if ($selected) {
@@ -5994,11 +5994,11 @@  discard block
 block discarded – undo
5994 5994
 	{
5995 5995
 		global $langs;
5996 5996
 		if ($htmlname != "none") {
5997
-			print '<form method="POST" action="' . $page . '">';
5997
+			print '<form method="POST" action="'.$page.'">';
5998 5998
 			print '<input type="hidden" name="action" value="settransportmode">';
5999
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5999
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6000 6000
 			$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active);
6001
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6001
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6002 6002
 			print '</form>';
6003 6003
 		} else {
6004 6004
 			if ($selected) {
@@ -6025,14 +6025,14 @@  discard block
 block discarded – undo
6025 6025
 		// phpcs:enable
6026 6026
 		global $langs;
6027 6027
 		if ($htmlname != "none") {
6028
-			print '<form method="POST" action="' . $page . '">';
6028
+			print '<form method="POST" action="'.$page.'">';
6029 6029
 			print '<input type="hidden" name="action" value="setmulticurrencycode">';
6030
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6030
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6031 6031
 			print $this->selectMultiCurrency($selected, $htmlname, 0);
6032
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6032
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6033 6033
 			print '</form>';
6034 6034
 		} else {
6035
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6035
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6036 6036
 			print !empty($selected) ? currency_name($selected, 1) : '&nbsp;';
6037 6037
 		}
6038 6038
 	}
@@ -6054,21 +6054,21 @@  discard block
 block discarded – undo
6054 6054
 		global $langs, $mysoc, $conf;
6055 6055
 
6056 6056
 		if ($htmlname != "none") {
6057
-			print '<form method="POST" action="' . $page . '">';
6057
+			print '<form method="POST" action="'.$page.'">';
6058 6058
 			print '<input type="hidden" name="action" value="setmulticurrencyrate">';
6059
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6060
-			print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> ';
6059
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6060
+			print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> ';
6061 6061
 			print '<select name="calculation_mode">';
6062
-			print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>';
6063
-			print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>';
6062
+			print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>';
6063
+			print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>';
6064 6064
 			print '</select> ';
6065
-			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6065
+			print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6066 6066
 			print '</form>';
6067 6067
 		} else {
6068 6068
 			if (!empty($rate)) {
6069 6069
 				print price($rate, 1, $langs, 0, 0);
6070 6070
 				if ($currency && $rate != 1) {
6071
-					print ' &nbsp; (' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')';
6071
+					print ' &nbsp; ('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')';
6072 6072
 				}
6073 6073
 			} else {
6074 6074
 				print 1;
@@ -6099,9 +6099,9 @@  discard block
 block discarded – undo
6099 6099
 		// phpcs:enable
6100 6100
 		global $conf, $langs;
6101 6101
 		if ($htmlname != "none") {
6102
-			print '<form method="post" action="' . $page . '">';
6102
+			print '<form method="post" action="'.$page.'">';
6103 6103
 			print '<input type="hidden" name="action" value="setabsolutediscount">';
6104
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6104
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6105 6105
 			print '<div class="inline-block">';
6106 6106
 			if (!empty($discount_type)) {
6107 6107
 				if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
@@ -6139,24 +6139,24 @@  discard block
 block discarded – undo
6139 6139
 			print '</div>';
6140 6140
 			if (empty($hidelist)) {
6141 6141
 				print '<div class="inline-block" style="padding-right: 10px">';
6142
-				$newfilter = 'discount_type=' . intval($discount_type);
6142
+				$newfilter = 'discount_type='.intval($discount_type);
6143 6143
 				if (!empty($discount_type)) {
6144 6144
 					$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available
6145 6145
 				} else {
6146 6146
 					$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available
6147 6147
 				}
6148 6148
 				if ($filter) {
6149
-					$newfilter .= ' AND (' . $filter . ')';
6149
+					$newfilter .= ' AND ('.$filter.')';
6150 6150
 				}
6151 6151
 				// output the combo of discounts
6152 6152
 				$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
6153 6153
 				if ($nbqualifiedlines > 0) {
6154
-					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"';
6154
+					print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
6155 6155
 					if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") {
6156
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6156
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6157 6157
 					}
6158 6158
 					if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") {
6159
-						print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"';
6159
+						print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
6160 6160
 					}
6161 6161
 
6162 6162
 					print '>';
@@ -6196,23 +6196,23 @@  discard block
 block discarded – undo
6196 6196
 		global $langs, $conf;
6197 6197
 
6198 6198
 		if ($htmlname != "none") {
6199
-			print '<form method="post" action="' . $page . '">';
6199
+			print '<form method="post" action="'.$page.'">';
6200 6200
 			print '<input type="hidden" name="action" value="set_contact">';
6201
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
6201
+			print '<input type="hidden" name="token" value="'.newToken().'">';
6202 6202
 			print '<table class="nobordernopadding">';
6203 6203
 			print '<tr><td>';
6204 6204
 			print $this->selectcontacts($societe->id, $selected, $htmlname);
6205 6205
 			$num = $this->num;
6206 6206
 			if ($num == 0) {
6207 6207
 				$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
6208
-				print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
6208
+				print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
6209 6209
 			}
6210 6210
 			print '</td>';
6211
-			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
6211
+			print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
6212 6212
 			print '</tr></table></form>';
6213 6213
 		} else {
6214 6214
 			if ($selected) {
6215
-				require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
6215
+				require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
6216 6216
 				$contact = new Contact($this->db);
6217 6217
 				$contact->fetch($selected);
6218 6218
 				print $contact->getFullName($langs);
@@ -6247,20 +6247,20 @@  discard block
 block discarded – undo
6247 6247
 
6248 6248
 		$out = '';
6249 6249
 		if ($htmlname != "none") {
6250
-			$out .= '<form method="post" action="' . $page . '">';
6250
+			$out .= '<form method="post" action="'.$page.'">';
6251 6251
 			$out .= '<input type="hidden" name="action" value="set_thirdparty">';
6252
-			$out .= '<input type="hidden" name="token" value="' . newToken() . '">';
6252
+			$out .= '<input type="hidden" name="token" value="'.newToken().'">';
6253 6253
 			$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids);
6254
-			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">';
6254
+			$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
6255 6255
 			$out .= '</form>';
6256 6256
 		} else {
6257 6257
 			if ($selected) {
6258
-				require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
6258
+				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
6259 6259
 				$soc = new Societe($this->db);
6260 6260
 				$soc->fetch($selected);
6261 6261
 				$out .= $soc->getNomUrl(0, '');
6262 6262
 			} else {
6263
-				$out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>';
6263
+				$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
6264 6264
 			}
6265 6265
 		}
6266 6266
 
@@ -6310,22 +6310,22 @@  discard block
 block discarded – undo
6310 6310
 			$selected = 'EUR'; // Pour compatibilite
6311 6311
 		}
6312 6312
 
6313
-		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">';
6313
+		$out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
6314 6314
 		if ($useempty) {
6315 6315
 			$out .= '<option value="-1" selected></option>';
6316 6316
 		}
6317 6317
 		foreach ($langs->cache_currencies as $code_iso => $currency) {
6318 6318
 			$labeltoshow = $currency['label'];
6319 6319
 			if ($mode == 1) {
6320
-				$labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>';
6320
+				$labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>';
6321 6321
 			} else {
6322
-				$labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>';
6322
+				$labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>';
6323 6323
 			}
6324 6324
 
6325 6325
 			if ($selected && $selected == $code_iso) {
6326
-				$out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6326
+				$out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">';
6327 6327
 			} else {
6328
-				$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
6328
+				$out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">';
6329 6329
 			}
6330 6330
 			$out .= $labeltoshow;
6331 6331
 			$out .= '</option>';
@@ -6336,7 +6336,7 @@  discard block
 block discarded – undo
6336 6336
 		}
6337 6337
 
6338 6338
 		// Make select dynamic
6339
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6339
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6340 6340
 		$out .= ajax_combobox($htmlname);
6341 6341
 
6342 6342
 		return $out;
@@ -6362,10 +6362,10 @@  discard block
 block discarded – undo
6362 6362
 
6363 6363
 		$TCurrency = array();
6364 6364
 
6365
-		$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
6366
-		$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
6365
+		$sql = "SELECT code FROM ".$this->db->prefix()."multicurrency";
6366
+		$sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')";
6367 6367
 		if ($filter) {
6368
-			$sql .= " AND " . $filter;
6368
+			$sql .= " AND ".$filter;
6369 6369
 		}
6370 6370
 		$resql = $this->db->query($sql);
6371 6371
 		if ($resql) {
@@ -6375,7 +6375,7 @@  discard block
 block discarded – undo
6375 6375
 		}
6376 6376
 
6377 6377
 		$out = '';
6378
-		$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
6378
+		$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
6379 6379
 		if ($useempty) {
6380 6380
 			$out .= '<option value="">&nbsp;</option>';
6381 6381
 		}
@@ -6387,13 +6387,13 @@  discard block
 block discarded – undo
6387 6387
 			foreach ($langs->cache_currencies as $code_iso => $currency) {
6388 6388
 				if (isset($TCurrency[$code_iso])) {
6389 6389
 					if (!empty($selected) && $selected == $code_iso) {
6390
-						$out .= '<option value="' . $code_iso . '" selected="selected">';
6390
+						$out .= '<option value="'.$code_iso.'" selected="selected">';
6391 6391
 					} else {
6392
-						$out .= '<option value="' . $code_iso . '">';
6392
+						$out .= '<option value="'.$code_iso.'">';
6393 6393
 					}
6394 6394
 
6395 6395
 					$out .= $currency['label'];
6396
-					$out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')';
6396
+					$out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
6397 6397
 					$out .= '</option>';
6398 6398
 				}
6399 6399
 			}
@@ -6402,7 +6402,7 @@  discard block
 block discarded – undo
6402 6402
 		$out .= '</select>';
6403 6403
 
6404 6404
 		// Make select dynamic
6405
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
6405
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
6406 6406
 		$out .= ajax_combobox($htmlname);
6407 6407
 
6408 6408
 		return $out;
@@ -6433,7 +6433,7 @@  discard block
 block discarded – undo
6433 6433
 		$sql .= " WHERE t.fk_pays = c.rowid";
6434 6434
 		$sql .= " AND t.active > 0";
6435 6435
 		$sql .= " AND t.entity IN (".getEntity('c_tva').")";
6436
-		$sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")";
6436
+		$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
6437 6437
 		$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
6438 6438
 
6439 6439
 		$resql = $this->db->query($sql);
@@ -6445,30 +6445,30 @@  discard block
 block discarded – undo
6445 6445
 
6446 6446
 					$tmparray = array();
6447 6447
 					$tmparray['rowid']			= $obj->rowid;
6448
-					$tmparray['type_vat']		= $obj->type_vat;
6449
-					$tmparray['code']			= $obj->code;
6448
+					$tmparray['type_vat'] = $obj->type_vat;
6449
+					$tmparray['code'] = $obj->code;
6450 6450
 					$tmparray['txtva']			= $obj->taux;
6451
-					$tmparray['nprtva']			= $obj->recuperableonly;
6451
+					$tmparray['nprtva'] = $obj->recuperableonly;
6452 6452
 					$tmparray['localtax1']	    = $obj->localtax1;
6453 6453
 					$tmparray['localtax1_type']	= $obj->localtax1_type;
6454 6454
 					$tmparray['localtax2']	    = $obj->localtax2;
6455 6455
 					$tmparray['localtax2_type']	= $obj->localtax1_type;
6456
-					$tmparray['label']			= $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or *
6457
-					$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
6456
+					$tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or *
6457
+					$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
6458 6458
 					$positiverates = '';
6459 6459
 					if ($obj->taux) {
6460
-						$positiverates .= ($positiverates ? '/' : '') . $obj->taux;
6460
+						$positiverates .= ($positiverates ? '/' : '').$obj->taux;
6461 6461
 					}
6462 6462
 					if ($obj->localtax1) {
6463
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax1;
6463
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax1;
6464 6464
 					}
6465 6465
 					if ($obj->localtax2) {
6466
-						$positiverates .= ($positiverates ? '/' : '') . $obj->localtax2;
6466
+						$positiverates .= ($positiverates ? '/' : '').$obj->localtax2;
6467 6467
 					}
6468 6468
 					if (empty($positiverates)) {
6469 6469
 						$positiverates = '0';
6470 6470
 					}
6471
-					$tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label
6471
+					$tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label
6472 6472
 
6473 6473
 					$this->cache_vatrates[$obj->rowid] = $tmparray;
6474 6474
 				}
@@ -6488,7 +6488,7 @@  discard block
 block discarded – undo
6488 6488
 				return -1;
6489 6489
 			}
6490 6490
 		} else {
6491
-			$this->error = '<span class="error">' . $this->db->error() . '</span>';
6491
+			$this->error = '<span class="error">'.$this->db->error().'</span>';
6492 6492
 			return -2;
6493 6493
 		}
6494 6494
 	}
@@ -6541,9 +6541,9 @@  discard block
 block discarded – undo
6541 6541
 		// Check parameters
6542 6542
 		if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
6543 6543
 			if ($societe_vendeuse->id == $mysoc->id) {
6544
-				$return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>';
6544
+				$return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>';
6545 6545
 			} else {
6546
-				$return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>';
6546
+				$return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>';
6547 6547
 			}
6548 6548
 			return $return;
6549 6549
 		}
@@ -6555,12 +6555,12 @@  discard block
 block discarded – undo
6555 6555
 		// Define list of countries to use to search VAT rates to show
6556 6556
 		// First we defined code_country to use to find list
6557 6557
 		if (is_object($societe_vendeuse)) {
6558
-			$code_country = "'" . $societe_vendeuse->country_code . "'";
6558
+			$code_country = "'".$societe_vendeuse->country_code."'";
6559 6559
 		} else {
6560
-			$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
6560
+			$code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente
6561 6561
 		}
6562 6562
 		if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {    // If option to have vat for end customer for services is on
6563
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
6563
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
6564 6564
 			// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
6565 6565
 			// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
6566 6566
 			$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
@@ -6570,27 +6570,27 @@  discard block
 block discarded – undo
6570 6570
 					if ($type == 1) { // We know product is a service
6571 6571
 						switch ($selectVatComboMode) {
6572 6572
 							case '1':
6573
-								$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6573
+								$code_country .= ",'".$societe_acheteuse->country_code."'";
6574 6574
 								break;
6575 6575
 							case '2':
6576
-								$code_country = "'" . $societe_acheteuse->country_code . "'";
6576
+								$code_country = "'".$societe_acheteuse->country_code."'";
6577 6577
 								break;
6578 6578
 						}
6579 6579
 					}
6580 6580
 				} elseif (!$idprod) {  // We don't know type of product
6581 6581
 					switch ($selectVatComboMode) {
6582 6582
 						case '1':
6583
-							$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6583
+							$code_country .= ",'".$societe_acheteuse->country_code."'";
6584 6584
 							break;
6585 6585
 						case '2':
6586
-							$code_country = "'" . $societe_acheteuse->country_code . "'";
6586
+							$code_country = "'".$societe_acheteuse->country_code."'";
6587 6587
 							break;
6588 6588
 					}
6589 6589
 				} else {
6590 6590
 					$prodstatic = new Product($this->db);
6591 6591
 					$prodstatic->fetch($idprod);
6592 6592
 					if ($prodstatic->type == Product::TYPE_SERVICE) {   // We know product is a service
6593
-						$code_country .= ",'" . $societe_acheteuse->country_code . "'";
6593
+						$code_country .= ",'".$societe_acheteuse->country_code."'";
6594 6594
 					}
6595 6595
 				}
6596 6596
 			}
@@ -6652,13 +6652,13 @@  discard block
 block discarded – undo
6652 6652
 				// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
6653 6653
 				// of using supplier invoices (this is a very bad idea !)
6654 6654
 				if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
6655
-					$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
6655
+					$title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"';
6656 6656
 					$disabled = true;
6657 6657
 				}
6658 6658
 			}
6659 6659
 
6660 6660
 			if (!$options_only) {
6661
-				$return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>';
6661
+				$return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>';
6662 6662
 			}
6663 6663
 
6664 6664
 			$selectedfound = false;
@@ -6672,13 +6672,13 @@  discard block
 block discarded – undo
6672 6672
 				$key = $rate['txtva'];
6673 6673
 				$key .= $rate['nprtva'] ? '*' : '';
6674 6674
 				if ($mode > 0 && $rate['code']) {
6675
-					$key .= ' (' . $rate['code'] . ')';
6675
+					$key .= ' ('.$rate['code'].')';
6676 6676
 				}
6677 6677
 				if ($mode < 0) {
6678 6678
 					$key = $rate['rowid'];
6679 6679
 				}
6680 6680
 
6681
-				$return .= '<option value="' . $key . '"';
6681
+				$return .= '<option value="'.$key.'"';
6682 6682
 				if (!$selectedfound) {
6683 6683
 					if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag
6684 6684
 						if ($defaultcode == $rate['code']) {
@@ -6749,7 +6749,7 @@  discard block
 block discarded – undo
6749 6749
 	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 = '')
6750 6750
 	{
6751 6751
 		// phpcs:enable
6752
-		dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6752
+		dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING);
6753 6753
 		$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof);
6754 6754
 		if (!empty($nooutput)) {
6755 6755
 			return $retstring;
@@ -6778,11 +6778,11 @@  discard block
 block discarded – undo
6778 6778
 	{
6779 6779
 		global $langs;
6780 6780
 
6781
-		$ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6781
+		$ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel');
6782 6782
 		if ($forcenewline) {
6783 6783
 			$ret .= '<br>';
6784 6784
 		}
6785
-		$ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6785
+		$ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel');
6786 6786
 		return $ret;
6787 6787
 	}
6788 6788
 
@@ -6848,7 +6848,7 @@  discard block
 block discarded – undo
6848 6848
 		$orig_set_time = $set_time;
6849 6849
 
6850 6850
 		if ($set_time === '' && $emptydate == 0) {
6851
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
6851
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
6852 6852
 			if ($gm == 'tzuser' || $gm == 'tzuserrel') {
6853 6853
 				$set_time = dol_now($gm);
6854 6854
 			} else {
@@ -6920,38 +6920,38 @@  discard block
 block discarded – undo
6920 6920
 				// Calendrier popup version eldy
6921 6921
 				if ($usecalendar == "eldy") {
6922 6922
 					// Input area to enter date manually
6923
-					$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
6923
+					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6924 6924
 					$retstring .= ($disabled ? ' disabled' : '');
6925
-					$retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6925
+					$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6926 6926
 					$retstring .= ' autocomplete="off">';
6927 6927
 
6928 6928
 					// Icon calendar
6929 6929
 					$retstringbuttom = '';
6930 6930
 					if (!$disabled) {
6931
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
6932
-						$base = DOL_URL_ROOT . '/core/';
6933
-						$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
6934
-						$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
6931
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
6932
+						$base = DOL_URL_ROOT.'/core/';
6933
+						$retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"';
6934
+						$retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>';
6935 6935
 					} else {
6936
-						$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6936
+						$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6937 6937
 					}
6938
-					$retstring = $retstringbuttom . $retstring;
6938
+					$retstring = $retstringbuttom.$retstring;
6939 6939
 
6940
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6941
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6942
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6940
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6941
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6942
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6943 6943
 				} elseif ($usecalendar == 'jquery' || $usecalendar == 'html') {
6944 6944
 					if (!$disabled && $usecalendar != 'html') {
6945 6945
 						// Output javascript for datepicker
6946 6946
 						$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100));
6947 6947
 						$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100));
6948 6948
 
6949
-						$retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">';
6950
-						$retstring .= "$(function(){ $('#" . $prefix . "').datepicker({
6951
-							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "',
6949
+						$retstring .= '<script nonce="'.getNonce().'" type="text/javascript">';
6950
+						$retstring .= "$(function(){ $('#".$prefix."').datepicker({
6951
+							dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."',
6952 6952
 							autoclose: true,
6953 6953
 							todayHighlight: true,
6954
-							yearRange: '" . $minYear . ":" . $maxYear . "',";
6954
+							yearRange: '" . $minYear.":".$maxYear."',";
6955 6955
 						if (!empty($conf->dol_use_jmobile)) {
6956 6956
 							$retstring .= "
6957 6957
 								beforeShow: function (input, datePicker) {
@@ -6966,7 +6966,7 @@  discard block
 block discarded – undo
6966 6966
 						if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
6967 6967
 							$retstring .= "
6968 6968
 								showOn: 'button',	/* both has problem with autocompletion */
6969
-								buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
6969
+								buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
6970 6970
 								buttonImageOnly: true";
6971 6971
 						}
6972 6972
 						$retstring .= "
@@ -6978,46 +6978,46 @@  discard block
 block discarded – undo
6978 6978
 					$retstring .= '<div class="nowraponall inline-block divfordateinput">';
6979 6979
 					$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
6980 6980
 					$retstring .= ($disabled ? ' disabled' : '');
6981
-					$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
6982
-					$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6981
+					$retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '');
6982
+					$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
6983 6983
 					$retstring .= ' autocomplete="off">';
6984 6984
 
6985 6985
 					// Icone calendrier
6986 6986
 					if ($disabled) {
6987
-						$retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
6988
-						$retstring = $retstringbutton . $retstring;
6987
+						$retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>';
6988
+						$retstring = $retstringbutton.$retstring;
6989 6989
 					}
6990 6990
 
6991 6991
 					$retstring .= '</div>';
6992
-					$retstring .= '<input type="hidden" id="' . $prefix . 'day"   name="' . $prefix . 'day"   value="' . $sday . '">' . "\n";
6993
-					$retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n";
6994
-					$retstring .= '<input type="hidden" id="' . $prefix . 'year"  name="' . $prefix . 'year"  value="' . $syear . '">' . "\n";
6992
+					$retstring .= '<input type="hidden" id="'.$prefix.'day"   name="'.$prefix.'day"   value="'.$sday.'">'."\n";
6993
+					$retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
6994
+					$retstring .= '<input type="hidden" id="'.$prefix.'year"  name="'.$prefix.'year"  value="'.$syear.'">'."\n";
6995 6995
 				} else {
6996 6996
 					$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
6997 6997
 				}
6998 6998
 			} else {
6999 6999
 				// Show date with combo selects
7000 7000
 				// Day
7001
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">';
7001
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
7002 7002
 
7003 7003
 				if ($emptydate || $set_time == -1) {
7004 7004
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7005 7005
 				}
7006 7006
 
7007 7007
 				for ($day = 1; $day <= 31; $day++) {
7008
-					$retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>';
7008
+					$retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>';
7009 7009
 				}
7010 7010
 
7011 7011
 				$retstring .= "</select>";
7012 7012
 
7013
-				$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">';
7013
+				$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">';
7014 7014
 				if ($emptydate || $set_time == -1) {
7015 7015
 					$retstring .= '<option value="0" selected>&nbsp;</option>';
7016 7016
 				}
7017 7017
 
7018 7018
 				// Month
7019 7019
 				for ($month = 1; $month <= 12; $month++) {
7020
-					$retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>';
7020
+					$retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>';
7021 7021
 					$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b");
7022 7022
 					$retstring .= "</option>";
7023 7023
 				}
@@ -7025,13 +7025,13 @@  discard block
 block discarded – undo
7025 7025
 
7026 7026
 				// Year
7027 7027
 				if ($emptydate || $set_time == -1) {
7028
-					$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 . '">';
7028
+					$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.'">';
7029 7029
 				} else {
7030
-					$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">';
7030
+					$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">';
7031 7031
 
7032 7032
 					$syear = (int) $syear;
7033 7033
 					for ($year = $syear - 10; $year < (int) $syear + 10; $year++) {
7034
-						$retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>';
7034
+						$retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>';
7035 7035
 					}
7036 7036
 					$retstring .= "</select>\n";
7037 7037
 				}
@@ -7055,15 +7055,15 @@  discard block
 block discarded – undo
7055 7055
 				}
7056 7056
 			}
7057 7057
 			// Show hour
7058
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">';
7058
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
7059 7059
 			if ($emptyhours) {
7060 7060
 				$retstring .= '<option value="-1">&nbsp;</option>';
7061 7061
 			}
7062 7062
 			for ($hour = $hourstart; $hour < $hourend; $hour++) {
7063 7063
 				if (strlen($hour) < 2) {
7064
-					$hour = "0" . $hour;
7064
+					$hour = "0".$hour;
7065 7065
 				}
7066
-				$retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour;
7066
+				$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
7067 7067
 				//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
7068 7068
 				$retstring .= '</option>';
7069 7069
 			}
@@ -7076,17 +7076,17 @@  discard block
 block discarded – undo
7076 7076
 
7077 7077
 		if ($m) {
7078 7078
 			// Show minutes
7079
-			$retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">';
7079
+			$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">';
7080 7080
 			if ($emptyhours) {
7081 7081
 				$retstring .= '<option value="-1">&nbsp;</option>';
7082 7082
 			}
7083 7083
 			for ($min = 0; $min < 60; $min += $stepminutes) {
7084 7084
 				$min_str = sprintf("%02d", $min);
7085
-				$retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>';
7085
+				$retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>';
7086 7086
 			}
7087 7087
 			$retstring .= '</select>';
7088 7088
 
7089
-			$retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">';
7089
+			$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
7090 7090
 		}
7091 7091
 
7092 7092
 		if ($d && $h) {
@@ -7109,10 +7109,10 @@  discard block
 block discarded – undo
7109 7109
 
7110 7110
 			// Generate the date part, depending on the use or not of the javascript calendar
7111 7111
 			if ($addnowlink == 1) { // server time expressed in user time setup
7112
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7113
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7114
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7115
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7112
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7113
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7114
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7115
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7116 7116
 			} elseif ($addnowlink == 2) {
7117 7117
 				/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
7118 7118
 				 * This break application for foreign languages.
@@ -7121,10 +7121,10 @@  discard block
 block discarded – undo
7121 7121
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
7122 7122
 				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
7123 7123
 				*/
7124
-				$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');';
7125
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7126
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7127
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7124
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
7125
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7126
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7127
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7128 7128
 			}
7129 7129
 			/*if ($usecalendar == "eldy")
7130 7130
 			{
@@ -7144,11 +7144,11 @@  discard block
 block discarded – undo
7144 7144
 				}
7145 7145
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
7146 7146
 				if ($addnowlink == 1) {
7147
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7148
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7147
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7148
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7149 7149
 				} elseif ($addnowlink == 2) {
7150
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());';
7151
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();';
7150
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());';
7151
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
7152 7152
 				}
7153 7153
 
7154 7154
 				if ($fullday) {
@@ -7162,11 +7162,11 @@  discard block
 block discarded – undo
7162 7162
 				}
7163 7163
 				//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
7164 7164
 				if ($addnowlink == 1) {
7165
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7166
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7165
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7166
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7167 7167
 				} elseif ($addnowlink == 2) {
7168
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());';
7169
-					$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();';
7168
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());';
7169
+					$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
7170 7170
 				}
7171 7171
 				if ($fullday) {
7172 7172
 					$reset_scripts .= ' } ';
@@ -7174,7 +7174,7 @@  discard block
 block discarded – undo
7174 7174
 			}
7175 7175
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7176 7176
 			if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
7177
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
7177
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
7178 7178
 				$retstring .= $langs->trans("Now");
7179 7179
 				$retstring .= '</button> ';
7180 7180
 			}
@@ -7186,16 +7186,16 @@  discard block
 block discarded – undo
7186 7186
 			$reset_scripts = "";
7187 7187
 
7188 7188
 			// Generate the date part, depending on the use or not of the javascript calendar
7189
-			$reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');';
7190
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');';
7191
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');';
7192
-			$reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');';
7189
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
7190
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
7191
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
7192
+			$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
7193 7193
 			// Update the hour part
7194 7194
 			if ($h) {
7195 7195
 				if ($fullday) {
7196 7196
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7197 7197
 				}
7198
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');';
7198
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
7199 7199
 				if ($fullday) {
7200 7200
 					$reset_scripts .= ' } ';
7201 7201
 				}
@@ -7205,14 +7205,14 @@  discard block
 block discarded – undo
7205 7205
 				if ($fullday) {
7206 7206
 					$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
7207 7207
 				}
7208
-				$reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');';
7208
+				$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
7209 7209
 				if ($fullday) {
7210 7210
 					$reset_scripts .= ' } ';
7211 7211
 				}
7212 7212
 			}
7213 7213
 			// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
7214 7214
 			if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) {
7215
-				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">';
7215
+				$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
7216 7216
 				$retstring .= $langs->trans("DateStartPlusOne");
7217 7217
 				$retstring .= '</button> ';
7218 7218
 			}
@@ -7270,17 +7270,17 @@  discard block
 block discarded – undo
7270 7270
 			unset($TDurationTypes[$value]);
7271 7271
 		}
7272 7272
 
7273
-		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">';
7273
+		$retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
7274 7274
 		foreach ($TDurationTypes as $key => $typeduration) {
7275
-			$retstring .= '<option value="' . $key . '"';
7275
+			$retstring .= '<option value="'.$key.'"';
7276 7276
 			if ($key == $selected) {
7277 7277
 				$retstring .= " selected";
7278 7278
 			}
7279
-			$retstring .= ">" . $typeduration . "</option>";
7279
+			$retstring .= ">".$typeduration."</option>";
7280 7280
 		}
7281 7281
 		$retstring .= "</select>";
7282 7282
 
7283
-		$retstring .= ajax_combobox('select_' . $prefix . 'type_duration');
7283
+		$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
7284 7284
 
7285 7285
 		return $retstring;
7286 7286
 	}
@@ -7312,30 +7312,30 @@  discard block
 block discarded – undo
7312 7312
 
7313 7313
 		// Hours
7314 7314
 		if ($iSecond != '') {
7315
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
7315
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
7316 7316
 
7317 7317
 			$hourSelected = convertSecondToTime($iSecond, 'allhour');
7318 7318
 			$minSelected = convertSecondToTime($iSecond, 'min');
7319 7319
 		}
7320 7320
 
7321 7321
 		if ($typehour == 'select') {
7322
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>';
7322
+			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
7323 7323
 			for ($hour = 0; $hour < 25; $hour++) {    // For a duration, we allow 24 hours
7324
-				$retstring .= '<option value="' . $hour . '"';
7324
+				$retstring .= '<option value="'.$hour.'"';
7325 7325
 				if (is_numeric($hourSelected) && $hourSelected == $hour) {
7326 7326
 					$retstring .= " selected";
7327 7327
 				}
7328
-				$retstring .= ">" . $hour . "</option>";
7328
+				$retstring .= ">".$hour."</option>";
7329 7329
 			}
7330 7330
 			$retstring .= "</select>";
7331 7331
 		} elseif ($typehour == 'text' || $typehour == 'textselect') {
7332
-			$retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">';
7332
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
7333 7333
 		} else {
7334 7334
 			return 'BadValueForParameterTypeHour';
7335 7335
 		}
7336 7336
 
7337 7337
 		if ($typehour != 'text') {
7338
-			$retstring .= ' ' . $langs->trans('HourShort');
7338
+			$retstring .= ' '.$langs->trans('HourShort');
7339 7339
 		} else {
7340 7340
 			$retstring .= '<span class="">:</span>';
7341 7341
 		}
@@ -7350,21 +7350,21 @@  discard block
 block discarded – undo
7350 7350
 		}
7351 7351
 
7352 7352
 		if ($typehour == 'select' || $typehour == 'textselect') {
7353
-			$retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>';
7353
+			$retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>';
7354 7354
 			for ($min = 0; $min <= 55; $min += 5) {
7355
-				$retstring .= '<option value="' . $min . '"';
7355
+				$retstring .= '<option value="'.$min.'"';
7356 7356
 				if (is_numeric($minSelected) && $minSelected == $min) {
7357 7357
 					$retstring .= ' selected';
7358 7358
 				}
7359
-				$retstring .= '>' . $min . '</option>';
7359
+				$retstring .= '>'.$min.'</option>';
7360 7360
 			}
7361 7361
 			$retstring .= "</select>";
7362 7362
 		} elseif ($typehour == 'text') {
7363
-			$retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">';
7363
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
7364 7364
 		}
7365 7365
 
7366 7366
 		if ($typehour != 'text') {
7367
-			$retstring .= ' ' . $langs->trans('MinuteShort');
7367
+			$retstring .= ' '.$langs->trans('MinuteShort');
7368 7368
 		}
7369 7369
 
7370 7370
 		$retstring .= "</span>";
@@ -7412,7 +7412,7 @@  discard block
 block discarded – undo
7412 7412
 			$placeholder = '';
7413 7413
 
7414 7414
 			if ($selected && empty($selected_input_value)) {
7415
-				require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7415
+				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7416 7416
 				$tickettmpselect = new Ticket($this->db);
7417 7417
 				$tickettmpselect->fetch($selected);
7418 7418
 				$selected_input_value = $tickettmpselect->ref;
@@ -7420,17 +7420,17 @@  discard block
 block discarded – undo
7420 7420
 			}
7421 7421
 
7422 7422
 			$urloption = '';
7423
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7423
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7424 7424
 
7425 7425
 			if (empty($hidelabel)) {
7426
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7426
+				$out .= $langs->trans("RefOrLabel").' : ';
7427 7427
 			} elseif ($hidelabel > 1) {
7428
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7428
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7429 7429
 				if ($hidelabel == 2) {
7430 7430
 					$out .= img_picto($langs->trans("Search"), 'search');
7431 7431
 				}
7432 7432
 			}
7433
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7433
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7434 7434
 			if ($hidelabel == 3) {
7435 7435
 				$out .= img_picto($langs->trans("Search"), 'search');
7436 7436
 			}
@@ -7474,8 +7474,8 @@  discard block
 block discarded – undo
7474 7474
 
7475 7475
 		$sql = "SELECT ";
7476 7476
 		$sql .= $selectFields;
7477
-		$sql .= " FROM " . $this->db->prefix() . "ticket as p";
7478
-		$sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')';
7477
+		$sql .= " FROM ".$this->db->prefix()."ticket as p";
7478
+		$sql .= ' WHERE p.entity IN ('.getEntity('ticket').')';
7479 7479
 
7480 7480
 		// Add criteria on ref/label
7481 7481
 		if ($filterkey != '') {
@@ -7491,7 +7491,7 @@  discard block
 block discarded – undo
7491 7491
 				if ($i > 0) {
7492 7492
 					$sql .= " AND ";
7493 7493
 				}
7494
-				$sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7494
+				$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'";
7495 7495
 				$sql .= ")";
7496 7496
 				$i++;
7497 7497
 			}
@@ -7504,22 +7504,22 @@  discard block
 block discarded – undo
7504 7504
 		$sql .= $this->db->plimit($limit, 0);
7505 7505
 
7506 7506
 		// Build output string
7507
-		dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG);
7507
+		dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG);
7508 7508
 		$result = $this->db->query($sql);
7509 7509
 		if ($result) {
7510
-			require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
7511
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php';
7510
+			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
7511
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
7512 7512
 
7513 7513
 			$num = $this->db->num_rows($result);
7514 7514
 
7515 7515
 			$events = array();
7516 7516
 
7517 7517
 			if (!$forcecombo) {
7518
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7518
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7519 7519
 				$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT);
7520 7520
 			}
7521 7521
 
7522
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7522
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7523 7523
 
7524 7524
 			$textifempty = '';
7525 7525
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7536,7 +7536,7 @@  discard block
 block discarded – undo
7536 7536
 				}
7537 7537
 			}
7538 7538
 			if ($showempty) {
7539
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7539
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7540 7540
 			}
7541 7541
 
7542 7542
 			$i = 0;
@@ -7591,13 +7591,13 @@  discard block
 block discarded – undo
7591 7591
 		$outref = $objp->ref;
7592 7592
 		$outtype = $objp->fk_product_type;
7593 7593
 
7594
-		$opt = '<option value="' . $objp->rowid . '"';
7594
+		$opt = '<option value="'.$objp->rowid.'"';
7595 7595
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7596 7596
 		$opt .= '>';
7597 7597
 		$opt .= $objp->ref;
7598 7598
 		$objRef = $objp->ref;
7599 7599
 		if (!empty($filterkey) && $filterkey != '') {
7600
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7600
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7601 7601
 		}
7602 7602
 
7603 7603
 		$opt .= "</option>\n";
@@ -7638,7 +7638,7 @@  discard block
 block discarded – undo
7638 7638
 			$placeholder = '';
7639 7639
 
7640 7640
 			if ($selected && empty($selected_input_value)) {
7641
-				require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7641
+				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7642 7642
 				$projecttmpselect = new Project($this->db);
7643 7643
 				$projecttmpselect->fetch($selected);
7644 7644
 				$selected_input_value = $projecttmpselect->ref;
@@ -7646,17 +7646,17 @@  discard block
 block discarded – undo
7646 7646
 			}
7647 7647
 
7648 7648
 			$urloption = '';
7649
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7649
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7650 7650
 
7651 7651
 			if (empty($hidelabel)) {
7652
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7652
+				$out .= $langs->trans("RefOrLabel").' : ';
7653 7653
 			} elseif ($hidelabel > 1) {
7654
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7654
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7655 7655
 				if ($hidelabel == 2) {
7656 7656
 					$out .= img_picto($langs->trans("Search"), 'search');
7657 7657
 				}
7658 7658
 			}
7659
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7659
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7660 7660
 			if ($hidelabel == 3) {
7661 7661
 				$out .= img_picto($langs->trans("Search"), 'search');
7662 7662
 			}
@@ -7699,8 +7699,8 @@  discard block
 block discarded – undo
7699 7699
 
7700 7700
 		$sql = "SELECT ";
7701 7701
 		$sql .= $selectFields;
7702
-		$sql .= " FROM " . $this->db->prefix() . "projet as p";
7703
-		$sql .= ' WHERE p.entity IN (' . getEntity('project') . ')';
7702
+		$sql .= " FROM ".$this->db->prefix()."projet as p";
7703
+		$sql .= ' WHERE p.entity IN ('.getEntity('project').')';
7704 7704
 
7705 7705
 		// Add criteria on ref/label
7706 7706
 		if ($filterkey != '') {
@@ -7716,7 +7716,7 @@  discard block
 block discarded – undo
7716 7716
 				if ($i > 0) {
7717 7717
 					$sql .= " AND ";
7718 7718
 				}
7719
-				$sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7719
+				$sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'";
7720 7720
 				$sql .= "";
7721 7721
 				$i++;
7722 7722
 			}
@@ -7729,22 +7729,22 @@  discard block
 block discarded – undo
7729 7729
 		$sql .= $this->db->plimit($limit, 0);
7730 7730
 
7731 7731
 		// Build output string
7732
-		dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG);
7732
+		dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG);
7733 7733
 		$result = $this->db->query($sql);
7734 7734
 		if ($result) {
7735
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
7736
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
7735
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
7736
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
7737 7737
 
7738 7738
 			$num = $this->db->num_rows($result);
7739 7739
 
7740 7740
 			$events = array();
7741 7741
 
7742 7742
 			if (!$forcecombo) {
7743
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7743
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7744 7744
 				$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
7745 7745
 			}
7746 7746
 
7747
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7747
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7748 7748
 
7749 7749
 			$textifempty = '';
7750 7750
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7761,7 +7761,7 @@  discard block
 block discarded – undo
7761 7761
 				}
7762 7762
 			}
7763 7763
 			if ($showempty) {
7764
-				$out .= '<option value="0" selected>' . $textifempty . '</option>';
7764
+				$out .= '<option value="0" selected>'.$textifempty.'</option>';
7765 7765
 			}
7766 7766
 
7767 7767
 			$i = 0;
@@ -7819,13 +7819,13 @@  discard block
 block discarded – undo
7819 7819
 		$outlabel = $objp->label;
7820 7820
 		$outtype = $objp->fk_product_type;
7821 7821
 
7822
-		$opt = '<option value="' . $objp->rowid . '"';
7822
+		$opt = '<option value="'.$objp->rowid.'"';
7823 7823
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
7824 7824
 		$opt .= '>';
7825 7825
 		$opt .= $objp->ref;
7826 7826
 		$objRef = $objp->ref;
7827 7827
 		if (!empty($filterkey) && $filterkey != '') {
7828
-			$objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1);
7828
+			$objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
7829 7829
 		}
7830 7830
 
7831 7831
 		$opt .= "</option>\n";
@@ -7867,7 +7867,7 @@  discard block
 block discarded – undo
7867 7867
 			$placeholder = '';
7868 7868
 
7869 7869
 			if ($selected && empty($selected_input_value)) {
7870
-				require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7870
+				require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7871 7871
 				$adherenttmpselect = new Adherent($this->db);
7872 7872
 				$adherenttmpselect->fetch($selected);
7873 7873
 				$selected_input_value = $adherenttmpselect->ref;
@@ -7876,17 +7876,17 @@  discard block
 block discarded – undo
7876 7876
 
7877 7877
 			$urloption = '';
7878 7878
 
7879
-			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7879
+			$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
7880 7880
 
7881 7881
 			if (empty($hidelabel)) {
7882
-				$out .= $langs->trans("RefOrLabel") . ' : ';
7882
+				$out .= $langs->trans("RefOrLabel").' : ';
7883 7883
 			} elseif ($hidelabel > 1) {
7884
-				$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
7884
+				$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
7885 7885
 				if ($hidelabel == 2) {
7886 7886
 					$out .= img_picto($langs->trans("Search"), 'search');
7887 7887
 				}
7888 7888
 			}
7889
-			$out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
7889
+			$out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />';
7890 7890
 			if ($hidelabel == 3) {
7891 7891
 				$out .= img_picto($langs->trans("Search"), 'search');
7892 7892
 			}
@@ -7931,8 +7931,8 @@  discard block
 block discarded – undo
7931 7931
 
7932 7932
 		$sql = "SELECT ";
7933 7933
 		$sql .= $selectFields;
7934
-		$sql .= " FROM " . $this->db->prefix() . "adherent as p";
7935
-		$sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')';
7934
+		$sql .= " FROM ".$this->db->prefix()."adherent as p";
7935
+		$sql .= ' WHERE p.entity IN ('.getEntity('adherent').')';
7936 7936
 
7937 7937
 		// Add criteria on ref/label
7938 7938
 		if ($filterkey != '') {
@@ -7948,8 +7948,8 @@  discard block
 block discarded – undo
7948 7948
 				if ($i > 0) {
7949 7949
 					$sql .= " AND ";
7950 7950
 				}
7951
-				$sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'";
7952
-				$sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')";
7951
+				$sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'";
7952
+				$sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')";
7953 7953
 				$i++;
7954 7954
 			}
7955 7955
 			if (count($search_crit) > 1) {
@@ -7958,27 +7958,27 @@  discard block
 block discarded – undo
7958 7958
 			$sql .= ')';
7959 7959
 		}
7960 7960
 		if ($status != -1) {
7961
-			$sql .= ' AND statut = ' . ((int) $status);
7961
+			$sql .= ' AND statut = '.((int) $status);
7962 7962
 		}
7963 7963
 		$sql .= $this->db->plimit($limit, 0);
7964 7964
 
7965 7965
 		// Build output string
7966
-		dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG);
7966
+		dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG);
7967 7967
 		$result = $this->db->query($sql);
7968 7968
 		if ($result) {
7969
-			require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
7970
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
7969
+			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
7970
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
7971 7971
 
7972 7972
 			$num = $this->db->num_rows($result);
7973 7973
 
7974 7974
 			$events = array();
7975 7975
 
7976 7976
 			if (!$forcecombo) {
7977
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
7977
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
7978 7978
 				$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
7979 7979
 			}
7980 7980
 
7981
-			$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
7981
+			$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
7982 7982
 
7983 7983
 			$textifempty = '';
7984 7984
 			// Do not use textifempty = ' ' or '&nbsp;' here, or search on key will search on ' key'.
@@ -7995,7 +7995,7 @@  discard block
 block discarded – undo
7995 7995
 				}
7996 7996
 			}
7997 7997
 			if ($showempty) {
7998
-				$out .= '<option value="-1" selected>' . $textifempty . '</option>';
7998
+				$out .= '<option value="-1" selected>'.$textifempty.'</option>';
7999 7999
 			}
8000 8000
 
8001 8001
 			$i = 0;
@@ -8051,11 +8051,11 @@  discard block
 block discarded – undo
8051 8051
 		$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname);
8052 8052
 		$outtype = $objp->fk_adherent_type;
8053 8053
 
8054
-		$opt = '<option value="' . $objp->rowid . '"';
8054
+		$opt = '<option value="'.$objp->rowid.'"';
8055 8055
 		$opt .= ($objp->rowid == $selected) ? ' selected' : '';
8056 8056
 		$opt .= '>';
8057 8057
 		if (!empty($filterkey) && $filterkey != '') {
8058
-			$outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1);
8058
+			$outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1);
8059 8059
 		}
8060 8060
 		$opt .= $outlabel;
8061 8061
 		$opt .= "</option>\n";
@@ -8090,8 +8090,8 @@  discard block
 block discarded – undo
8090 8090
 		$objectdescorig = $objectdesc;
8091 8091
 		$objecttmp = null;
8092 8092
 		$InfoFieldList = array();
8093
-		$filter = '';  // Ensure filter has value (for static analysis)
8094
-		$sortfield = '';  // Ensure filter has value (for static analysis)
8093
+		$filter = ''; // Ensure filter has value (for static analysis)
8094
+		$sortfield = ''; // Ensure filter has value (for static analysis)
8095 8095
 
8096 8096
 		if ($objectfield) {	// We must retrieve the objectdesc from the field or extrafield
8097 8097
 			// Example: $objectfield = 'product:options_package'
@@ -8132,9 +8132,9 @@  discard block
 block discarded – undo
8132 8132
 			$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
8133 8133
 			$reg = array();
8134 8134
 			if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
8135
-				$InfoFieldList[4] = $reg[1];    // take the sort field
8135
+				$InfoFieldList[4] = $reg[1]; // take the sort field
8136 8136
 			}
8137
-			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
8137
+			$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
8138 8138
 
8139 8139
 			$classname = $InfoFieldList[0];
8140 8140
 			$classpath = $InfoFieldList[1];
@@ -8165,8 +8165,8 @@  discard block
 block discarded – undo
8165 8165
 		);
8166 8166
 
8167 8167
 		if (!is_object($objecttmp)) {
8168
-			dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield, LOG_WARNING);
8169
-			return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield;
8168
+			dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield, LOG_WARNING);
8169
+			return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield;
8170 8170
 		}
8171 8171
 		'@phan-var-force CommonObject $objecttmp';
8172 8172
 
@@ -8178,9 +8178,9 @@  discard block
 block discarded – undo
8178 8178
 		if ($prefixforautocompletemode == 'product') {
8179 8179
 			$prefixforautocompletemode = 'produit';
8180 8180
 		}
8181
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8181
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8182 8182
 
8183
-		dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG);
8183
+		dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG);
8184 8184
 
8185 8185
 		// Generate the combo HTML component
8186 8186
 		$out = '';
@@ -8209,13 +8209,13 @@  discard block
 block discarded – undo
8209 8209
 			}
8210 8210
 
8211 8211
 			// Set url and param to call to get json of the search results
8212
-			$urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php';
8213
-			$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
8212
+			$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
8213
+			$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : '');
8214 8214
 
8215 8215
 			// Activate the auto complete using ajax call.
8216 8216
 			$out .= ajax_autocompleter($preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0);
8217 8217
 			$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
8218
-			$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) . '"' : '') . ' />';
8218
+			$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).'"' : '').' />';
8219 8219
 		} else {
8220 8220
 			// Immediate load of table record.
8221 8221
 			$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
@@ -8255,16 +8255,16 @@  discard block
 block discarded – undo
8255 8255
 		if ($prefixforautocompletemode == 'societe') {
8256 8256
 			$prefixforautocompletemode = 'company';
8257 8257
 		}
8258
-		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8258
+		$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
8259 8259
 
8260 8260
 		if (!empty($objecttmp->fields)) {    // For object that declare it, it is better to use declared fields (like societe, contact, ...)
8261 8261
 			$tmpfieldstoshow = '';
8262 8262
 			foreach ($objecttmp->fields as $key => $val) {
8263
-				if (! (int) dol_eval($val['enabled'], 1, 1, '1')) {
8263
+				if (!(int) dol_eval($val['enabled'], 1, 1, '1')) {
8264 8264
 					continue;
8265 8265
 				}
8266 8266
 				if (!empty($val['showoncombobox'])) {
8267
-					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key;
8267
+					$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
8268 8268
 				}
8269 8269
 			}
8270 8270
 			if ($tmpfieldstoshow) {
@@ -8292,18 +8292,18 @@  discard block
 block discarded – undo
8292 8292
 		$num = 0;
8293 8293
 
8294 8294
 		// Search data
8295
-		$sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t";
8295
+		$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t";
8296 8296
 		if (!empty($objecttmp->isextrafieldmanaged)) {
8297
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object";
8297
+			$sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object";
8298 8298
 		}
8299 8299
 		if (isset($objecttmp->ismultientitymanaged)) {
8300 8300
 			if (!is_numeric($objecttmp->ismultientitymanaged)) {
8301 8301
 				$tmparray = explode('@', $objecttmp->ismultientitymanaged);
8302
-				$sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0];
8302
+				$sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
8303 8303
 			}
8304 8304
 			if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8305 8305
 				if (!$user->hasRight('societe', 'client', 'voir')) {
8306
-					$sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc";
8306
+					$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
8307 8307
 				}
8308 8308
 			}
8309 8309
 		}
@@ -8323,21 +8323,21 @@  discard block
 block discarded – undo
8323 8323
 			$sql .= " WHERE 1=1";
8324 8324
 			if (isset($objecttmp->ismultientitymanaged)) {
8325 8325
 				if ($objecttmp->ismultientitymanaged == 1) {
8326
-					$sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")";
8326
+					$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
8327 8327
 				}
8328 8328
 				if (!is_numeric($objecttmp->ismultientitymanaged)) {
8329
-					$sql .= " AND parenttable.entity = t." . $tmparray[0];
8329
+					$sql .= " AND parenttable.entity = t.".$tmparray[0];
8330 8330
 				}
8331 8331
 				if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
8332 8332
 					if ($objecttmp->element == 'societe') {
8333
-						$sql .= " AND t.rowid = " . ((int) $user->socid);
8333
+						$sql .= " AND t.rowid = ".((int) $user->socid);
8334 8334
 					} else {
8335
-						$sql .= " AND t.fk_soc = " . ((int) $user->socid);
8335
+						$sql .= " AND t.fk_soc = ".((int) $user->socid);
8336 8336
 					}
8337 8337
 				}
8338 8338
 				if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
8339 8339
 					if (!$user->hasRight('societe', 'client', 'voir')) {
8340
-						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
8340
+						$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
8341 8341
 					}
8342 8342
 				}
8343 8343
 			}
@@ -8349,7 +8349,7 @@  discard block
 block discarded – undo
8349 8349
 				$errormessage = '';
8350 8350
 				$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
8351 8351
 				if ($errormessage) {
8352
-					return 'Error forging a SQL request from an universal criteria: ' . $errormessage;
8352
+					return 'Error forging a SQL request from an universal criteria: '.$errormessage;
8353 8353
 				}
8354 8354
 			}
8355 8355
 		}
@@ -8361,7 +8361,7 @@  discard block
 block discarded – undo
8361 8361
 		$resql = $this->db->query($sql);
8362 8362
 		if ($resql) {
8363 8363
 			// Construct $out and $outarray
8364
-			$out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n";
8364
+			$out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
8365 8365
 
8366 8366
 			// 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
8367 8367
 			$textifempty = '&nbsp;';
@@ -8375,7 +8375,7 @@  discard block
 block discarded – undo
8375 8375
 				}
8376 8376
 			}
8377 8377
 			if ($showempty) {
8378
-				$out .= '<option value="-1">' . $textifempty . '</option>' . "\n";
8378
+				$out .= '<option value="-1">'.$textifempty.'</option>'."\n";
8379 8379
 			}
8380 8380
 
8381 8381
 			$num = $this->db->num_rows($resql);
@@ -8398,9 +8398,9 @@  discard block
 block discarded – undo
8398 8398
 					}
8399 8399
 					if (empty($outputmode)) {
8400 8400
 						if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
8401
-							$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>';
8401
+							$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>';
8402 8402
 						} else {
8403
-							$out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>';
8403
+							$out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>';
8404 8404
 						}
8405 8405
 					} else {
8406 8406
 						array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label));
@@ -8413,10 +8413,10 @@  discard block
 block discarded – undo
8413 8413
 				}
8414 8414
 			}
8415 8415
 
8416
-			$out .= '</select>' . "\n";
8416
+			$out .= '</select>'."\n";
8417 8417
 
8418 8418
 			if (!$forcecombo) {
8419
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8419
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8420 8420
 				$out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0));
8421 8421
 			}
8422 8422
 		} else {
@@ -8480,8 +8480,8 @@  discard block
 block discarded – undo
8480 8480
 			}
8481 8481
 		}
8482 8482
 		$idname = str_replace(array('[', ']'), array('', ''), $htmlname);
8483
-		$out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"';
8484
-		$out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : '');
8483
+		$out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"';
8484
+		$out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : '');
8485 8485
 		$out .= '>'."\n";
8486 8486
 
8487 8487
 		if ($show_empty) {
@@ -8492,7 +8492,7 @@  discard block
 block discarded – undo
8492 8492
 			if (!is_numeric($show_empty)) {
8493 8493
 				$textforempty = $show_empty;
8494 8494
 			}
8495
-			$out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n";
8495
+			$out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
8496 8496
 		}
8497 8497
 		if (is_array($array)) {
8498 8498
 			// Translate
@@ -8517,7 +8517,7 @@  discard block
 block discarded – undo
8517 8517
 					$value = $tmpvalue['label'];
8518 8518
 					//$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html'];
8519 8519
 					$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled';
8520
-					$style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"';
8520
+					$style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"';
8521 8521
 				} else {
8522 8522
 					$value = $tmpvalue;
8523 8523
 					//$valuehtml = $tmpvalue;
@@ -8533,9 +8533,9 @@  discard block
 block discarded – undo
8533 8533
 				}
8534 8534
 				if ($key_in_label) {
8535 8535
 					if (empty($nohtmlescape)) {
8536
-						$selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value));
8536
+						$selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value));
8537 8537
 					} else {
8538
-						$selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value);
8538
+						$selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value);
8539 8539
 					}
8540 8540
 				} else {
8541 8541
 					if (empty($nohtmlescape)) {
@@ -8547,8 +8547,8 @@  discard block
 block discarded – undo
8547 8547
 						$selectOptionValue = '&nbsp;';
8548 8548
 					}
8549 8549
 				}
8550
-				$out .= '<option value="' . $key . '"';
8551
-				$out .= $style . $disabled;
8550
+				$out .= '<option value="'.$key.'"';
8551
+				$out .= $style.$disabled;
8552 8552
 				if (is_array($id)) {
8553 8553
 					if (in_array($key, $id) && !$disabled) {
8554 8554
 						$out .= ' selected'; // To preselect a value
@@ -8560,7 +8560,7 @@  discard block
 block discarded – undo
8560 8560
 					}
8561 8561
 				}
8562 8562
 				if (!empty($nohtmlescape)) {	// deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content.
8563
-					$out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"';
8563
+					$out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
8564 8564
 				}
8565 8565
 
8566 8566
 				if (is_array($tmpvalue)) {
@@ -8579,7 +8579,7 @@  discard block
 block discarded – undo
8579 8579
 		// Add code for jquery to use multiselect
8580 8580
 		if ($addjscombo && $jsbeautify) {
8581 8581
 			// Enhance with select2
8582
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
8582
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
8583 8583
 			$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
8584 8584
 		}
8585 8585
 
@@ -8607,28 +8607,28 @@  discard block
 block discarded – undo
8607 8607
 	public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
8608 8608
 	{
8609 8609
 		global $conf, $langs;
8610
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8610
+		global $delayedhtmlcontent; // Will be used later outside of this function
8611 8611
 
8612 8612
 		// TODO Use an internal dolibarr component instead of select2
8613 8613
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8614 8614
 			return '';
8615 8615
 		}
8616 8616
 
8617
-		$out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>';
8617
+		$out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>';
8618 8618
 
8619 8619
 		$outdelayed = '';
8620 8620
 		if (!empty($conf->use_javascript_ajax)) {
8621 8621
 			$tmpplugin = 'select2';
8622
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8623
-		    	<script nonce="' . getNonce() . '">
8622
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8623
+		    	<script nonce="' . getNonce().'">
8624 8624
 		    	$(document).ready(function () {
8625 8625
 
8626
-	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . '
8626
+	    	        ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').'
8627 8627
 
8628
-	                $(".' . $htmlname . '").select2({
8628
+	                $(".' . $htmlname.'").select2({
8629 8629
 				    	ajax: {
8630 8630
 					    	dir: "ltr",
8631
-					    	url: "' . $url . '",
8631
+					    	url: "' . $url.'",
8632 8632
 					    	dataType: \'json\',
8633 8633
 					    	delay: 250,
8634 8634
 					    	data: function (params) {
@@ -8655,9 +8655,9 @@  discard block
 block discarded – undo
8655 8655
 				    	},
8656 8656
 		 				language: select2arrayoflanguage,
8657 8657
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8658
-					    placeholder: "' . dol_escape_js($placeholder) . '",
8658
+					    placeholder: "' . dol_escape_js($placeholder).'",
8659 8659
 				    	escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8660
-				    	minimumInputLength: ' . ((int) $minimumInputLength) . ',
8660
+				    	minimumInputLength: ' . ((int) $minimumInputLength).',
8661 8661
 				        formatResult: function (result, container, query, escapeMarkup) {
8662 8662
 	                        return escapeMarkup(result.text);
8663 8663
 	                    },
@@ -8665,10 +8665,10 @@  discard block
 block discarded – undo
8665 8665
 
8666 8666
 	                ' . ($callurlonselect ? '
8667 8667
 	                /* Code to execute a GET when we select a value */
8668
-	                $(".' . $htmlname . '").change(function() {
8669
-				    	var selected = $(".' . $htmlname . '").val();
8668
+	                $(".' . $htmlname.'").change(function() {
8669
+				    	var selected = $(".' . $htmlname.'").val();
8670 8670
 	                	console.log("We select in selectArrayAjax the entry "+selected)
8671
-				        $(".' . $htmlname . '").val("");  /* reset visible combo value */
8671
+				        $(".' . $htmlname.'").val("");  /* reset visible combo value */
8672 8672
 	    			    $.each( saveRemoteData, function( key, value ) {
8673 8673
 	    				        if (key == selected)
8674 8674
 	    			            {
@@ -8676,7 +8676,7 @@  discard block
 block discarded – undo
8676 8676
 	    			                 location.assign(value.url);
8677 8677
 	    			            }
8678 8678
 	                    });
8679
-	    			});' : '') . '
8679
+	    			});' : '').'
8680 8680
 
8681 8681
 	    	   });
8682 8682
 		       </script>';
@@ -8712,14 +8712,14 @@  discard block
 block discarded – undo
8712 8712
 	public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '')
8713 8713
 	{
8714 8714
 		global $conf, $langs;
8715
-		global $delayedhtmlcontent;    // Will be used later outside of this function
8715
+		global $delayedhtmlcontent; // Will be used later outside of this function
8716 8716
 
8717 8717
 		// TODO Use an internal dolibarr component instead of select2
8718 8718
 		if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
8719 8719
 			return '';
8720 8720
 		}
8721 8721
 
8722
-		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8722
+		$out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>';
8723 8723
 
8724 8724
 		$formattedarrayresult = array();
8725 8725
 
@@ -8734,20 +8734,20 @@  discard block
 block discarded – undo
8734 8734
 		$outdelayed = '';
8735 8735
 		if (!empty($conf->use_javascript_ajax)) {
8736 8736
 			$tmpplugin = 'select2';
8737
-			$outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' -->
8738
-				<script nonce="' . getNonce() . '">
8737
+			$outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
8738
+				<script nonce="' . getNonce().'">
8739 8739
 				$(document).ready(function () {
8740
-					var data = ' . json_encode($formattedarrayresult) . ';
8740
+					var data = ' . json_encode($formattedarrayresult).';
8741 8741
 
8742
-					' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . '
8742
+					' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').'
8743 8743
 
8744
-					$(".' . $htmlname . '").select2({
8744
+					$(".' . $htmlname.'").select2({
8745 8745
 						data: data,
8746 8746
 						language: select2arrayoflanguage,
8747 8747
 						containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
8748
-						placeholder: "' . dol_escape_js($placeholder) . '",
8748
+						placeholder: "' . dol_escape_js($placeholder).'",
8749 8749
 						escapeMarkup: function (markup) { return markup; }, 	// let our custom formatter work
8750
-						minimumInputLength: ' . $minimumInputLength . ',
8750
+						minimumInputLength: ' . $minimumInputLength.',
8751 8751
 						formatResult: function (result, container, query, escapeMarkup) {
8752 8752
 							return escapeMarkup(result.text);
8753 8753
 						},
@@ -8786,11 +8786,11 @@  discard block
 block discarded – undo
8786 8786
 
8787 8787
 					' . ($callurlonselect ? '
8788 8788
 					/* Code to execute a GET when we select a value */
8789
-					$(".' . $htmlname . '").change(function() {
8790
-						var selected = $(".' . $htmlname . '").val();
8789
+					$(".' . $htmlname.'").change(function() {
8790
+						var selected = $(".' . $htmlname.'").val();
8791 8791
 						console.log("We select "+selected)
8792 8792
 
8793
-						$(".' . $htmlname . '").val("");  /* reset visible combo value */
8793
+						$(".' . $htmlname.'").val("");  /* reset visible combo value */
8794 8794
 						$.each( saveRemoteData, function( key, value ) {
8795 8795
 							if (key == selected)
8796 8796
 							{
@@ -8798,7 +8798,7 @@  discard block
 block discarded – undo
8798 8798
 								location.assign(value.url);
8799 8799
 							}
8800 8800
 						});
8801
-					});' : '') . '
8801
+					});' : '').'
8802 8802
 
8803 8803
 				});
8804 8804
 				</script>';
@@ -8847,7 +8847,7 @@  discard block
 block discarded – undo
8847 8847
 		$useenhancedmultiselect = 0;
8848 8848
 		if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
8849 8849
 			if ($addjscombo) {
8850
-				$useenhancedmultiselect = 1;	// Use the js multiselect in one line. Possible only if $addjscombo not 0.
8850
+				$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
8851 8851
 			}
8852 8852
 		}
8853 8853
 
@@ -8856,7 +8856,7 @@  discard block
 block discarded – undo
8856 8856
 		// submitted to nothing.
8857 8857
 		$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
8858 8858
 		// Output select component
8859
-		$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', (string) $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
8859
+		$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', (string) $width) ? $width : $width.'px').'"' : '').'>'."\n";
8860 8860
 		if (is_array($array) && !empty($array)) {
8861 8861
 			if ($value_as_key) {
8862 8862
 				$array = array_combine($array, $array);
@@ -8877,33 +8877,33 @@  discard block
 block discarded – undo
8877 8877
 						$tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml'];
8878 8878
 					}
8879 8879
 					$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
8880
-					$newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval);
8880
+					$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
8881 8881
 
8882
-					$out .= '<option value="' . $tmpkey . '"';
8882
+					$out .= '<option value="'.$tmpkey.'"';
8883 8883
 					if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
8884 8884
 						$out .= ' selected';
8885 8885
 					}
8886 8886
 					if (!empty($tmplabelhtml)) {
8887
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8887
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8888 8888
 					} else {
8889
-						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval;
8890
-						$out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"';
8889
+						$tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval;
8890
+						$out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"';
8891 8891
 					}
8892 8892
 					$out .= '>';
8893 8893
 					$out .= dol_htmlentitiesbr($newval);
8894
-					$out .= '</option>' . "\n";
8894
+					$out .= '</option>'."\n";
8895 8895
 				}
8896 8896
 			}
8897 8897
 		}
8898
-		$out .= '</select>' . "\n";
8898
+		$out .= '</select>'."\n";
8899 8899
 
8900 8900
 		// Add code for jquery to use multiselect
8901 8901
 		if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
8902
-			$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
8903
-			$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
8902
+			$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
8903
+			$out .= "\n".'<script nonce="'.getNonce().'">'."\n";
8904 8904
 			if ($addjscombo == 1) {
8905 8905
 				$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
8906
-				$out .= 'function formatResult(record, container) {' . "\n";
8906
+				$out .= 'function formatResult(record, container) {'."\n";
8907 8907
 				// If property data-html set, we decode html entities and use this.
8908 8908
 				// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
8909 8909
 				$out .= '	if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {';
@@ -8911,26 +8911,26 @@  discard block
 block discarded – undo
8911 8911
 				$out .= '		return htmlEntityDecodeJs($(record.element).attr("data-html"));';
8912 8912
 				$out .= '	}'."\n";
8913 8913
 				$out .= '	return record.text;';
8914
-				$out .= '}' . "\n";
8915
-				$out .= 'function formatSelection(record) {' . "\n";
8914
+				$out .= '}'."\n";
8915
+				$out .= 'function formatSelection(record) {'."\n";
8916 8916
 				if ($elemtype == 'category') {
8917
-					$out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8917
+					$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
8918 8918
 				} else {
8919 8919
 					$out .= 'return record.text;';
8920 8920
 				}
8921
-				$out .= '}' . "\n";
8921
+				$out .= '}'."\n";
8922 8922
 				$out .= '$(document).ready(function () {
8923
-							$(\'#' . $htmlname . '\').' . $tmpplugin . '({';
8923
+							$(\'#' . $htmlname.'\').'.$tmpplugin.'({';
8924 8924
 				if ($placeholder) {
8925 8925
 					$out .= '
8926 8926
 								placeholder: {
8927 8927
 								    id: \'-1\',
8928
-								    text: \'' . dol_escape_js($placeholder) . '\'
8928
+								    text: \'' . dol_escape_js($placeholder).'\'
8929 8929
 								  },';
8930 8930
 				}
8931 8931
 				$out .= '		dir: \'ltr\',
8932 8932
 								containerCssClass: \':all:\',					/* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
8933
-								dropdownCssClass: \'' . $morecss . '\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
8933
+								dropdownCssClass: \'' . $morecss.'\',				/* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */
8934 8934
 								// Specify format function for dropdown item
8935 8935
 								formatResult: formatResult,
8936 8936
 							 	templateResult: formatResult,		/* For 4.0 */
@@ -8942,21 +8942,21 @@  discard block
 block discarded – undo
8942 8942
 
8943 8943
 							/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
8944 8944
 								 the size only if component is not hidden by default on load */
8945
-							$(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\');
8945
+							$(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\');
8946 8946
 						});' . "\n";
8947 8947
 			} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) {
8948 8948
 				// Add other js lib
8949 8949
 				// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
8950 8950
 				// ...
8951
-				$out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');';
8951
+				$out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');';
8952 8952
 				$out .= '$(document).ready(function () {
8953
-							$(\'#' . $htmlname . '\').multiSelect({
8953
+							$(\'#' . $htmlname.'\').multiSelect({
8954 8954
 								containerHTML: \'<div class="multi-select-container">\',
8955 8955
 								menuHTML: \'<div class="multi-select-menu">\',
8956
-								buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\',
8956
+								buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\',
8957 8957
 								menuItemHTML: \'<label class="multi-select-menuitem">\',
8958 8958
 								activeClass: \'multi-select-container--open\',
8959
-								noneText: \'' . $placeholder . '\'
8959
+								noneText: \'' . $placeholder.'\'
8960 8960
 							});
8961 8961
 						})';
8962 8962
 			}
@@ -8988,7 +8988,7 @@  discard block
 block discarded – undo
8988 8988
 			return '';
8989 8989
 		}
8990 8990
 
8991
-		$tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show
8991
+		$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
8992 8992
 
8993 8993
 		if (!empty($user->conf->$tmpvar)) {        // A list of fields was already customized for user
8994 8994
 			$tmparray = explode(',', $user->conf->$tmpvar);
@@ -9031,19 +9031,19 @@  discard block
 block discarded – undo
9031 9031
 				}
9032 9032
 
9033 9033
 				// Note: $val['checked'] <> 0 means we must show the field into the combo list  @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
9034
-				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
9035
-				$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
9034
+				$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
9035
+				$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
9036 9036
 			}
9037 9037
 		}
9038 9038
 
9039
-		$out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' -->
9039
+		$out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' -->
9040 9040
 
9041 9041
         <dl class="dropdown">
9042 9042
             <dt>
9043
-            <a href="#' . $htmlname . '">
9044
-              ' . img_picto('', 'list') . '
9043
+            <a href="#' . $htmlname.'">
9044
+              ' . img_picto('', 'list').'
9045 9045
             </a>
9046
-            <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
9046
+            <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
9047 9047
             </dt>
9048 9048
             <dd class="dropdowndd">
9049 9049
                 <div class="multiselectcheckbox'.$htmlname.'">
@@ -9055,19 +9055,19 @@  discard block
 block discarded – undo
9055 9055
             </dd>
9056 9056
         </dl>
9057 9057
 
9058
-        <script nonce="' . getNonce() . '" type="text/javascript">
9058
+        <script nonce="' . getNonce().'" type="text/javascript">
9059 9059
           jQuery(document).ready(function () {
9060
-              $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () {
9060
+              $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () {
9061 9061
                   console.log("A new field was added/removed, we edit field input[name=formfilteraction]");
9062 9062
 
9063 9063
                   $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\');	// Update field so we know we changed something on selected fields after POST
9064 9064
 
9065 9065
                   var title = $(this).val() + ",";
9066 9066
                   if ($(this).is(\':checked\')) {
9067
-                      $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val());
9067
+                      $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val());
9068 9068
                   }
9069 9069
                   else {
9070
-                      $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') )
9070
+                      $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') )
9071 9071
                   }
9072 9072
                   // Now, we submit page
9073 9073
                   //$(this).parents(\'form:first\').submit();
@@ -9098,7 +9098,7 @@  discard block
 block discarded – undo
9098 9098
 	 */
9099 9099
 	public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
9100 9100
 	{
9101
-		include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
9101
+		include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
9102 9102
 
9103 9103
 		$cat = new Categorie($this->db);
9104 9104
 		$categories = $cat->containing($id, $type);
@@ -9108,10 +9108,10 @@  discard block
 block discarded – undo
9108 9108
 			foreach ($categories as $c) {
9109 9109
 				$ways = $c->print_all_ways(' &gt;&gt; ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
9110 9110
 				foreach ($ways as $way) {
9111
-					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
9111
+					$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
9112 9112
 				}
9113 9113
 			}
9114
-			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
9114
+			return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
9115 9115
 		}
9116 9116
 
9117 9117
 		if ($rendermode == 0) {
@@ -9159,15 +9159,15 @@  discard block
 block discarded – undo
9159 9159
 
9160 9160
 
9161 9161
 			print '<div class="div-table-responsive-no-min">';
9162
-			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '"  data-elementid="' . $object->id . '"   >';
9162
+			print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'"  data-elementid="'.$object->id.'"   >';
9163 9163
 
9164 9164
 			print '<tr class="liste_titre">';
9165
-			print '<td>' . $langs->trans("Type") . '</td>';
9166
-			print '<td>' . $langs->trans("Ref") . '</td>';
9165
+			print '<td>'.$langs->trans("Type").'</td>';
9166
+			print '<td>'.$langs->trans("Ref").'</td>';
9167 9167
 			print '<td class="center"></td>';
9168
-			print '<td class="center">' . $langs->trans("Date") . '</td>';
9169
-			print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9170
-			print '<td class="right">' . $langs->trans("Status") . '</td>';
9168
+			print '<td class="center">'.$langs->trans("Date").'</td>';
9169
+			print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9170
+			print '<td class="right">'.$langs->trans("Status").'</td>';
9171 9171
 			print '<td></td>';
9172 9172
 			print '</tr>';
9173 9173
 
@@ -9186,13 +9186,13 @@  discard block
 block discarded – undo
9186 9186
 				if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
9187 9187
 					$element = $regs[1];
9188 9188
 					$subelement = $regs[2];
9189
-					$tplpath = $element . '/' . $subelement;
9189
+					$tplpath = $element.'/'.$subelement;
9190 9190
 				}
9191 9191
 				$tplname = 'linkedobjectblock';
9192 9192
 
9193 9193
 				// To work with non standard path
9194 9194
 				if ($objecttype == 'facture') {
9195
-					$tplpath = 'compta/' . $element;
9195
+					$tplpath = 'compta/'.$element;
9196 9196
 					if (!isModEnabled('invoice')) {
9197 9197
 						continue; // Do not show if module disabled
9198 9198
 					}
@@ -9203,7 +9203,7 @@  discard block
 block discarded – undo
9203 9203
 						continue; // Do not show if module disabled
9204 9204
 					}
9205 9205
 				} elseif ($objecttype == 'propal') {
9206
-					$tplpath = 'comm/' . $element;
9206
+					$tplpath = 'comm/'.$element;
9207 9207
 					if (!isModEnabled('propal')) {
9208 9208
 						continue; // Do not show if module disabled
9209 9209
 					}
@@ -9254,7 +9254,7 @@  discard block
 block discarded – undo
9254 9254
 				$linkedObjectBlock = $objects;
9255 9255
 
9256 9256
 				// Output template part (modules that overwrite templates must declare this into descriptor)
9257
-				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl'));
9257
+				$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
9258 9258
 				foreach ($dirtpls as $reldir) {
9259 9259
 					$reldir = rtrim($reldir, '/');
9260 9260
 					if ($nboftypesoutput == ($nbofdifferenttypes - 1)) {    // No more type to show after
@@ -9262,7 +9262,7 @@  discard block
 block discarded – undo
9262 9262
 						$noMoreLinkedObjectBlockAfter = 1;
9263 9263
 					}
9264 9264
 
9265
-					$res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php');
9265
+					$res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
9266 9266
 					if ($res) {
9267 9267
 						$nboftypesoutput++;
9268 9268
 						break;
@@ -9271,7 +9271,7 @@  discard block
 block discarded – undo
9271 9271
 			}
9272 9272
 
9273 9273
 			if (!$nboftypesoutput) {
9274
-				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>';
9274
+				print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
9275 9275
 			}
9276 9276
 
9277 9277
 			print '</table>';
@@ -9311,14 +9311,14 @@  discard block
 block discarded – undo
9311 9311
 		if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
9312 9312
 			$listofidcompanytoscan = $object->thirdparty->id;
9313 9313
 			if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
9314
-				$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
9314
+				$listofidcompanytoscan .= ','.$object->thirdparty->parent;
9315 9315
 			}
9316 9316
 			if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
9317
-				include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
9317
+				include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
9318 9318
 				$tmpproject = new Project($this->db);
9319 9319
 				$tmpproject->fetch($object->fk_project);
9320 9320
 				if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) {
9321
-					$listofidcompanytoscan .= ',' . $tmpproject->socid;
9321
+					$listofidcompanytoscan .= ','.$tmpproject->socid;
9322 9322
 				}
9323 9323
 				unset($tmpproject);
9324 9324
 			}
@@ -9328,63 +9328,63 @@  discard block
 block discarded – undo
9328 9328
 					'enabled' => isModEnabled('propal'),
9329 9329
 					'perms' => 1,
9330 9330
 					'label' => 'LinkToProposal',
9331
-					'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') . ')'),
9331
+					'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').')'),
9332 9332
 				'shipping' => array(
9333 9333
 					'enabled' => isModEnabled('shipping'),
9334 9334
 					'perms' => 1,
9335 9335
 					'label' => 'LinkToExpedition',
9336
-					'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') . ')'),
9336
+					'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').')'),
9337 9337
 				'order' => array(
9338 9338
 					'enabled' => isModEnabled('order'),
9339 9339
 					'perms' => 1,
9340 9340
 					'label' => 'LinkToOrder',
9341
-					'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') . ')'),
9341
+					'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').')'),
9342 9342
 				'invoice' => array(
9343 9343
 					'enabled' => isModEnabled('invoice'),
9344 9344
 					'perms' => 1,
9345 9345
 					'label' => 'LinkToInvoice',
9346
-					'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') . ')'),
9346
+					'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').')'),
9347 9347
 				'invoice_template' => array(
9348 9348
 					'enabled' => isModEnabled('invoice'),
9349 9349
 					'perms' => 1,
9350 9350
 					'label' => 'LinkToTemplateInvoice',
9351
-					'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') . ')'),
9351
+					'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').')'),
9352 9352
 				'contrat' => array(
9353 9353
 					'enabled' => isModEnabled('contract'),
9354 9354
 					'perms' => 1,
9355 9355
 					'label' => 'LinkToContract',
9356 9356
 					'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
9357
-							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'
9357
+							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'
9358 9358
 				),
9359 9359
 				'fichinter' => array(
9360 9360
 					'enabled' => isModEnabled('intervention'),
9361 9361
 					'perms' => 1,
9362 9362
 					'label' => 'LinkToIntervention',
9363
-					'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') . ')'),
9363
+					'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').')'),
9364 9364
 				'supplier_proposal' => array(
9365 9365
 					'enabled' => isModEnabled('supplier_proposal'),
9366 9366
 					'perms' => 1,
9367 9367
 					'label' => 'LinkToSupplierProposal',
9368
-					'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') . ')'),
9368
+					'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').')'),
9369 9369
 				'order_supplier' => array(
9370 9370
 					'enabled' => isModEnabled("supplier_order"),
9371 9371
 					'perms' => 1,
9372 9372
 					'label' => 'LinkToSupplierOrder',
9373
-					'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') . ')'),
9373
+					'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').')'),
9374 9374
 				'invoice_supplier' => array(
9375 9375
 					'enabled' => isModEnabled("supplier_invoice"),
9376 9376
 					'perms' => 1, 'label' => 'LinkToSupplierInvoice',
9377
-					'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') . ')'),
9377
+					'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').')'),
9378 9378
 				'ticket' => array(
9379 9379
 					'enabled' => isModEnabled('ticket'),
9380 9380
 					'perms' => 1,
9381 9381
 					'label' => 'LinkToTicket',
9382
-					'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') . ')'),
9382
+					'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').')'),
9383 9383
 				'mo' => array(
9384 9384
 					'enabled' => isModEnabled('mrp'),
9385 9385
 					'perms' => 1,
9386 9386
 					'label' => 'LinkToMo',
9387
-					'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') . ')')
9387
+					'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').')')
9388 9388
 			);
9389 9389
 		}
9390 9390
 
@@ -9420,22 +9420,22 @@  discard block
 block discarded – undo
9420 9420
 			}
9421 9421
 
9422 9422
 			if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
9423
-				print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
9423
+				print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
9424 9424
 
9425 9425
 				if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9426 9426
 					print '<br>'."\n";
9427 9427
 					print '<!-- form to add a link from anywhere -->'."\n";
9428
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
9429
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9428
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">';
9429
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9430 9430
 					print '<input type="hidden" name="action" value="addlinkbyref">';
9431
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9432
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9431
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9432
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9433 9433
 					print '<table class="noborder">';
9434 9434
 					print '<tr>';
9435 9435
 					//print '<td>' . $langs->trans("Ref") . '</td>';
9436
-					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;';
9437
-					print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;';
9438
-					print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
9436
+					print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'">&nbsp;';
9437
+					print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'">&nbsp;';
9438
+					print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
9439 9439
 					print '</tr>';
9440 9440
 					print '</table>';
9441 9441
 					print '</form>';
@@ -9450,48 +9450,48 @@  discard block
 block discarded – undo
9450 9450
 
9451 9451
 					print '<br>';
9452 9452
 					print '<!-- form to add a link from object to same thirdparty -->'."\n";
9453
-					print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">';
9453
+					print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">';
9454 9454
 					print '<input type="hidden" name="action" value="addlink">';
9455
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
9456
-					print '<input type="hidden" name="id" value="' . $object->id . '">';
9457
-					print '<input type="hidden" name="addlink" value="' . $key . '">';
9455
+					print '<input type="hidden" name="token" value="'.newToken().'">';
9456
+					print '<input type="hidden" name="id" value="'.$object->id.'">';
9457
+					print '<input type="hidden" name="addlink" value="'.$key.'">';
9458 9458
 					print '<table class="noborder">';
9459 9459
 					print '<tr class="liste_titre">';
9460 9460
 					print '<td class="nowrap"></td>';
9461
-					print '<td class="center">' . $langs->trans("Ref") . '</td>';
9462
-					print '<td class="left">' . $langs->trans("RefCustomer") . '</td>';
9463
-					print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>';
9464
-					print '<td class="left">' . $langs->trans("Company") . '</td>';
9461
+					print '<td class="center">'.$langs->trans("Ref").'</td>';
9462
+					print '<td class="left">'.$langs->trans("RefCustomer").'</td>';
9463
+					print '<td class="right">'.$langs->trans("AmountHTShort").'</td>';
9464
+					print '<td class="left">'.$langs->trans("Company").'</td>';
9465 9465
 					print '</tr>';
9466 9466
 					while ($i < $num) {
9467 9467
 						$objp = $this->db->fetch_object($resqllist);
9468 9468
 
9469 9469
 						print '<tr class="oddeven">';
9470 9470
 						print '<td class="left">';
9471
-						print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">';
9471
+						print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">';
9472 9472
 						print '</td>';
9473
-						print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>';
9474
-						print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>';
9473
+						print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>';
9474
+						print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>';
9475 9475
 						print '<td class="right">';
9476 9476
 						if ($possiblelink['label'] == 'LinkToContract') {
9477 9477
 							$form = new Form($this->db);
9478
-							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' ';
9478
+							print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
9479 9479
 						}
9480
-						print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>';
9480
+						print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>';
9481 9481
 						print '</td>';
9482
-						print '<td>' . $objp->name . '</td>';
9482
+						print '<td>'.$objp->name.'</td>';
9483 9483
 						print '</tr>';
9484 9484
 						$i++;
9485 9485
 					}
9486 9486
 					print '</table>';
9487 9487
 					print '<div class="center">';
9488 9488
 					if ($num) {
9489
-						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">';
9489
+						print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">';
9490 9490
 					}
9491 9491
 					if (empty($conf->use_javascript_ajax)) {
9492
-						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
9492
+						print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
9493 9493
 					} else {
9494
-						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>';
9494
+						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>';
9495 9495
 					}
9496 9496
 					print '</form>';
9497 9497
 					$this->db->free($resqllist);
@@ -9502,10 +9502,10 @@  discard block
 block discarded – undo
9502 9502
 
9503 9503
 				//$linktoelem.=($linktoelem?' &nbsp; ':'');
9504 9504
 				if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
9505
-					$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
9505
+					$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
9506 9506
 					// } else $linktoelem.=$langs->trans($possiblelink['label']);
9507 9507
 				} else {
9508
-					$linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>';
9508
+					$linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>';
9509 9509
 				}
9510 9510
 			}
9511 9511
 		}
@@ -9515,22 +9515,22 @@  discard block
 block discarded – undo
9515 9515
     		<dl class="dropdown" id="linktoobjectname">
9516 9516
     		';
9517 9517
 			if (!empty($conf->use_javascript_ajax)) {
9518
-				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
9518
+				$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>';
9519 9519
 			}
9520 9520
 			$linktoelem .= '<dd>
9521 9521
     		<div class="multiselectlinkto">
9522
-    		<ul class="ulselectedfields">' . $linktoelemlist . '
9522
+    		<ul class="ulselectedfields">' . $linktoelemlist.'
9523 9523
     		</ul>
9524 9524
     		</div>
9525 9525
     		</dd>
9526 9526
     		</dl>';
9527 9527
 		} else {
9528
-			$linktoelem = '';  // @phan-suppress-current-line PhanPluginRedundantAssignment
9528
+			$linktoelem = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment
9529 9529
 		}
9530 9530
 
9531 9531
 		if (!empty($conf->use_javascript_ajax)) {
9532 9532
 			print '<!-- Add js to show linkto box -->
9533
-				<script nonce="' . getNonce() . '">
9533
+				<script nonce="' . getNonce().'">
9534 9534
 				jQuery(document).ready(function() {
9535 9535
 					jQuery(".linkto").click(function() {
9536 9536
 						console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list");
@@ -9571,19 +9571,19 @@  discard block
 block discarded – undo
9571 9571
 
9572 9572
 		$disabled = ($disabled ? ' disabled' : '');
9573 9573
 
9574
-		$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
9574
+		$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
9575 9575
 		if ($useempty) {
9576
-			$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
9576
+			$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
9577 9577
 		}
9578 9578
 		if (("$value" == 'yes') || ($value == 1)) {
9579
-			$resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n";
9580
-			$resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n";
9579
+			$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
9580
+			$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
9581 9581
 		} else {
9582 9582
 			$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
9583
-			$resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n";
9584
-			$resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n";
9583
+			$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
9584
+			$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
9585 9585
 		}
9586
-		$resultyesno .= '</select>' . "\n";
9586
+		$resultyesno .= '</select>'."\n";
9587 9587
 
9588 9588
 		if ($addjscombo) {
9589 9589
 			$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss);
@@ -9607,12 +9607,12 @@  discard block
 block discarded – undo
9607 9607
 	{
9608 9608
 		// phpcs:enable
9609 9609
 		$sql = "SELECT rowid, label";
9610
-		$sql .= " FROM " . $this->db->prefix() . "export_model";
9611
-		$sql .= " WHERE type = '" . $this->db->escape($type) . "'";
9610
+		$sql .= " FROM ".$this->db->prefix()."export_model";
9611
+		$sql .= " WHERE type = '".$this->db->escape($type)."'";
9612 9612
 		$sql .= " ORDER BY rowid";
9613 9613
 		$result = $this->db->query($sql);
9614 9614
 		if ($result) {
9615
-			print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
9615
+			print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
9616 9616
 			if ($useempty) {
9617 9617
 				print '<option value="-1">&nbsp;</option>';
9618 9618
 			}
@@ -9622,9 +9622,9 @@  discard block
 block discarded – undo
9622 9622
 			while ($i < $num) {
9623 9623
 				$obj = $this->db->fetch_object($result);
9624 9624
 				if ($selected == $obj->rowid) {
9625
-					print '<option value="' . $obj->rowid . '" selected>';
9625
+					print '<option value="'.$obj->rowid.'" selected>';
9626 9626
 				} else {
9627
-					print '<option value="' . $obj->rowid . '">';
9627
+					print '<option value="'.$obj->rowid.'">';
9628 9628
 				}
9629 9629
 				print $obj->label;
9630 9630
 				print '</option>';
@@ -9715,8 +9715,8 @@  discard block
 block discarded – undo
9715 9715
 				$stringforfirstkey .= ' CTL +';
9716 9716
 			}
9717 9717
 
9718
-			$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>';
9719
-			$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>';
9718
+			$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>';
9719
+			$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>';
9720 9720
 		}
9721 9721
 
9722 9722
 		//print "xx".$previous_ref."x".$next_ref;
@@ -9724,18 +9724,18 @@  discard block
 block discarded – undo
9724 9724
 
9725 9725
 		// Right part of banner
9726 9726
 		if ($morehtmlright) {
9727
-			$ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>';
9727
+			$ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>';
9728 9728
 		}
9729 9729
 
9730 9730
 		if ($previous_ref || $next_ref || $morehtml) {
9731 9731
 			$ret .= '<div class="pagination paginationref"><ul class="right">';
9732 9732
 		}
9733 9733
 		if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) {
9734
-			$ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>';
9734
+			$ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>';
9735 9735
 		}
9736 9736
 		if ($shownav && ($previous_ref || $next_ref)) {
9737
-			$ret .= '<li class="pagination">' . $previous_ref . '</li>';
9738
-			$ret .= '<li class="pagination">' . $next_ref . '</li>';
9737
+			$ret .= '<li class="pagination">'.$previous_ref.'</li>';
9738
+			$ret .= '<li class="pagination">'.$next_ref.'</li>';
9739 9739
 		}
9740 9740
 		if ($previous_ref || $next_ref || $morehtml) {
9741 9741
 			$ret .= '</ul></div>';
@@ -9750,7 +9750,7 @@  discard block
 block discarded – undo
9750 9750
 			$morehtmlstatus = $hookmanager->resPrint;
9751 9751
 		}
9752 9752
 		if ($morehtmlstatus) {
9753
-			$ret .= '<div class="statusref">' . $morehtmlstatus . '</div>';
9753
+			$ret .= '<div class="statusref">'.$morehtmlstatus.'</div>';
9754 9754
 		}
9755 9755
 
9756 9756
 		$parameters = array();
@@ -9764,14 +9764,14 @@  discard block
 block discarded – undo
9764 9764
 		// Left part of banner
9765 9765
 		if ($morehtmlleft) {
9766 9766
 			if ($conf->browser->layout == 'phone') {
9767
-				$ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>';
9767
+				$ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>';
9768 9768
 			} else {
9769
-				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>';
9769
+				$ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>';
9770 9770
 			}
9771 9771
 		}
9772 9772
 
9773 9773
 		//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>';
9774
-		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">';
9774
+		$ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">';
9775 9775
 
9776 9776
 		// For thirdparty, contact, user, member, the ref is the id, so we show something else
9777 9777
 		if ($object->element == 'societe') {
@@ -9785,7 +9785,7 @@  discard block
 block discarded – undo
9785 9785
 
9786 9786
 			if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
9787 9787
 				if (!is_object($extralanguages)) {
9788
-					include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php';
9788
+					include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
9789 9789
 					$extralanguages = new ExtraLanguages($this->db);
9790 9790
 				}
9791 9791
 				$extralanguages->fetch_name_extralanguages('societe');
@@ -9800,29 +9800,29 @@  discard block
 block discarded – undo
9800 9800
 						if ($object->array_languages['name'][$extralangcode]) {
9801 9801
 							$htmltext .= $object->array_languages['name'][$extralangcode];
9802 9802
 						} else {
9803
-							$htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>';
9803
+							$htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>';
9804 9804
 						}
9805 9805
 					}
9806
-					$ret .= '<!-- Show translations of name -->' . "\n";
9806
+					$ret .= '<!-- Show translations of name -->'."\n";
9807 9807
 					$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
9808 9808
 				}
9809 9809
 			}
9810 9810
 		} elseif ($object->element == 'member') {
9811 9811
 			'@phan-var-force Adherent $object';
9812
-			$ret .= $object->ref . '<br>';
9812
+			$ret .= $object->ref.'<br>';
9813 9813
 			$fullname = $object->getFullName($langs);
9814 9814
 			if ($object->morphy == 'mor' && $object->societe) {
9815
-				$ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : '');
9815
+				$ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : '');
9816 9816
 			} else {
9817
-				$ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : '');
9817
+				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
9818 9818
 			}
9819 9819
 		} elseif (in_array($object->element, array('contact', 'user'))) {
9820
-			$ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt;
9820
+			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
9821 9821
 		} elseif ($object->element == 'usergroup') {
9822 9822
 			$ret .= dol_htmlentities($object->name);
9823 9823
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
9824 9824
 			'@phan-var-force ActionComm $object';
9825
-			$ret .= $object->ref . '<br>' . $object->label;
9825
+			$ret .= $object->ref.'<br>'.$object->label;
9826 9826
 		} elseif (in_array($object->element, array('adherent_type'))) {
9827 9827
 			$ret .= $object->label;
9828 9828
 		} elseif ($object->element == 'ecm_directories') {
@@ -9875,9 +9875,9 @@  discard block
 block discarded – undo
9875 9875
 		}
9876 9876
 
9877 9877
 		// Barcode image  @phan-suppress-next-line PhanUndeclaredProperty
9878
-		$url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code);
9879
-		$out = '<!-- url barcode = ' . $url . ' -->';
9880
-		$out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>';
9878
+		$url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
9879
+		$out = '<!-- url barcode = '.$url.' -->';
9880
+		$out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>';
9881 9881
 
9882 9882
 		return $out;
9883 9883
 	}
@@ -9904,7 +9904,7 @@  discard block
 block discarded – undo
9904 9904
 		global $conf, $langs;
9905 9905
 
9906 9906
 		$entity = (empty($object->entity) ? $conf->entity : $object->entity);
9907
-		$id = (empty($object->id) ? $object->rowid : $object->id);  // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
9907
+		$id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid)
9908 9908
 
9909 9909
 		$dir = '';
9910 9910
 		$file = '';
@@ -9917,28 +9917,28 @@  discard block
 block discarded – undo
9917 9917
 			if (!empty($object->logo)) {
9918 9918
 				if (dolIsAllowedForPreview($object->logo)) {
9919 9919
 					if ((string) $imagesize == 'mini') {
9920
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9920
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
9921 9921
 					} elseif ((string) $imagesize == 'small') {
9922
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small');
9922
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
9923 9923
 					} else {
9924
-						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9924
+						$file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9925 9925
 					}
9926
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo;
9926
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
9927 9927
 				}
9928 9928
 			}
9929 9929
 			$email = $object->email;
9930 9930
 		} elseif ($modulepart == 'contact') {
9931
-			$dir = $conf->societe->multidir_output[$entity] . '/contact';
9931
+			$dir = $conf->societe->multidir_output[$entity].'/contact';
9932 9932
 			if (!empty($object->photo)) {
9933 9933
 				if (dolIsAllowedForPreview($object->photo)) {
9934 9934
 					if ((string) $imagesize == 'mini') {
9935
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9935
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9936 9936
 					} elseif ((string) $imagesize == 'small') {
9937
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9937
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
9938 9938
 					} else {
9939
-						$file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9939
+						$file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9940 9940
 					}
9941
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo;
9941
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
9942 9942
 				}
9943 9943
 			}
9944 9944
 			$email = $object->email;
@@ -9948,17 +9948,17 @@  discard block
 block discarded – undo
9948 9948
 			if (!empty($object->photo)) {
9949 9949
 				if (dolIsAllowedForPreview($object->photo)) {
9950 9950
 					if ((string) $imagesize == 'mini') {
9951
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9951
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9952 9952
 					} elseif ((string) $imagesize == 'small') {
9953
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9953
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
9954 9954
 					} else {
9955
-						$file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9955
+						$file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9956 9956
 					}
9957
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
9957
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
9958 9958
 				}
9959 9959
 			}
9960 9960
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9961
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9961
+				$altfile = $object->id.".jpg"; // For backward compatibility
9962 9962
 			}
9963 9963
 			$email = $object->email;
9964 9964
 			$capture = 'user';
@@ -9967,17 +9967,17 @@  discard block
 block discarded – undo
9967 9967
 			if (!empty($object->photo)) {
9968 9968
 				if (dolIsAllowedForPreview($object->photo)) {
9969 9969
 					if ((string) $imagesize == 'mini') {
9970
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini');
9970
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
9971 9971
 					} elseif ((string) $imagesize == 'small') {
9972
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small');
9972
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
9973 9973
 					} else {
9974
-						$file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9974
+						$file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9975 9975
 					}
9976
-					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
9976
+					$originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
9977 9977
 				}
9978 9978
 			}
9979 9979
 			if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
9980
-				$altfile = $object->id . ".jpg"; // For backward compatibility
9980
+				$altfile = $object->id.".jpg"; // For backward compatibility
9981 9981
 			}
9982 9982
 			$email = $object->email;
9983 9983
 			$capture = 'user';
@@ -10003,35 +10003,35 @@  discard block
 block discarded – undo
10003 10003
 		$ret = '';
10004 10004
 
10005 10005
 		if ($dir) {
10006
-			if ($file && file_exists($dir . "/" . $file)) {
10006
+			if ($file && file_exists($dir."/".$file)) {
10007 10007
 				if ($addlinktofullsize) {
10008
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10008
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10009 10009
 					if ($urladvanced) {
10010
-						$ret .= '<a href="' . $urladvanced . '">';
10010
+						$ret .= '<a href="'.$urladvanced.'">';
10011 10011
 					} else {
10012
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10012
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10013 10013
 					}
10014 10014
 				}
10015
-				$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 . '">';
10015
+				$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.'">';
10016 10016
 				if ($addlinktofullsize) {
10017 10017
 					$ret .= '</a>';
10018 10018
 				}
10019
-			} elseif ($altfile && file_exists($dir . "/" . $altfile)) {
10019
+			} elseif ($altfile && file_exists($dir."/".$altfile)) {
10020 10020
 				if ($addlinktofullsize) {
10021
-					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity);
10021
+					$urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity);
10022 10022
 					if ($urladvanced) {
10023
-						$ret .= '<a href="' . $urladvanced . '">';
10023
+						$ret .= '<a href="'.$urladvanced.'">';
10024 10024
 					} else {
10025
-						$ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">';
10025
+						$ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
10026 10026
 					}
10027 10027
 				}
10028
-				$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 . '">';
10028
+				$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.'">';
10029 10029
 				if ($addlinktofullsize) {
10030 10030
 					$ret .= '</a>';
10031 10031
 				}
10032 10032
 			} else {
10033 10033
 				$nophoto = '/public/theme/common/nophoto.png';
10034
-				$defaultimg = 'identicon';        // For gravatar
10034
+				$defaultimg = 'identicon'; // For gravatar
10035 10035
 				if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) {    // For modules that need a special image when photo not found
10036 10036
 					if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) {
10037 10037
 						$nophoto = 'company';
@@ -10049,13 +10049,13 @@  discard block
 block discarded – undo
10049 10049
 				if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) {
10050 10050
 					// see https://gravatar.com/site/implement/images/php/
10051 10051
 					$ret .= '<!-- Put link to gravatar -->';
10052
-					$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
10052
+					$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
10053 10053
 				} else {
10054 10054
 					if ($nophoto == 'company') {
10055
-						$ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>';
10055
+						$ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
10056 10056
 						//$ret .= '<div class="difforspanimgright"></div>';
10057 10057
 					} else {
10058
-						$ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">';
10058
+						$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
10059 10059
 					}
10060 10060
 				}
10061 10061
 			}
@@ -10066,15 +10066,15 @@  discard block
 block discarded – undo
10066 10066
 				}
10067 10067
 				$ret .= '<table class="nobordernopadding centpercent">';
10068 10068
 				if ($object->photo) {
10069
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>';
10069
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
10070 10070
 				}
10071 10071
 				$ret .= '<tr><td class="tdoverflow">';
10072 10072
 				$maxfilesizearray = getMaxFileSizeArray();
10073 10073
 				$maxmin = $maxfilesizearray['maxmin'];
10074 10074
 				if ($maxmin > 0) {
10075
-					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
10075
+					$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
10076 10076
 				}
10077
-				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>';
10077
+				$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
10078 10078
 				$ret .= '</td></tr>';
10079 10079
 				$ret .= '</table>';
10080 10080
 			}
@@ -10128,38 +10128,38 @@  discard block
 block discarded – undo
10128 10128
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10129 10129
 			$sql .= ", e.label";
10130 10130
 		}
10131
-		$sql .= " FROM " . $this->db->prefix() . "usergroup as ug ";
10131
+		$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
10132 10132
 		if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
10133
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity";
10133
+			$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
10134 10134
 			if ($force_entity) {
10135
-				$sql .= " WHERE ug.entity IN (0, " . $force_entity . ")";
10135
+				$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
10136 10136
 			} else {
10137 10137
 				$sql .= " WHERE ug.entity IS NOT NULL";
10138 10138
 			}
10139 10139
 		} else {
10140
-			$sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")";
10140
+			$sql .= " WHERE ug.entity IN (0, ".$conf->entity.")";
10141 10141
 		}
10142 10142
 		if (is_array($exclude) && $excludeGroups) {
10143
-			$sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")";
10143
+			$sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")";
10144 10144
 		}
10145 10145
 		if (is_array($include) && $includeGroups) {
10146
-			$sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")";
10146
+			$sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")";
10147 10147
 		}
10148 10148
 		$sql .= " ORDER BY ug.nom ASC";
10149 10149
 
10150
-		dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG);
10150
+		dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG);
10151 10151
 		$resql = $this->db->query($sql);
10152 10152
 		if ($resql) {
10153 10153
 			// Enhance with select2
10154
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10154
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10155 10155
 
10156
-			$out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>';
10156
+			$out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
10157 10157
 
10158 10158
 			$num = $this->db->num_rows($resql);
10159 10159
 			$i = 0;
10160 10160
 			if ($num) {
10161 10161
 				if ($show_empty && !$multiple) {
10162
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
10162
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>&nbsp;</option>'."\n";
10163 10163
 				}
10164 10164
 
10165 10165
 				while ($i < $num) {
@@ -10172,11 +10172,11 @@  discard block
 block discarded – undo
10172 10172
 					$label = $obj->name;
10173 10173
 					$labelhtml = $obj->name;
10174 10174
 					if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
10175
-						$label .= " (" . $obj->label . ")";
10176
-						$labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>';
10175
+						$label .= " (".$obj->label.")";
10176
+						$labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>';
10177 10177
 					}
10178 10178
 
10179
-					$out .= '<option value="' . $obj->rowid . '"';
10179
+					$out .= '<option value="'.$obj->rowid.'"';
10180 10180
 					if ($disableline) {
10181 10181
 						$out .= ' disabled';
10182 10182
 					}
@@ -10192,9 +10192,9 @@  discard block
 block discarded – undo
10192 10192
 				}
10193 10193
 			} else {
10194 10194
 				if ($show_empty) {
10195
-					$out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n";
10195
+					$out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n";
10196 10196
 				}
10197
-				$out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>';
10197
+				$out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>';
10198 10198
 			}
10199 10199
 			$out .= '</select>';
10200 10200
 
@@ -10238,25 +10238,25 @@  discard block
 block discarded – undo
10238 10238
 		$out = '';
10239 10239
 
10240 10240
 		if (!empty($conf->use_javascript_ajax)) {
10241
-			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
10241
+			$out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>';
10242 10242
 		}
10243
-		$out .= '<script nonce="' . getNonce() . '">
10243
+		$out .= '<script nonce="'.getNonce().'">
10244 10244
             $(document).ready(function() {
10245
-                $("#' . $cssclass . 's").click(function() {
10245
+                $("#' . $cssclass.'s").click(function() {
10246 10246
                     if($(this).is(\':checked\')){
10247
-                        console.log("We check all ' . $cssclass . ' and trigger the change method");
10248
-                		$(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\');
10247
+                        console.log("We check all ' . $cssclass.' and trigger the change method");
10248
+                		$(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\');
10249 10249
                     }
10250 10250
                     else
10251 10251
                     {
10252 10252
                         console.log("We uncheck all");
10253
-                		$(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\');
10253
+                		$(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\');
10254 10254
                     }' . "\n";
10255 10255
 		if ($calljsfunction) {
10256
-			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10256
+			$out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
10257 10257
 		}
10258 10258
 		$out .= '         });
10259
-        	        $(".' . $cssclass . '").change(function() {
10259
+        	        $(".' . $cssclass.'").change(function() {
10260 10260
 					$(this).closest("tr").toggleClass("highlight", this.checked);
10261 10261
 				});
10262 10262
 		 	});
@@ -10301,67 +10301,67 @@  discard block
 block discarded – undo
10301 10301
 		global $langs, $user;
10302 10302
 
10303 10303
 		$out = '';
10304
-		$sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1";
10305
-		$sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")";
10304
+		$sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1";
10305
+		$sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")";
10306 10306
 		if (!empty($excludeid)) {
10307
-			$sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")";
10307
+			$sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")";
10308 10308
 		}
10309 10309
 		$sql .= " ORDER BY label";
10310 10310
 
10311 10311
 		$resql = $this->db->query($sql);
10312 10312
 		if ($resql) {
10313
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">';
10313
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">';
10314 10314
 			if ($useempty) {
10315 10315
 				$out .= '<option value="0">&nbsp;</option>';
10316 10316
 			}
10317 10317
 
10318 10318
 			while ($obj = $this->db->fetch_object($resql)) {
10319
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>';
10319
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
10320 10320
 			}
10321 10321
 			$out .= '</select>';
10322
-			$out .= ajax_combobox('select_' . $htmlname);
10322
+			$out .= ajax_combobox('select_'.$htmlname);
10323 10323
 
10324 10324
 			if (!empty($htmlname) && $user->admin && $info_admin) {
10325
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10325
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
10326 10326
 			}
10327 10327
 
10328 10328
 			if (!empty($target)) {
10329
-				$sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10329
+				$sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1";
10330 10330
 				$resql = $this->db->query($sql);
10331 10331
 				if ($resql) {
10332 10332
 					if ($this->db->num_rows($resql) > 0) {
10333 10333
 						$obj = $this->db->fetch_object($resql);
10334
-						$out .= '<script nonce="' . getNonce() . '">
10334
+						$out .= '<script nonce="'.getNonce().'">
10335 10335
 							$(function() {
10336
-								$("select[name=' . $target . ']").on("change", function() {
10336
+								$("select[name=' . $target.']").on("change", function() {
10337 10337
 									var current_val = $(this).val();
10338
-									if (current_val == ' . $obj->id . ') {';
10338
+									if (current_val == ' . $obj->id.') {';
10339 10339
 						if (!empty($default_selected) || !empty($selected)) {
10340
-							$out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");';
10340
+							$out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");';
10341 10341
 						}
10342 10342
 
10343 10343
 						$out .= '
10344
-										$("select[name=' . $htmlname . ']").change();
10344
+										$("select[name=' . $htmlname.']").change();
10345 10345
 									}
10346 10346
 								});
10347 10347
 
10348
-								$("select[name=' . $htmlname . ']").change(function() {
10348
+								$("select[name=' . $htmlname.']").change(function() {
10349 10349
 
10350
-									if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') {
10350
+									if ($("select[name=' . $target.']").val() == '.$obj->id.') {
10351 10351
 										// get price of kilometer to fill the unit price
10352 10352
 										$.ajax({
10353 10353
 											method: "POST",
10354 10354
 											dataType: "json",
10355
-											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' },
10356
-											url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '",
10355
+											data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' },
10356
+											url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'",
10357 10357
 										}).done(function( data, textStatus, jqXHR ) {
10358 10358
 											console.log(data);
10359 10359
 											if (typeof data.up != "undefined") {
10360 10360
 												$("input[name=value_unit]").val(data.up);
10361
-												$("select[name=' . $htmlname . ']").attr("title", data.title);
10361
+												$("select[name=' . $htmlname.']").attr("title", data.title);
10362 10362
 											} else {
10363 10363
 												$("input[name=value_unit]").val("");
10364
-												$("select[name=' . $htmlname . ']").attr("title", "");
10364
+												$("select[name=' . $htmlname.']").attr("title", "");
10365 10365
 											}
10366 10366
 										});
10367 10367
 									}
@@ -10391,18 +10391,18 @@  discard block
 block discarded – undo
10391 10391
 		global $conf, $langs;
10392 10392
 
10393 10393
 		$out = '';
10394
-		$sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range";
10395
-		$sql .= " WHERE entity = " . $conf->entity . " AND active = 1";
10394
+		$sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range";
10395
+		$sql .= " WHERE entity = ".$conf->entity." AND active = 1";
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
 
10404 10404
 			while ($obj = $this->db->fetch_object($resql)) {
10405
-				$out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>';
10405
+				$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>';
10406 10406
 			}
10407 10407
 			$out .= '</select>';
10408 10408
 		} else {
@@ -10433,12 +10433,12 @@  discard block
 block discarded – undo
10433 10433
 
10434 10434
 		$resql = $this->db->query($sql);
10435 10435
 		if ($resql) {
10436
-			$out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">';
10436
+			$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
10437 10437
 			if ($useempty) {
10438 10438
 				$out .= '<option value="0"></option>';
10439 10439
 			}
10440 10440
 			if ($allchoice) {
10441
-				$out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>';
10441
+				$out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
10442 10442
 			}
10443 10443
 
10444 10444
 			$field = 'code';
@@ -10448,7 +10448,7 @@  discard block
 block discarded – undo
10448 10448
 
10449 10449
 			while ($obj = $this->db->fetch_object($resql)) {
10450 10450
 				$key = $langs->trans($obj->code);
10451
-				$out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>';
10451
+				$out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>';
10452 10452
 			}
10453 10453
 			$out .= '</select>';
10454 10454
 
@@ -10482,7 +10482,7 @@  discard block
 block discarded – undo
10482 10482
 	{
10483 10483
 		global $user, $conf, $langs;
10484 10484
 
10485
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
10485
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
10486 10486
 
10487 10487
 		if (is_null($usertofilter)) {
10488 10488
 			$usertofilter = $user;
@@ -10506,10 +10506,10 @@  discard block
 block discarded – undo
10506 10506
 		$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
10507 10507
             p.title, p.fk_soc, p.fk_statut, p.public,";
10508 10508
 		$sql .= ' s.nom as name';
10509
-		$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
10510
-		$sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,';
10511
-		$sql .= ' ' . $this->db->prefix() . 'facture as f';
10512
-		$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
10509
+		$sql .= ' FROM '.$this->db->prefix().'projet as p';
10510
+		$sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,';
10511
+		$sql .= ' '.$this->db->prefix().'facture as f';
10512
+		$sql .= " WHERE p.entity IN (".getEntity('project').")";
10513 10513
 		$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
10514 10514
 		//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")";
10515 10515
 		//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
@@ -10520,14 +10520,14 @@  discard block
 block discarded – undo
10520 10520
 		if ($resql) {
10521 10521
 			// Use select2 selector
10522 10522
 			if (!empty($conf->use_javascript_ajax)) {
10523
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10523
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10524 10524
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10525 10525
 				$out .= $comboenhancement;
10526 10526
 				$morecss = 'minwidth200imp maxwidth500';
10527 10527
 			}
10528 10528
 
10529 10529
 			if (empty($option_only)) {
10530
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10530
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10531 10531
 			}
10532 10532
 			if (!empty($show_empty)) {
10533 10533
 				$out .= '<option value="0" class="optiongrey">';
@@ -10557,33 +10557,33 @@  discard block
 block discarded – undo
10557 10557
 						if ($showproject == 'all') {
10558 10558
 							$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref
10559 10559
 							if ($obj->name) {
10560
-								$labeltoshow .= ' - ' . $obj->name; // Soc name
10560
+								$labeltoshow .= ' - '.$obj->name; // Soc name
10561 10561
 							}
10562 10562
 
10563 10563
 							$disabled = 0;
10564 10564
 							if ($obj->fk_statut == Project::STATUS_DRAFT) {
10565 10565
 								$disabled = 1;
10566
-								$labeltoshow .= ' - ' . $langs->trans("Draft");
10566
+								$labeltoshow .= ' - '.$langs->trans("Draft");
10567 10567
 							} elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
10568 10568
 								if ($discard_closed == 2) {
10569 10569
 									$disabled = 1;
10570 10570
 								}
10571
-								$labeltoshow .= ' - ' . $langs->trans("Closed");
10571
+								$labeltoshow .= ' - '.$langs->trans("Closed");
10572 10572
 							} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
10573 10573
 								$disabled = 1;
10574
-								$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
10574
+								$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
10575 10575
 							}
10576 10576
 						}
10577 10577
 
10578 10578
 						if (!empty($selected) && $selected == $obj->rowid) {
10579
-							$out .= '<option value="' . $obj->rowid . '" selected';
10579
+							$out .= '<option value="'.$obj->rowid.'" selected';
10580 10580
 							//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10581
-							$out .= '>' . $labeltoshow . '</option>';
10581
+							$out .= '>'.$labeltoshow.'</option>';
10582 10582
 						} else {
10583 10583
 							if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
10584 10584
 								$resultat = '';
10585 10585
 							} else {
10586
-								$resultat = '<option value="' . $obj->rowid . '"';
10586
+								$resultat = '<option value="'.$obj->rowid.'"';
10587 10587
 								if ($disabled) {
10588 10588
 									$resultat .= ' disabled';
10589 10589
 								}
@@ -10635,22 +10635,22 @@  discard block
 block discarded – undo
10635 10635
 
10636 10636
 		$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc';
10637 10637
 		//$sql.= ', el.fk_source';
10638
-		$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f';
10639
-		$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
10638
+		$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f';
10639
+		$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
10640 10640
 		$sql .= " ORDER BY f.titre ASC";
10641 10641
 
10642 10642
 		$resql = $this->db->query($sql);
10643 10643
 		if ($resql) {
10644 10644
 			// Use select2 selector
10645 10645
 			if (!empty($conf->use_javascript_ajax)) {
10646
-				include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
10646
+				include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
10647 10647
 				$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
10648 10648
 				$out .= $comboenhancement;
10649 10649
 				$morecss = 'minwidth200imp maxwidth500';
10650 10650
 			}
10651 10651
 
10652 10652
 			if (empty($option_only)) {
10653
-				$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">';
10653
+				$out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">';
10654 10654
 			}
10655 10655
 			if (!empty($show_empty)) {
10656 10656
 				$out .= '<option value="0" class="optiongrey">';
@@ -10669,19 +10669,19 @@  discard block
 block discarded – undo
10669 10669
 					$disabled = 0;
10670 10670
 					if (!empty($obj->suspended)) {
10671 10671
 						$disabled = 1;
10672
-						$labeltoshow .= ' - ' . $langs->trans("Closed");
10672
+						$labeltoshow .= ' - '.$langs->trans("Closed");
10673 10673
 					}
10674 10674
 
10675 10675
 
10676 10676
 					if (!empty($selected) && $selected == $obj->rowid) {
10677
-						$out .= '<option value="' . $obj->rowid . '" selected';
10677
+						$out .= '<option value="'.$obj->rowid.'" selected';
10678 10678
 						//if ($disabled) $out.=' disabled';						// with select2, field can't be preselected if disabled
10679
-						$out .= '>' . $labeltoshow . '</option>';
10679
+						$out .= '>'.$labeltoshow.'</option>';
10680 10680
 					} else {
10681 10681
 						if ($disabled && ($selected != $obj->rowid)) {
10682 10682
 							$resultat = '';
10683 10683
 						} else {
10684
-							$resultat = '<option value="' . $obj->rowid . '"';
10684
+							$resultat = '<option value="'.$obj->rowid.'"';
10685 10685
 							if ($disabled) {
10686 10686
 								$resultat .= ' disabled';
10687 10687
 							}
@@ -10721,14 +10721,14 @@  discard block
 block discarded – undo
10721 10721
 		global $langs;
10722 10722
 
10723 10723
 		if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) {    // If $search_component_params_hidden does not start and end with ()
10724
-			$search_component_params_hidden = '(' . $search_component_params_hidden . ')';
10724
+			$search_component_params_hidden = '('.$search_component_params_hidden.')';
10725 10725
 		}
10726 10726
 
10727 10727
 		$ret = '';
10728 10728
 
10729 10729
 		$ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">';
10730 10730
 		$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">';
10731
-		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth hideonsmartphone" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>';
10731
+		$ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth hideonsmartphone" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>';
10732 10732
 		$ret .= '</a>';
10733 10733
 
10734 10734
 		$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">';
@@ -10772,29 +10772,29 @@  discard block
 block discarded – undo
10772 10772
 			$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">';
10773 10773
 		}
10774 10774
 		$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%')) -->";
10775
-		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">';
10775
+		$ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">';
10776 10776
 		// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->";
10777 10777
 
10778 10778
 		// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields
10779 10779
 		foreach ($arrayofcriterias as $criteria) {
10780 10780
 			foreach ($criteria as $criteriafamilykey => $criteriafamilyval) {
10781
-				if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10781
+				if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) {
10782 10782
 					continue;
10783 10783
 				}
10784 10784
 				if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) {
10785 10785
 					continue;
10786 10786
 				}
10787 10787
 				if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) {
10788
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">';
10789
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">';
10790
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">';
10791
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">';
10792
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">';
10793
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">';
10794
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">';
10795
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">';
10788
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">';
10789
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">';
10790
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">';
10791
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">';
10792
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">';
10793
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">';
10794
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">';
10795
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">';
10796 10796
 				} else {
10797
-					$ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">';
10797
+					$ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">';
10798 10798
 				}
10799 10799
 			}
10800 10800
 		}
@@ -10802,7 +10802,7 @@  discard block
 block discarded – undo
10802 10802
 		$ret .= '</div>';
10803 10803
 
10804 10804
 		$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";
10805
-		$ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10805
+		$ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">';
10806 10806
 
10807 10807
 		$ret .= '</div>';
10808 10808
 		$ret .= '</div>';
@@ -10876,7 +10876,7 @@  discard block
 block discarded – undo
10876 10876
 
10877 10877
 		$TModels = array();
10878 10878
 
10879
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
10879
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
10880 10880
 		$formmail = new FormMail($this->db);
10881 10881
 		$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
10882 10882
 
@@ -10889,17 +10889,17 @@  discard block
 block discarded – undo
10889 10889
 			}
10890 10890
 		}
10891 10891
 
10892
-		$retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">';
10892
+		$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
10893 10893
 
10894 10894
 		foreach ($TModels as $id_model => $label_model) {
10895
-			$retstring .= '<option value="' . $id_model . '"';
10896
-			$retstring .= ">" . $label_model . "</option>";
10895
+			$retstring .= '<option value="'.$id_model.'"';
10896
+			$retstring .= ">".$label_model."</option>";
10897 10897
 		}
10898 10898
 
10899 10899
 		$retstring .= "</select>";
10900 10900
 
10901 10901
 		if ($addjscombo) {
10902
-			$retstring .= ajax_combobox('select_' . $prefix . 'model_mail');
10902
+			$retstring .= ajax_combobox('select_'.$prefix.'model_mail');
10903 10903
 		}
10904 10904
 
10905 10905
 		return $retstring;
@@ -10950,16 +10950,16 @@  discard block
 block discarded – undo
10950 10950
 
10951 10951
 		foreach ($buttons as $button) {
10952 10952
 			$addclass = empty($button['addclass']) ? '' : $button['addclass'];
10953
-			$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
10953
+			$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
10954 10954
 		}
10955 10955
 		$retstring .= $withoutdiv ? '' : '</div>';
10956 10956
 
10957 10957
 		if ($dol_openinpopup) {
10958
-			$retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n";
10959
-			$retstring .= '<script nonce="' . getNonce() . '">';
10958
+			$retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n";
10959
+			$retstring .= '<script nonce="'.getNonce().'">';
10960 10960
 			$retstring .= 'jQuery(".button-cancel").click(function(e) {
10961
-				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\');
10962
-				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\');
10961
+				e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\');
10962
+				window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\');
10963 10963
 				 });';
10964 10964
 			$retstring .= '</script>';
10965 10965
 		}
@@ -10988,7 +10988,7 @@  discard block
 block discarded – undo
10988 10988
 		dol_syslog(__METHOD__, LOG_DEBUG);
10989 10989
 
10990 10990
 		$sql = "SELECT rowid, code, label as label";
10991
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
10991
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
10992 10992
 		$sql .= " WHERE active = 1";
10993 10993
 
10994 10994
 		$resql = $this->db->query($sql);
@@ -10999,7 +10999,7 @@  discard block
 block discarded – undo
10999 10999
 				$obj = $this->db->fetch_object($resql);
11000 11000
 
11001 11001
 				// If translation exists, we use it, otherwise we take the default wording
11002
-				$label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11002
+				$label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : '');
11003 11003
 				$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid;
11004 11004
 				$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code;
11005 11005
 				$this->cache_invoice_subtype[$obj->rowid]['label'] = $label;
@@ -11031,18 +11031,18 @@  discard block
 block discarded – undo
11031 11031
 		global $langs, $user;
11032 11032
 
11033 11033
 		$out = '';
11034
-		dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG);
11034
+		dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
11035 11035
 
11036 11036
 		$this->load_cache_invoice_subtype();
11037 11037
 
11038
-		$out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
11038
+		$out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
11039 11039
 		if ($addempty) {
11040 11040
 			$out .= '<option value="0">&nbsp;</option>';
11041 11041
 		}
11042 11042
 
11043 11043
 		foreach ($this->cache_invoice_subtype as $rowid => $subtype) {
11044 11044
 			$label = $subtype['label'];
11045
-			$out .= '<option value="' . $subtype['rowid'] . '"';
11045
+			$out .= '<option value="'.$subtype['rowid'].'"';
11046 11046
 			if ($selected == $subtype['rowid']) {
11047 11047
 				$out .= ' selected="selected"';
11048 11048
 			}
Please login to merge, or discard this patch.
htdocs/emailcollector/class/emailcollector.class.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -24,24 +24,24 @@  discard block
 block discarded – undo
24 24
  */
25 25
 
26 26
 // Put here all includes required by your class file
27
-include_once DOL_DOCUMENT_ROOT .'/emailcollector/lib/emailcollector.lib.php';
28
-
29
-require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
30
-require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
31
-
32
-require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php';                   // Customer Proposal
33
-require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';                    // Sale Order
34
-require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php';               // Customer Invoice
35
-require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php';                      // Contact / Address
36
-require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php';                // Shipping / Delivery
37
-require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php';           // Purchase Order
38
-require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php';            // Purchase Invoice
39
-require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php';                       // Project
40
-require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php';                  // Reception
41
-require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php';   // Recruiting
42
-require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php';                      // Third-Party
43
-require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php';  // Supplier Proposal
44
-require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php';                        // Ticket
27
+include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php';
28
+
29
+require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
30
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
31
+
32
+require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // Customer Proposal
33
+require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; // Sale Order
34
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Customer Invoice
35
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; // Contact / Address
36
+require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; // Shipping / Delivery
37
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // Purchase Order
38
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // Purchase Invoice
39
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Project
40
+require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; // Reception
41
+require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting
42
+require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; // Third-Party
43
+require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal
44
+require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; // Ticket
45 45
 //require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport.class.php';        // Expense Report
46 46
 //require_once DOL_DOCUMENT_ROOT .'/holiday/class/holiday.class.php';                    // Holidays (leave request)
47 47
 
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 		} elseif (empty($this->imap_encryption) || ($this->imap_encryption == 'ssl' && getDolGlobalString('IMAP_FORCE_NOSSL'))) {
795 795
 			$flags .= '';
796 796
 		} else {
797
-			$flags .= '/' . $this->imap_encryption;
797
+			$flags .= '/'.$this->imap_encryption;
798 798
 		}
799 799
 
800 800
 		$flags .= '/novalidate-cert';
@@ -824,8 +824,8 @@  discard block
 block discarded – undo
824 824
 	{
825 825
 		if (function_exists('mb_convert_encoding')) {
826 826
 			// change spaces by entropy because mb_convert fail with spaces
827
-			$str = preg_replace("/ /", "xxxSPACExxx", $str);		// the replacement string must be valid in utf7 so _ can't be used
828
-			$str = preg_replace("/\[Gmail\]/", "xxxGMAILxxx", $str);	// the replacement string must be valid in utf7 so _ can't be used
827
+			$str = preg_replace("/ /", "xxxSPACExxx", $str); // the replacement string must be valid in utf7 so _ can't be used
828
+			$str = preg_replace("/\[Gmail\]/", "xxxGMAILxxx", $str); // the replacement string must be valid in utf7 so _ can't be used
829 829
 			// if mb_convert work
830 830
 			if ($str = mb_convert_encoding($str, "UTF-7")) {
831 831
 				// change characters
@@ -1437,7 +1437,7 @@  discard block
 block discarded – undo
1437 1437
 				}
1438 1438
 
1439 1439
 				if ($rule['type'] == 'from') {
1440
-					$tmprulevaluearray = explode('*', $rule['rulevalue']);	// Search on abc*def means searching on 'abc' and on 'def'
1440
+					$tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def'
1441 1441
 					if (count($tmprulevaluearray) >= 2) {
1442 1442
 						foreach ($tmprulevaluearray as $tmprulevalue) {
1443 1443
 							$search .= ($search ? ' ' : '').$not.'FROM "'.str_replace('"', '', $tmprulevalue).'"';
@@ -1447,7 +1447,7 @@  discard block
 block discarded – undo
1447 1447
 					}
1448 1448
 				}
1449 1449
 				if ($rule['type'] == 'to') {
1450
-					$tmprulevaluearray = explode('*', $rule['rulevalue']);	// Search on abc*def means searching on 'abc' and on 'def'
1450
+					$tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def'
1451 1451
 					if (count($tmprulevaluearray) >= 2) {
1452 1452
 						foreach ($tmprulevaluearray as $tmprulevalue) {
1453 1453
 							$search .= ($search ? ' ' : '').$not.'TO "'.str_replace('"', '', $tmprulevalue).'"';
@@ -1623,7 +1623,7 @@  discard block
 block discarded – undo
1623 1623
 			}
1624 1624
 		}
1625 1625
 
1626
-		$arrayofemailtodelete = array();	// Track email to delete to make the deletion at end.
1626
+		$arrayofemailtodelete = array(); // Track email to delete to make the deletion at end.
1627 1627
 
1628 1628
 		// Loop on each email found
1629 1629
 		if (!$error && !empty($arrayofemail) && count($arrayofemail) > 0) {
@@ -1820,7 +1820,7 @@  discard block
 block discarded – undo
1820 1820
 						$attachments = [];
1821 1821
 					}
1822 1822
 				} else {
1823
-					$this->getmsg($connection, $imapemail);	// This set global var $charset, $htmlmsg, $plainmsg, $attachments
1823
+					$this->getmsg($connection, $imapemail); // This set global var $charset, $htmlmsg, $plainmsg, $attachments
1824 1824
 				}
1825 1825
 				'@phan-var-force Webklex\PHPIMAP\Attachment[] $attachments';
1826 1826
 
@@ -2263,7 +2263,7 @@  discard block
 block discarded – undo
2263 2263
 
2264 2264
 						// Make Operation
2265 2265
 						dol_syslog("Execute action ".$operation['type']." actionparam=".$operation['actionparam'].' thirdpartystatic->id='.$thirdpartystatic->id.' contactstatic->id='.$contactstatic->id.' projectstatic->id='.$projectstatic->id);
2266
-						dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type);	// If a Dolibarr tracker id is found, we should now the id of object
2266
+						dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type); // If a Dolibarr tracker id is found, we should now the id of object
2267 2267
 
2268 2268
 						$actioncode = 'EMAIL_IN';
2269 2269
 						// If we scan the Sent box, we use the code for out email
@@ -2514,11 +2514,11 @@  discard block
 block discarded – undo
2514 2514
 									$result = $contactstatic->fetch(0, null, '', $from);
2515 2515
 									if ($result < 0) {
2516 2516
 										$errorforactions++;
2517
-										$this->error = 'Error when getting contact with email ' . $from;
2517
+										$this->error = 'Error when getting contact with email '.$from;
2518 2518
 										$this->errors[] = $this->error;
2519 2519
 										break;
2520 2520
 									} elseif ($result == 0) {
2521
-										dol_syslog("Contact with email " . $from . " was not found. We try to create it.");
2521
+										dol_syslog("Contact with email ".$from." was not found. We try to create it.");
2522 2522
 										$contactstatic = new Contact($this->db);
2523 2523
 
2524 2524
 										// Create contact
@@ -2533,28 +2533,28 @@  discard block
 block discarded – undo
2533 2533
 										} else {
2534 2534
 											// Search country by name or code
2535 2535
 											if (!empty($contactstatic->country)) {
2536
-												require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
2536
+												require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
2537 2537
 												$result = getCountry('', 3, $this->db, '', 1, $contactstatic->country);
2538 2538
 												if ($result == 'NotDefined') {
2539 2539
 													$errorforactions++;
2540
-													$this->error = "Error country not found by this name '" . $contactstatic->country . "'";
2540
+													$this->error = "Error country not found by this name '".$contactstatic->country."'";
2541 2541
 												} elseif (!($result > 0)) {
2542 2542
 													$errorforactions++;
2543
-													$this->error = "Error when search country by this name '" . $contactstatic->country . "'";
2543
+													$this->error = "Error when search country by this name '".$contactstatic->country."'";
2544 2544
 													$this->errors[] = $this->db->lasterror();
2545 2545
 												} else {
2546 2546
 													$contactstatic->country_id = $result;
2547 2547
 													$operationslog .= '<br>We set property country_id='.dol_escape_htmltag($result);
2548 2548
 												}
2549 2549
 											} elseif (!empty($contactstatic->country_code)) {
2550
-												require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
2550
+												require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
2551 2551
 												$result = getCountry($contactstatic->country_code, 3, $this->db);
2552 2552
 												if ($result == 'NotDefined') {
2553 2553
 													$errorforactions++;
2554
-													$this->error = "Error country not found by this code '" . $contactstatic->country_code . "'";
2554
+													$this->error = "Error country not found by this code '".$contactstatic->country_code."'";
2555 2555
 												} elseif (!($result > 0)) {
2556 2556
 													$errorforactions++;
2557
-													$this->error = "Error when search country by this code '" . $contactstatic->country_code . "'";
2557
+													$this->error = "Error when search country by this code '".$contactstatic->country_code."'";
2558 2558
 													$this->errors[] = $this->db->lasterror();
2559 2559
 												} else {
2560 2560
 													$contactstatic->country_id = $result;
@@ -2565,28 +2565,28 @@  discard block
 block discarded – undo
2565 2565
 											if (!$errorforactions) {
2566 2566
 												// Search state by name or code (for country if defined)
2567 2567
 												if (!empty($contactstatic->state)) {
2568
-													require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
2568
+													require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
2569 2569
 													$result = dol_getIdFromCode($this->db, $contactstatic->state, 'c_departements', 'nom', 'rowid');
2570 2570
 													if (empty($result)) {
2571 2571
 														$errorforactions++;
2572
-														$this->error = "Error state not found by this name '" . $contactstatic->state . "'";
2572
+														$this->error = "Error state not found by this name '".$contactstatic->state."'";
2573 2573
 													} elseif (!($result > 0)) {
2574 2574
 														$errorforactions++;
2575
-														$this->error = "Error when search state by this name '" . $contactstatic->state . "'";
2575
+														$this->error = "Error when search state by this name '".$contactstatic->state."'";
2576 2576
 														$this->errors[] = $this->db->lasterror();
2577 2577
 													} else {
2578 2578
 														$contactstatic->state_id = $result;
2579 2579
 														$operationslog .= '<br>We set property state_id='.dol_escape_htmltag($result);
2580 2580
 													}
2581 2581
 												} elseif (!empty($contactstatic->state_code)) {
2582
-													require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
2582
+													require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
2583 2583
 													$result = dol_getIdFromCode($this->db, $contactstatic->state_code, 'c_departements', 'code_departement', 'rowid');
2584 2584
 													if (empty($result)) {
2585 2585
 														$errorforactions++;
2586
-														$this->error = "Error state not found by this code '" . $contactstatic->state_code . "'";
2586
+														$this->error = "Error state not found by this code '".$contactstatic->state_code."'";
2587 2587
 													} elseif (!($result > 0)) {
2588 2588
 														$errorforactions++;
2589
-														$this->error = "Error when search state by this code '" . $contactstatic->state_code . "'";
2589
+														$this->error = "Error when search state by this code '".$contactstatic->state_code."'";
2590 2590
 														$this->errors[] = $this->db->lasterror();
2591 2591
 													} else {
2592 2592
 														$contactstatic->state_id = $result;
@@ -2649,8 +2649,8 @@  discard block
 block discarded – undo
2649 2649
 								$actioncomm->label       = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from;
2650 2650
 								$actioncomm->note_private = $descriptionfull;
2651 2651
 								$actioncomm->fk_project  = $projectstatic->id;
2652
-								$actioncomm->datep       = $date;	// date of email
2653
-								$actioncomm->datef       = $date;	// date of email
2652
+								$actioncomm->datep       = $date; // date of email
2653
+								$actioncomm->datef       = $date; // date of email
2654 2654
 								$actioncomm->percentage  = -1; // Not applicable
2655 2655
 								$actioncomm->socid       = $thirdpartystatic->id;
2656 2656
 								$actioncomm->contact_id = $contactstatic->id;
@@ -2849,7 +2849,7 @@  discard block
 block discarded – undo
2849 2849
 								}
2850 2850
 								$hookmanager->initHooks(array('emailcolector'));
2851 2851
 								$parameters = array('arrayobject' => $arrayobject);
2852
-								$reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters);    // Note that $action and $object may have been modified by some hooks
2852
+								$reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters); // Note that $action and $object may have been modified by some hooks
2853 2853
 								if ($reshook > 0) {
2854 2854
 									$arrayobject = $hookmanager->resArray;
2855 2855
 								}
@@ -2858,10 +2858,10 @@  discard block
 block discarded – undo
2858 2858
 
2859 2859
 								foreach ($arrayobject as $key => $objectdesc) {
2860 2860
 									$sql = 'SELECT DISTINCT t.rowid ';
2861
-									$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->db->sanitize($objectdesc['table']) . ' AS t';
2861
+									$sql .= ' FROM '.MAIN_DB_PREFIX.$this->db->sanitize($objectdesc['table']).' AS t';
2862 2862
 									$sql .= ' WHERE ';
2863 2863
 									foreach ($objectdesc['fields'] as $field) {
2864
-										$sql .= "('" .$this->db->escape($subject) . "'  LIKE CONCAT('%',  t." . $this->db->sanitize($field) . ", '%') AND t." . $this->db->sanitize($field) . " <> '') OR ";
2864
+										$sql .= "('".$this->db->escape($subject)."'  LIKE CONCAT('%',  t.".$this->db->sanitize($field).", '%') AND t.".$this->db->sanitize($field)." <> '') OR ";
2865 2865
 									}
2866 2866
 									$sql = substr($sql, 0, -4);
2867 2867
 
@@ -2881,8 +2881,8 @@  discard block
 block discarded – undo
2881 2881
 									foreach ($ids as $val) {
2882 2882
 										$res = $objectmanaged->fetch($val);
2883 2883
 										if ($res) {
2884
-											$path = ($objectmanaged->entity > 1 ? "/" . $objectmanaged->entity : '');
2885
-											$dirs[] = DOL_DATA_ROOT . $path . "/" . $elementpath . '/' . dol_sanitizeFileName($objectmanaged->ref) . '/';
2884
+											$path = ($objectmanaged->entity > 1 ? "/".$objectmanaged->entity : '');
2885
+											$dirs[] = DOL_DATA_ROOT.$path."/".$elementpath.'/'.dol_sanitizeFileName($objectmanaged->ref).'/';
2886 2886
 										} else {
2887 2887
 											$this->errors[] = 'object not found';
2888 2888
 										}
@@ -2891,7 +2891,7 @@  discard block
 block discarded – undo
2891 2891
 								foreach ($dirs as $target) {
2892 2892
 									$prefix = $this->actions[$this->id]['actionparam'];
2893 2893
 									foreach ($data as $filename => $content) {
2894
-										$resr = saveAttachment($target, $prefix . '_' . $filename, $content);
2894
+										$resr = saveAttachment($target, $prefix.'_'.$filename, $content);
2895 2895
 										if ($resr == -1) {
2896 2896
 											$this->errors[] = 'Doc not saved';
2897 2897
 										}
@@ -2938,7 +2938,7 @@  discard block
 block discarded – undo
2938 2938
 								$percent_opp_status = dol_getIdFromCode($this->db, 'PROSP', 'c_lead_status', 'code', 'percent');
2939 2939
 
2940 2940
 								$projecttocreate->title = $subject;
2941
-								$projecttocreate->date_start = $date;	// date of email
2941
+								$projecttocreate->date_start = $date; // date of email
2942 2942
 								$projecttocreate->date_end = 0;
2943 2943
 								$projecttocreate->opp_status = $id_opp_status;
2944 2944
 								$projecttocreate->opp_percent = $percent_opp_status;
@@ -3202,7 +3202,7 @@  discard block
 block discarded – undo
3202 3202
 								$candidaturetocreate->note_private = $descriptionfull;
3203 3203
 								$candidaturetocreate->entity = $conf->entity;
3204 3204
 								$candidaturetocreate->email_msgid = $msgid;
3205
-								$candidaturetocreate->email_date = $date;		// date of email
3205
+								$candidaturetocreate->email_date = $date; // date of email
3206 3206
 								$candidaturetocreate->status = $candidaturetocreate::STATUS_DRAFT;
3207 3207
 								//$candidaturetocreate->fk_contact = $contactstatic->id;
3208 3208
 
@@ -3569,8 +3569,8 @@  discard block
 block discarded – undo
3569 3569
 				 * append increment number to the original filename
3570 3570
 				 */
3571 3571
 				while (file_exists($destdir.$file_name.".".$extension)) {
3572
-					$file_name = $file_name_original . ' (' . $num . ')';
3573
-					$file_name_complete = $file_name . "." . $extension;
3572
+					$file_name = $file_name_original.' ('.$num.')';
3573
+					$file_name_complete = $file_name.".".$extension;
3574 3574
 					$destination = $destdir.$file_name_complete;
3575 3575
 					$num++;
3576 3576
 				}
@@ -3704,7 +3704,7 @@  discard block
 block discarded – undo
3704 3704
 	 */
3705 3705
 	private function saveAttachment($destdir, $filename, $content)
3706 3706
 	{
3707
-		require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php';
3707
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
3708 3708
 
3709 3709
 		$tmparraysize = getDefaultImageSizes();
3710 3710
 		$maxwidthsmall = $tmparraysize['maxwidthsmall'];
Please login to merge, or discard this patch.
htdocs/api/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	/**
97 97
 	 * @return Luracast\Restler\AutoLoader
98 98
 	 */
99
-	static function () {
99
+	static function() {
100 100
 		$loader = Luracast\Restler\AutoLoader::instance();
101 101
 		spl_autoload_register($loader);
102 102
 		return $loader;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 // If MAIN_API_DEBUG is set to 1, we save logs into file "dolibarr_api.log"
179 179
 if (getDolGlobalString('MAIN_API_DEBUG')) {
180 180
 	$r = $api->r;
181
-	$r->onCall(function () use ($r) {
181
+	$r->onCall(function() use ($r) {
182 182
 		// Don't log Luracast Restler Explorer resources calls
183 183
 		//if (!preg_match('/^explorer/', $r->url)) {
184 184
 		//	'method'  => $api->r->requestMethod,
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	$allowedip = explode(' ', getDolGlobalString('API_RESTRICT_ON_IP'));
211 211
 	$ipremote = getUserRemoteIP();
212 212
 	if (!in_array($ipremote, $allowedip)) {
213
-		dol_syslog('Remote ip is '.$ipremote.', not into list ' . getDolGlobalString('API_RESTRICT_ON_IP'));
213
+		dol_syslog('Remote ip is '.$ipremote.', not into list '.getDolGlobalString('API_RESTRICT_ON_IP'));
214 214
 		print 'APIs are not allowed from the IP '.$ipremote;
215 215
 		header('HTTP/1.1 503 API not allowed from your IP '.$ipremote);
216 216
 		//session_destroy();
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 			}
362 362
 		}
363 363
 
364
-		if (! $endpointisallowed) {
364
+		if (!$endpointisallowed) {
365 365
 			dol_syslog('The API with endpoint /'.$classfile.' is forbidden by config API_ENDPOINT_RULES', LOG_WARNING);
366 366
 			print 'The API with endpoint /'.$classfile.' is forbidden by config API_ENDPOINT_RULES';
367 367
 			header('HTTP/1.1 501 API is forbidden by API_ENDPOINT_RULES');
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 		$result2 = $db->query($sql2);
473 473
 		if (!$result2) {
474 474
 			$modeapicall = $updateapi ? 'updating' : 'inserting';
475
-			dol_syslog('Error while '.$modeapicall. ' API_COUNT_CALL for user '.$userid, LOG_ERR);
475
+			dol_syslog('Error while '.$modeapicall.' API_COUNT_CALL for user '.$userid, LOG_ERR);
476 476
 			$error++;
477 477
 		}
478 478
 	} else {
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 
490 490
 // Call API termination method
491 491
 $apiMethodInfo = &$api->r->apiMethodInfo;
492
-$terminateCall = '_terminate_' . $apiMethodInfo->methodName . '_' . $api->r->responseFormat->getExtension();
492
+$terminateCall = '_terminate_'.$apiMethodInfo->methodName.'_'.$api->r->responseFormat->getExtension();
493 493
 if (method_exists($apiMethodInfo->className, $terminateCall)) {
494 494
 	// Now flush output buffers so that response data is sent to the client even if we still have action to do in a termination method.
495 495
 	ob_end_flush();
Please login to merge, or discard this patch.
htdocs/api/class/api_setup.class.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -1396,7 +1396,6 @@
 block discarded – undo
1396 1396
 	}
1397 1397
 
1398 1398
 	/**
1399
-
1400 1399
 	 * Update Extrafield object
1401 1400
 	 *
1402 1401
 	 * @param	string	$attrname		extrafield attrname
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1173,7 +1173,7 @@  discard block
 block discarded – undo
1173 1173
 					$list[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed;
1174 1174
 					$list[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique;
1175 1175
 					$list[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired;
1176
-					$list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : '');	// This may be a string encoded with serialise() or json_encode()
1176
+					$list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode()
1177 1177
 					$list[$tab->elementtype][$tab->name]['pos'] = $tab->pos;
1178 1178
 					$list[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable;
1179 1179
 					$list[$tab->elementtype][$tab->name]['perms'] = $tab->perms;
@@ -1283,7 +1283,7 @@  discard block
 block discarded – undo
1283 1283
 					$answer[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed;
1284 1284
 					$answer[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique;
1285 1285
 					$answer[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired;
1286
-					$answer[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : '');	// This may be a string encoded with serialise() or json_encode()
1286
+					$answer[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode()
1287 1287
 					$answer[$tab->elementtype][$tab->name]['pos'] = $tab->pos;
1288 1288
 					$answer[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable;
1289 1289
 					$answer[$tab->elementtype][$tab->name]['perms'] = $tab->perms;
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
 		$pos = $request_data['pos'];
1372 1372
 		$moreparams = array();
1373 1373
 
1374
-		if ( 0 > $extrafields->addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $default_value, $param, $alwayseditable, $perms, $list, $help, $computed, $entity, $langfile, $enabled, $totalizable, $printable, $moreparams)) {
1374
+		if (0 > $extrafields->addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $default_value, $param, $alwayseditable, $perms, $list, $help, $computed, $entity, $langfile, $enabled, $totalizable, $printable, $moreparams)) {
1375 1375
 			throw new RestException(500, 'Error creating extrafield', array_merge(array($extrafields->errno), $extrafields->errors));
1376 1376
 		}
1377 1377
 
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
 		$moreparams = array();
1458 1458
 
1459 1459
 		dol_syslog(get_class($this).'::updateExtraField', LOG_DEBUG);
1460
-		if ( 0 > $extrafields->updateExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $default_value, $param, $alwayseditable, $perms, $list, $help, $computed, $entity, $langfile, $enabled, $totalizable, $printable, $moreparams)) {
1460
+		if (0 > $extrafields->updateExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $default_value, $param, $alwayseditable, $perms, $list, $help, $computed, $entity, $langfile, $enabled, $totalizable, $printable, $moreparams)) {
1461 1461
 			throw new RestException(500, 'Error updating extrafield', array_merge(array($extrafields->errno), $extrafields->errors));
1462 1462
 		}
1463 1463
 
@@ -2102,7 +2102,7 @@  discard block
 block discarded – undo
2102 2102
 			$num = $this->db->num_rows($result);
2103 2103
 			$min = min($num, ($limit <= 0 ? $num : $limit));
2104 2104
 			for ($i = 0; $i < $min; $i++) {
2105
-				$type =$this->db->fetch_object($result);
2105
+				$type = $this->db->fetch_object($result);
2106 2106
 				$this->translateLabel($type, $lang, 'TicketTypeShort', array('ticket'));
2107 2107
 				$list[] = $type;
2108 2108
 			}
@@ -2165,7 +2165,7 @@  discard block
 block discarded – undo
2165 2165
 			$num = $this->db->num_rows($result);
2166 2166
 			$min = min($num, ($limit <= 0 ? $num : $limit));
2167 2167
 			for ($i = 0; $i < $min; $i++) {
2168
-				$type =$this->db->fetch_object($result);
2168
+				$type = $this->db->fetch_object($result);
2169 2169
 				$list[] = $type;
2170 2170
 			}
2171 2171
 		} else {
@@ -2399,13 +2399,13 @@  discard block
 block discarded – undo
2399 2399
 				throw new RestException(500, $langs->trans('XmlNotFound').': /install/'.$xmlshortfile);
2400 2400
 			}
2401 2401
 		} else {
2402
-			$xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0);	// Accept http or https links on external remote server only. Same is used into filecheck.php.
2402
+			$xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php.
2403 2403
 
2404 2404
 			// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
2405 2405
 			if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
2406 2406
 				$xmlfile = $xmlarray['content'];
2407 2407
 				//print "xmlfilestart".$xmlfile."endxmlfile";
2408
-				$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
2408
+				$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
2409 2409
 			} else {
2410 2410
 				$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
2411 2411
 				throw new RestException(500, $errormsg);
Please login to merge, or discard this patch.